Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 a.java 源代码,内容仅作参考
package co.hyperverge.hypersnapsdk;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import co.hyperverge.crashguard.CrashGuard;
import co.hyperverge.hypersnapsdk.b.g.d;
import co.hyperverge.hypersnapsdk.c.l;
import co.hyperverge.hypersnapsdk.c.o;
import co.hyperverge.hypersnapsdk.c.p;
import co.hyperverge.hypersnapsdk.f.i;
import co.hyperverge.hypersnapsdk.objects.HVError;
import co.hyperverge.hypersnapsdk.objects.HyperSnapParams$Product;
import co.hyperverge.hypersnapsdk.objects.HyperSnapParams$Region;
import com.getkeepsafe.relinker.MissingLibraryException;
import java.util.Collections;
import java.util.HashMap;
import okhttp3.Cache;
public class a {
private static final String b = "co.hyperverge.hypersnapsdk.HyperSnapSDK";
private static co.hyperverge.hypersnapsdk.objects.e c = new co.hyperverge.hypersnapsdk.objects.e();
private static a d;
private static boolean e;
private static Cache f;
private boolean a = false;
public class C0213a implements d.b {
C0213a() {
}
@Override
public void a(HVError hVError) {
String str = a.b;
Log.e(str, "onError: " + hVError.getErrorMessage());
o.C().l(co.hyperverge.hypersnapsdk.c.h.a());
o.C().s(true);
}
@Override
public void onSuccess() {
o.C().s(true);
}
}
public class b implements d.b {
b() {
}
@Override
public void a(HVError hVError) {
a.this.l();
}
@Override
public void onSuccess() {
a.this.l();
}
}
private a() {
}
public static void A(Boolean bool) {
c.setShouldLogOnlyErrors(bool.booleanValue());
}
public static void B(boolean z) {
c.setShouldReturnRawResponse(z);
}
private void b(Context context) {
o.C().i(o.C().n(context));
co.hyperverge.hypersnapsdk.objects.e s = s();
HashMap hashMap = new HashMap();
hashMap.put("hv_app_id", s.getAppId());
hashMap.put("hv_hs_sdk_version", "3.7.2");
co.hyperverge.hypersnapsdk.objects.d hyperKYCConfigs = s.getHyperKYCConfigs();
if (hyperKYCConfigs != null) {
HashMap<String, String> hyperKYCValueMap = hyperKYCConfigs.getHyperKYCValueMap();
for (String str : hyperKYCValueMap.values()) {
hashMap.put(str, hyperKYCValueMap.get(str));
}
}
if (i.v(context)) {
try {
CrashGuard.g(context).i(n(), p(), new CrashGuard.b(Collections.singletonList(i()), hashMap));
} catch (Exception | NoClassDefFoundError e2) {
Log.e(b, i.h(e2));
}
}
}
private void c(Context context, HyperSnapParams$Region hyperSnapParams$Region) {
try {
o.C().o(context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName);
} catch (PackageManager.NameNotFoundException e2) {
Log.e(b, i.h(e2));
o.C().n(context).a(e2);
}
o.C().k(context.getPackageName());
if (hyperSnapParams$Region == HyperSnapParams$Region.INDIA) {
o.C().r(o.C().B());
} else if (hyperSnapParams$Region == HyperSnapParams$Region.ASIA_PACIFIC) {
o.C().r(o.C().v());
} else if (hyperSnapParams$Region == HyperSnapParams$Region.AFRICA) {
o.C().r(o.C().q());
} else {
o.C().r(o.C().v());
}
}
private void d(Context context, co.hyperverge.hypersnapsdk.objects.e eVar) {
if (!w()) {
o(context);
}
if (eVar.isShouldActivateDeviceBlocklist()) {
co.hyperverge.hypersnapsdk.c.a.a().b(context);
}
l.a(context);
m(context);
j(context);
r();
if (o.C().M()) {
o.C().d(context).i();
}
}
@Deprecated
private static void e(Context context, String str, String str2, HyperSnapParams$Region hyperSnapParams$Region, HyperSnapParams$Product hyperSnapParams$Product, String str3) {
c.setAppId(str);
c.setAppKey(str2);
c.setHyperSnapRegion(hyperSnapParams$Region);
if (hyperSnapParams$Region == HyperSnapParams$Region.India) {
c.setHyperSnapRegion(HyperSnapParams$Region.INDIA);
} else if (hyperSnapParams$Region == HyperSnapParams$Region.AsiaPacific) {
c.setHyperSnapRegion(HyperSnapParams$Region.ASIA_PACIFIC);
}
c.setHyperSnapProduct(hyperSnapParams$Product);
if (!co.hyperverge.hypersnapsdk.f.g.a(str3)) {
c.setAccessToken(str3);
}
e = true;
t().u(context, c, null);
}
private void g(co.hyperverge.hypersnapsdk.objects.e eVar) {
co.hyperverge.hypersnapsdk.b.g.d.b(f).h(eVar.getAppId(), false, new b());
}
private void h(String str, int i) {
}
private String i() {
co.hyperverge.hypersnapsdk.objects.d hyperKYCConfigs = s().getHyperKYCConfigs();
if (hyperKYCConfigs != null && !TextUtils.isEmpty(hyperKYCConfigs.getSentryFilter())) {
return hyperKYCConfigs.getSentryFilter();
}
return "co.hyperverge";
}
private void j(Context context) {
o.C().j(new co.hyperverge.hypersnapsdk.service.d.a(context));
}
private boolean k(Context context, co.hyperverge.hypersnapsdk.objects.e eVar) {
if (context == null) {
h("Context object should not be null", 6);
return false;
} else if (eVar == null) {
h("HyperSnapSDKConfig object should not be null", 6);
return false;
} else if (co.hyperverge.hypersnapsdk.f.g.a(eVar.getAppId())) {
h("appId is compulsory", 6);
return false;
} else {
boolean a = co.hyperverge.hypersnapsdk.f.g.a(eVar.getAppKey());
boolean a2 = co.hyperverge.hypersnapsdk.f.g.a(eVar.getAccessToken());
if (a && a2) {
h("Either appKey or accessToken are empty/null; Set either of them", 6);
return false;
} else if (!a && !a2) {
h("Set either appKey or appId, not both", 6);
return false;
} else if (eVar.isShouldUseLocation() && !q(context)) {
h("Location permission not available while location config is set to true", 8);
return false;
} else {
return true;
}
}
}
@SuppressLint({"LogNotTimber"})
public void l() {
co.hyperverge.hypersnapsdk.b.g.d.b(f).f("3.7.2", new C0213a());
}
private void m(Context context) {
int q = p.q();
if (q == 1000) {
q = i.n(100);
p.c(q);
}
o.C().f(q);
try {
if (o.C().M()) {
o.C().g(new co.hyperverge.hypersnapsdk.a.a(context));
o.C().u(true);
}
} catch (Exception | NoClassDefFoundError e2) {
Log.e(b, i.h(e2));
o.C().n(context).a(e2);
o.C().u(false);
}
}
private String n() {
co.hyperverge.hypersnapsdk.objects.d hyperKYCConfigs = s().getHyperKYCConfigs();
if (hyperKYCConfigs != null && !TextUtils.isEmpty(hyperKYCConfigs.getSentryEndPoint())) {
return hyperKYCConfigs.getSentryEndPoint();
}
return "https://5f0c7fd2678f44beba342ffbd306984e@o435277.ingest.sentry.io/api/6019750/store/";
}
private void o(Context context) {
try {
co.hyperverge.facedetection.a.c(context.getApplicationContext(), 2);
o.C().m(true);
} catch (MissingLibraryException e2) {
e = e2;
Log.e(b, i.h(e));
o.C().n(context).a(e);
o.C().p(true);
} catch (NoClassDefFoundError e3) {
Log.e(b, i.h(e3));
o.C().n(context).a(e3);
o.C().m(false);
} catch (UnsatisfiedLinkError e4) {
e = e4;
Log.e(b, i.h(e));
o.C().n(context).a(e);
o.C().p(true);
}
}
private String p() {
co.hyperverge.hypersnapsdk.objects.d hyperKYCConfigs = s().getHyperKYCConfigs();
if (hyperKYCConfigs != null && !TextUtils.isEmpty(hyperKYCConfigs.getSentryKey())) {
return hyperKYCConfigs.getSentryKey();
}
return "5f0c7fd2678f44beba342ffbd306984e";
}
private boolean q(Context context) {
int checkSelfPermission = androidx.core.content.a.checkSelfPermission(context, "android.permission.ACCESS_FINE_LOCATION");
int checkSelfPermission2 = androidx.core.content.a.checkSelfPermission(context, "android.permission.ACCESS_COARSE_LOCATION");
if (checkSelfPermission != 0 && checkSelfPermission2 != 0) {
return false;
}
return true;
}
private void r() {
this.a = true;
}
public static a t() {
if (d == null) {
d = new a();
}
return d;
}
public static void v(Context context, String str, String str2, HyperSnapParams$Region hyperSnapParams$Region) {
e(context, str, str2, hyperSnapParams$Region, HyperSnapParams$Product.FACEID, null);
}
public static boolean x() {
return t().w();
}
public static boolean y() {
if (x()) {
return !TextUtils.isEmpty(p.p());
}
return false;
}
public static void z(int i, int i2, int i3) {
c.setConnectTimeOut(i);
c.setReadTimeOut(i2);
c.setWriteTimeOut(i3);
}
public co.hyperverge.hypersnapsdk.objects.e s() {
return c;
}
public void u(@NonNull Context context, @NonNull co.hyperverge.hypersnapsdk.objects.e eVar, co.hyperverge.hypersnapsdk.listeners.b bVar) {
f = new Cache(context.getApplicationContext().getCacheDir(), 5242880L);
c = eVar;
if (k(context, eVar)) {
b(context);
c(context, eVar.getHyperSnapRegion());
p.e(context);
if (eVar.isShouldUseRemoteConfig()) {
g(eVar);
} else {
o.C().e();
l();
}
d(context, eVar);
}
}
public boolean w() {
return this.a;
}
}