翰林优商.apk(点击下载) / l1.java


package com.kuaishou.weapon.p0;

import android.content.Context;
import android.graphics.Point;
import android.hardware.Camera;
import android.media.AudioManager;
import android.net.ConnectivityManager;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
import android.view.WindowMetrics;
import android.webkit.WebSettings;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.math.BigDecimal;

public class l1 {
    public static String A() {
        if (Build.VERSION.SDK_INT >= 14) {
            return Build.getRadioVersion();
        }
        return null;
    }

    /* JADX WARNING: Removed duplicated region for block: B:22:? A[RETURN, SYNTHETIC] */
    public static long B() {
        BufferedReader bufferedReader;
        String readLine;
        try {
            bufferedReader = new BufferedReader(new FileReader("/proc/meminfo"), 8192);
            do {
                try {
                    readLine = bufferedReader.readLine();
                    if (readLine != null) {
                    }
                } catch (Throwable unused) {
                    if (bufferedReader == null) {
                        return 0;
                    }
                    bufferedReader.close();
                    return 0;
                }
                try {
                    bufferedReader.close();
                    return 0;
                } catch (IOException unused2) {
                    return 0;
                }
            } while (!readLine.contains("MemTotal"));
            long longValue = Long.valueOf(readLine.split("\\s+")[1]).longValue();
            try {
                bufferedReader.close();
            } catch (IOException unused3) {
            }
            return longValue;
        } catch (Throwable unused4) {
            bufferedReader = null;
            if (bufferedReader == null) {
            }
            bufferedReader.close();
            return 0;
        }
    }

