Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 d.java 源代码,内容仅作参考
package co.hyperverge.hypersnapsdk.b.g;
import android.annotation.SuppressLint;
import android.util.Log;
import androidx.annotation.NonNull;
import co.hyperverge.hypersnapsdk.c.h;
import co.hyperverge.hypersnapsdk.c.o;
import co.hyperverge.hypersnapsdk.f.i;
import co.hyperverge.hypersnapsdk.objects.HVError;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import okhttp3.Cache;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@SuppressLint({"LogNotTimber"})
public class d {
private static final String c = "co.hyperverge.hypersnapsdk.b.g.d";
private static d d = null;
static final boolean e = true;
private final ExecutorService a = Executors.newSingleThreadExecutor();
private final Cache b;
public class a implements Callback<co.hyperverge.hypersnapsdk.b.e> {
final boolean a;
final b b;
a(boolean z, b bVar) {
this.a = z;
this.b = bVar;
}
@Override
public void onFailure(@NonNull Call<co.hyperverge.hypersnapsdk.b.e> call, @NonNull Throwable th) {
if (this.a) {
d.this.j(true, i.h(th), 12);
}
o.C().h(new co.hyperverge.hypersnapsdk.b.e());
this.b.a(new HVError(12, "Could not get remote configs"));
}
@Override
public void onResponse(@NonNull Call<co.hyperverge.hypersnapsdk.b.e> call, @NonNull Response<co.hyperverge.hypersnapsdk.b.e> response) {
String string;
if (response.isSuccessful()) {
d.this.i(this.a);
o.C().h(response.body());
this.b.onSuccess();
return;
}
if (response.errorBody() != null) {
try {
string = response.errorBody().string();
} catch (IOException e) {
Log.e(a.class.getCanonicalName(), i.h(e));
}
d.this.j(this.a, string, response.code());
o.C().e();
this.b.a(new HVError(response.code(), "Could not get remote configs"));
}
string = "Server Error";
d.this.j(this.a, string, response.code());
o.C().e();
this.b.a(new HVError(response.code(), "Could not get remote configs"));
}
}
public interface b {
void a(HVError hVError);
void onSuccess();
}
private d(Cache cache) {
this.b = cache;
}
public static d b(Cache cache) {
if (d == null) {
d = new d(cache);
}
return d;
}
private <T> String c(Response<T> response) {
String string;
if (response.isSuccessful()) {
return "";
}
if (response.errorBody() != null) {
try {
string = response.errorBody().string();
} catch (IOException e2) {
Log.e(d.class.getCanonicalName(), i.h(e2));
}
j(false, string, response.code());
return string;
}
string = "Server Error";
j(false, string, response.code());
return string;
}
public void g(String str, String str2, b bVar) {
try {
e b2 = co.hyperverge.hypersnapsdk.b.g.a.b(this.b);
Response<co.hyperverge.hypersnapsdk.b.f.b> execute = b2.a(str).execute();
Response<co.hyperverge.hypersnapsdk.b.f.b> execute2 = b2.a(str2).execute();
if (execute.isSuccessful() && execute2.isSuccessful()) {
List<co.hyperverge.hypersnapsdk.b.f.a> a2 = execute.body().a();
List<co.hyperverge.hypersnapsdk.b.f.a> a3 = execute2.body().a();
boolean z = e;
if (!z && a2 == null) {
throw new AssertionError();
}
o.C().l(h.b(a2, a3));
bVar.onSuccess();
return;
}
String c2 = c(execute);
String c3 = c(execute2);
bVar.a(new HVError(12, c2 + "\n" + c3));
} catch (Exception e2) {
Log.e(c, "getFeatureConfigs: ", e2);
bVar.a(new HVError(12, i.h(e2)));
}
}
public void i(boolean z) {
if (z) {
if (o.C().M() && o.C().t() != null) {
o.C().t().c0();
}
} else if (o.C().M() && o.C().t() != null) {
o.C().t().b();
}
}
public void j(boolean z, String str, int i) {
if (z) {
if (o.C().M() && o.C().t() != null) {
o.C().t().A0(str, i);
}
} else if (o.C().M() && o.C().t() != null) {
o.C().t().E0(str, i);
}
}
public void f(String str, final b bVar) {
String G = o.C().G();
final String str2 = G + "sdk.json";
final String str3 = G + String.format("%s.json", str);
this.a.submit(new Runnable() {
@Override
public final void run() {
d.this.g(str2, str3, bVar);
}
});
}
public void h(String str, boolean z, b bVar) {
co.hyperverge.hypersnapsdk.b.g.a.b(this.b).b("https://s3-ap-south-1.amazonaws.com/hv-central-config/sdk-client-config/hypersnapsdk/v1/" + str + ".json").enqueue(new a(z, bVar));
}
}