Wolves Themes v1.0版本的 MD5 值为:cddc92b47f6b7c4a195c9625507eb51c

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


package com.applovin.impl.sdk;

import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.hardware.SensorManager;
import android.media.AudioManager;
import android.os.Build;
import android.os.Handler;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import com.applovin.sdk.AppLovinEventTypes;
import com.applovin.sdk.AppLovinLogger;
import com.tapjoy.TapjoyConstants;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
public class ah {
    private static String e;
    private static String f;
    private static int g;
    private final AppLovinSdkImpl a;
    private final AppLovinLogger b;
    private final Context c;
    private final Map<Class, Object> d;

    public ah(AppLovinSdkImpl appLovinSdkImpl) {
        if (appLovinSdkImpl == null) {
            throw new IllegalArgumentException("No sdk specified");
        }
        this.a = appLovinSdkImpl;
        this.b = appLovinSdkImpl.getLogger();
        this.c = appLovinSdkImpl.getApplicationContext();
        this.d = Collections.synchronizedMap(new HashMap());
    }

    private am a(am amVar) {
        if (amVar == null) {
            amVar = new am();
        }
        amVar.w = ac.a(this.c);
        amVar.x = ac.b(this.c);
        amVar.r = ((Boolean) this.a.get(ea.cp)).booleanValue() ? i() : null;
        if (((Boolean) this.a.get(ea.co)).booleanValue()) {
            amVar.q = k();
        }
        try {
            AudioManager audioManager = (AudioManager) this.c.getSystemService("audio");
            if (audioManager != null) {
                amVar.s = (int) (audioManager.getStreamVolume(3) * ((Float) this.a.get(ea.cv)).floatValue());
            }
        } catch (Throwable th) {
            this.b.e("DataCollector", "Unable to collect volume", th);
        }
        if (((Boolean) this.a.get(ea.cy)).booleanValue()) {
            if (e == null) {
                String o = o();
                if (!gd.isValidString(o)) {
                    o = "";
                }
                e = o;
            }
            if (gd.isValidString(e)) {
                amVar.t = e;
            }
        }
        String str = (String) this.a.getSettingsManager().a(ea.cm);
        if (f != null && str.equalsIgnoreCase(f)) {
            amVar.p = g;
            return amVar;
        }
        try {
            f = str;
            PackageInfo packageInfo = this.c.getPackageManager().getPackageInfo(str, 0);
            amVar.p = packageInfo.versionCode;
            g = packageInfo.versionCode;
            return amVar;
        } catch (Throwable unused) {
            g = 0;
            return amVar;
        }
    }

    public static boolean a(String str, Context context) {
        if (str == null) {
            throw new IllegalArgumentException("No permission name specified");
        }
        if (context == null) {
            throw new IllegalArgumentException("No context specified");
        }
        return context.getPackageManager().checkPermission(str, context.getPackageName()) == 0;
    }

