Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f

以下内容为反编译后的 e.java 源代码,内容仅作参考


package com.ironsource.environment;

import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import androidx.browser.trusted.sharing.ShareTarget;
import com.ironsource.mediationsdk.config.VersionInfo;
import com.tapjoy.TapjoyConstants;
import java.io.DataOutputStream;
import java.lang.Thread;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import org.json.JSONObject;

public final class e {

    public static String f43768c = "";

    public JSONObject f43769a;

    public String f43770b;

    public String f43771d;

    public String f43772e;

    public Context f43773f;

    public Thread.UncaughtExceptionHandler f43774g;

    public String f43775h;

    public String f43776i;

    public class b implements Runnable {

        public Context f43783b;

        public String f43784c;

        public b(Context context, String str) {
            this.f43783b = context;
            this.f43784c = str;
        }

        @Override
        public final void run() {
            try {
                String C = h.C(this.f43783b);
                if (!TextUtils.isEmpty(C)) {
                    e.this.f43770b = C;
                }
                String D = h.D(this.f43783b);
                if (!TextUtils.isEmpty(D)) {
                    e.this.f43772e = D;
                }
                SharedPreferences.Editor edit = this.f43783b.getSharedPreferences("CRep", 0).edit();
                edit.putString("String1", e.this.f43770b);
                edit.putString("sId", this.f43784c);
                edit.apply();
            } catch (Exception e11) {
                e11.printStackTrace();
            }
        }
    }

    public class c implements Runnable {
        public c() {
        }

        @Override
        public final void run() {
            try {
                HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(e.a().f43775h).openConnection();
                httpURLConnection.setRequestMethod(ShareTarget.METHOD_POST);
                httpURLConnection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
                httpURLConnection.setRequestProperty("Accept", "application/json");
                httpURLConnection.setDoOutput(true);
                httpURLConnection.setDoInput(true);
                Log.i("JSON", e.this.f43769a.toString());
                DataOutputStream dataOutputStream = new DataOutputStream(httpURLConnection.getOutputStream());
                dataOutputStream.writeBytes(e.this.f43769a.toString());
                dataOutputStream.flush();
                dataOutputStream.close();
                Log.i("STATUS", String.valueOf(httpURLConnection.getResponseCode()));
                Log.i("MSG", httpURLConnection.getResponseMessage());
                httpURLConnection.disconnect();
            } catch (Exception e11) {
                e11.printStackTrace();
            }
        }
    }

    public static class d {

        public static volatile e f43792a = new e(0);
    }

    private e() {
        this.f43769a = new JSONObject();
        Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
        this.f43774g = defaultUncaughtExceptionHandler;
        this.f43776i = " ";
        this.f43775h = "https://outcome-crash-report.supersonicads.com/reporter";
        Thread.setDefaultUncaughtExceptionHandler(new com.ironsource.environment.d(defaultUncaughtExceptionHandler));
    }

    public static e a() {
        return d.f43792a;
    }

