导航菜单

页面标题

页面副标题

Aisle v12.32 - z.java 源代码

正在查看: Aisle v12.32 应用的 z.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package Z5;

import J5.T;
import Z5.e;
import Z5.z;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.StatFs;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import com.cashfree.pg.core.hidden.utils.Constants;
import com.facebook.h;
import e6.C0754a;
import java.io.BufferedInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.regex.Pattern;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.text.Charsets;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

public final class z {
    private static int b;
    private static Locale j;
    public static final z a = new z();
    private static long c = -1;
    private static long d = -1;
    private static long e = -1;
    private static String f = "";
    private static String g = "";
    private static String h = "NoCarrier";
    private static String i = "";

    public interface a {
        void a(JSONObject jSONObject);

        void b(I5.e eVar);
    }

    private z() {
    }

    public static final JSONObject A() {
        if (C0754a.d(z.class)) {
            return null;
        }
        try {
            String string = com.facebook.g.l().getSharedPreferences("com.facebook.sdk.DataProcessingOptions", 0).getString("data_processing_options", null);
            if (string != null) {
                try {
                    return new JSONObject(string);
                } catch (JSONException unused) {
                }
            }
            return null;
        } catch (Throwable th) {
            C0754a.b(th, z.class);
            return null;
        }
    }

    public static final String C(String str) {
        String t = com.facebook.g.t();
        if (str != null) {
            if (Intrinsics.areEqual(str, "gaming")) {
                return kotlin.text.h.B(t, "facebook.com", "fb.gg", false, 4, (Object) null);
            }
            if (Intrinsics.areEqual(str, "instagram")) {
                return kotlin.text.h.B(t, "facebook.com", "instagram.com", false, 4, (Object) null);
            }
        }
        return t;
    }

    private final com.facebook.h D(String str) {
        Bundle bundle = new Bundle();
        bundle.putString("fields", K(z()));
        bundle.putString("access_token", str);
        com.facebook.h y = com.facebook.h.n.y(null, null);
        y.G(bundle);
        y.F(I5.t.GET);
        return y;
    }

    public static final void E(final String str, final a aVar) {
        Intrinsics.checkNotNullParameter(str, "accessToken");
        Intrinsics.checkNotNullParameter(aVar, "callback");
        JSONObject a2 = u.a(str);
        if (a2 != null) {
            aVar.a(a2);
            return;
        }
        h.b bVar = new h.b() {
            @Override
            public final void a(com.facebook.k kVar) {
                z.F(z.a.this, str, kVar);
            }
        };
        com.facebook.h D = a.D(str);
        D.C(bVar);
        D.l();
    }

    public static final void F(a aVar, String str, com.facebook.k kVar) {
        Intrinsics.checkNotNullParameter(aVar, "$callback");
        Intrinsics.checkNotNullParameter(str, "$accessToken");
        Intrinsics.checkNotNullParameter(kVar, "response");
        if (kVar.b() != null) {
            aVar.b(kVar.b().g());
            return;
        }
        JSONObject d2 = kVar.d();
        if (d2 == null) {
            throw new IllegalStateException("Required value was null.");
        }
        u.b(str, d2);
        aVar.a(kVar.d());
    }

    public static final String H(Context context) {
        A.g(context, "context");
        return com.facebook.g.m();
    }

    public static final Method I(Class cls, String str, Class... clsArr) {
        Intrinsics.checkNotNullParameter(cls, "clazz");
        Intrinsics.checkNotNullParameter(str, "methodName");
        Intrinsics.checkNotNullParameter(clsArr, "parameterTypes");
        try {
            return cls.getMethod(str, (Class[]) Arrays.copyOf(clsArr, clsArr.length));
        } catch (NoSuchMethodException unused) {
            return null;
        }
    }

    public static final Method J(String str, String str2, Class... clsArr) {
        Intrinsics.checkNotNullParameter(str, "className");
        Intrinsics.checkNotNullParameter(str2, "methodName");
        Intrinsics.checkNotNullParameter(clsArr, "parameterTypes");
        try {
            Class<?> cls = Class.forName(str);
            Intrinsics.checkNotNullExpressionValue(cls, "clazz");
            return I(cls, str2, (Class[]) Arrays.copyOf(clsArr, clsArr.length));
        } catch (ClassNotFoundException unused) {
            return null;
        }
    }

