package com.seewo.vcommons.data;

import android.os.SystemProperties;
import android.util.Log;
import java.util.Locale;

/* JADX INFO: compiled from: PropertiesUtils.java */
/* JADX INFO: loaded from: classes.dex */
public class d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final boolean f2548a = k("persist.sys.umengfunction", true);

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private static final String f2549b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private static final String f2550c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private static final String f2551d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private static final String f2552e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private static final String f2553f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private static final String f2554g;
    private static final String h;
    private static final String i;
    private static final String j;
    private static final String k;
    private static final String l;
    private static final String m;
    private static final String n;
    private static final String o;
    private static final String p;

    static {
        f2549b = b.c.d.d.b.m() ? "persist.ctm.ir_lock_white_list" : "persist.sys.ir_lock_white_list";
        f2550c = b.c.d.d.b.m() ? "persist.ctm.no_signal_type" : "persist.sys.no_signal_type";
        f2551d = b.c.d.d.b.m() ? "persist.ctm.double_screen.display_mode" : "persist.sys.double_screen.display_mode";
        f2552e = b.c.d.d.b.m() ? "persist.ctm.dual_touch_mode" : "persist.sys.dual_touch_mode";
        f2553f = b.c.d.d.b.m() ? "persist.ctm.is_factory_mode" : "persist.sys.is_factory_mode";
        f2554g = b.c.d.d.b.m() ? "persist.ctm.note.tmp_fd_abs" : "persist.sys.note.tmp_fd_abs";
        h = b.c.d.d.b.m() ? "persist.ctm.long_touch_screen" : "persist.sys.long_touch_screen";
        i = b.c.d.d.b.m() ? "persist.ctm.long_touch_ui" : "persist.sys.long_touch_ui";
        j = b.c.d.d.b.m() ? "persist.ctm.long_touch_status" : "persist.sys.long_touch_status";
        k = b.c.d.d.b.m() ? "persist.ctm.long_touch_counts" : "persist.sys.long_touch_counts";
        l = b.c.d.d.b.m() ? "persist.ctm.long_touch_operation" : "persist.sys.long_touch_operation";
        m = b.c.d.d.b.m() ? "persist.ctm.netlog.on" : "persist.sys.netlog.on";
        n = b.c.d.d.b.m() ? "persist.ctm.netlog.state" : "persist.sys.netlog.state";
        o = b.c.d.d.b.m() ? "persist.ctm.sharp.security_mode" : "persist.sys.sharp.security_mode";
        p = b.c.d.d.b.m() ? "ctm.freeform.top_task_id" : "sys.freeform.top_task_id";
    }

    public static String a() {
        if (!"empty".equals(j("ro.customer.product.model", "empty"))) {
            return i("ro.product.model");
        }
        String strG = g();
        return (!b.c.d.b.a.i() || b.c.d.b.a.h()) ? b.c.d.b.a.g() ? String.format(Locale.ENGLISH, "S%sEC", strG.substring(1, 3)) : b.c.d.b.a.d() ? d() : b.c.d.b.a.c() ? String.format(Locale.ENGLISH, "ETP%sU", strG.substring(1, 3)) : b.c.d.b.a.f() ? f() : b.c.d.b.a.b() ? String.format(Locale.ENGLISH, "LU%s-ST400", strG.substring(1, 3)) : b.c.d.b.a.e() ? j("ro.product.model", "empty") : b.c.d.d.b.j() ? j("ro.product.model", "empty") : strG : String.format(Locale.ENGLISH, "IFP%s50", strG.substring(1, 3));
    }

    public static String b() {
        String strJ = j("ro.product.board", "null");
        if (strJ.equals("null")) {
            return null;
        }
        return strJ;
    }

    public static String c() {
        String strJ = j("ro.cvte.boardname", "null");
        if (strJ.equals("null")) {
            return null;
        }
        return strJ;
    }

    public static String d() {
        String strG = g();
        return b.c.d.a.a.f(11) ? strG : b.c.d.d.b.i() ? i("ro.product.model") : ("E55IB-GLM351A-G".equals(strG) || "E65IB-GLM351A-G".equals(strG)) ? String.format(Locale.ENGLISH, "P%s12", strG.substring(1, 3)) : ("EX65".equals(strG) || "EX75".equals(strG) || "EX86".equals(strG)) ? strG : String.format(Locale.ENGLISH, "E10%s", strG.substring(1, 3));
    }

    public static String e() {
        return j("ro.build.version.incremental", "develop");
    }

    private static String f() {
        String strG = g();
        return strG.startsWith("L55EB") ? "L55EB-EV5501IDP" : strG.startsWith("L65EB") ? "L65EB-EV6501IDP" : strG.startsWith("L75EB") ? "L75EB-EV7501IDP" : strG.startsWith("L86EB") ? "L86EB-EV8601IDP" : strG;
    }

    public static String g() {
        String strJ = j(b.c.d.a.b.f1480g, "empty");
        if ("empty".equals(strJ)) {
            strJ = j("persist.sys.product.model", "empty");
        }
        if ("empty".equals(strJ)) {
            strJ = j("ro.customer.product.model", "empty");
        }
        return strJ.equals("empty") ? j("ro.product.model", "empty") : strJ;
    }

    public static int h(String str, int i2) {
        try {
            return SystemProperties.getInt(str, i2);
        } catch (Exception e2) {
            Log.w("PropertiesUtils", "getProperty int: ", e2);
            return i2;
        }
    }

    public static String i(String str) {
        try {
            return SystemProperties.get(str);
        } catch (Exception e2) {
            Log.w("PropertiesUtils", "getProperty String: ", e2);
            return "";
        }
    }

    public static String j(String str, String str2) {
        try {
            return SystemProperties.get(str, str2);
        } catch (Exception e2) {
            Log.w("PropertiesUtils", "getProperty String: ", e2);
            return str2;
        }
    }

    public static boolean k(String str, boolean z) {
        try {
            return SystemProperties.getBoolean(str, z);
        } catch (Exception e2) {
            Log.w("PropertiesUtils", "getProperty bool: ", e2);
            return z;
        }
    }

    public static int l() {
        return h("persist.sys.working.writer", 0);
    }

    public static boolean m() {
        return k("persist.sys.log.enable", false);
    }

    public static boolean n() {
        return "1".equals(i("persist.sys.accelerator_lock"));
    }

    public static boolean o() {
        return !n();
    }

    public static void p(int i2) {
        q("persist.sys.sleeptime.default", Integer.toString(i2));
    }

    public static boolean q(String str, String str2) {
        try {
            SystemProperties.set(str, str2);
            return true;
        } catch (Exception e2) {
            Log.w("PropertiesUtils", "setProperty: ", e2);
            return false;
        }
    }

    public static void r(boolean z) {
        q("persist.sys.upgrade_mode", String.valueOf(z));
    }
}