    public static String b(Context context) {
        ConnectivityManager connectivityManager;
        Network activeNetwork;
        if (context == null || (connectivityManager = (ConnectivityManager) context.getSystemService("connectivity")) == null) {
            return "none";
        }
        try {
            if (Build.VERSION.SDK_INT >= 23) {
                activeNetwork = connectivityManager.getActiveNetwork();
                NetworkCapabilities networkCapabilities = connectivityManager.getNetworkCapabilities(activeNetwork);
                if (networkCapabilities == null) {
                    return "none";
                }
                if (networkCapabilities.hasTransport(1)) {
                    return TapjoyConstants.TJC_CONNECTION_TYPE_WIFI;
                }
                if (networkCapabilities.hasTransport(0)) {
                    return "cellular";
                }
            } else {
                NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
                if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) {
                    if (activeNetworkInfo.getTypeName().equalsIgnoreCase("WIFI")) {
                        return TapjoyConstants.TJC_CONNECTION_TYPE_WIFI;
                    }
                    if (activeNetworkInfo.getTypeName().equalsIgnoreCase("MOBILE")) {
                        return "cellular";
                    }
                }
            }
            return "none";
        } catch (Exception e11) {
            e11.printStackTrace();
            return "none";
        }
    }

    public e(byte b11) {
        this();
    }

    public final void a(Context context, HashSet<String> hashSet, String str, String str2, boolean z11, String str3, int i11, boolean z12) {
        if (context != null) {
            Log.d("automation_log", "init ISCrashReporter");
            this.f43773f = context;
            if (!TextUtils.isEmpty(str2)) {
                this.f43776i = str2;
            }
            if (!TextUtils.isEmpty(str)) {
                this.f43775h = str;
            }
            this.f43771d = str3;
            if (z11) {
                com.ironsource.environment.a aVar = new com.ironsource.environment.a(i11);
                aVar.f43742h = z12;
                aVar.f43741g = true;
                aVar.f43736b = new a();
                aVar.start();
            }
            String b11 = b(this.f43773f);
            if (!b11.equals("none")) {
                SharedPreferences sharedPreferences = context.getSharedPreferences("CRep", 0);
                String string = sharedPreferences.getString("String1", this.f43770b);
                String string2 = sharedPreferences.getString("sId", this.f43771d);
                for (com.ironsource.environment.c cVar : f.a()) {
                    String b12 = cVar.b();
                    String a11 = cVar.a();
                    String c11 = cVar.c();
                    String packageName = context.getPackageName();
                    JSONObject jSONObject = new JSONObject();
                    try {
                        jSONObject.put("crashDate", b12);
                        jSONObject.put("stacktraceCrash", a11);
                        jSONObject.put("crashType", c11);
                        jSONObject.put("CrashReporterVersion", "1.0.5");
                        jSONObject.put("SDKVersion", VersionInfo.VERSION);
                        jSONObject.put("deviceLanguage", h.a(context));
                        jSONObject.put("appVersion", com.ironsource.environment.c.c(context, packageName));
                        jSONObject.put("deviceOSVersion", h.e());
                        jSONObject.put("network", b11);
                        jSONObject.put("deviceApiLevel", h.f());
                        jSONObject.put("deviceModel", h.g());
                        jSONObject.put("deviceOS", h.i());
                        jSONObject.put("advertisingId", string);
                        jSONObject.put("deviceOEM", h.h());
                        jSONObject.put("systemProperties", System.getProperties());
                        jSONObject.put("bundleId", packageName);
                        jSONObject.put("sId", string2);
                        if (!TextUtils.isEmpty(this.f43772e)) {
                            jSONObject.put("isLimitAdTrackingEnabled", Boolean.parseBoolean(this.f43772e));
                        }
                        JSONObject jSONObject2 = new JSONObject();
                        if (hashSet != null && !hashSet.isEmpty()) {
                            Iterator<String> it = hashSet.iterator();
                            while (it.hasNext()) {
                                String next = it.next();
                                try {
                                    if (jSONObject.has(next)) {
                                        jSONObject2.put(next, jSONObject.opt(next));
                                    }
                                } catch (Exception e11) {
                                    e11.printStackTrace();
                                }
                            }
                            jSONObject = jSONObject2;
                        }
                        this.f43769a = jSONObject;
                    } catch (Exception unused) {
                    }
                    if (this.f43769a.length() == 0) {
                        Log.d("ISCrashReport", " Is Empty");
                    } else {
                        new Thread(new c()).start();
                        f.c();
                    }
                }
            }
            new Thread(new b(context, str3)).start();
        }
    }

    public class a implements n00.a {
        public a() {
        }

        @Override
        public final void a() {
            Map<Thread, StackTraceElement[]> allStackTraces = Thread.getAllStackTraces();
            StringBuilder sb2 = new StringBuilder(128);
            for (Thread thread : allStackTraces.keySet()) {
                StackTraceElement[] stackTrace = thread.getStackTrace();
                if (stackTrace != null && stackTrace.length > 0) {
                    sb2.append("*** Thread Name ");
                    sb2.append(thread.getName());
                    sb2.append(" Thread ID ");
                    sb2.append(thread.getId());
                    sb2.append(" (");
                    sb2.append(thread.getState().toString());
                    sb2.append(") ***\n");
                    for (StackTraceElement stackTraceElement : stackTrace) {
                        sb2.append(stackTraceElement.toString());
                        sb2.append(" ");
                        sb2.append(thread.getState().toString());
                        sb2.append("\n");
                    }
                }
            }
            e.f43768c = sb2.toString();
        }

        @Override
        public final void b() {
        }
    }
}