package com.xiaomi.push; import android.content.Context; import android.os.Build; import android.text.TextUtils; import com.meizu.cloud.pushsdk.constants.PushConstants; import com.xiaomi.channel.commonutils.logger.b; public class v { private static Context a; /* renamed from: a reason: collision with other field name */ private static String f7641a; public static int a() { try { Class<?> a2 = a(null, "miui.os.Build"); if (a2.getField("IS_STABLE_VERSION").getBoolean(null)) { return 3; } return a2.getField("IS_DEVELOPMENT_VERSION").getBoolean(null) ? 2 : 1; } catch (Exception unused) { return 0; } } /* renamed from: a reason: collision with other method in class */ public static Context m9749a() { return a; } /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Missing exception handler attribute for start block: B:13:0x0024 */ public static Class<?> a(Context context, String str) { if (str == null || str.trim().length() == 0) { throw new ClassNotFoundException("class is empty"); } boolean z = context != null; if (z && Build.VERSION.SDK_INT >= 29) { return context.getClassLoader().loadClass(str); } try { return Class.forName(str); } catch (Throwable th) { b.m9051a(String.format("loadClass fail hasContext= %s, errMsg = %s", Boolean.valueOf(z), th.getLocalizedMessage())); throw new ClassNotFoundException("loadClass fail ", th); } } /* renamed from: a reason: collision with other method in class */ public static synchronized String m9750a() { synchronized (v.class) { if (f7641a != null) { return f7641a; } String str = Build.VERSION.INCREMENTAL; if (a() <= 0) { String b = b(); if (TextUtils.isEmpty(b)) { b = c(); if (TextUtils.isEmpty(b)) { b = d(); if (TextUtils.isEmpty(b)) { str = String.valueOf(u.a("ro.product.brand", "Android") + "_" + str); } } } str = b; } f7641a = str; return str; } } public static String a(Context context) { if (l.m9612b()) { return ""; } String str = (String) bk.a("com.xiaomi.xmsf.helper.MIIDAccountHelper", "getMIID", context); return TextUtils.isEmpty(str) ? PushConstants.PUSH_TYPE_NOTIFY : str; } /* renamed from: a reason: collision with other method in class */ public static void m9751a(Context context) { a = context.getApplicationContext(); } /* renamed from: a reason: collision with other method in class */ public static boolean m9752a() { return TextUtils.equals((String) bk.a("android.os.SystemProperties", "get", "sys.boot_completed"), "1"); } /* renamed from: a reason: collision with other method in class */ public static boolean m9753a(Context context) { try { return (context.getApplicationInfo().flags & 2) != 0; } catch (Exception e) { b.a(e); return false; } } private static String b() { String a2 = u.a("ro.build.version.emui", ""); f7641a = a2; return a2; } /* renamed from: b reason: collision with other method in class */ public static boolean m9754b() { try { return a(null, "miui.os.Build").getField("IS_GLOBAL_BUILD").getBoolean(false); } catch (ClassNotFoundException unused) { b.d("miui.os.Build ClassNotFound"); return false; } catch (Exception e) { b.a(e); return false; } } private static String c() { String a2 = u.a("ro.build.version.opporom", ""); if (!TextUtils.isEmpty(a2) && !a2.startsWith("ColorOS_")) { f7641a = "ColorOS_" + a2; } return f7641a; } private static String d() { String a2 = u.a("ro.vivo.os.version", ""); if (!TextUtils.isEmpty(a2) && !a2.startsWith("FuntouchOS_")) { f7641a = "FuntouchOS_" + a2; } return f7641a; } }