Maxcredito v1.2.1版本的 MD5 值为:2605738f37f8ddb81288799ddcbfcbe8
以下内容为反编译后的 z.java 源代码,内容仅作参考
package com.appsflyer.internal;
import android.content.Context;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerInAppPurchaseValidatorListener;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.sensorsdata.analytics.android.sdk.data.DbParams;
import java.lang.ref.WeakReference;
import java.net.HttpURLConnection;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
public final class z implements Runnable {
private static String AFKeystoreWrapper = null;
private static String values = "https://%ssdk-services.%s/validate-android-signature";
private WeakReference<Context> AFInAppEventParameterName;
private String AFInAppEventType;
private String AFLogger$LogLevel;
private String AFVersionDeclaration;
private String AppsFlyer2dXConversionCallback;
private String getLevel;
private Map<String, String> init;
private String valueOf;
static {
StringBuilder sb = new StringBuilder("https://%svalidate.%s/api/v");
sb.append(ah.AFInAppEventParameterName);
sb.append("/androidevent?buildnumber=6.2.3&app_id=");
AFKeystoreWrapper = sb.toString();
}
public z(Context context, String str, String str2, String str3, String str4, String str5, String str6, Map<String, String> map) {
this.AFInAppEventParameterName = new WeakReference<>(context);
this.valueOf = str;
this.AFInAppEventType = str2;
this.AFLogger$LogLevel = str4;
this.AFVersionDeclaration = str5;
this.getLevel = str6;
this.init = map;
this.AppsFlyer2dXConversionCallback = str3;
}
private static HttpURLConnection AFKeystoreWrapper(bk bkVar) {
StringBuilder sb = new StringBuilder("Calling ");
sb.append(bkVar.onAttributionFailureNative);
AFLogger.AFKeystoreWrapper(sb.toString());
bkVar.onDeepLinking = AppsFlyerLib.getInstance().isStopped();
return new m(bkVar).AFKeystoreWrapper();
}
public static void values(z zVar, Map map, Map map2, WeakReference weakReference) {
if (weakReference.get() != null) {
ad.AFInAppEventParameterName((Context) weakReference.get()).AFKeystoreWrapper();
StringBuilder sb = new StringBuilder();
sb.append(String.format(AFKeystoreWrapper, AppsFlyerLib.getInstance().getHostPrefix(), ah.AFInAppEventParameterName().getHostName()));
sb.append(((Context) weakReference.get()).getPackageName());
String obj = sb.toString();
String string = ah.values((Context) weakReference.get()).getString("referrer", "");
h bqVar = new bq((Context) weakReference.get());
bqVar.AFVersionDeclaration = zVar.valueOf;
bqVar.getLevel = string;
ah AFInAppEventParameterName = ah.AFInAppEventParameterName();
Map<String, Object> AFKeystoreWrapper2 = AFInAppEventParameterName.AFKeystoreWrapper(bqVar);
AFKeystoreWrapper2.put(FirebaseAnalytics.Param.PRICE, zVar.AFVersionDeclaration);
AFKeystoreWrapper2.put(FirebaseAnalytics.Param.CURRENCY, zVar.getLevel);
AFKeystoreWrapper2.put("receipt_data", map);
if (map2 != null) {
AFKeystoreWrapper2.put("extra_prms", map2);
}
AFKeystoreWrapper2.putAll(AFInAppEventParameterName.AFInAppEventType());
ap.AFInAppEventParameterName().valueOf("server_request", obj, new JSONObject((Map<?, ?>) AFKeystoreWrapper2).toString());
HttpURLConnection httpURLConnection = null;
try {
httpURLConnection = AFKeystoreWrapper((bk) bqVar.values((Map<String, ?>) AFKeystoreWrapper2).AFInAppEventParameterName(obj));
int responseCode = httpURLConnection != null ? httpURLConnection.getResponseCode() : -1;
String AFInAppEventType = AFInAppEventParameterName.AFInAppEventType(httpURLConnection);
ap.AFInAppEventParameterName().valueOf("server_response", obj, String.valueOf(responseCode), AFInAppEventType);
StringBuilder sb2 = new StringBuilder("Validate-WH response - ");
sb2.append(responseCode);
sb2.append(": ");
sb2.append(new JSONObject(AFInAppEventType).toString());
AFLogger.valueOf(sb2.toString());
} catch (Throwable th) {
try {
AFLogger.values(th.getMessage(), th);
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
} finally {
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
}
}
}
}
@Override
public final void run() {
String str = this.valueOf;
if (str == null || str.length() == 0 || AppsFlyerLib.getInstance().isStopped()) {
return;
}
HttpURLConnection httpURLConnection = null;
try {
Context context = this.AFInAppEventParameterName.get();
if (context == null) {
return;
}
HashMap hashMap = new HashMap();
hashMap.put("public-key", this.AFInAppEventType);
hashMap.put("sig-data", this.AFLogger$LogLevel);
hashMap.put("signature", this.AppsFlyer2dXConversionCallback);
final HashMap hashMap2 = new HashMap(hashMap);
new Thread(new Runnable() {
@Override
public final void run() {
z zVar = z.this;
z.values(zVar, hashMap2, zVar.init, z.this.AFInAppEventParameterName);
}
}).start();
hashMap.put("dev_key", this.valueOf);
hashMap.put("app_id", context.getPackageName());
hashMap.put("uid", AppsFlyerLib.getInstance().getAppsFlyerUID(context));
hashMap.put("advertiserId", AppsFlyerProperties.getInstance().getString("advertiserId"));
String jSONObject = new JSONObject((Map<?, ?>) hashMap).toString();
String format = String.format(values, AppsFlyerLib.getInstance().getHostPrefix(), ah.AFInAppEventParameterName().getHostName());
ap.AFInAppEventParameterName().valueOf("server_request", format, jSONObject);
HttpURLConnection AFKeystoreWrapper2 = AFKeystoreWrapper((bk) new bj().values(hashMap).AFInAppEventParameterName(format));
int responseCode = AFKeystoreWrapper2 != null ? AFKeystoreWrapper2.getResponseCode() : -1;
String AFInAppEventType = ah.AFInAppEventParameterName().AFInAppEventType(AFKeystoreWrapper2);
ap.AFInAppEventParameterName().valueOf("server_response", format, String.valueOf(responseCode), AFInAppEventType);
JSONObject jSONObject2 = new JSONObject(AFInAppEventType);
jSONObject2.put("code", responseCode);
if (responseCode == 200) {
StringBuilder sb = new StringBuilder("Validate response 200 ok: ");
sb.append(jSONObject2.toString());
AFLogger.valueOf(sb.toString());
valueOf(jSONObject2.optBoolean(DbParams.KEY_CHANNEL_RESULT), this.AFLogger$LogLevel, this.AFVersionDeclaration, this.getLevel, jSONObject2.toString());
} else {
AFLogger.valueOf("Failed Validate request");
valueOf(false, this.AFLogger$LogLevel, this.AFVersionDeclaration, this.getLevel, jSONObject2.toString());
}
if (AFKeystoreWrapper2 != null) {
AFKeystoreWrapper2.disconnect();
}
} catch (Throwable th) {
try {
if (ah.AFKeystoreWrapper != null) {
AFLogger.values("Failed Validate request + ex", th);
valueOf(false, this.AFLogger$LogLevel, this.AFVersionDeclaration, this.getLevel, th.getMessage());
}
AFLogger.values(th.getMessage(), th);
} finally {
if (0 != 0) {
httpURLConnection.disconnect();
}
}
}
}
private static void valueOf(boolean z, String str, String str2, String str3, String str4) {
if (ah.AFKeystoreWrapper != null) {
StringBuilder sb = new StringBuilder("Validate callback parameters: ");
sb.append(str);
sb.append(" ");
sb.append(str2);
sb.append(" ");
sb.append(str3);
AFLogger.AFKeystoreWrapper(sb.toString());
if (z) {
AFLogger.AFKeystoreWrapper("Validate in app purchase success: ".concat(String.valueOf(str4)));
ah.AFKeystoreWrapper.onValidateInApp();
return;
}
AFLogger.AFKeystoreWrapper("Validate in app purchase failed: ".concat(String.valueOf(str4)));
AppsFlyerInAppPurchaseValidatorListener appsFlyerInAppPurchaseValidatorListener = ah.AFKeystoreWrapper;
if (str4 == null) {
str4 = "Failed validating";
}
appsFlyerInAppPurchaseValidatorListener.onValidateInAppFailure(str4);
}
}
}