CCIPTV PRO v3.0.9.1版本的 MD5 值为:e78d4d980447be4a9f823314f45bbf03

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


package f.d;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
public final class b0 {
    public static final String a = "f.d.b0";
    public static AtomicBoolean b = new AtomicBoolean(false);
    public static AtomicBoolean c = new AtomicBoolean(false);
    public static b f4928d = new b(true, "com.facebook.sdk.AutoInitEnabled");
    public static b f4929e = new b(true, "com.facebook.sdk.AutoLogAppEventsEnabled");
    public static b f4930f = new b(true, "com.facebook.sdk.AdvertiserIDCollectionEnabled");
    public static b f4931g = new b(false, "auto_event_setup_enabled");
    public static SharedPreferences f4932h;

    public static class a implements Runnable {
        public final long b;

        public a(long j2) {
            this.b = j2;
        }

        @Override
        public void run() {
            com.facebook.internal.l o2;
            if (b0.f4930f.a() && (o2 = com.facebook.internal.m.o(j.f(), false)) != null && o2.b()) {
                com.facebook.internal.a h2 = com.facebook.internal.a.h(j.e());
                if (((h2 == null || h2.b() == null) ? null : h2.b()) != null) {
                    Bundle bundle = new Bundle();
                    bundle.putString("advertiser_id", h2.b());
                    bundle.putString("fields", "auto_event_setup_enabled");
                    n J = n.J(null, j.f(), null);
                    J.a0(true);
                    J.Z(bundle);
                    JSONObject h3 = J.g().h();
                    if (h3 != null) {
                        b0.f4931g.b = Boolean.valueOf(h3.optBoolean("auto_event_setup_enabled", false));
                        b0.f4931g.f4933d = this.b;
                        b0.r(b0.f4931g);
                    }
                }
            }
            b0.c.set(false);
        }
    }

    public static class b {
        public String a;
        public Boolean b;
        public boolean c;
        public long f4933d;

        public b(boolean z, String str) {
            this.c = z;
            this.a = str;
        }

        public boolean a() {
            Boolean bool = this.b;
            return bool == null ? this.c : bool.booleanValue();
        }
    }

    public static boolean e() {
        j();
        return f4930f.a();
    }

    public static boolean f() {
        j();
        return f4928d.a();
    }

    public static boolean g() {
        j();
        return f4929e.a();
    }

    public static boolean h() {
        j();
        return f4931g.a();
    }

    public static void i() {
        p(f4931g);
        long currentTimeMillis = System.currentTimeMillis();
        b bVar = f4931g;
        if (bVar.b == null || currentTimeMillis - bVar.f4933d >= 604800000) {
            b bVar2 = f4931g;
            bVar2.b = null;
            bVar2.f4933d = 0L;
            if (c.compareAndSet(false, true)) {
                j.m().execute(new a(currentTimeMillis));
            }
        }
    }

    public static void j() {
        if (j.u() && b.compareAndSet(false, true)) {
            f4932h = j.e().getSharedPreferences("com.facebook.sdk.USER_SETTINGS", 0);
            k(f4929e, f4930f, f4928d);
            i();
            o();
            n();
        }
    }

    public static void k(b... bVarArr) {
        for (b bVar : bVarArr) {
            if (bVar == f4931g) {
                i();
            } else if (bVar.b == null) {
                p(bVar);
                if (bVar.b == null) {
                    l(bVar);
                }
            } else {
                r(bVar);
            }
        }
    }

    public static void l(b bVar) {
        q();
        try {
            Context e2 = j.e();
            ApplicationInfo applicationInfo = e2.getPackageManager().getApplicationInfo(e2.getPackageName(), 128);
            if (applicationInfo == null || applicationInfo.metaData == null || !applicationInfo.metaData.containsKey(bVar.a)) {
                return;
            }
            bVar.b = Boolean.valueOf(applicationInfo.metaData.getBoolean(bVar.a, bVar.c));
        } catch (PackageManager.NameNotFoundException e3) {
            com.facebook.internal.w.S(a, e3);
        }
    }

    public static void m() {
        try {
            Context e2 = j.e();
            ApplicationInfo applicationInfo = e2.getPackageManager().getApplicationInfo(e2.getPackageName(), 128);
            if (applicationInfo == null || applicationInfo.metaData == null || !applicationInfo.metaData.getBoolean("com.facebook.sdk.AutoAppLinkEnabled", false)) {
                return;
            }
            com.facebook.appevents.m mVar = new com.facebook.appevents.m(e2);
            Bundle bundle = new Bundle();
            if (!com.facebook.internal.w.I()) {
                bundle.putString("SchemeWarning", "You haven't set the Auto App Link URL scheme: fb<YOUR APP ID> in AndroidManifest");
                Log.w(a, "You haven't set the Auto App Link URL scheme: fb<YOUR APP ID> in AndroidManifest");
            }
            mVar.f("fb_auto_applink", bundle);
        } catch (PackageManager.NameNotFoundException unused) {
        }
    }

