PicWish v1.6.8版本的 MD5 值为:7e8bab240f03cf6dad8952f8374c4ed1

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


package b3;

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 b3.l0;
import com.facebook.GraphRequest;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
public final class l0 {
    public static final l0 f854a = new l0();
    public static final AtomicBoolean f855b = new AtomicBoolean(false);
    public static final AtomicBoolean c = new AtomicBoolean(false);
    public static final a f856d = new a(true, "com.facebook.sdk.AutoInitEnabled");
    public static final a f857e = new a(true, "com.facebook.sdk.AutoLogAppEventsEnabled");
    public static final a f858f = new a(true, "com.facebook.sdk.AdvertiserIDCollectionEnabled");
    public static final a f859g = new a(false, "auto_event_setup_enabled");
    public static final a f860h = new a(true, "com.facebook.sdk.MonitorEnabled");
    public static SharedPreferences f861i;

    public static final class a {
        public boolean f862a;
        public String f863b;
        public Boolean c;
        public long f864d;

        public a(boolean z10, String str) {
            this.f862a = z10;
            this.f863b = str;
        }

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

    public static final boolean a() {
        if (v3.a.b(l0.class)) {
            return false;
        }
        try {
            f854a.d();
            return f858f.a();
        } catch (Throwable th2) {
            v3.a.a(th2, l0.class);
            return false;
        }
    }

    public static final boolean b() {
        if (v3.a.b(l0.class)) {
            return false;
        }
        try {
            f854a.d();
            return f857e.a();
        } catch (Throwable th2) {
            v3.a.a(th2, l0.class);
            return false;
        }
    }

