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


package com.ss.android.socialbase.appdownloader.f;

import android.os.Build;
import android.text.TextUtils;
import com.ss.android.socialbase.appdownloader.g;
import com.ss.android.socialbase.downloader.constants.e;
import com.ss.android.socialbase.downloader.downloader.c;
import com.ss.android.socialbase.downloader.g.a;
import com.ss.android.socialbase.downloader.i.f;
import java.io.BufferedReader;
import java.io.InputStreamReader;

/* compiled from: RomUtils */
public class d {
    public static String a = null;
    public static String b = "";
    public static String c = null;
    private static String d = "";
    private static String e;
    private static String f;
    private static String g;

    public static boolean a() {
        return a("EMUI");
    }

    public static boolean b() {
        return a("MIUI");
    }

    public static boolean c() {
        return a("VIVO");
    }

    public static boolean d() {
        o();
        return a(a);
    }

    public static boolean e() {
        return a("FLYME");
    }

    public static boolean f() {
        return a("SAMSUNG");
    }

    public static String g() {
        if (e == null) {
            a("");
        }
        return e;
    }

    public static String h() {
        if (f == null) {
            a("");
        }
        return f;
    }

    public static String i() {
        if (c == null) {
            a("");
        }
        return c;
    }

    private static void o() {
        if (TextUtils.isEmpty(a)) {
            c.F();
            a = e.b;
            d = "ro.build.version." + e.c + "rom";
            b = "com." + e.c + ".market";
        }
    }

    public static boolean a(String str) {
        o();
        String str2 = e;
        if (str2 != null) {
            return str2.equals(str);
        }
        String d2 = d("ro.miui.ui.version.name");
        f = d2;
        if (!TextUtils.isEmpty(d2)) {
            e = "MIUI";
            c = "com.xiaomi.market";
            g = f;
        } else {
            String d3 = d("ro.build.version.emui");
            f = d3;
            if (!TextUtils.isEmpty(d3)) {
                e = "EMUI";
                c = "com.huawei.appmarket";
            } else {
                String d4 = d(d);
                f = d4;
                if (!TextUtils.isEmpty(d4)) {
                    e = a;
                    if (g.a(b) > -1) {
                        c = b;
                    } else {
                        c = "com.heytap.market";
                    }
                } else {
                    String d5 = d("ro.vivo.os.version");
                    f = d5;
                    if (!TextUtils.isEmpty(d5)) {
                        e = "VIVO";
                        c = "com.bbk.appstore";
                    } else {
                        String d6 = d("ro.smartisan.version");
                        f = d6;
                        if (!TextUtils.isEmpty(d6)) {
                            e = "SMARTISAN";
                            c = "com.smartisanos.appstore";
                        } else {
                            String d7 = d("ro.gn.sv.version");
                            f = d7;
                            if (!TextUtils.isEmpty(d7)) {
                                e = "QIONEE";
                                c = "com.gionee.aora.market";
                            } else {
                                String d8 = d("ro.lenovo.lvp.version");
                                f = d8;
                                if (!TextUtils.isEmpty(d8)) {
                                    e = "LENOVO";
                                    c = "com.lenovo.leos.appstore";
                                } else if (j().toUpperCase().contains("SAMSUNG")) {
                                    e = "SAMSUNG";
                                    c = "com.sec.android.app.samsungapps";
                                } else if (j().toUpperCase().contains("ZTE")) {
                                    e = "ZTE";
                                    c = "zte.com.market";
                                } else if (j().toUpperCase().contains("NUBIA")) {
                                    e = "NUBIA";
                                    c = "cn.nubia.neostore";
                                } else if (k().toUpperCase().contains("FLYME")) {
                                    e = "FLYME";
                                    c = "com.meizu.mstore";
                                    f = k();
                                } else if (j().toUpperCase().contains("ONEPLUS")) {
                                    e = "ONEPLUS";
                                    f = d("ro.rom.version");
                                    if (g.a(b) > -1) {
                                        c = b;
                                    } else {
                                        c = "com.heytap.market";
                                    }
                                } else {
                                    e = j().toUpperCase();
                                    c = "";
                                    f = "";
                                }
                            }
                        }
                    }
                }
            }
        }
        return e.equals(str);
    }

    public static String b(String str) {
        BufferedReader bufferedReader;
        try {
            bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("getprop " + str).getInputStream()), 1024);
            try {
                String readLine = bufferedReader.readLine();
                bufferedReader.close();
                f.a(bufferedReader);
                return readLine;
            } catch (Throwable unused) {
                f.a(bufferedReader);
                return null;
            }
        } catch (Throwable unused2) {
            bufferedReader = null;
            f.a(bufferedReader);
            return null;
        }
    }

    public static String c(String str) throws Throwable {
        return (String) Class.forName("android.os.SystemProperties").getMethod("get", String.class).invoke(null, str);
    }

    public static String d(String str) {
        if (!a.b().optBoolean("enable_reflect_system_properties", true)) {
            return b(str);
        }
        try {
            return c(str);
        } catch (Throwable th) {
            th.printStackTrace();
            return b(str);
        }
    }

    public static String j() {
        return Build.MANUFACTURER == null ? "" : Build.MANUFACTURER.trim();
    }

    public static String k() {
        return Build.DISPLAY == null ? "" : Build.DISPLAY.trim();
    }

    public static boolean l() {
        p();
        return "V10".equals(g);
    }

    public static boolean m() {
        p();
        return "V11".equals(g);
    }

    public static boolean n() {
        p();
        return "V12".equals(g);
    }

    private static void p() {
        if (g == null) {
            try {
                g = d("ro.miui.ui.version.name");
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            String str = g;
            if (str == null) {
                str = "";
            }
            g = str;
        }
    }
}