    public static void n() {
        int i2;
        ApplicationInfo applicationInfo;
        if (b.get() && j.u()) {
            Context e2 = j.e();
            int i3 = 0;
            int i4 = ((f4928d.a() ? 1 : 0) << 0) | 0 | ((f4929e.a() ? 1 : 0) << 1) | ((f4930f.a() ? 1 : 0) << 2);
            int i5 = f4932h.getInt("com.facebook.sdk.USER_SETTINGS_BITMASK", 0);
            if (i5 != i4) {
                f4932h.edit().putInt("com.facebook.sdk.USER_SETTINGS_BITMASK", i4).commit();
                try {
                    applicationInfo = e2.getPackageManager().getApplicationInfo(e2.getPackageName(), 128);
                } catch (PackageManager.NameNotFoundException unused) {
                }
                if (applicationInfo != null && applicationInfo.metaData != null) {
                    String[] strArr = {"com.facebook.sdk.AutoInitEnabled", "com.facebook.sdk.AutoLogAppEventsEnabled", "com.facebook.sdk.AdvertiserIDCollectionEnabled"};
                    boolean[] zArr = {true, true, true};
                    int i6 = 0;
                    i2 = 0;
                    for (int i7 = 0; i7 < 3; i7++) {
                        try {
                            i2 |= (applicationInfo.metaData.containsKey(strArr[i7]) ? 1 : 0) << i7;
                            i6 |= (applicationInfo.metaData.getBoolean(strArr[i7], zArr[i7]) ? 1 : 0) << i7;
                        } catch (PackageManager.NameNotFoundException unused2) {
                        }
                    }
                    i3 = i6;
                    com.facebook.appevents.m mVar = new com.facebook.appevents.m(e2);
                    Bundle bundle = new Bundle();
                    bundle.putInt("usage", i2);
                    bundle.putInt("initial", i3);
                    bundle.putInt("previous", i5);
                    bundle.putInt("current", i4);
                    mVar.i("fb_sdk_settings_changed", bundle);
                }
                i2 = 0;
                com.facebook.appevents.m mVar2 = new com.facebook.appevents.m(e2);
                Bundle bundle2 = new Bundle();
                bundle2.putInt("usage", i2);
                bundle2.putInt("initial", i3);
                bundle2.putInt("previous", i5);
                bundle2.putInt("current", i4);
                mVar2.i("fb_sdk_settings_changed", bundle2);
            }
        }
    }

    public static void o() {
        try {
            Context e2 = j.e();
            ApplicationInfo applicationInfo = e2.getPackageManager().getApplicationInfo(e2.getPackageName(), 128);
            if (applicationInfo == null || applicationInfo.metaData == null) {
                return;
            }
            if (!applicationInfo.metaData.containsKey("com.facebook.sdk.AutoLogAppEventsEnabled")) {
                Log.w(a, "Please set a value for AutoLogAppEventsEnabled. Set the flag to TRUE if you want to collect app install, app launch and in-app purchase events automatically. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#disable-auto-events.");
            }
            if (!applicationInfo.metaData.containsKey("com.facebook.sdk.AdvertiserIDCollectionEnabled")) {
                Log.w(a, "You haven't set a value for AdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#disable-auto-events.");
            }
            if (e()) {
                return;
            }
            Log.w(a, "The value for AdvertiserIDCollectionEnabled is currently set to FALSE so you're sending app events without collecting Advertiser ID. This can affect the quality of your advertising and analytics results.");
        } catch (PackageManager.NameNotFoundException unused) {
        }
    }

    public static void p(b bVar) {
        q();
        try {
            String string = f4932h.getString(bVar.a, "");
            if (string.isEmpty()) {
                return;
            }
            JSONObject jSONObject = new JSONObject(string);
            bVar.b = Boolean.valueOf(jSONObject.getBoolean("value"));
            bVar.f4933d = jSONObject.getLong("last_timestamp");
        } catch (JSONException e2) {
            com.facebook.internal.w.S(a, e2);
        }
    }

    public static void q() {
        if (!b.get()) {
            throw new k("The UserSettingManager has not been initialized successfully");
        }
    }

    public static void r(b bVar) {
        q();
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("value", bVar.b);
            jSONObject.put("last_timestamp", bVar.f4933d);
            f4932h.edit().putString(bVar.a, jSONObject.toString()).commit();
            n();
        } catch (Exception e2) {
            com.facebook.internal.w.S(a, e2);
        }
    }
}