Translate SMS German v2.1.0.2版本的 MD5 值为:bcf759bfd2c1bd0234a10506935f703f
以下内容为反编译后的 ReferralReceiver.java 源代码,内容仅作参考
package com.appnext.tracking;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import com.github.kevinsawicki.http.HttpRequest;
import com.rjfun.cordova.ad.GenericAdPlugin;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public final class ReferralReceiver extends BroadcastReceiver {
public static String guid = "";
private static boolean in = true;
private static final String[] io = {"utm_source", "utm_medium", "utm_term", "utm_content", "utm_campaign"};
private static final String ip = "appnext";
Context context;
@Override
@SuppressLint({"SetJavaScriptEnabled"})
public void onReceive(Context context, Intent intent) {
try {
this.context = context;
if (in) {
in = false;
try {
List<ResolveInfo> queryBroadcastReceivers = context.getPackageManager().queryBroadcastReceivers(intent, 0);
if (queryBroadcastReceivers.size() > 0 && queryBroadcastReceivers.get(0).activityInfo.name.equals(getClass().getName())) {
Iterator<ResolveInfo> it = queryBroadcastReceivers.iterator();
while (it.hasNext()) {
ActivityInfo activityInfo = it.next().activityInfo;
if (activityInfo.enabled && activityInfo.exported && activityInfo.packageName.equals(context.getPackageName())) {
String str = activityInfo.name;
if (!activityInfo.name.equals(getClass().getName())) {
try {
BroadcastReceiver broadcastReceiver = (BroadcastReceiver) Class.forName(str).newInstance();
intent.setClassName(context, str);
broadcastReceiver.onReceive(context, intent);
} catch (Throwable th) {
}
}
}
}
}
} catch (Throwable th2) {
}
}
try {
Bundle extras = intent.getExtras();
if (extras != null) {
extras.containsKey(null);
}
HashMap hashMap = new HashMap();
String stringExtra = intent.getStringExtra("referrer");
if (stringExtra != null && stringExtra.length() != 0) {
try {
String decode = URLDecoder.decode(stringExtra, HttpRequest.CHARSET_UTF8);
SharedPreferences.Editor edit = context.getSharedPreferences(ip, 0).edit();
edit.putString("ref", intent.getStringExtra("referrer"));
edit.apply();
String[] split = decode.split("&");
for (String str2 : split) {
String[] split2 = str2.split("=");
hashMap.put(split2[0], split2[1]);
}
if (hashMap.get("utm_content") != null) {
guid = (String) hashMap.get("utm_content");
}
a(context, hashMap);
AppnextTrack.F(context);
} catch (UnsupportedEncodingException e) {
}
}
} catch (Throwable th3) {
}
} catch (Throwable th4) {
AppnextTrack.track(context);
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
th4.printStackTrace(printWriter);
String obj = stringWriter.toString();
printWriter.close();
String str3 = "";
try {
str3 = intent.getDataString();
} catch (Throwable th5) {
}
new a("referral crash", str3, obj, getPackage(), cf(), "").execute(new Void[0]);
}
}
private static void a(Context context, Map<String, String> map) {
SharedPreferences.Editor edit = context.getSharedPreferences(ip, 0).edit();
for (String str : io) {
String str2 = map.get(str);
if (str2 != null) {
edit.putString(str, str2);
}
}
edit.putBoolean("appnextSent", false);
edit.apply();
}
private static Map<String, String> I(Context context) {
HashMap hashMap = new HashMap();
SharedPreferences sharedPreferences = context.getSharedPreferences(ip, 0);
for (String str : io) {
String string = sharedPreferences.getString(str, null);
if (string != null) {
hashMap.put(str, string);
}
}
return hashMap;
}
private class a extends AsyncTask<Void, Void, Void> {
String iq;
String ir;
String is;
String it;
String iu;
String iv;
public a(String str, String str2, String str3, String str4, String str5, String str6) {
this.iq = str;
this.ir = str2;
this.is = str3;
this.it = str4;
this.iu = str5;
this.iv = str6;
}
@Override
public Void doInBackground(Void... voidArr) {
HashMap hashMap = new HashMap();
hashMap.put("e", this.iq);
hashMap.put("r", this.ir);
hashMap.put(GenericAdPlugin.OPT_Y, this.is);
hashMap.put("g", this.it);
hashMap.put("p", this.iu);
hashMap.put("d", this.iv);
try {
AppnextTrack.a("http://admin.appnext.com/AdminService.asmx/ery", hashMap);
return null;
} catch (Throwable th) {
return null;
}
}
}
private String cf() {
try {
return URLEncoder.encode("android " + Build.VERSION.SDK_INT + " " + Build.MANUFACTURER + " " + Build.MODEL, HttpRequest.CHARSET_UTF8);
} catch (UnsupportedEncodingException e) {
return "android";
}
}
private String getPackage() {
try {
return this.context.getPackageName();
} catch (Throwable th) {
return "";
}
}
}