package d.i.f.c;

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

/* JADX INFO: compiled from: PropertiesUtils.java */
/* JADX INFO: loaded from: classes.dex */
public class c {
    public static final String a;

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

    static {
        g("persist.sys.umengfunction", true);
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        d.i.c.a.w();
        a = d.i.c.a.w() ? "persist.ctm.netlog.on" : "persist.sys.netlog.on";
        f3648b = d.i.c.a.w() ? "persist.ctm.netlog.state" : "persist.sys.netlog.state";
        d.i.c.a.w();
        d.i.c.a.w();
    }

    public static int a() {
        String str = d.i.f.b.a.a;
        if (str.equals("goodview")) {
            return c("persist.sys.toolbar.type", 3);
        }
        return c("persist.sys.toolbar.type", (str.endsWith("a1") || str.equals("predia")) ? 2 : 1);
    }

    public static String b() {
        String strF = f(d.i.f.a.b.f3639c, "empty");
        if ("empty".equals(strF)) {
            strF = f("persist.sys.product.model", "empty");
        }
        if ("empty".equals(strF)) {
            strF = f("ro.customer.product.model", "empty");
        }
        return strF.equals("empty") ? f("ro.product.model", "empty") : strF;
    }

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

    public static long d(String str, long j2) {
        try {
            return SystemProperties.getLong(str, j2);
        } catch (Exception e2) {
            Log.w("PropertiesUtils", "getProperty long: ", e2);
            return j2;
        }
    }

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

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

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

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

    public static boolean i() {
        return c(d.i.f.a.b.f3644h, 0) == 0;
    }

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

    public static boolean k() {
        return c("persist.sys.usbscsi", 1) == 1;
    }

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

    public static void m(boolean z) {
        l("persist.sys.usbscsi", z ? "1" : "0");
    }
}
