S T G SuperAPPS v9.99.99版本的 MD5 值为:ec866d8c695a659ed10459d6bd169615
以下内容为反编译后的 aa.java 源代码,内容仅作参考
package com.appsflyer.internal;
import android.content.pm.PackageManager;
import android.os.Build;
import android.text.TextUtils;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerLibCore;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.BackgroundHttpTask;
import com.appsflyer.ServerConfigHandler;
import com.appsflyer.ServerParameters;
import com.appsflyer.internal.model.event.BackgroundEvent;
import com.appsflyer.internal.model.event.ProxyEvent;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class aa {
private static aa f199 = null;
private static String f200 = "https://%smonitorsdk.%s/remote-debug?app_id=";
public boolean f203;
private JSONObject f204;
private boolean f205;
private boolean f206;
private int f207;
private boolean f201 = true;
private final List<String> f208 = new ArrayList();
private String f202 = "-1";
private aa() {
this.f207 = 0;
boolean z10 = AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.DPM, false);
this.f206 = z10;
this.f203 = true ^ z10;
this.f207 = 0;
this.f205 = false;
}
private synchronized String m145() {
String str;
try {
this.f204.put("data", new JSONArray((Collection) this.f208));
str = this.f204.toString();
try {
m153();
} catch (JSONException unused) {
}
} catch (JSONException unused2) {
str = null;
}
return str;
}
private boolean m149() {
if (this.f203) {
return this.f201 || this.f205;
}
return false;
}
public static aa m150() {
if (f199 == null) {
f199 = new aa();
}
return f199;
}
private synchronized void m153() {
this.f208.clear();
this.f207 = 0;
}
public final synchronized void m154() {
this.f205 = true;
m159("r_debugging_on", new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ", Locale.ENGLISH).format(Long.valueOf(System.currentTimeMillis())), new String[0]);
}
public final synchronized void m156(String str) {
this.f202 = str;
}
public final synchronized void m157() {
this.f201 = false;
m153();
}
public final synchronized void m158() {
this.f204 = null;
f199 = null;
}
public final boolean m160() {
return this.f205;
}
public final synchronized void m155() {
m159("r_debugging_off", new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ", Locale.ENGLISH).format(Long.valueOf(System.currentTimeMillis())), new String[0]);
this.f205 = false;
this.f201 = false;
}
private synchronized void m144(String str, String str2, String str3, String str4) {
try {
this.f204.put(ServerParameters.SDK_DATA_SDK_VERSION, str);
if (str2 != null && str2.length() > 0) {
this.f204.put(ServerParameters.DEV_KEY, str2);
}
if (str3 != null && str3.length() > 0) {
this.f204.put("originalAppsFlyerId", str3);
}
if (str4 != null && str4.length() > 0) {
this.f204.put(ServerParameters.AF_USER_ID, str4);
}
} catch (Throwable unused) {
}
}
public static void m148(String str, PackageManager packageManager) {
try {
if (f199 == null) {
f199 = new aa();
}
f199.m151(str, packageManager);
if (f199 == null) {
f199 = new aa();
}
BackgroundEvent trackingStopped = new ProxyEvent().body(f199.m145()).trackingStopped(AppsFlyerLib.getInstance().isStopped());
StringBuilder sb2 = new StringBuilder();
sb2.append(ServerConfigHandler.getUrl(f200));
sb2.append(str);
new Thread(new BackgroundHttpTask.AnonymousClass5()).start();
} catch (Throwable th2) {
AFLogger.afErrorLog(th2);
}
}
public final synchronized void m159(String str, String str2, String... strArr) {
String obj;
if (m149()) {
if (this.f207 < 98304) {
try {
long currentTimeMillis = System.currentTimeMillis();
String join = TextUtils.join(", ", strArr);
if (str != null) {
StringBuilder sb2 = new StringBuilder();
sb2.append(currentTimeMillis);
sb2.append(" ");
sb2.append(Thread.currentThread().getId());
sb2.append(" _/AppsFlyer_6.1.1 [");
sb2.append(str);
sb2.append("] ");
sb2.append(str2);
sb2.append(" ");
sb2.append(join);
obj = sb2.toString();
} else {
StringBuilder sb3 = new StringBuilder();
sb3.append(currentTimeMillis);
sb3.append(" ");
sb3.append(Thread.currentThread().getId());
sb3.append(" ");
sb3.append(str2);
sb3.append("/AppsFlyer_6.1.1 ");
sb3.append(join);
obj = sb3.toString();
}
this.f208.add(obj);
this.f207 += obj.length() << 1;
} catch (Throwable unused) {
}
}
}
}
private synchronized void m147(String str, String str2, String str3, String str4, String str5, String str6) {
try {
this.f204.put(ServerParameters.BRAND, str);
this.f204.put(ServerParameters.MODEL, str2);
this.f204.put(ServerParameters.PLATFORM, "Android");
this.f204.put("platform_version", str3);
if (str4 != null && str4.length() > 0) {
this.f204.put(ServerParameters.ADVERTISING_ID_PARAM, str4);
}
if (str5 != null && str5.length() > 0) {
this.f204.put(ServerParameters.IMEI, str5);
}
if (str6 != null && str6.length() > 0) {
this.f204.put(ServerParameters.ANDROID_ID, str6);
}
} catch (Throwable unused) {
}
}
private synchronized void m151(String str, PackageManager packageManager) {
AppsFlyerProperties appsFlyerProperties = AppsFlyerProperties.getInstance();
AppsFlyerLibCore appsFlyerLibCore = AppsFlyerLibCore.getInstance();
String string = appsFlyerProperties.getString("remote_debug_static_data");
if (string != null) {
try {
this.f204 = new JSONObject(string);
} catch (Throwable unused) {
}
} else {
this.f204 = new JSONObject();
m147(Build.BRAND, Build.MODEL, Build.VERSION.RELEASE, appsFlyerProperties.getString(ServerParameters.ADVERTISING_ID_PARAM), appsFlyerLibCore.f87, appsFlyerLibCore.f98);
StringBuilder sb2 = new StringBuilder("6.1.1.");
sb2.append(AppsFlyerLibCore.f83);
m144(sb2.toString(), appsFlyerProperties.getString(AppsFlyerProperties.AF_KEY), appsFlyerProperties.getString("KSAppsFlyerId"), appsFlyerProperties.getString(ServerParameters.AF_USER_ID));
try {
int i10 = packageManager.getPackageInfo(str, 0).versionCode;
m146(str, String.valueOf(i10), appsFlyerProperties.getString("channel"), appsFlyerProperties.getString("preInstallName"));
} catch (Throwable unused2) {
}
appsFlyerProperties.set("remote_debug_static_data", this.f204.toString());
}
try {
this.f204.put(ServerParameters.LAUNCH_COUNTER, this.f202);
} catch (JSONException e10) {
e10.printStackTrace();
}
}
private synchronized void m146(String str, String str2, String str3, String str4) {
if (str != null) {
try {
if (str.length() > 0) {
this.f204.put(ServerParameters.APP_ID, str);
}
} catch (Throwable unused) {
return;
}
}
if (str2 != null && str2.length() > 0) {
this.f204.put("app_version", str2);
}
if (str3 != null && str3.length() > 0) {
this.f204.put("channel", str3);
}
if (str4 != null && str4.length() > 0) {
this.f204.put("preInstall", str4);
}
}
public static String[] m152(String str, StackTraceElement[] stackTraceElementArr) {
if (stackTraceElementArr == null) {
return new String[]{str};
}
String[] strArr = new String[stackTraceElementArr.length + 1];
strArr[0] = str;
for (int i10 = 1; i10 < stackTraceElementArr.length; i10++) {
strArr[i10] = stackTraceElementArr[i10].toString();
}
return strArr;
}
}