    public final void c() {
        if (v3.a.b(this)) {
            return;
        }
        try {
            a aVar = f859g;
            h(aVar);
            final long currentTimeMillis = System.currentTimeMillis();
            if (aVar.c == null || currentTimeMillis - aVar.f864d >= 604800000) {
                aVar.c = null;
                aVar.f864d = 0L;
                if (c.compareAndSet(false, true)) {
                    s sVar = s.f870a;
                    s.e().execute(new Runnable() {
                        @Override
                        public final void run() {
                            long j10 = currentTimeMillis;
                            if (v3.a.b(l0.class)) {
                                return;
                            }
                            try {
                                if (l0.f858f.a()) {
                                    q3.o oVar = q3.o.f12249a;
                                    s sVar2 = s.f870a;
                                    q3.n f10 = q3.o.f(s.b(), false);
                                    if (f10 != null && f10.f12239j) {
                                        q3.a b10 = q3.a.f12130f.b(s.a());
                                        String a10 = (b10 == null || b10.a() == null) ? null : b10.a();
                                        if (a10 != null) {
                                            Bundle bundle = new Bundle();
                                            bundle.putString("advertiser_id", a10);
                                            bundle.putString("fields", "auto_event_setup_enabled");
                                            GraphRequest h10 = GraphRequest.f2640j.h(null, "app", null);
                                            h10.f2646d = bundle;
                                            JSONObject jSONObject = h10.c().f899b;
                                            if (jSONObject != null) {
                                                l0.a aVar2 = l0.f859g;
                                                aVar2.c = Boolean.valueOf(jSONObject.optBoolean("auto_event_setup_enabled", false));
                                                aVar2.f864d = j10;
                                                l0.f854a.j(aVar2);
                                            }
                                        }
                                    }
                                }
                                l0.c.set(false);
                            } catch (Throwable th2) {
                                v3.a.a(th2, l0.class);
                            }
                        }
                    });
                }
            }
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }

    public final void d() {
        if (v3.a.b(this)) {
            return;
        }
        try {
            s sVar = s.f870a;
            if (s.j()) {
                int i10 = 0;
                if (f855b.compareAndSet(false, true)) {
                    SharedPreferences sharedPreferences = s.a().getSharedPreferences("com.facebook.sdk.USER_SETTINGS", 0);
                    j9.b.h(sharedPreferences, "FacebookSdk.getApplicationContext()\n            .getSharedPreferences(USER_SETTINGS, Context.MODE_PRIVATE)");
                    f861i = sharedPreferences;
                    a[] aVarArr = {f857e, f858f, f856d};
                    if (!v3.a.b(this)) {
                        while (i10 < 3) {
                            a aVar = aVarArr[i10];
                            i10++;
                            if (aVar == f859g) {
                                c();
                            } else if (aVar.c == null) {
                                h(aVar);
                                if (aVar.c == null) {
                                    e(aVar);
                                }
                            } else {
                                j(aVar);
                            }
                        }
                    }
                    c();
                    g();
                    f();
                }
            }
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }

    public final void e(a aVar) {
        if (v3.a.b(this)) {
            return;
        }
        try {
            i();
            try {
                s sVar = s.f870a;
                Context a10 = s.a();
                ApplicationInfo applicationInfo = a10.getPackageManager().getApplicationInfo(a10.getPackageName(), 128);
                j9.b.h(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
                Bundle bundle = applicationInfo.metaData;
                if (bundle == null || !bundle.containsKey(aVar.f863b)) {
                    return;
                }
                aVar.c = Boolean.valueOf(applicationInfo.metaData.getBoolean(aVar.f863b, aVar.f862a));
            } catch (PackageManager.NameNotFoundException unused) {
                s sVar2 = s.f870a;
                s sVar3 = s.f870a;
            }
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }

    public final void f() {
        int i10;
        int i11;
        Bundle bundle;
        ApplicationInfo applicationInfo;
        if (v3.a.b(this)) {
            return;
        }
        try {
            if (f855b.get()) {
                s sVar = s.f870a;
                if (s.j()) {
                    Context a10 = s.a();
                    int i12 = ((f856d.a() ? 1 : 0) << 0) | 0 | ((f857e.a() ? 1 : 0) << 1) | ((f858f.a() ? 1 : 0) << 2) | ((f860h.a() ? 1 : 0) << 3);
                    SharedPreferences sharedPreferences = f861i;
                    if (sharedPreferences == null) {
                        j9.b.x("userSettingPref");
                        throw null;
                    }
                    int i13 = sharedPreferences.getInt("com.facebook.sdk.USER_SETTINGS_BITMASK", 0);
                    if (i13 != i12) {
                        SharedPreferences sharedPreferences2 = f861i;
                        if (sharedPreferences2 == null) {
                            j9.b.x("userSettingPref");
                            throw null;
                        }
                        sharedPreferences2.edit().putInt("com.facebook.sdk.USER_SETTINGS_BITMASK", i12).apply();
                        try {
                            applicationInfo = a10.getPackageManager().getApplicationInfo(a10.getPackageName(), 128);
                            j9.b.h(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
                        } catch (PackageManager.NameNotFoundException unused) {
                        }
                        if (applicationInfo.metaData != null) {
                            String[] strArr = {"com.facebook.sdk.AutoInitEnabled", "com.facebook.sdk.AutoLogAppEventsEnabled", "com.facebook.sdk.AdvertiserIDCollectionEnabled", "com.facebook.sdk.MonitorEnabled"};
                            boolean[] zArr = {true, true, true, true};
                            int i14 = 0;
                            i10 = 0;
                            i11 = 0;
                            while (true) {
                                int i15 = i14 + 1;
                                try {
                                    i10 |= (applicationInfo.metaData.containsKey(strArr[i14]) ? 1 : 0) << i14;
                                    i11 |= (applicationInfo.metaData.getBoolean(strArr[i14], zArr[i14]) ? 1 : 0) << i14;
                                    if (i15 > 3) {
                                        break;
                                    }
                                    i14 = i15;
                                } catch (PackageManager.NameNotFoundException unused2) {
                                }
                            }
                            c3.n nVar = new c3.n(a10, (String) null);
                            bundle = new Bundle();
                            bundle.putInt("usage", i10);
                            bundle.putInt("initial", i11);
                            bundle.putInt("previous", i13);
                            bundle.putInt("current", i12);
                            if (!((bundle.getInt("previous") & 2) == 0)) {
                                s sVar2 = s.f870a;
                                if (!s.c()) {
                                    return;
                                }
                            }
                            nVar.f("fb_sdk_settings_changed", bundle);
                        }
                        i10 = 0;
                        i11 = 0;
                        c3.n nVar2 = new c3.n(a10, (String) null);
                        bundle = new Bundle();
                        bundle.putInt("usage", i10);
                        bundle.putInt("initial", i11);
                        bundle.putInt("previous", i13);
                        bundle.putInt("current", i12);
                        if (!((bundle.getInt("previous") & 2) == 0)) {
                        }
                        nVar2.f("fb_sdk_settings_changed", bundle);
                    }
                }
            }
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }

    public final void g() {
        if (v3.a.b(this)) {
            return;
        }
        try {
            s sVar = s.f870a;
            Context a10 = s.a();
            ApplicationInfo applicationInfo = a10.getPackageManager().getApplicationInfo(a10.getPackageName(), 128);
            j9.b.h(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
            Bundle bundle = applicationInfo.metaData;
            if (bundle != null) {
                if (!bundle.containsKey("com.facebook.sdk.AutoLogAppEventsEnabled")) {
                    Log.w("b3.l0", "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("b3.l0", "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 (a()) {
                    return;
                }
                Log.w("b3.l0", "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) {
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }

    public final void h(a aVar) {
        String str = "";
        if (v3.a.b(this)) {
            return;
        }
        try {
            i();
            try {
                SharedPreferences sharedPreferences = f861i;
                if (sharedPreferences == null) {
                    j9.b.x("userSettingPref");
                    throw null;
                }
                String string = sharedPreferences.getString(aVar.f863b, "");
                if (string != null) {
                    str = string;
                }
                if (str.length() > 0) {
                    JSONObject jSONObject = new JSONObject(str);
                    aVar.c = Boolean.valueOf(jSONObject.getBoolean("value"));
                    aVar.f864d = jSONObject.getLong("last_timestamp");
                }
            } catch (JSONException unused) {
                s sVar = s.f870a;
                s sVar2 = s.f870a;
            }
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }

    public final void i() {
        if (v3.a.b(this)) {
            return;
        }
        try {
            if (f855b.get()) {
                return;
            }
            throw new t("The UserSettingManager has not been initialized successfully");
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }

    public final void j(a aVar) {
        if (v3.a.b(this)) {
            return;
        }
        try {
            i();
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("value", aVar.c);
                jSONObject.put("last_timestamp", aVar.f864d);
                SharedPreferences sharedPreferences = f861i;
                if (sharedPreferences == null) {
                    j9.b.x("userSettingPref");
                    throw null;
                }
                sharedPreferences.edit().putString(aVar.f863b, jSONObject.toString()).apply();
                f();
            } catch (Exception unused) {
                s sVar = s.f870a;
                s sVar2 = s.f870a;
            }
        } catch (Throwable th2) {
            v3.a.a(th2, this);
        }
    }
}