    private final String K(String str) {
        return Intrinsics.areEqual(str, "instagram") ? "id,name,profile_picture" : "id,name,first_name,middle_name,last_name";
    }

    public static final Locale L() {
        try {
            return com.facebook.g.l().getResources().getConfiguration().locale;
        } catch (Exception unused) {
            return null;
        }
    }

    public static final Object M(JSONObject jSONObject, String str, String str2) {
        Intrinsics.checkNotNullParameter(jSONObject, "jsonObject");
        Object opt = jSONObject.opt(str);
        if (opt != null && (opt instanceof String)) {
            opt = new JSONTokener((String) opt).nextValue();
        }
        if (opt == null || (opt instanceof JSONObject) || (opt instanceof JSONArray)) {
            return opt;
        }
        if (str2 == null) {
            throw new I5.e("Got an unexpected non-JSON object.");
        }
        JSONObject jSONObject2 = new JSONObject();
        jSONObject2.putOpt(str2, opt);
        return jSONObject2;
    }

    private final String O(MessageDigest messageDigest, byte[] bArr) {
        messageDigest.update(bArr);
        byte[] digest = messageDigest.digest();
        StringBuilder sb = new StringBuilder();
        Intrinsics.checkNotNullExpressionValue(digest, "digest");
        for (byte b2 : digest) {
            sb.append(Integer.toHexString((b2 >> 4) & 15));
            sb.append(Integer.toHexString(b2 & 15));
        }
        String sb2 = sb.toString();
        Intrinsics.checkNotNullExpressionValue(sb2, "builder.toString()");
        return sb2;
    }

    private final String P(String str, String str2) {
        byte[] bytes = str2.getBytes(Charsets.UTF_8);
        Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
        return Q(str, bytes);
    }

    private final String Q(String str, byte[] bArr) {
        try {
            MessageDigest messageDigest = MessageDigest.getInstance(str);
            Intrinsics.checkNotNullExpressionValue(messageDigest, "hash");
            return O(messageDigest, bArr);
        } catch (NoSuchAlgorithmException unused) {
            return null;
        }
    }

    public static final Object R(Object obj, Method method, Object... objArr) {
        Intrinsics.checkNotNullParameter(method, "method");
        Intrinsics.checkNotNullParameter(objArr, "args");
        try {
            return method.invoke(obj, Arrays.copyOf(objArr, objArr.length));
        } catch (IllegalAccessException | InvocationTargetException unused) {
            return null;
        }
    }

