what-the-bank/sources/com/huawei/hms/android/SystemUtils.java

479 lines
18 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.android;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Process;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewConfiguration;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.huawei.hms.android.HwBuildEx;
import com.huawei.hms.support.log.HMSLog;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Locale;
import net.sf.scuba.smartcards.ISO7816;
import o.C13001fNn;
import o.C4593bdB;
import o.xzZ;
/* loaded from: classes2.dex */
public class SystemUtils {
public static final String PRODUCT_BRAND = "ro.product.brand";
public static final String PRODUCT_HONOR = "HONOR";
public static final String PRODUCT_HUAWEI = "HUAWEI";
public static final String UNKNOWN = "unknown";
private static final byte[] $$a = {ISO7816.INS_INCREASE, 10, Byte.MIN_VALUE, -124};
private static final int $$b = 100;
private static int $10 = 0;
private static int $11 = 1;
private static int a = 0;
private static int c = 1;
private static long b = -1169345980740404910L;
private static String a() {
int i = 2 % 2;
int i2 = a + 11;
c = i2 % 128;
int i3 = i2 % 2;
String systemProperties = getSystemProperties("ro.product.locale", "");
int i4 = a + 49;
c = i4 % 128;
if (i4 % 2 != 0) {
return systemProperties;
}
throw null;
}
private static String b() {
int i = 2 % 2;
int i2 = c + 97;
a = i2 % 128;
if (i2 % 2 != 0) {
getSystemProperties("ro.product.locale.region", "");
throw null;
}
String systemProperties = getSystemProperties("ro.product.locale.region", "");
int i3 = a + 59;
c = i3 % 128;
int i4 = i3 % 2;
return systemProperties;
}
private static void f(byte b2, int i, int i2, Object[] objArr) {
int i3 = 78 - b2;
int i4 = i * 3;
int i5 = 4 - (i2 * 4);
byte[] bArr = $$a;
byte[] bArr2 = new byte[1 - i4];
int i6 = 0 - i4;
int i7 = -1;
if (bArr == null) {
i5++;
i3 = i5 + (-i6);
}
while (true) {
i7++;
bArr2[i7] = (byte) i3;
if (i7 == i6) {
objArr[0] = new String(bArr2, 0);
return;
} else {
byte b3 = bArr[i5];
i5++;
i3 += -b3;
}
}
}
public static String getAndoridVersion() {
int i = 2 % 2;
int i2 = a + 93;
c = i2 % 128;
if (i2 % 2 == 0) {
getSystemProperties("ro.build.version.release", UNKNOWN);
Object obj = null;
obj.hashCode();
throw null;
}
String systemProperties = getSystemProperties("ro.build.version.release", UNKNOWN);
int i3 = a + 11;
c = i3 % 128;
if (i3 % 2 == 0) {
int i4 = 72 / 0;
}
return systemProperties;
}
public static String getManufacturer() {
int i = 2 % 2;
int i2 = a + 93;
c = i2 % 128;
int i3 = i2 % 2;
String systemProperties = getSystemProperties("ro.product.manufacturer", UNKNOWN);
int i4 = a + 39;
c = i4 % 128;
if (i4 % 2 != 0) {
return systemProperties;
}
throw null;
}
public static String getPhoneModel() {
int i = 2 % 2;
int i2 = c + 5;
a = i2 % 128;
if (i2 % 2 == 0) {
return getSystemProperties("ro.product.model", UNKNOWN);
}
getSystemProperties("ro.product.model", UNKNOWN);
Object obj = null;
obj.hashCode();
throw null;
}
public static boolean isEMUI() {
int i = 2 % 2;
StringBuilder sb = new StringBuilder("is Emui :");
int i2 = HwBuildEx.VERSION.EMUI_SDK_INT;
sb.append(i2);
HMSLog.i("SystemUtils", sb.toString());
if (i2 <= 0) {
return false;
}
int i3 = c;
int i4 = i3 + 63;
a = i4 % 128;
int i5 = i4 % 2;
int i6 = i3 + 17;
a = i6 % 128;
int i7 = i6 % 2;
return true;
}
public static boolean isTVDevice() {
boolean equalsIgnoreCase;
int i = 2 % 2;
int i2 = a + 47;
c = i2 % 128;
if (i2 % 2 == 0) {
equalsIgnoreCase = getSystemProperties("ro.build.characteristics", C13001fNn.DEFAULT_IDENTIFIER).equalsIgnoreCase("tv");
int i3 = 24 / 0;
} else {
equalsIgnoreCase = getSystemProperties("ro.build.characteristics", C13001fNn.DEFAULT_IDENTIFIER).equalsIgnoreCase("tv");
}
int i4 = c + 87;
a = i4 % 128;
if (i4 % 2 == 0) {
return equalsIgnoreCase;
}
throw null;
}
public static boolean isHuawei() {
int i = 2 % 2;
String systemProperties = getSystemProperties(PRODUCT_BRAND, UNKNOWN);
Object[] objArr = new Object[1];
d(new char[]{60124, 25130, 64259, 28674, 51581, 17994}, 35051 - Gravity.getAbsoluteGravity(0, 0), objArr);
if (((String) objArr[0]).intern().equalsIgnoreCase(systemProperties) || !(!PRODUCT_HONOR.equalsIgnoreCase(systemProperties))) {
int i2 = c + 125;
a = i2 % 128;
int i3 = i2 % 2;
return true;
}
int i4 = a + 111;
c = i4 % 128;
int i5 = i4 % 2;
return false;
}
public static String getLocalCountry() {
int i = 2 % 2;
int i2 = c + 29;
a = i2 % 128;
if (i2 % 2 == 0) {
Locale locale = Locale.getDefault();
if (locale != null) {
String country = locale.getCountry();
int i3 = c + 93;
a = i3 % 128;
int i4 = i3 % 2;
return country;
}
int i5 = a + 79;
c = i5 % 128;
int i6 = i5 % 2;
return "";
}
Locale.getDefault();
throw null;
}
public static String getSystemProperties(String str, String str2) {
int i = 2 % 2;
int i2 = a + 79;
c = i2 % 128;
int i3 = i2 % 2;
try {
Class<?> cls = Class.forName("android.os.SystemProperties");
String str3 = (String) cls.getDeclaredMethod("get", String.class, String.class).invoke(cls, str, str2);
int i4 = a + 105;
c = i4 % 128;
int i5 = i4 % 2;
return str3;
} catch (ClassCastException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | NoSuchMethodException | InvocationTargetException unused) {
HMSLog.e("SystemUtils", "An exception occurred while reading: getSystemProperties:".concat(String.valueOf(str)));
return str2;
}
}
public static String getNetType(Context context) {
ConnectivityManager connectivityManager;
int i = 2 % 2;
if (context != null && (connectivityManager = (ConnectivityManager) context.getSystemService("connectivity")) != null) {
int i2 = c + 19;
a = i2 % 128;
int i3 = i2 % 2;
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
if (activeNetworkInfo != null && !(!activeNetworkInfo.isAvailable())) {
int i4 = a + 49;
c = i4 % 128;
if (i4 % 2 != 0) {
return activeNetworkInfo.getTypeName();
}
activeNetworkInfo.getTypeName();
Object obj = null;
obj.hashCode();
throw null;
}
}
return "";
}
/* JADX WARN: Removed duplicated region for block: B:10:0x0042 */
/* JADX WARN: Removed duplicated region for block: B:15:? A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static boolean isSystemApp(android.content.Context r4, java.lang.String r5) {
/*
r0 = 2
int r1 = r0 % r0
r1 = 0
java.lang.String r2 = "SystemUtils"
if (r4 != 0) goto Le
java.lang.String r4 = "isSystemApp context is null"
com.huawei.hms.support.log.HMSLog.w(r2, r4)
return r1
Le:
android.content.pm.PackageManager r4 = r4.getPackageManager() // Catch: java.lang.RuntimeException -> L22 android.util.AndroidException -> L31
r3 = 16384(0x4000, float:2.2959E-41)
android.content.pm.PackageInfo r4 = r4.getPackageInfo(r5, r3) // Catch: java.lang.RuntimeException -> L22 android.util.AndroidException -> L31
int r5 = com.huawei.hms.android.SystemUtils.c
int r5 = r5 + 125
int r2 = r5 % 128
com.huawei.hms.android.SystemUtils.a = r2
int r5 = r5 % r0
goto L40
L22:
r4 = move-exception
java.lang.String r5 = "isSystemApp RuntimeException:"
java.lang.String r4 = java.lang.String.valueOf(r4)
java.lang.String r4 = r5.concat(r4)
com.huawei.hms.support.log.HMSLog.e(r2, r4)
goto L3f
L31:
r4 = move-exception
java.lang.String r5 = "isSystemApp Exception: "
java.lang.String r4 = java.lang.String.valueOf(r4)
java.lang.String r4 = r5.concat(r4)
com.huawei.hms.support.log.HMSLog.e(r2, r4)
L3f:
r4 = 0
L40:
if (r4 == 0) goto L54
int r5 = com.huawei.hms.android.SystemUtils.a
int r5 = r5 + 107
int r2 = r5 % 128
com.huawei.hms.android.SystemUtils.c = r2
int r5 = r5 % r0
android.content.pm.ApplicationInfo r4 = r4.applicationInfo
int r4 = r4.flags
r5 = 1
r4 = r4 & r5
if (r4 <= 0) goto L54
r1 = r5
L54:
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.huawei.hms.android.SystemUtils.isSystemApp(android.content.Context, java.lang.String):boolean");
}
@Deprecated
public static boolean isChinaROM() {
int i = 2 % 2;
int i2 = a + 41;
c = i2 % 128;
int i3 = i2 % 2;
String b2 = b();
if (!TextUtils.isEmpty(b2)) {
boolean equalsIgnoreCase = "cn".equalsIgnoreCase(b2);
int i4 = a + 15;
c = i4 % 128;
if (i4 % 2 == 0) {
int i5 = 0 / 0;
}
return equalsIgnoreCase;
}
String a2 = a();
if (!TextUtils.isEmpty(a2)) {
int i6 = a + 61;
c = i6 % 128;
int i7 = i6 % 2;
return a2.toLowerCase(Locale.US).contains("cn");
}
String localCountry = getLocalCountry();
if (TextUtils.isEmpty(localCountry)) {
return false;
}
int i8 = c + 21;
a = i8 % 128;
int i9 = i8 % 2;
return "cn".equalsIgnoreCase(localCountry);
}
private static void d(char[] cArr, int i, Object[] objArr) {
Object method;
int i2 = 2 % 2;
C4593bdB c4593bdB = new C4593bdB();
c4593bdB.a = i;
int length = cArr.length;
long[] jArr = new long[length];
c4593bdB.e = 0;
while (c4593bdB.e < cArr.length) {
int i3 = $10 + 97;
$11 = i3 % 128;
if (i3 % 2 == 0) {
int i4 = c4593bdB.e;
try {
Object[] objArr2 = {Integer.valueOf(cArr[c4593bdB.e]), c4593bdB, c4593bdB};
Object obj = xzZ.y.get(-1229953068);
if (obj == null) {
Class cls = (Class) xzZ.c(401 - TextUtils.lastIndexOf("", '0'), 5 - View.combineMeasuredStates(0, 0), (char) (21608 - View.MeasureSpec.getMode(0)));
byte b2 = (byte) 1;
byte b3 = (byte) (b2 - 1);
Object[] objArr3 = new Object[1];
f(b2, b3, b3, objArr3);
obj = cls.getMethod((String) objArr3[0], Integer.TYPE, Object.class, Object.class);
xzZ.y.put(-1229953068, obj);
}
jArr[i4] = ((Long) ((Method) obj).invoke(null, objArr2)).longValue() / (b & (-6958928035870403642L));
Object[] objArr4 = {c4593bdB, c4593bdB};
Object obj2 = xzZ.y.get(-1143917229);
if (obj2 == null) {
Class cls2 = (Class) xzZ.c(238 - View.getDefaultSize(0, 0), 5 - TextUtils.indexOf("", ""), (char) ((-1) - TextUtils.lastIndexOf("", '0', 0, 0)));
byte b4 = (byte) 0;
byte b5 = b4;
Object[] objArr5 = new Object[1];
f(b4, b5, b5, objArr5);
obj2 = cls2.getMethod((String) objArr5[0], Object.class, Object.class);
xzZ.y.put(-1143917229, obj2);
}
((Method) obj2).invoke(null, objArr4);
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
} else {
int i5 = c4593bdB.e;
try {
Object[] objArr6 = {Integer.valueOf(cArr[c4593bdB.e]), c4593bdB, c4593bdB};
Object obj3 = xzZ.y.get(-1229953068);
if (obj3 == null) {
Class cls3 = (Class) xzZ.c((Process.myTid() >> 22) + 402, TextUtils.indexOf((CharSequence) "", '0') + 6, (char) ((TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 21608));
byte b6 = (byte) 1;
byte b7 = (byte) (b6 - 1);
Object[] objArr7 = new Object[1];
f(b6, b7, b7, objArr7);
obj3 = cls3.getMethod((String) objArr7[0], Integer.TYPE, Object.class, Object.class);
xzZ.y.put(-1229953068, obj3);
}
jArr[i5] = ((Long) ((Method) obj3).invoke(null, objArr6)).longValue() ^ (b ^ (-6958928035870403642L));
try {
Object[] objArr8 = {c4593bdB, c4593bdB};
Object obj4 = xzZ.y.get(-1143917229);
if (obj4 == null) {
Class cls4 = (Class) xzZ.c(238 - View.MeasureSpec.makeMeasureSpec(0, 0), 5 - (Process.myTid() >> 22), (char) (ViewConfiguration.getFadingEdgeLength() >> 16));
byte b8 = (byte) 0;
byte b9 = b8;
Object[] objArr9 = new Object[1];
f(b8, b9, b9, objArr9);
obj4 = cls4.getMethod((String) objArr9[0], Object.class, Object.class);
xzZ.y.put(-1143917229, obj4);
}
((Method) obj4).invoke(null, objArr8);
} catch (Throwable th2) {
Throwable cause2 = th2.getCause();
if (cause2 == null) {
throw th2;
}
throw cause2;
}
} catch (Throwable th3) {
Throwable cause3 = th3.getCause();
if (cause3 == null) {
throw th3;
}
throw cause3;
}
}
int i6 = $11 + 21;
$10 = i6 % 128;
if (i6 % 2 != 0) {
int i7 = 4 % 2;
}
}
char[] cArr2 = new char[length];
c4593bdB.e = 0;
while (c4593bdB.e < cArr.length) {
int i8 = $11 + 75;
$10 = i8 % 128;
int i9 = i8 % 2;
cArr2[c4593bdB.e] = (char) jArr[c4593bdB.e];
Object[] objArr10 = {c4593bdB, c4593bdB};
Object obj5 = xzZ.y.get(-1143917229);
if (obj5 != null) {
method = obj5;
} else {
Class cls5 = (Class) xzZ.c(237 - TextUtils.indexOf((CharSequence) "", '0'), 4 - TextUtils.lastIndexOf("", '0', 0, 0), (char) ((Process.getElapsedCpuTime() > 0L ? 1 : (Process.getElapsedCpuTime() == 0L ? 0 : -1)) - 1));
byte b10 = (byte) 0;
byte b11 = b10;
Object[] objArr11 = new Object[1];
f(b10, b11, b11, objArr11);
method = cls5.getMethod((String) objArr11[0], Object.class, Object.class);
xzZ.y.put(-1143917229, method);
}
((Method) method).invoke(null, objArr10);
int i10 = $11 + 31;
$10 = i10 % 128;
int i11 = i10 % 2;
}
objArr[0] = new String(cArr2);
}
public static long getMegabyte(double d) {
int i = 2 % 2;
int i2 = c + 105;
a = i2 % 128;
double d2 = d * 1000.0d;
return (long) (i2 % 2 != 0 ? d2 % 1000.0d : d2 * 1000.0d);
}
}