APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Gizmo
版本号:1.7.0
包名称:ai.saveall.app

MD5 校验值:51aae3247d6bd20bca268c4c9a4dd21c

反编译源代码说明

E.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package V1;

import E1.C0275n;
import E1.C0277p;
import a2.C0325a;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.collections.AbstractC0820i;
import kotlin.collections.AbstractC0827p;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;

public final class E {

    public static final E f3601a;

    private static final String f3602b;

    private static final List f3603c;

    private static final List f3604d;

    private static final Map f3605e;

    private static final AtomicBoolean f3606f;

    private static final Integer[] f3607g;

    public static final class a extends e {
        @Override
        public String c() {
            return (String) g();
        }

        @Override
        public String d() {
            return "com.facebook.arstudio.player";
        }

        public Void g() {
            return null;
        }
    }

    private static final class b extends e {
        @Override
        public String c() {
            return "com.instagram.platform.AppAuthorizeActivity";
        }

        @Override
        public String d() {
            return "com.instagram.android";
        }

        @Override
        public String e() {
            return "token,signed_request,graph_domain,granted_scopes";
        }
    }

    public static final class c extends e {
        private final boolean g() {
            if (E1.z.l().getApplicationInfo().targetSdkVersion >= 30) {
                return true;
            }
            return false;
        }

        @Override
        public String c() {
            return "com.facebook.katana.ProxyAuth";
        }

        @Override
        public String d() {
            return "com.facebook.katana";
        }

        @Override
        public void f() {
            if (g()) {
                Log.w(E.c(), "Apps that target Android API 30+ (Android 11+) cannot call Facebook native apps unless the package visibility needs are declared. Please follow https://developers.facebook.com/docs/android/troubleshooting/#faq_267321845055988 to make the declaration.");
            }
        }
    }

    public static final class d extends e {
        @Override
        public String c() {
            return (String) g();
        }

        @Override
        public String d() {
            return "com.facebook.orca";
        }

        public Void g() {
            return null;
        }
    }

    public static final class f {

        public static final a f3609c = new a(null);

        private e f3610a;

        private int f3611b;

        public static final class a {
            private a() {
            }

            public final f a(e eVar, int i5) {
                f fVar = new f(null);
                fVar.f3610a = eVar;
                fVar.f3611b = i5;
                return fVar;
            }

            public final f b() {
                f fVar = new f(null);
                fVar.f3611b = -1;
                return fVar;
            }

            public a(DefaultConstructorMarker defaultConstructorMarker) {
                this();
            }
        }

        private f() {
        }

        public final int c() {
            return this.f3611b;
        }

        public f(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }
    }

    public static final class g extends e {
        @Override
        public String c() {
            return "com.facebook.katana.ProxyAuth";
        }

        @Override
        public String d() {
            return "com.facebook.wakizashi";
        }
    }

    static {
        E e5 = new E();
        f3601a = e5;
        f3602b = E.class.getName();
        f3603c = e5.f();
        f3604d = e5.e();
        f3605e = e5.d();
        f3606f = new AtomicBoolean(false);
        f3607g = new Integer[]{20210906, 20171115, 20170417, 20170411, 20170213, 20161017, 20160327, 20150702, 20150401, 20141218, 20141107, 20141028, 20141001, 20140701, 20140324, 20140313, 20140204, 20131107, 20131024, 20130618, 20130502, 20121101};
    }

    private E() {
    }