    private boolean a(String str, ec<String> ecVar) {
        for (String str2 : aa.a((String) this.a.get(ecVar))) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    private String b(String str) {
        int length = str.length();
        int[] iArr = {11, 12, 10, 3, 2, 1, 15, 10, 15, 14};
        int length2 = iArr.length;
        char[] cArr = new char[length];
        for (int i = 0; i < length; i++) {
            cArr[i] = str.charAt(i);
            for (int i2 = length2 - 1; i2 >= 0; i2--) {
                cArr[i] = (char) (cArr[i] ^ iArr[i2]);
            }
        }
        String str2 = new String(cArr);
        return str2 != null ? str2 : "";
    }

    private String f() {
        int a;
        String str;
        try {
            a = gd.a(this.c);
        } catch (Throwable th) {
            this.a.getLogger().e("DataCollector", "Encountered error while attempting to collect application orientation", th);
        }
        if (a != 1) {
            str = a == 2 ? "landscape" : "landscape";
            return "none";
        }
        str = "portrait";
        return str;
    }

    private aj g() {
        AppLovinLogger appLovinLogger;
        String str;
        String str2;
        try {
            ContentResolver contentResolver = this.c.getContentResolver();
            String string = Settings.Secure.getString(contentResolver, TapjoyConstants.TJC_ADVERTISING_ID);
            aj ajVar = new aj();
            if (string == null) {
                string = "";
            }
            ajVar.b = string;
            ajVar.a = Settings.Secure.getInt(contentResolver, "limit_ad_tracking") != 0;
            return ajVar;
        } catch (Settings.SettingNotFoundException e2) {
            e = e2;
            appLovinLogger = this.b;
            str = "DataCollector";
            str2 = "Unable to determine if FireOS limited ad tracking is turned on";
            appLovinLogger.e(str, str2, e);
            return null;
        } catch (Throwable th) {
            e = th;
            appLovinLogger = this.b;
            str = "DataCollector";
            str2 = "Unable to collect FireOS IDFA";
            appLovinLogger.e(str, str2, e);
            return null;
        }
    }

    private aj h() {
        Object invoke;
        try {
            Class<?> cls = Class.forName("com.google.android.gms.ads.identifier.AdvertisingIdClient");
            if (cls != null && (invoke = cls.getMethod("getAdvertisingIdInfo", Context.class).invoke(null, this.c)) != null) {
                Class<?> cls2 = invoke.getClass();
                Object invoke2 = cls2.getMethod("isLimitAdTrackingEnabled", null).invoke(invoke, null);
                String str = (String) cls2.getMethod("getId", null).invoke(invoke, null);
                if (str == null) {
                    str = "";
                }
                aj ajVar = new aj();
                ajVar.a = ((Boolean) invoke2).booleanValue();
                ajVar.b = str;
                return ajVar;
            }
        } catch (ClassNotFoundException e2) {
            this.b.userError("DataCollector", "Could not collect Google Advertising ID - this will negatively impact your eCPMs! Please integrate the Google Play Services SDK into your application. More info can be found online at http://developer.android.com/google/play-services/setup.html. If you're sure you've integrated the SDK and are still seeing this message, you may need to add a ProGuard exception: -keep public class com.google.android.gms.** { public protected *; }", e2);
        } catch (Throwable th) {
            this.b.e("DataCollector", "Could not collect Google Advertising ID - this will negatively impact your eCPMs! Please integrate the Google Play Services SDK into your application. More info can be found online at http://developer.android.com/google/play-services/setup.html. If you're sure you've integrated the SDK and are still seeing this message, you may need to add a ProGuard exception: -keep public class com.google.android.gms.** { public protected *; }", th);
        }
        return new aj();
    }

    private al i() {
        try {
            al alVar = new al();
            Intent registerReceiver = this.c.registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
            int intExtra = registerReceiver != null ? registerReceiver.getIntExtra(AppLovinEventTypes.USER_COMPLETED_LEVEL, -1) : -1;
            int intExtra2 = registerReceiver != null ? registerReceiver.getIntExtra("scale", -1) : -1;
            if (intExtra <= 0 || intExtra2 <= 0) {
                alVar.b = -1;
            } else {
                alVar.b = (int) ((intExtra / intExtra2) * 100.0f);
            }
            alVar.a = registerReceiver != null ? registerReceiver.getIntExtra("status", -1) : -1;
            return alVar;
        } catch (Throwable th) {
            this.b.e("DataCollector", "Unable to collect battery info", th);
            return null;
        }
    }

    private double j() {
        return Math.round((TimeZone.getDefault().getOffset(new Date().getTime()) * 10.0d) / 3600000.0d) / 10.0d;
    }

    private boolean k() {
        try {
            if (!l()) {
                if (!m()) {
                    return false;
                }
            }
            return true;
        } catch (Throwable unused) {
            return false;
        }
    }

    private boolean l() {
        String str = Build.TAGS;
        return str != null && str.contains(b("lz}$blpz"));
    }

    private boolean m() {
        for (String str : new String[]{"&zpz}ld&hyy&Z|yl{|zl{'hyb", "&zk`g&z|", "&zpz}ld&k`g&z|", "&zpz}ld&qk`g&z|", "&mh}h&efjhe&qk`g&z|", "&mh}h&efjhe&k`g&z|", "&zpz}ld&zm&qk`g&z|", "&zpz}ld&k`g&oh`ezhol&z|", "&mh}h&efjhe&z|"}) {
            if (new File(b(str)).exists()) {
                return true;
            }
        }
        return false;
    }

    private boolean n() {
        return a(Build.DEVICE, ea.cr) || a(Build.HARDWARE, ea.cq) || a(Build.MANUFACTURER, ea.cs) || a(Build.MODEL, ea.ct);
    }

    private String o() {
        AtomicReference atomicReference = new AtomicReference();
        CountDownLatch countDownLatch = new CountDownLatch(1);
        new Handler(this.c.getMainLooper()).post(new ai(this, atomicReference, countDownLatch));
        try {
            countDownLatch.await(((Long) this.a.get(ea.cz)).longValue(), TimeUnit.MILLISECONDS);
        } catch (Throwable unused) {
        }
        return (String) atomicReference.get();
    }

    public am a() {
        TelephonyManager telephonyManager;
        Object obj = this.d.get(am.class);
        if (obj != null) {
            return a((am) obj);
        }
        am amVar = new am();
        amVar.k = Locale.getDefault();
        amVar.a = Build.MODEL;
        amVar.b = Build.VERSION.RELEASE;
        amVar.c = b();
        amVar.d = Build.MANUFACTURER;
        amVar.e = Build.BRAND;
        amVar.f = Build.HARDWARE;
        amVar.h = Build.VERSION.SDK_INT;
        amVar.g = Build.DEVICE;
        amVar.l = f();
        amVar.o = j();
        amVar.u = n();
        try {
            amVar.v = ((SensorManager) this.c.getSystemService("sensor")).getDefaultSensor(4) != null;
        } catch (Throwable th) {
            this.b.e("DataCollector", "Unable to retrieve gyroscope availability", th);
        }
        if (a("android.permission.READ_PHONE_STATE") && (telephonyManager = (TelephonyManager) this.c.getSystemService("phone")) != null) {
            amVar.i = telephonyManager.getSimCountryIso().toUpperCase(Locale.ENGLISH);
            String networkOperatorName = telephonyManager.getNetworkOperatorName();
            try {
                amVar.j = URLEncoder.encode(networkOperatorName, "UTF-8");
            } catch (UnsupportedEncodingException unused) {
                amVar.j = networkOperatorName;
            }
        }
        try {
            DisplayMetrics displayMetrics = this.c.getResources().getDisplayMetrics();
            amVar.m = displayMetrics.density;
            amVar.n = displayMetrics.densityDpi;
        } catch (Throwable unused2) {
        }
        this.d.put(am.class, amVar);
        return amVar;
    }

    boolean a(String str) {
        return a(str, this.c);
    }

    public String b() {
        return this.a.isFireOS() ? "fireos" : TapjoyConstants.TJC_DEVICE_PLATFORM_TYPE;
    }

    public am c() {
        return a((am) null);
    }

    public ak d() {
        PackageInfo packageInfo;
        Object obj = this.d.get(ak.class);
        if (obj != null) {
            return (ak) obj;
        }
        ApplicationInfo applicationInfo = this.c.getApplicationInfo();
        long lastModified = new File(applicationInfo.sourceDir).lastModified();
        PackageManager packageManager = this.c.getPackageManager();
        String str = null;
        try {
            packageInfo = packageManager.getPackageInfo(this.c.getPackageName(), 0);
            try {
                str = packageManager.getInstallerPackageName(applicationInfo.packageName);
            } catch (PackageManager.NameNotFoundException unused) {
            }
        } catch (PackageManager.NameNotFoundException unused2) {
            packageInfo = null;
        }
        ak akVar = new ak();
        akVar.c = applicationInfo.packageName;
        if (str == null) {
            str = "";
        }
        akVar.d = str;
        akVar.e = lastModified;
        akVar.a = String.valueOf(packageManager.getApplicationLabel(applicationInfo));
        akVar.b = packageInfo != null ? packageInfo.versionName : "";
        this.d.put(ak.class, akVar);
        return akVar;
    }

    public aj e() {
        aj h;
        if (this.a.isFireOS()) {
            h = g();
            if (h == null) {
                if (!((Boolean) this.a.get(ea.ch)).booleanValue()) {
                    h = new aj();
                }
            }
            if (((Boolean) this.a.get(ea.bL)).booleanValue()) {
                return new aj();
            }
            if (!h.a || ((Boolean) this.a.get(ea.bK)).booleanValue()) {
                return h;
            }
            h.b = "";
            return h;
        }
        h = h();
        if (((Boolean) this.a.get(ea.bL)).booleanValue()) {
        }
    }
}