MD5 校验值:c9acc583577d8b1a394e7959c947bec3
AppLovinBridge.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package com.safedk.android.analytics; import android.content.Context; import android.os.Bundle; import android.text.TextUtils; import com.applovin.communicator.AppLovinCommunicator; import com.applovin.communicator.AppLovinCommunicatorMessage; import com.applovin.communicator.AppLovinCommunicatorPublisher; import com.applovin.communicator.AppLovinCommunicatorSubscriber; import com.safedk.android.SafeDK; import com.safedk.android.analytics.reporters.CrashReporter; import com.safedk.android.utils.Logger; import com.safedk.android.utils.j; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; public class AppLovinBridge { private static Context G = null; public static final String a = "SafeDK"; public static final String b = "v1/events"; public static final String c = "v1/image_uploaded"; public static final String d = "v1/resolved"; public static final String e = "platform"; public static final String f = "package"; public static final String g = "android"; public static final String h = "body"; private static final String j = "AppLovinBridge"; private static final String k = "max_ad_events"; private static final String l = "safedk_init"; private static final String m = "user_info"; private static final String n = "send_http_request"; private static final String o = "receive_http_response"; private static final String p = "safedk_ad_info"; private static final String q = "url"; private static final String r = "backup_url"; private static final String s = "post_body"; private static final String t = "report"; private static final String u = "metadata"; private static final String v = "events"; private static final String w = "public"; private static final String x = "private"; private static final String y = "ad_review_creative_id"; private static String z = "https://edge.safedk.com/v1/events"; private static String A = "https://edge.safedk.com/v1/events"; private static String B = "https://edge.safedk.com/v1/image_uploaded"; private static String C = "https://edge.safedk.com/v1/image_uploaded"; private static String D = "https://edge.safedk.com/v1/resolved"; private static String E = "https://edge.safedk.com/v1/resolved"; private static HashMap<String, ArrayList<b>> F = new HashMap<>(); static AppLovinCommunicatorSubscriber i = new AppLovinCommunicatorSubscriber() { @Override public void onMessageReceived(AppLovinCommunicatorMessage message) { Logger.d(AppLovinBridge.j, "Response received " + message.getMessageData() + ", topic=" + message.getTopic() + ", url=" + message.getMessageData().getString("url")); Bundle messageData = message.getMessageData(); String string = message.getMessageData().getString("url"); if (string.endsWith(AppLovinBridge.b)) { AppLovinBridge.b(AppLovinBridge.b, messageData.getBundle(AppLovinBridge.h)); } else if (string.endsWith(AppLovinBridge.c)) { AppLovinBridge.b(AppLovinBridge.c, messageData.getBundle(AppLovinBridge.h)); } else if (string.endsWith(AppLovinBridge.d)) { AppLovinBridge.b(AppLovinBridge.d, messageData.getBundle(AppLovinBridge.h)); } } @Override public String getCommunicatorId() { return AppLovinBridge.a; } }; public static void init(Context context) { G = context; registerToReceiveResponse(i); } public static void receiveEdgeUrls(String url, String backupUrl) { Logger.d(j, "receiveEdgeUrls url=" + url + ", backupUrl=" + backupUrl); if (!TextUtils.isEmpty(url)) { z = url + "/" + b; Logger.d(j, "receiveEdgeUrls edgeBrandSafetyReportUrl updated to " + z); B = url + "/" + c; Logger.d(j, "receiveEdgeUrls ImageUploadedUrl updated to " + B); D = url + "/" + d; Logger.d(j, "receiveEdgeUrls resolvedUrl updated to " + D); } if (!TextUtils.isEmpty(backupUrl)) { A = backupUrl + "/" + b; Logger.d(j, "Backup edgeBackupBrandSafetyReportUrl updated to " + A); C = backupUrl + "/" + c; Logger.d(j, "Backup ImageUploadedUrl updated to " + C); E = backupUrl + "/" + d; Logger.d(j, "Backup resolvedUrl updated to " + E); } } public static void a(ArrayList<Bundle> arrayList, AppLovinCommunicatorPublisher appLovinCommunicatorPublisher) { j.b(j, "reportEvents start " + arrayList.size() + " events. edgeUrl=" + z + ", events : " + arrayList.toString()); Bundle bundle = new Bundle(); bundle.putString("url", z); bundle.putString(r, A); Bundle bundle2 = new Bundle(); bundle2.putBundle(u, SafeDK.getInstance().r().c()); bundle2.putParcelableArrayList("events", arrayList); Bundle bundle3 = new Bundle(); bundle3.putBundle("report", bundle2); bundle.putBundle(s, bundle3); AppLovinCommunicatorMessage appLovinCommunicatorMessage = new AppLovinCommunicatorMessage(bundle, n, appLovinCommunicatorPublisher); AppLovinCommunicator appLovinCommunicator = AppLovinCommunicator.getInstance(G); Logger.d(j, "publishing message with " + arrayList.size() + " events"); appLovinCommunicator.getMessagingService().publish(appLovinCommunicatorMessage); } public static void reportImageUploadEvent(Bundle data, AppLovinCommunicatorPublisher callback) { Logger.d(j, "reportImageUploadEvent start. Data=" + data.toString()); Bundle bundle = new Bundle(); bundle.putString("url", B); bundle.putString(r, C); data.putBundle(u, SafeDK.getInstance().r().c()); bundle.putBundle(s, data); AppLovinCommunicatorMessage appLovinCommunicatorMessage = new AppLovinCommunicatorMessage(bundle, n, callback); AppLovinCommunicator appLovinCommunicator = AppLovinCommunicator.getInstance(G); Logger.d(j, "publishing message. body=" + data.toString()); appLovinCommunicator.getMessagingService().publish(appLovinCommunicatorMessage); } public static void reportClickUrlResolvedEvent(Bundle data, AppLovinCommunicatorPublisher callback) { Logger.d(j, "reportClickUrlResolvedEvent start"); Bundle bundle = new Bundle(); bundle.putString("url", D); bundle.putString(r, E); data.putBundle(u, SafeDK.getInstance().r().c()); bundle.putBundle(s, data); AppLovinCommunicatorMessage appLovinCommunicatorMessage = new AppLovinCommunicatorMessage(bundle, n, callback); AppLovinCommunicator appLovinCommunicator = AppLovinCommunicator.getInstance(G); Logger.d(j, "publishing message. body=" + data.toString()); appLovinCommunicator.getMessagingService().publish(appLovinCommunicatorMessage); } public static void reportMaxCreativeId(Bundle appLovinMaxBundle, String creativeId, AppLovinCommunicatorPublisher callback) { Logger.d(j, "reportMaxCreativeId start, creativeId=" + creativeId + ", appLovinMaxBundle=" + appLovinMaxBundle.toString()); Bundle bundle = new Bundle(); bundle.putString(y, creativeId); Bundle bundle2 = new Bundle(); bundle2.putBundle(w, bundle); bundle2.putBundle(x, appLovinMaxBundle); AppLovinCommunicatorMessage appLovinCommunicatorMessage = new AppLovinCommunicatorMessage(bundle2, p, callback); AppLovinCommunicator appLovinCommunicator = AppLovinCommunicator.getInstance(G); Logger.d(j, "reportMaxCreativeId publishing message. body=" + bundle2.toString()); appLovinCommunicator.getMessagingService().publish(appLovinCommunicatorMessage); } public static void registerToReceiveMaxEvents(AppLovinCommunicatorSubscriber subscriber) { a(subscriber, k); } public static void registerToReceiveResponse(AppLovinCommunicatorSubscriber subscriber) { a(subscriber, o); } public static void registerToReceiveSafeDKSettings(AppLovinCommunicatorSubscriber subscriber) { a(subscriber, l); } public static void registerToReceiveUserInfo(AppLovinCommunicatorSubscriber subscriber) { a(subscriber, m); } private static void a(AppLovinCommunicatorSubscriber appLovinCommunicatorSubscriber, String str) { AppLovinCommunicator.getInstance(G).subscribe(appLovinCommunicatorSubscriber, Arrays.asList(str)); } public static void registerListener(String requestName, b listener) { try { Logger.d(j, "registerListener started, requestName=" + requestName); if (!F.containsKey(requestName)) { Logger.d(j, "registerListener listener list created for requestName=" + requestName); F.put(requestName, new ArrayList<>()); } ArrayList<b> arrayList = F.get(requestName); Logger.d(j, "registerListener listener added for requestName=" + requestName + "," + listener); arrayList.add(listener); } catch (Throwable th) { Logger.e(j, "registerListener failed during registerListener. requestName:" + requestName + ", listener: " + listener, th); new CrashReporter().caughtException(th); } } public static void b(String str, Bundle bundle) { try { Logger.d(j, "notifyListeners started, requestName=" + str + ",data=" + bundle.toString()); ArrayList<b> arrayList = F.get(str); if (arrayList != null) { Iterator<b> it = arrayList.iterator(); while (it.hasNext()) { b next = it.next(); Logger.d(j, "Invoking handler for requestName '" + str + "', Bundle : " + bundle.toString()); next.a(str, bundle); } } } catch (Throwable th) { Logger.e(j, "Failed to read response", th); } } }