    public static final Intent A(Context context, Intent intent, e eVar) {
        ResolveInfo resolveService;
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            Intrinsics.checkNotNullParameter(context, "context");
            if (intent == null || (resolveService = context.getPackageManager().resolveService(intent, 0)) == null) {
                return null;
            }
            C0306k c0306k = C0306k.f3737a;
            String str = resolveService.serviceInfo.packageName;
            Intrinsics.checkNotNullExpressionValue(str, "resolveInfo.serviceInfo.packageName");
            if (!C0306k.a(context, str)) {
                return null;
            }
            return intent;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static final TreeSet b(E e5, e eVar) {
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            return e5.o(eVar);
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static final String c() {
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            return f3602b;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    private final Map d() {
        if (C0325a.d(this)) {
            return null;
        }
        try {
            HashMap hashMap = new HashMap();
            ArrayList arrayList = new ArrayList();
            arrayList.add(new d());
            List list = f3603c;
            hashMap.put("com.facebook.platform.action.request.OGACTIONPUBLISH_DIALOG", list);
            hashMap.put("com.facebook.platform.action.request.FEED_DIALOG", list);
            hashMap.put("com.facebook.platform.action.request.LIKE_DIALOG", list);
            hashMap.put("com.facebook.platform.action.request.APPINVITES_DIALOG", list);
            hashMap.put("com.facebook.platform.action.request.MESSAGE_DIALOG", arrayList);
            hashMap.put("com.facebook.platform.action.request.OGMESSAGEPUBLISH_DIALOG", arrayList);
            hashMap.put("com.facebook.platform.action.request.CAMERA_EFFECT", f3604d);
            hashMap.put("com.facebook.platform.action.request.SHARE_STORY", list);
            return hashMap;
        } catch (Throwable th) {
            C0325a.b(th, this);
            return null;
        }
    }

    private final List e() {
        if (C0325a.d(this)) {
            return null;
        }
        try {
            ArrayList d5 = AbstractC0827p.d(new a());
            d5.addAll(f());
            return d5;
        } catch (Throwable th) {
            C0325a.b(th, this);
            return null;
        }
    }

    private final List f() {
        if (C0325a.d(this)) {
            return null;
        }
        try {
            return AbstractC0827p.d(new c(), new g());
        } catch (Throwable th) {
            C0325a.b(th, this);
            return null;
        }
    }

    private final Uri g(e eVar) {
        if (C0325a.d(this)) {
            return null;
        }
        try {
            Uri parse = Uri.parse("content://" + eVar.d() + ".provider.PlatformProvider/versions");
            Intrinsics.checkNotNullExpressionValue(parse, "parse(CONTENT_SCHEME + appInfo.getPackage() + PLATFORM_PROVIDER_VERSIONS)");
            return parse;
        } catch (Throwable th) {
            C0325a.b(th, this);
            return null;
        }
    }

    public static final int h(TreeSet treeSet, int i5, int[] versionSpec) {
        if (C0325a.d(E.class)) {
            return 0;
        }
        try {
            Intrinsics.checkNotNullParameter(versionSpec, "versionSpec");
            if (treeSet == null) {
                return -1;
            }
            int length = versionSpec.length - 1;
            Iterator descendingIterator = treeSet.descendingIterator();
            int i6 = -1;
            while (descendingIterator.hasNext()) {
                Integer fbAppVersion = (Integer) descendingIterator.next();
                Intrinsics.checkNotNullExpressionValue(fbAppVersion, "fbAppVersion");
                i6 = Math.max(i6, fbAppVersion.intValue());
                while (length >= 0 && versionSpec[length] > fbAppVersion.intValue()) {
                    length--;
                }
                if (length < 0) {
                    return -1;
                }
                if (versionSpec[length] == fbAppVersion.intValue()) {
                    if (length % 2 != 0) {
                        return -1;
                    }
                    return Math.min(i6, i5);
                }
            }
            return -1;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return 0;
        }
    }

    public static final Bundle i(C0275n c0275n) {
        if (C0325a.d(E.class) || c0275n == null) {
            return null;
        }
        try {
            Bundle bundle = new Bundle();
            bundle.putString("error_description", c0275n.toString());
            if (c0275n instanceof C0277p) {
                bundle.putString("error_type", "UserCanceled");
            }
            return bundle;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static final Intent j(Context context, String applicationId, Collection permissions, String e2e, boolean z5, boolean z6, f2.d defaultAudience, String clientState, String authType, String str, boolean z7, boolean z8, boolean z9) {
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(applicationId, "applicationId");
            Intrinsics.checkNotNullParameter(permissions, "permissions");
            Intrinsics.checkNotNullParameter(e2e, "e2e");
            Intrinsics.checkNotNullParameter(defaultAudience, "defaultAudience");
            Intrinsics.checkNotNullParameter(clientState, "clientState");
            Intrinsics.checkNotNullParameter(authType, "authType");
            b bVar = new b();
            return z(context, f3601a.k(bVar, applicationId, permissions, e2e, z6, defaultAudience, clientState, authType, false, str, z7, f2.x.INSTAGRAM, z8, z9, "", null, null), bVar);
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    private final Intent k(e eVar, String str, Collection collection, String str2, boolean z5, f2.d dVar, String str3, String str4, boolean z6, String str5, boolean z7, f2.x xVar, boolean z8, boolean z9, String str6, String str7, String str8) {
        if (C0325a.d(this)) {
            return null;
        }
        try {
            String c5 = eVar.c();
            if (c5 == null) {
                return null;
            }
            Intent putExtra = new Intent().setClassName(eVar.d(), c5).putExtra("client_id", str);
            Intrinsics.checkNotNullExpressionValue(putExtra, "Intent()\n            .setClassName(appInfo.getPackage(), activityName)\n            .putExtra(FACEBOOK_PROXY_AUTH_APP_ID_KEY, applicationId)");
            putExtra.putExtra("facebook_sdk_version", E1.z.B());
            if (!P.Y(collection)) {
                putExtra.putExtra("scope", TextUtils.join(",", collection));
            }
            if (!P.X(str2)) {
                putExtra.putExtra("e2e", str2);
            }
            putExtra.putExtra("state", str3);
            putExtra.putExtra("response_type", eVar.e());
            putExtra.putExtra("nonce", str6);
            putExtra.putExtra("return_scopes", "true");
            if (z5) {
                putExtra.putExtra("default_audience", dVar.c());
            }
            putExtra.putExtra("legacy_override", E1.z.w());
            putExtra.putExtra("auth_type", str4);
            if (z6) {
                putExtra.putExtra("fail_on_logged_out", true);
            }
            putExtra.putExtra("messenger_page_id", str5);
            putExtra.putExtra("reset_messenger_state", z7);
            if (z8) {
                putExtra.putExtra("fx_app", xVar.toString());
            }
            if (z9) {
                putExtra.putExtra("skip_dedupe", true);
            }
            return putExtra;
        } catch (Throwable th) {
            C0325a.b(th, this);
            return null;
        }
    }

    public static final Intent l(Context context) {
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            Intrinsics.checkNotNullParameter(context, "context");
            for (e eVar : f3603c) {
                Intent A5 = A(context, new Intent("com.facebook.platform.PLATFORM_SERVICE").setPackage(eVar.d()).addCategory("android.intent.category.DEFAULT"), eVar);
                if (A5 != null) {
                    return A5;
                }
            }
            return null;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static final Intent m(Intent requestIntent, Bundle bundle, C0275n c0275n) {
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            Intrinsics.checkNotNullParameter(requestIntent, "requestIntent");
            UUID p5 = p(requestIntent);
            if (p5 == null) {
                return null;
            }
            Intent intent = new Intent();
            intent.putExtra("com.facebook.platform.protocol.PROTOCOL_VERSION", v(requestIntent));
            Bundle bundle2 = new Bundle();
            bundle2.putString("action_id", p5.toString());
            if (c0275n != null) {
                bundle2.putBundle("error", i(c0275n));
            }
            intent.putExtra("com.facebook.platform.protocol.BRIDGE_ARGS", bundle2);
            if (bundle != null) {
                intent.putExtra("com.facebook.platform.protocol.RESULT_ARGS", bundle);
            }
            return intent;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static final List n(Context context, String applicationId, Collection permissions, String e2e, boolean z5, boolean z6, f2.d defaultAudience, String clientState, String authType, boolean z7, String str, boolean z8, boolean z9, boolean z10, String str2, String str3, String str4) {
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            Intrinsics.checkNotNullParameter(applicationId, "applicationId");
            Intrinsics.checkNotNullParameter(permissions, "permissions");
            Intrinsics.checkNotNullParameter(e2e, "e2e");
            Intrinsics.checkNotNullParameter(defaultAudience, "defaultAudience");
            Intrinsics.checkNotNullParameter(clientState, "clientState");
            Intrinsics.checkNotNullParameter(authType, "authType");
            List list = f3603c;
            ArrayList arrayList = new ArrayList();
            Iterator it = list.iterator();
            while (it.hasNext()) {
                ArrayList arrayList2 = arrayList;
                Intent k5 = f3601a.k((e) it.next(), applicationId, permissions, e2e, z6, defaultAudience, clientState, authType, z7, str, z8, f2.x.FACEBOOK, z9, z10, str2, str3, str4);
                if (k5 != null) {
                    arrayList2.add(k5);
                }
                arrayList = arrayList2;
            }
            return arrayList;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    private final TreeSet o(e eVar) {
        Cursor cursor;
        ProviderInfo providerInfo;
        Cursor cursor2;
        String str;
        if (C0325a.d(this)) {
            return null;
        }
        try {
            TreeSet treeSet = new TreeSet();
            ContentResolver contentResolver = E1.z.l().getContentResolver();
            String[] strArr = {"version"};
            Uri g5 = g(eVar);
            try {
                try {
                    providerInfo = E1.z.l().getPackageManager().resolveContentProvider(Intrinsics.i(eVar.d(), ".provider.PlatformProvider"), 0);
                } catch (RuntimeException e5) {
                    Log.e(f3602b, "Failed to query content resolver.", e5);
                    providerInfo = null;
                }
                if (providerInfo != null) {
                    try {
                        try {
                            cursor2 = contentResolver.query(g5, strArr, null, null, null);
                        } catch (NullPointerException unused) {
                            str = f3602b;
                            Log.e(str, "Failed to query content resolver.");
                            cursor2 = null;
                            if (cursor2 != null) {
                            }
                            if (cursor2 != null) {
                            }
                            return treeSet;
                        }
                    } catch (IllegalArgumentException unused2) {
                        str = f3602b;
                        Log.e(str, "Failed to query content resolver.");
                        cursor2 = null;
                        if (cursor2 != null) {
                        }
                        if (cursor2 != null) {
                        }
                        return treeSet;
                    } catch (SecurityException unused3) {
                        str = f3602b;
                        Log.e(str, "Failed to query content resolver.");
                        cursor2 = null;
                        if (cursor2 != null) {
                        }
                        if (cursor2 != null) {
                        }
                        return treeSet;
                    }
                    if (cursor2 != null) {
                        while (cursor2.moveToNext()) {
                            try {
                                treeSet.add(Integer.valueOf(cursor2.getInt(cursor2.getColumnIndex("version"))));
                            } catch (Throwable th) {
                                cursor = cursor2;
                                th = th;
                                if (cursor != null) {
                                    cursor.close();
                                }
                                throw th;
                            }
                        }
                    }
                } else {
                    cursor2 = null;
                }
                if (cursor2 != null) {
                    cursor2.close();
                }
                return treeSet;
            } catch (Throwable th2) {
                th = th2;
                cursor = null;
            }
        } catch (Throwable th3) {
            C0325a.b(th3, this);
            return null;
        }
    }

    public static final UUID p(Intent intent) {
        String stringExtra;
        if (C0325a.d(E.class) || intent == null) {
            return null;
        }
        try {
            if (w(v(intent))) {
                Bundle bundleExtra = intent.getBundleExtra("com.facebook.platform.protocol.BRIDGE_ARGS");
                if (bundleExtra != null) {
                    stringExtra = bundleExtra.getString("action_id");
                } else {
                    stringExtra = null;
                }
            } else {
                stringExtra = intent.getStringExtra("com.facebook.platform.protocol.CALL_ID");
            }
            if (stringExtra == null) {
                return null;
            }
            try {
                return UUID.fromString(stringExtra);
            } catch (IllegalArgumentException unused) {
                return null;
            }
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static final C0275n q(Bundle bundle) {
        if (C0325a.d(E.class) || bundle == null) {
            return null;
        }
        try {
            String string = bundle.getString("error_type");
            if (string == null) {
                string = bundle.getString("com.facebook.platform.status.ERROR_TYPE");
            }
            String string2 = bundle.getString("error_description");
            if (string2 == null) {
                string2 = bundle.getString("com.facebook.platform.status.ERROR_DESCRIPTION");
            }
            if (string != null && kotlin.text.g.l(string, "UserCanceled", true)) {
                return new C0277p(string2);
            }
            return new C0275n(string2);
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    private final f r(List list, int[] iArr) {
        if (C0325a.d(this)) {
            return null;
        }
        try {
            x();
            if (list == null) {
                return f.f3609c.b();
            }
            Iterator it = list.iterator();
            while (it.hasNext()) {
                e eVar = (e) it.next();
                int h5 = h(eVar.b(), t(), iArr);
                if (h5 != -1) {
                    return f.f3609c.a(eVar, h5);
                }
            }
            return f.f3609c.b();
        } catch (Throwable th) {
            C0325a.b(th, this);
            return null;
        }
    }

    public static final int s(int i5) {
        if (C0325a.d(E.class)) {
            return 0;
        }
        try {
            return f3601a.r(f3603c, new int[]{i5}).c();
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return 0;
        }
    }

    public static final int t() {
        if (C0325a.d(E.class)) {
            return 0;
        }
        try {
            return f3607g[0].intValue();
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return 0;
        }
    }

    public static final Bundle u(Intent intent) {
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            Intrinsics.checkNotNullParameter(intent, "intent");
            if (!w(v(intent))) {
                return intent.getExtras();
            }
            return intent.getBundleExtra("com.facebook.platform.protocol.METHOD_ARGS");
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static final int v(Intent intent) {
        if (C0325a.d(E.class)) {
            return 0;
        }
        try {
            Intrinsics.checkNotNullParameter(intent, "intent");
            return intent.getIntExtra("com.facebook.platform.protocol.PROTOCOL_VERSION", 0);
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return 0;
        }
    }

    public static final boolean w(int i5) {
        if (C0325a.d(E.class)) {
            return false;
        }
        try {
            if (!AbstractC0820i.r(f3607g, Integer.valueOf(i5)) || i5 < 20140701) {
                return false;
            }
            return true;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return false;
        }
    }

    public static final void x() {
        if (C0325a.d(E.class)) {
            return;
        }
        try {
            if (!f3606f.compareAndSet(false, true)) {
                return;
            }
            E1.z.t().execute(new Runnable() {
                @Override
                public final void run() {
                    E.y();
                }
            });
        } catch (Throwable th) {
            C0325a.b(th, E.class);
        }
    }

    public static final void y() {
        if (C0325a.d(E.class)) {
            return;
        }
        try {
            try {
                Iterator it = f3603c.iterator();
                while (it.hasNext()) {
                    ((e) it.next()).a(true);
                }
            } finally {
                f3606f.set(false);
            }
        } catch (Throwable th) {
            C0325a.b(th, E.class);
        }
    }

    public static final Intent z(Context context, Intent intent, e eVar) {
        ResolveInfo resolveActivity;
        if (C0325a.d(E.class)) {
            return null;
        }
        try {
            Intrinsics.checkNotNullParameter(context, "context");
            if (intent == null || (resolveActivity = context.getPackageManager().resolveActivity(intent, 0)) == null) {
                return null;
            }
            C0306k c0306k = C0306k.f3737a;
            String str = resolveActivity.activityInfo.packageName;
            Intrinsics.checkNotNullExpressionValue(str, "resolveInfo.activityInfo.packageName");
            if (!C0306k.a(context, str)) {
                return null;
            }
            return intent;
        } catch (Throwable th) {
            C0325a.b(th, E.class);
            return null;
        }
    }

    public static abstract class e {

        private TreeSet f3608a;

        public final synchronized void a(boolean z5) {
            Boolean valueOf;
            TreeSet treeSet;
            if (!z5) {
                try {
                    TreeSet treeSet2 = this.f3608a;
                    if (treeSet2 != null) {
                        if (treeSet2 == null) {
                            valueOf = null;
                        } else {
                            valueOf = Boolean.valueOf(treeSet2.isEmpty());
                        }
                        if (!Intrinsics.a(valueOf, Boolean.FALSE)) {
                        }
                        treeSet = this.f3608a;
                        if (treeSet != null || treeSet.isEmpty()) {
                            f();
                        }
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
            this.f3608a = E.b(E.f3601a, this);
            treeSet = this.f3608a;
            if (treeSet != null) {
            }
            f();
        }

        public final TreeSet b() {
            Boolean valueOf;
            TreeSet treeSet = this.f3608a;
            if (treeSet != null) {
                if (treeSet == null) {
                    valueOf = null;
                } else {
                    valueOf = Boolean.valueOf(treeSet.isEmpty());
                }
            }
            a(false);
            return this.f3608a;
        }

        public abstract String c();

        public abstract String d();

        public String e() {
            return "id_token,token,signed_request,graph_domain";
        }

        public void f() {
        }
    }
}