    public static final boolean S() {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
            String format = String.format("fb%s://applinks", Arrays.copyOf(new Object[]{com.facebook.g.m()}, 1));
            Intrinsics.checkNotNullExpressionValue(format, "format(format, *args)");
            intent.setData(Uri.parse(format));
            Context l = com.facebook.g.l();
            PackageManager packageManager = l.getPackageManager();
            String packageName = l.getPackageName();
            List<ResolveInfo> queryIntentActivities = packageManager.queryIntentActivities(intent, 65536);
            Intrinsics.checkNotNullExpressionValue(queryIntentActivities, "packageManager.queryInte…nager.MATCH_DEFAULT_ONLY)");
            Iterator<ResolveInfo> it = queryIntentActivities.iterator();
            while (it.hasNext()) {
                if (Intrinsics.areEqual(packageName, it.next().activityInfo.packageName)) {
                    return true;
                }
            }
            return false;
        } catch (Exception unused) {
            return false;
        }
    }

    public static final boolean T(com.facebook.a aVar) {
        return aVar != null && Intrinsics.areEqual(aVar, com.facebook.a.s.e());
    }

    public static final boolean U() {
        if (C0754a.d(z.class)) {
            return false;
        }
        try {
            JSONObject A = A();
            if (A == null) {
                return false;
            }
            try {
                JSONArray jSONArray = A.getJSONArray("data_processing_options");
                int length = jSONArray.length();
                for (int i2 = 0; i2 < length; i2++) {
                    String string = jSONArray.getString(i2);
                    Intrinsics.checkNotNullExpressionValue(string, "options.getString(i)");
                    String lowerCase = string.toLowerCase();
                    Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase()");
                    if (Intrinsics.areEqual(lowerCase, "ldu")) {
                        return true;
                    }
                }
            } catch (Exception unused) {
            }
            return false;
        } catch (Throwable th) {
            C0754a.b(th, z.class);
            return false;
        }
    }

    private final boolean V(Context context) {
        Method J = J("com.google.android.gms.common.GooglePlayServicesUtil", "isGooglePlayServicesAvailable", Context.class);
        if (J == null) {
            return false;
        }
        Object R = R(null, J, context);
        return (R instanceof Integer) && Intrinsics.areEqual(R, 0);
    }

    public static final boolean W(String str) {
        return str == null || str.length() == 0;
    }

    public static final List X(JSONArray jSONArray) {
        Intrinsics.checkNotNullParameter(jSONArray, "jsonArray");
        ArrayList arrayList = new ArrayList();
        int length = jSONArray.length();
        for (int i2 = 0; i2 < length; i2++) {
            arrayList.add(jSONArray.getString(i2));
        }
        return arrayList;
    }

    public static final Map Y(String str) {
        Intrinsics.checkNotNullParameter(str, "str");
        if (str.length() == 0) {
            return new HashMap();
        }
        try {
            HashMap hashMap = new HashMap();
            JSONObject jSONObject = new JSONObject(str);
            Iterator<String> keys = jSONObject.keys();
            while (keys.hasNext()) {
                String next = keys.next();
                Intrinsics.checkNotNullExpressionValue(next, "key");
                String string = jSONObject.getString(next);
                Intrinsics.checkNotNullExpressionValue(string, "jsonObject.getString(key)");
                hashMap.put(next, string);
            }
            return hashMap;
        } catch (JSONException unused) {
            return new HashMap();
        }
    }

    public static final void Z(String str, Exception exc) {
        if (!com.facebook.g.A() || str == null || exc == null) {
            return;
        }
        Log.d(str, exc.getClass().getSimpleName() + ": " + exc.getMessage());
    }

    public static final void a0(String str, String str2) {
        if (!com.facebook.g.A() || str == null || str2 == null) {
            return;
        }
        Log.d(str, str2);
    }

    public static final String b0(Map map) {
        Intrinsics.checkNotNullParameter(map, "map");
        String str = "";
        if (map.isEmpty()) {
            return "";
        }
        try {
            JSONObject jSONObject = new JSONObject();
            for (Map.Entry entry : map.entrySet()) {
                jSONObject.put((String) entry.getKey(), (String) entry.getValue());
            }
            str = jSONObject.toString();
        } catch (JSONException unused) {
        }
        Intrinsics.checkNotNullExpressionValue(str, "{\n      try {\n        va…\n        \"\"\n      }\n    }");
        return str;
    }

    private final void c(JSONObject jSONObject, C0292a c0292a, String str, Context context) {
        if (Build.VERSION.SDK_INT < 31 || !V(context)) {
            jSONObject.put("anon_id", str);
        } else {
            if (c0292a.k()) {
                return;
            }
            jSONObject.put("anon_id", str);
        }
    }

    public static final String c0(String str) {
        Intrinsics.checkNotNullParameter(str, "key");
        return a.P("MD5", str);
    }

    private final void d(JSONObject jSONObject, C0292a c0292a, Context context) {
        if (Build.VERSION.SDK_INT < 31 || !V(context)) {
            jSONObject.put("attribution", c0292a.j());
        } else {
            if (c0292a.k()) {
                return;
            }
            jSONObject.put("attribution", c0292a.j());
        }
    }

    public static final String d0(InputStream inputStream) {
        BufferedInputStream bufferedInputStream;
        Throwable th;
        InputStreamReader inputStreamReader;
        try {
            bufferedInputStream = new BufferedInputStream(inputStream);
            try {
                inputStreamReader = new InputStreamReader(bufferedInputStream);
                try {
                    StringBuilder sb = new StringBuilder();
                    char[] cArr = new char[2048];
                    while (true) {
                        int read = inputStreamReader.read(cArr);
                        if (read == -1) {
                            String sb2 = sb.toString();
                            Intrinsics.checkNotNullExpressionValue(sb2, "{\n      bufferedInputStr…gBuilder.toString()\n    }");
                            i(bufferedInputStream);
                            i(inputStreamReader);
                            return sb2;
                        }
                        sb.append(cArr, 0, read);
                    }
                } catch (Throwable th2) {
                    th = th2;
                    i(bufferedInputStream);
                    i(inputStreamReader);
                    throw th;
                }
            } catch (Throwable th3) {
                th = th3;
                inputStreamReader = null;
            }
        } catch (Throwable th4) {
            bufferedInputStream = null;
            th = th4;
            inputStreamReader = null;
        }
    }

    public static final boolean e(Object obj, Object obj2) {
        return obj == null ? obj2 == null : Intrinsics.areEqual(obj, obj2);
    }

    private final void e0() {
        try {
            if (r()) {
                StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
                e = statFs.getAvailableBlocks() * statFs.getBlockSize();
            }
            e = k(e);
        } catch (Exception unused) {
        }
    }

    public static final JSONObject f(String str) {
        Intrinsics.checkNotNullParameter(str, "accessToken");
        JSONObject a2 = u.a(str);
        if (a2 != null) {
            return a2;
        }
        com.facebook.k k = a.D(str).k();
        if (k.b() != null) {
            return null;
        }
        return k.d();
    }

    private final int f0() {
        int i2 = b;
        if (i2 > 0) {
            return i2;
        }
        try {
            File[] listFiles = new File("/sys/devices/system/cpu/").listFiles(new FilenameFilter() {
                @Override
                public final boolean accept(File file, String str) {
                    boolean g0;
                    g0 = z.g0(file, str);
                    return g0;
                }
            });
            if (listFiles != null) {
                b = listFiles.length;
            }
        } catch (Exception unused) {
        }
        if (b <= 0) {
            b = Math.max(Runtime.getRuntime().availableProcessors(), 1);
        }
        return b;
    }

    private final void g(Context context, String str) {
        CookieSyncManager.createInstance(context).sync();
        CookieManager cookieManager = CookieManager.getInstance();
        String cookie = cookieManager.getCookie(str);
        if (cookie == null) {
            return;
        }
        for (String str2 : (String[]) kotlin.text.h.x0(cookie, new String[]{";"}, false, 0, 6, (Object) null).toArray(new String[0])) {
            String[] strArr = (String[]) kotlin.text.h.x0(str2, new String[]{"="}, false, 0, 6, (Object) null).toArray(new String[0]);
            if (strArr.length > 0) {
                StringBuilder sb = new StringBuilder();
                String str3 = strArr[0];
                int length = str3.length() - 1;
                int i2 = 0;
                boolean z = false;
                while (i2 <= length) {
                    boolean z2 = Intrinsics.compare(str3.charAt(!z ? i2 : length), 32) <= 0;
                    if (z) {
                        if (!z2) {
                            break;
                        } else {
                            length--;
                        }
                    } else if (z2) {
                        i2++;
                    } else {
                        z = true;
                    }
                }
                sb.append(str3.subSequence(i2, length + 1).toString());
                sb.append("=;expires=Sat, 1 Jan 2000 00:00:01 UTC;");
                cookieManager.setCookie(str, sb.toString());
            }
        }
        cookieManager.removeExpiredCookie();
    }

    public static final boolean g0(File file, String str) {
        return Pattern.matches("cpu[0-9]+", str);
    }

    public static final void h(Context context) {
        Intrinsics.checkNotNullParameter(context, "context");
        try {
            z zVar = a;
            zVar.g(context, "facebook.com");
            zVar.g(context, ".facebook.com");
            zVar.g(context, "https://facebook.com");
            zVar.g(context, "https://.facebook.com");
        } catch (Exception unused) {
        }
    }

    private final void h0(Context context) {
        if (Intrinsics.areEqual(h, "NoCarrier")) {
            try {
                Object systemService = context.getSystemService(Constants.PHONE);
                Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.telephony.TelephonyManager");
                String networkOperatorName = ((TelephonyManager) systemService).getNetworkOperatorName();
                Intrinsics.checkNotNullExpressionValue(networkOperatorName, "telephonyManager.networkOperatorName");
                h = networkOperatorName;
            } catch (Exception unused) {
            }
        }
    }

    public static final void i(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException unused) {
            }
        }
    }

    private final void i0(Context context) {
        if (c == -1 || System.currentTimeMillis() - c >= 1800000) {
            c = System.currentTimeMillis();
            j0();
            h0(context);
            k0();
            e0();
        }
    }

    public static final String j(String str, String str2) {
        return W(str) ? str2 : str;
    }

    private final void j0() {
        try {
            TimeZone timeZone = TimeZone.getDefault();
            String displayName = timeZone.getDisplayName(timeZone.inDaylightTime(new Date()), 0);
            Intrinsics.checkNotNullExpressionValue(displayName, "tz.getDisplayName(tz.inD…(Date()), TimeZone.SHORT)");
            f = displayName;
            String id = timeZone.getID();
            Intrinsics.checkNotNullExpressionValue(id, "tz.id");
            g = id;
        } catch (AssertionError | Exception unused) {
        }
    }

    private final long k(double d2) {
        return Math.round(d2 / 1.073741824E9d);
    }

    private final void k0() {
        try {
            if (r()) {
                StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
                d = statFs.getBlockCount() * statFs.getBlockSize();
            }
            d = k(d);
        } catch (Exception unused) {
        }
    }

    public static final HashSet l(JSONArray jSONArray) {
        if (jSONArray == null || jSONArray.length() == 0) {
            return null;
        }
        HashSet hashSet = new HashSet();
        int length = jSONArray.length();
        for (int i2 = 0; i2 < length; i2++) {
            String string = jSONArray.getString(i2);
            Intrinsics.checkNotNullExpressionValue(string, "jsonArray.getString(i)");
            hashSet.add(string);
        }
        return hashSet;
    }

    public static final void l0(Runnable runnable) {
        try {
            com.facebook.g.s().execute(runnable);
        } catch (Exception unused) {
        }
    }

    public static final List m(JSONArray jSONArray) {
        Intrinsics.checkNotNullParameter(jSONArray, "jsonArray");
        try {
            ArrayList arrayList = new ArrayList();
            int length = jSONArray.length();
            for (int i2 = 0; i2 < length; i2++) {
                String string = jSONArray.getString(i2);
                Intrinsics.checkNotNullExpressionValue(string, "jsonArray.getString(i)");
                arrayList.add(string);
            }
            return arrayList;
        } catch (JSONException unused) {
            return new ArrayList();
        }
    }

    public static final void m0(JSONObject jSONObject, C0292a c0292a, String str, boolean z, Context context) {
        Intrinsics.checkNotNullParameter(jSONObject, "params");
        Intrinsics.checkNotNullParameter(context, "context");
        e.b bVar = e.b.ServiceUpdateCompliance;
        if (!e.g(bVar)) {
            jSONObject.put("anon_id", str);
        }
        jSONObject.put("application_tracking_enabled", !z);
        jSONObject.put("advertiser_id_collection_enabled", com.facebook.g.k());
        if (c0292a != null) {
            if (e.g(bVar)) {
                a.c(jSONObject, c0292a, str, context);
            }
            if (c0292a.j() != null) {
                if (e.g(bVar)) {
                    a.d(jSONObject, c0292a, context);
                } else {
                    jSONObject.put("attribution", c0292a.j());
                }
            }
            if (c0292a.h() != null) {
                jSONObject.put("advertiser_id", c0292a.h());
                jSONObject.put("advertiser_tracking_enabled", !c0292a.k());
            }
            if (!c0292a.k()) {
                String b2 = T.b();
                if (b2.length() != 0) {
                    jSONObject.put("ud", b2);
                }
            }
            if (c0292a.i() != null) {
                jSONObject.put("installer_package", c0292a.i());
            }
        }
        U5.j a2 = U5.j.b.a();
        Object e2 = a2 != null ? a2.e("campaign_ids") : null;
        if (e2 != null) {
            jSONObject.put("campaign_ids", e2);
        }
    }

    public static final Map n(JSONObject jSONObject) {
        Intrinsics.checkNotNullParameter(jSONObject, "jsonObject");
        HashMap hashMap = new HashMap();
        JSONArray names = jSONObject.names();
        if (names != null) {
            int length = names.length();
            for (int i2 = 0; i2 < length; i2++) {
                try {
                    String string = names.getString(i2);
                    Intrinsics.checkNotNullExpressionValue(string, "keys.getString(i)");
                    Object obj = jSONObject.get(string);
                    if (obj instanceof JSONObject) {
                        obj = n((JSONObject) obj);
                    }
                    Intrinsics.checkNotNullExpressionValue(obj, "value");
                    hashMap.put(string, obj);
                } catch (JSONException unused) {
                }
            }
        }
        return hashMap;
    }

    public static final void n0(JSONObject jSONObject, Context context) {
        Locale locale;
        int i2;
        Display display;
        PackageInfo packageInfo;
        Intrinsics.checkNotNullParameter(jSONObject, "params");
        Intrinsics.checkNotNullParameter(context, "appContext");
        JSONArray jSONArray = new JSONArray();
        jSONArray.put("a2");
        a.i0(context);
        String packageName = context.getPackageName();
        int i3 = 0;
        int i4 = -1;
        try {
            packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
        } catch (PackageManager.NameNotFoundException unused) {
        }
        if (packageInfo == null) {
            return;
        }
        i4 = packageInfo.versionCode;
        i = packageInfo.versionName;
        jSONArray.put(packageName);
        jSONArray.put(i4);
        jSONArray.put(i);
        jSONArray.put(Build.VERSION.RELEASE);
        jSONArray.put(Build.MODEL);
        try {
            locale = context.getResources().getConfiguration().locale;
        } catch (Exception unused2) {
            locale = Locale.getDefault();
        }
        j = locale;
        StringBuilder sb = new StringBuilder();
        Locale locale2 = j;
        String language = locale2 != null ? locale2.getLanguage() : null;
        if (language == null) {
            language = "";
        }
        sb.append(language);
        sb.append('_');
        Locale locale3 = j;
        String country = locale3 != null ? locale3.getCountry() : null;
        sb.append(country != null ? country : "");
        jSONArray.put(sb.toString());
        jSONArray.put(f);
        jSONArray.put(h);
        double d2 = 0.0d;
        try {
            Object systemService = context.getSystemService("display");
            DisplayManager displayManager = systemService instanceof DisplayManager ? (DisplayManager) systemService : null;
            display = displayManager != null ? displayManager.getDisplay(0) : null;
        } catch (Exception unused3) {
        }
        if (display != null) {
            DisplayMetrics displayMetrics = new DisplayMetrics();
            display.getMetrics(displayMetrics);
            int i10 = displayMetrics.widthPixels;
            try {
                i3 = displayMetrics.heightPixels;
                d2 = displayMetrics.density;
            } catch (Exception unused4) {
            }
            i2 = i3;
            i3 = i10;
            jSONArray.put(i3);
            jSONArray.put(i2);
            jSONArray.put(new DecimalFormat("#.##").format(d2));
            jSONArray.put(a.f0());
            jSONArray.put(d);
            jSONArray.put(e);
            jSONArray.put(g);
            jSONObject.put("extinfo", jSONArray.toString());
        }
        i2 = 0;
        jSONArray.put(i3);
        jSONArray.put(i2);
        jSONArray.put(new DecimalFormat("#.##").format(d2));
        jSONArray.put(a.f0());
        jSONArray.put(d);
        jSONArray.put(e);
        jSONArray.put(g);
        jSONObject.put("extinfo", jSONArray.toString());
    }

    public static final Map o(JSONObject jSONObject) {
        Intrinsics.checkNotNullParameter(jSONObject, "jsonObject");
        HashMap hashMap = new HashMap();
        Iterator<String> keys = jSONObject.keys();
        while (keys.hasNext()) {
            String next = keys.next();
            String optString = jSONObject.optString(next);
            if (optString != null) {
                Intrinsics.checkNotNullExpressionValue(next, "key");
                hashMap.put(next, optString);
            }
        }
        return hashMap;
    }

    public static final String o0(byte[] bArr) {
        Intrinsics.checkNotNullParameter(bArr, "bytes");
        return a.Q("SHA-1", bArr);
    }

    public static final int p(InputStream inputStream, OutputStream outputStream) {
        BufferedInputStream bufferedInputStream;
        Intrinsics.checkNotNullParameter(outputStream, "outputStream");
        BufferedInputStream bufferedInputStream2 = null;
        try {
            bufferedInputStream = new BufferedInputStream(inputStream);
        } catch (Throwable th) {
            th = th;
        }
        try {
            byte[] bArr = new byte[8192];
            int i2 = 0;
            while (true) {
                int read = bufferedInputStream.read(bArr);
                if (read == -1) {
                    break;
                }
                outputStream.write(bArr, 0, read);
                i2 += read;
            }
            bufferedInputStream.close();
            if (inputStream != null) {
                inputStream.close();
            }
            return i2;
        } catch (Throwable th2) {
            th = th2;
            bufferedInputStream2 = bufferedInputStream;
            if (bufferedInputStream2 != null) {
                bufferedInputStream2.close();
            }
            if (inputStream != null) {
                inputStream.close();
            }
            throw th;
        }
    }

    public static final String p0(String str) {
        if (str == null) {
            return null;
        }
        return a.P("SHA-256", str);
    }

    public static final void q(URLConnection uRLConnection) {
        if (uRLConnection == null || !(uRLConnection instanceof HttpURLConnection)) {
            return;
        }
        ((HttpURLConnection) uRLConnection).disconnect();
    }

    private final boolean r() {
        return Intrinsics.areEqual("mounted", Environment.getExternalStorageState());
    }

    public static final String s(Context context) {
        if (context == null) {
            return "null";
        }
        if (context == context.getApplicationContext()) {
            return "unknown";
        }
        String simpleName = context.getClass().getSimpleName();
        Intrinsics.checkNotNullExpressionValue(simpleName, "{\n      context.javaClass.simpleName\n    }");
        return simpleName;
    }

    public static final String t(Context context) {
        Intrinsics.checkNotNullParameter(context, "context");
        try {
            String n = com.facebook.g.n();
            if (n != null) {
                return n;
            }
            ApplicationInfo applicationInfo = context.getApplicationInfo();
            int i2 = applicationInfo.labelRes;
            if (i2 == 0) {
                return applicationInfo.nonLocalizedLabel.toString();
            }
            String string = context.getString(i2);
            Intrinsics.checkNotNullExpressionValue(string, "context.getString(stringId)");
            return string;
        } catch (Exception unused) {
            return "";
        }
    }

    public static final String u() {
        Context l = com.facebook.g.l();
        if (l == null) {
            return null;
        }
        try {
            PackageInfo packageInfo = l.getPackageManager().getPackageInfo(l.getPackageName(), 0);
            if (packageInfo == null) {
                return null;
            }
            return packageInfo.versionName;
        } catch (PackageManager.NameNotFoundException unused) {
            return null;
        }
    }

    public static final long x(Uri uri) {
        Intrinsics.checkNotNullParameter(uri, "contentUri");
        Cursor cursor = null;
        try {
            cursor = com.facebook.g.l().getContentResolver().query(uri, null, null, null, null);
            if (cursor == null) {
                return 0L;
            }
            int columnIndex = cursor.getColumnIndex("_size");
            cursor.moveToFirst();
            long j2 = cursor.getLong(columnIndex);
            cursor.close();
            return j2;
        } finally {
        }
    }

    public static final Locale y() {
        Locale L = L();
        if (L != null) {
            return L;
        }
        Locale locale = Locale.getDefault();
        Intrinsics.checkNotNullExpressionValue(locale, "getDefault()");
        return locale;
    }

    private final String z() {
        com.facebook.a e2 = com.facebook.a.s.e();
        return (e2 == null || e2.j() == null) ? "facebook" : e2.j();
    }

    public final String B() {
        return g;
    }

    public final Locale G() {
        return j;
    }

    public final String N() {
        return i;
    }

    public final long v() {
        return e;
    }

    public final String w() {
        return h;
    }
}