    public static String C() {
        File externalStorageDirectory;
        try {
            return (!"mounted".equals(Environment.getExternalStorageState()) || (externalStorageDirectory = Environment.getExternalStorageDirectory()) == null) ? i1.a : BigDecimal.valueOf((double) (((float) (new StatFs(externalStorageDirectory.getPath()).getAvailableBytes() >> 20)) / 1024.0f)).setScale(2, 4).toString();
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String D() {
        File externalStorageDirectory;
        try {
            return (!"mounted".equals(Environment.getExternalStorageState()) || (externalStorageDirectory = Environment.getExternalStorageDirectory()) == null) ? i1.a : BigDecimal.valueOf((double) (((float) (new StatFs(externalStorageDirectory.getPath()).getTotalBytes() >> 20)) / 1024.0f)).setScale(2, 4).toString();
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String E() {
        try {
            File file = new File("/system/bin/servicemanager");
            return (!file.exists() || !file.canRead()) ? i1.d : g.a(file);
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String F() {
        try {
            String property = System.getProperty("http.agent");
            return TextUtils.isEmpty(property) ? i1.c : property;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String G() {
        try {
            String str = Build.TAGS;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String H() {
        try {
            return BigDecimal.valueOf((double) (((float) (new StatFs(Environment.getDataDirectory().getPath()).getTotalBytes() >> 20)) / 1024.0f)).setScale(2, 4).toString();
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String I() {
        try {
            String str = Build.TYPE;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String J() {
        try {
            String str = Build.USER;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:30:0x0046 A[SYNTHETIC, Splitter:B:30:0x0046] */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x004d A[SYNTHETIC, Splitter:B:34:0x004d] */
    /* JADX WARNING: Removed duplicated region for block: B:38:0x0054  */
    /* JADX WARNING: Removed duplicated region for block: B:40:? A[RETURN, SYNTHETIC] */
    public static String K() {
        InputStream inputStream;
        Process process;
        BufferedReader bufferedReader;
        BufferedReader bufferedReader2 = null;
        try {
            process = Runtime.getRuntime().exec("uname -a");
            try {
                inputStream = process.waitFor() == 0 ? process.getInputStream() : process.getErrorStream();
            } catch (Throwable unused) {
                inputStream = null;
                if (bufferedReader2 != null) {
                    try {
                        bufferedReader2.close();
                    } catch (Throwable unused2) {
                    }
                }
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (Throwable unused3) {
                    }
                }
                if (process != null) {
                    return i1.d;
                }
                process.destroy();
                return i1.d;
            }
            try {
                bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 512);
            } catch (Throwable unused4) {
                if (bufferedReader2 != null) {
                }
                if (inputStream != null) {
                }
                if (process != null) {
                }
            }
            try {
                String readLine = bufferedReader.readLine();
                try {
                    bufferedReader.close();
                } catch (Throwable unused5) {
                }
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (Throwable unused6) {
                    }
                }
                if (process != null) {
                    process.destroy();
                }
                return readLine;
            } catch (Throwable unused7) {
                bufferedReader2 = bufferedReader;
                if (bufferedReader2 != null) {
                }
                if (inputStream != null) {
                }
                if (process != null) {
                }
            }
        } catch (Throwable unused8) {
            process = null;
            inputStream = null;
            if (bufferedReader2 != null) {
            }
            if (inputStream != null) {
            }
            if (process != null) {
            }
        }
    }

    public static String L() {
        try {
            String str = Build.VERSION.RELEASE;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static float a(DisplayMetrics displayMetrics) {
        if (displayMetrics == null) {
            return 0.0f;
        }
        try {
            return displayMetrics.xdpi;
        } catch (Throwable unused) {
            return 0.0f;
        }
    }

    public static int a() {
        try {
            return Build.VERSION.SDK_INT;
        } catch (Throwable unused) {
            return -2;
        }
    }

    public static String a(Context context) {
        DisplayMetrics c = c(context);
        if (c != null) {
            return Integer.toString(c.densityDpi);
        }
        return null;
    }

    public static float b(DisplayMetrics displayMetrics) {
        if (displayMetrics == null) {
            return 0.0f;
        }
        try {
            return displayMetrics.ydpi;
        } catch (Throwable unused) {
            return 0.0f;
        }
    }

    public static String b() {
        try {
            return g.a(new File("/system/bin/app_process"));
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:44:0x0075 A[SYNTHETIC, Splitter:B:44:0x0075] */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x007c  */
    /* JADX WARNING: Removed duplicated region for block: B:50:? A[RETURN, SYNTHETIC] */
    public static String b(Context context) {
        Process process;
        InputStream inputStream;
        InputStream inputStream2 = null;
        r7 = null;
        String str = null;
        inputStream2 = null;
        try {
            process = Runtime.getRuntime().exec("cat /proc/version");
            try {
                inputStream = process.getInputStream();
            } catch (Throwable unused) {
                if (inputStream2 != null) {
                    try {
                        inputStream2.close();
                    } catch (Throwable unused2) {
                    }
                }
                if (process == null) {
                    return i1.d;
                }
                process.destroy();
                return i1.d;
            }
            try {
                byte[] bArr = new byte[1024];
                int read = inputStream.read(bArr);
                if (read <= 0) {
                    if (inputStream != null) {
                        try {
                            inputStream.close();
                        } catch (Throwable unused3) {
                        }
                    }
                    if (process != null) {
                        process.destroy();
                    }
                    return i1.c;
                }
                byte[] bArr2 = new byte[read];
                System.arraycopy(bArr, 0, bArr2, 0, read);
                String str2 = new String(bArr2, "utf-8");
                int indexOf = str2.indexOf("version");
                if (indexOf != -1) {
                    String[] split = str2.substring(indexOf).split(" ");
                    if (1 < split.length) {
                        str = split[1];
                    }
                }
                if (TextUtils.isEmpty(str)) {
                    if (inputStream != null) {
                        try {
                            inputStream.close();
                        } catch (Throwable unused4) {
                        }
                    }
                    if (process != null) {
                        process.destroy();
                    }
                    return i1.c;
                }
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (Throwable unused5) {
                    }
                }
                if (process != null) {
                    process.destroy();
                }
                return str;
            } catch (Throwable unused6) {
                inputStream2 = inputStream;
                if (inputStream2 != null) {
                }
                if (process == null) {
                }
            }
        } catch (Throwable unused7) {
            process = null;
            if (inputStream2 != null) {
            }
            if (process == null) {
            }
        }
    }

    public static DisplayMetrics c(Context context) {
        try {
            Display defaultDisplay = ((WindowManager) context.getSystemService("window")).getDefaultDisplay();
            DisplayMetrics displayMetrics = new DisplayMetrics();
            defaultDisplay.getMetrics(displayMetrics);
            return displayMetrics;
        } catch (Throwable unused) {
            return null;
        }
    }

    public static String c() {
        try {
            return BigDecimal.valueOf((double) (((float) (new StatFs(Environment.getDataDirectory().getPath()).getAvailableBytes() >> 20)) / 1024.0f)).setScale(2, 4).toString();
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static int d(Context context) {
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            if (telephonyManager == null) {
                return -1;
            }
            return telephonyManager.getPhoneType();
        } catch (Throwable unused) {
            return -2;
        }
    }

    public static String d() {
        try {
            String a = h1.a("persist.service.bdroid.bdaddr");
            return TextUtils.isEmpty(a) ? i1.c : a;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String e() {
        try {
            Class<?> cls = Class.forName("android.os.SystemProperties");
            String str = (String) cls.getMethod("get", String.class).invoke(cls, "gsm.version.baseband");
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:19:0x0084  */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x0097  */
    public static String e(Context context) {
        int i;
        int i2;
        int i3;
        int i4;
        try {
            WindowManager windowManager = (WindowManager) context.getSystemService("window");
            Display defaultDisplay = windowManager.getDefaultDisplay();
            defaultDisplay.getMetrics(new DisplayMetrics());
            int i5 = 0;
            if (Build.VERSION.SDK_INT >= 31) {
                WindowMetrics maximumWindowMetrics = windowManager.getMaximumWindowMetrics();
                i3 = maximumWindowMetrics.getBounds().width();
                i4 = maximumWindowMetrics.getBounds().height();
            } else if (Build.VERSION.SDK_INT >= 17) {
                Point point = new Point();
                defaultDisplay.getRealSize(point);
                i3 = point.x;
                i4 = point.y;
            } else if (Build.VERSION.SDK_INT >= 17 || Build.VERSION.SDK_INT < 14) {
                i = 0;
                if (i5 > i) {
                    return i + "*" + i5;
                }
                return i5 + "*" + i;
            } else {
                Method method = Display.class.getMethod("getRawHeight", new Class[0]);
                int intValue = ((Integer) Display.class.getMethod("getRawWidth", new Class[0]).invoke(defaultDisplay, new Object[0])).intValue();
                i2 = ((Integer) method.invoke(defaultDisplay, new Object[0])).intValue();
                i3 = intValue;
                i = i2;
                i5 = i3;
                if (i5 > i) {
                }
            }
            i2 = i4;
            i = i2;
            i5 = i3;
            if (i5 > i) {
            }
        } catch (Throwable unused) {
            return "";
        }
    }

    public static int f(Context context) {
        try {
            return ((AudioManager) context.getSystemService("audio")).getRingerMode();
        } catch (Exception unused) {
            return -2;
        }
    }

    public static String f() {
        try {
            String str = Build.BOARD;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static int g(Context context) {
        try {
            return Settings.System.getInt(context.getContentResolver(), "screen_off_timeout");
        } catch (Exception unused) {
            return -2;
        }
    }

    public static String g() {
        try {
            String str = Build.BOOTLOADER;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String h() {
        try {
            String str = Build.BRAND;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:23:0x00b8  */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x00ce  */
    public static String h(Context context) {
        int i;
        float a;
        float b;
        int round;
        int round2;
        int i2;
        int i3;
        int i4;
        try {
            WindowManager windowManager = (WindowManager) context.getSystemService("window");
            Display defaultDisplay = windowManager.getDefaultDisplay();
            defaultDisplay.getMetrics(new DisplayMetrics());
            int i5 = 0;
            if (Build.VERSION.SDK_INT >= 31) {
                WindowMetrics maximumWindowMetrics = windowManager.getMaximumWindowMetrics();
                i3 = maximumWindowMetrics.getBounds().width();
                i4 = maximumWindowMetrics.getBounds().height();
            } else if (Build.VERSION.SDK_INT >= 17) {
                Point point = new Point();
                defaultDisplay.getRealSize(point);
                i3 = point.x;
                i4 = point.y;
            } else if (Build.VERSION.SDK_INT >= 17 || Build.VERSION.SDK_INT < 14) {
                i = 0;
                a = a(c(context));
                b = b(c(context));
                if (!(a == 0.0f || b == 0.0f)) {
                    round = Math.round((((float) i5) / a) * 2.54f) * 10;
                    round2 = Math.round((((float) i) / b) * 2.54f) * 10;
                    if (round > round2) {
                        return round2 + "mm * " + round + "mm";
                    }
                    return round + "mm * " + round2 + "mm";
                }
                return "";
            } else {
                Method method = Display.class.getMethod("getRawHeight", new Class[0]);
                int intValue = ((Integer) Display.class.getMethod("getRawWidth", new Class[0]).invoke(defaultDisplay, new Object[0])).intValue();
                i2 = ((Integer) method.invoke(defaultDisplay, new Object[0])).intValue();
                i3 = intValue;
                i = i2;
                i5 = i3;
                a = a(c(context));
                b = b(c(context));
                round = Math.round((((float) i5) / a) * 2.54f) * 10;
                round2 = Math.round((((float) i) / b) * 2.54f) * 10;
                if (round > round2) {
                }
            }
            i2 = i4;
            i = i2;
            i5 = i3;
            a = a(c(context));
            b = b(c(context));
            round = Math.round((((float) i5) / a) * 2.54f) * 10;
            round2 = Math.round((((float) i) / b) * 2.54f) * 10;
            if (round > round2) {
            }
        } catch (Throwable unused) {
        }
    }

    public static String i() {
        try {
            String str = Build.ID;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:10:0x0017 A[ORIG_RETURN, RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:13:? A[RETURN, SYNTHETIC] */
    public static String i(Context context) {
        String str;
        try {
            if (Build.VERSION.SDK_INT >= 17) {
                try {
                    str = WebSettings.getDefaultUserAgent(context);
                } catch (Throwable unused) {
                }
                return !TextUtils.isEmpty(str) ? i1.c : str;
            }
            str = System.getProperty("http.agent");
            if (!TextUtils.isEmpty(str)) {
            }
        } catch (Throwable unused2) {
            return i1.d;
        }
    }

    public static int j(Context context) {
        try {
            Method declaredMethod = ConnectivityManager.class.getDeclaredMethod("getMobileDataEnabled", new Class[0]);
            declaredMethod.setAccessible(true);
            return !((Boolean) declaredMethod.invoke((ConnectivityManager) context.getSystemService("connectivity"), new Object[0])).booleanValue();
        } catch (Throwable unused) {
            return -2;
        }
    }

    public static String j() {
        try {
            String str = Build.VERSION.CODENAME;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String k() {
        try {
            String a = h1.a("ro.build.description");
            return TextUtils.isEmpty(a) ? i1.c : a;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String l() {
        try {
            String str = Build.DEVICE;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String m() {
        try {
            String str = Build.DISPLAY;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String n() {
        try {
            String str = Build.FINGERPRINT;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String o() {
        try {
            File file = new File("/system/framework/framework.jar");
            return (!file.exists() || !file.canRead()) ? i1.d : g.a(file);
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String p() {
        try {
            String str = Build.HARDWARE;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String q() {
        try {
            String a = h1.a("dalvik.vm.heapgrowthlimit");
            return TextUtils.isEmpty(a) ? i1.c : a;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String r() {
        try {
            String str = Build.HOST;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String s() {
        try {
            String str = Build.VERSION.INCREMENTAL;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String t() {
        try {
            String a = h1.a("rild.libpath");
            return TextUtils.isEmpty(a) ? i1.c : a;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String u() {
        try {
            String str = Build.MANUFACTURER;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String v() {
        try {
            String str = Build.MODEL;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String w() {
        try {
            String a = h1.a("ro.product.name");
            return TextUtils.isEmpty(a) ? i1.c : a;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String x() {
        try {
            int numberOfCameras = Camera.getNumberOfCameras();
            StringBuilder sb = new StringBuilder();
            sb.append(numberOfCameras);
            return sb.toString();
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String y() {
        try {
            String str = Build.PRODUCT;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }

    public static String z() {
        try {
            String str = Build.RADIO;
            return TextUtils.isEmpty(str) ? i1.c : str;
        } catch (Throwable unused) {
            return i1.d;
        }
    }
}