155 lines
4.9 KiB
Java
155 lines
4.9 KiB
Java
package com.huawei.hms.hwid;
|
|
|
|
import android.text.TextUtils;
|
|
import com.huawei.hms.framework.common.EmuiUtil;
|
|
import java.lang.reflect.AccessibleObject;
|
|
import java.lang.reflect.Field;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class aq {
|
|
private static int a = -1;
|
|
private static int b;
|
|
|
|
static {
|
|
b();
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:10:0x0037 */
|
|
/* JADX WARN: Removed duplicated region for block: B:13:? A[RETURN, SYNTHETIC] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private static void b() {
|
|
/*
|
|
int r0 = d()
|
|
com.huawei.hms.hwid.aq.b = r0
|
|
r1 = 17
|
|
if (r0 < r1) goto Le
|
|
r1 = 90
|
|
com.huawei.hms.hwid.aq.a = r1
|
|
Le:
|
|
r1 = 11
|
|
if (r0 < r1) goto L17
|
|
r0 = 50
|
|
L14:
|
|
com.huawei.hms.hwid.aq.a = r0
|
|
goto L32
|
|
L17:
|
|
r1 = 10
|
|
if (r0 < r1) goto L1e
|
|
r0 = 41
|
|
goto L14
|
|
L1e:
|
|
r1 = 9
|
|
if (r0 < r1) goto L25
|
|
r0 = 40
|
|
goto L14
|
|
L25:
|
|
r1 = 8
|
|
if (r0 < r1) goto L2c
|
|
r0 = 31
|
|
goto L14
|
|
L2c:
|
|
r1 = 7
|
|
if (r0 < r1) goto L32
|
|
r0 = 30
|
|
goto L14
|
|
L32:
|
|
int r0 = com.huawei.hms.hwid.aq.a
|
|
r1 = -1
|
|
if (r0 != r1) goto L3a
|
|
c()
|
|
L3a:
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.huawei.hms.hwid.aq.b():void");
|
|
}
|
|
|
|
private static void c() {
|
|
try {
|
|
Class<?> cls = Class.forName("android.os.SystemProperties");
|
|
String str = (String) cls.getDeclaredMethod("get", String.class).invoke(cls, "ro.build.version.emui");
|
|
if (str != null) {
|
|
if (str.contains("EmotionUI_3.0")) {
|
|
a = 30;
|
|
return;
|
|
}
|
|
if (str.contains("EmotionUI_3.1")) {
|
|
a = 31;
|
|
return;
|
|
}
|
|
if (str.contains("EmotionUI_4.0")) {
|
|
a = 40;
|
|
} else if (str.contains("EmotionUI_4.1")) {
|
|
a = 41;
|
|
} else if (str.contains("EmotionUI_5.0")) {
|
|
a = 50;
|
|
}
|
|
}
|
|
} catch (RuntimeException unused) {
|
|
as.d("EmuiUtil", "RuntimeException getEmuiType.", true);
|
|
} catch (Exception unused2) {
|
|
as.d("EmuiUtil", "getEmuiType Exception.", true);
|
|
}
|
|
}
|
|
|
|
private static int d() {
|
|
Object a2 = a.a(EmuiUtil.BUILDEX_VERSION, EmuiUtil.EMUI_SDK_INT);
|
|
if (a2 != null) {
|
|
try {
|
|
b = ((Integer) a2).intValue();
|
|
} catch (ClassCastException unused) {
|
|
as.d("EmuiUtil", "getEMUIVersionCode is not a number", true);
|
|
}
|
|
}
|
|
return b;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public static class a {
|
|
public static Class<?> a(String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return null;
|
|
}
|
|
if (!EmuiUtil.BUILDEX_VERSION.equals(str) && !EmuiUtil.IMMERSION_STYLE.equals(str)) {
|
|
return null;
|
|
}
|
|
try {
|
|
return Class.forName(str);
|
|
} catch (ClassNotFoundException unused) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static Object a(String str, String str2) {
|
|
Class<?> a = a(str);
|
|
if (a == null || TextUtils.isEmpty(str2) || !EmuiUtil.BUILDEX_VERSION.equals(str) || !EmuiUtil.EMUI_SDK_INT.equals(str2)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Field declaredField = a.getDeclaredField(str2);
|
|
AccessibleObject.setAccessible(new Field[]{declaredField}, true);
|
|
return declaredField.get(a);
|
|
} catch (IllegalAccessException unused) {
|
|
as.c("ReflectionUtils", "Exception in getFieldObj :: IllegalAccessException", true);
|
|
return null;
|
|
} catch (IllegalArgumentException unused2) {
|
|
as.c("ReflectionUtils", "Exception in getFieldObj :: IllegalArgumentException", true);
|
|
return null;
|
|
} catch (NoSuchFieldException unused3) {
|
|
as.c("ReflectionUtils", "Exception in getFieldObj :: NoSuchFieldException", true);
|
|
return null;
|
|
} catch (SecurityException unused4) {
|
|
as.b("ReflectionUtils", "not security int method getStaticFieldObj", true);
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static boolean a() {
|
|
return b >= 21;
|
|
}
|
|
}
|