319 lines
11 KiB
Java
319 lines
11 KiB
Java
|
package com.huawei.hms.support.common;
|
||
|
|
||
|
import android.app.Activity;
|
||
|
import android.app.Application;
|
||
|
import android.graphics.Color;
|
||
|
import android.media.AudioTrack;
|
||
|
import android.os.Bundle;
|
||
|
import android.text.TextUtils;
|
||
|
import android.view.ViewConfiguration;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
import com.huawei.hms.support.log.HMSLog;
|
||
|
import java.lang.ref.WeakReference;
|
||
|
import java.lang.reflect.Method;
|
||
|
import net.sf.scuba.smartcards.ISO7816;
|
||
|
import o.C4593bdB;
|
||
|
import o.xzZ;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class ActivityMgr implements Application.ActivityLifecycleCallbacks {
|
||
|
public static final ActivityMgr INST;
|
||
|
private static int b;
|
||
|
private static long c;
|
||
|
private WeakReference<Activity> a;
|
||
|
private static final byte[] $$a = {40, -44, -105, ISO7816.INS_READ_BINARY2};
|
||
|
private static final int $$b = 126;
|
||
|
private static int $10 = 0;
|
||
|
private static int $11 = 1;
|
||
|
private static int d = 1;
|
||
|
|
||
|
static {
|
||
|
b = 0;
|
||
|
c();
|
||
|
INST = new ActivityMgr();
|
||
|
int i = d + 121;
|
||
|
b = i % 128;
|
||
|
if (i % 2 != 0) {
|
||
|
throw null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private ActivityMgr() {
|
||
|
}
|
||
|
|
||
|
private static String a(Object obj) {
|
||
|
int i = 2 % 2;
|
||
|
if (obj == null) {
|
||
|
int i2 = b + 113;
|
||
|
d = i2 % 128;
|
||
|
if (i2 % 2 == 0) {
|
||
|
Object[] objArr = new Object[1];
|
||
|
e(new char[]{17480, 37740, 59956, 49655}, 55103 % (ViewConfiguration.getMinimumFlingVelocity() / 40), objArr);
|
||
|
return ((String) objArr[0]).intern();
|
||
|
}
|
||
|
Object[] objArr2 = new Object[1];
|
||
|
e(new char[]{17480, 37740, 59956, 49655}, (ViewConfiguration.getMinimumFlingVelocity() >> 16) + 55103, objArr2);
|
||
|
return ((String) objArr2[0]).intern();
|
||
|
}
|
||
|
StringBuilder sb = new StringBuilder();
|
||
|
sb.append(obj.getClass().getName());
|
||
|
sb.append('@');
|
||
|
sb.append(Integer.toHexString(obj.hashCode()));
|
||
|
String obj2 = sb.toString();
|
||
|
int i3 = b + 35;
|
||
|
d = i3 % 128;
|
||
|
int i4 = i3 % 2;
|
||
|
return obj2;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Removed duplicated region for block: B:10:0x0021 */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:7:0x0019 */
|
||
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0021 -> B:4:0x002c). Please report as a decompilation issue!!! */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private static void f(byte r6, short r7, int r8, java.lang.Object[] r9) {
|
||
|
/*
|
||
|
byte[] r0 = com.huawei.hms.support.common.ActivityMgr.$$a
|
||
|
int r6 = r6 * 3
|
||
|
int r1 = r6 + 1
|
||
|
int r8 = 78 - r8
|
||
|
int r7 = r7 + 4
|
||
|
byte[] r1 = new byte[r1]
|
||
|
r2 = 0
|
||
|
if (r0 != 0) goto L13
|
||
|
r3 = r8
|
||
|
r4 = r2
|
||
|
r8 = r7
|
||
|
goto L2c
|
||
|
L13:
|
||
|
r3 = r2
|
||
|
L14:
|
||
|
byte r4 = (byte) r8
|
||
|
r1[r3] = r4
|
||
|
if (r3 != r6) goto L21
|
||
|
java.lang.String r6 = new java.lang.String
|
||
|
r6.<init>(r1, r2)
|
||
|
r9[r2] = r6
|
||
|
return
|
||
|
L21:
|
||
|
int r7 = r7 + 1
|
||
|
r4 = r0[r7]
|
||
|
int r3 = r3 + 1
|
||
|
r5 = r8
|
||
|
r8 = r7
|
||
|
r7 = r4
|
||
|
r4 = r3
|
||
|
r3 = r5
|
||
|
L2c:
|
||
|
int r7 = -r7
|
||
|
int r7 = r7 + r3
|
||
|
r3 = r4
|
||
|
r5 = r8
|
||
|
r8 = r7
|
||
|
r7 = r5
|
||
|
goto L14
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: com.huawei.hms.support.common.ActivityMgr.f(byte, short, int, java.lang.Object[]):void");
|
||
|
}
|
||
|
|
||
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||
|
public final void onActivityCreated(Activity activity, Bundle bundle) {
|
||
|
int i = 2 % 2;
|
||
|
StringBuilder sb = new StringBuilder("onCreated:");
|
||
|
sb.append(a(activity));
|
||
|
HMSLog.d("ActivityMgr", sb.toString());
|
||
|
this.a = new WeakReference<>(activity);
|
||
|
int i2 = b + 89;
|
||
|
d = i2 % 128;
|
||
|
if (i2 % 2 != 0) {
|
||
|
return;
|
||
|
}
|
||
|
Object obj = null;
|
||
|
obj.hashCode();
|
||
|
throw null;
|
||
|
}
|
||
|
|
||
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||
|
public final void onActivityResumed(Activity activity) {
|
||
|
int i = 2 % 2;
|
||
|
StringBuilder sb = new StringBuilder("onResumed:");
|
||
|
sb.append(a(activity));
|
||
|
HMSLog.d("ActivityMgr", sb.toString());
|
||
|
this.a = new WeakReference<>(activity);
|
||
|
int i2 = d + 19;
|
||
|
b = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
}
|
||
|
|
||
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||
|
public final void onActivityStarted(Activity activity) {
|
||
|
int i = 2 % 2;
|
||
|
StringBuilder sb = new StringBuilder("onStarted:");
|
||
|
sb.append(a(activity));
|
||
|
HMSLog.d("ActivityMgr", sb.toString());
|
||
|
this.a = new WeakReference<>(activity);
|
||
|
int i2 = b + 71;
|
||
|
d = i2 % 128;
|
||
|
if (i2 % 2 == 0) {
|
||
|
int i3 = 56 / 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final Activity getCurrentActivity() {
|
||
|
int i = 2 % 2;
|
||
|
int i2 = d + 83;
|
||
|
b = i2 % 128;
|
||
|
if (i2 % 2 != 0) {
|
||
|
throw null;
|
||
|
}
|
||
|
if (this.a == null) {
|
||
|
StringBuilder sb = new StringBuilder("mCurrentActivity is ");
|
||
|
sb.append(this.a);
|
||
|
HMSLog.i("ActivityMgr", sb.toString());
|
||
|
int i3 = d + 65;
|
||
|
b = i3 % 128;
|
||
|
if (i3 % 2 != 0) {
|
||
|
int i4 = 4 / 0;
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
StringBuilder sb2 = new StringBuilder("mCurrentActivity.get() is ");
|
||
|
sb2.append(this.a.get());
|
||
|
HMSLog.i("ActivityMgr", sb2.toString());
|
||
|
return this.a.get();
|
||
|
}
|
||
|
|
||
|
public final void init(Application application) {
|
||
|
int i = 2 % 2;
|
||
|
int i2 = b + 27;
|
||
|
d = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
HMSLog.d("ActivityMgr", "init");
|
||
|
if (application != null) {
|
||
|
ActivityMgr activityMgr = INST;
|
||
|
application.unregisterActivityLifecycleCallbacks(activityMgr);
|
||
|
application.registerActivityLifecycleCallbacks(activityMgr);
|
||
|
} else {
|
||
|
int i4 = d + 17;
|
||
|
b = i4 % 128;
|
||
|
int i5 = i4 % 2;
|
||
|
HMSLog.w("ActivityMgr", "init failed for app is null");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private static void e(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;
|
||
|
int i3 = $11 + 103;
|
||
|
$10 = i3 % 128;
|
||
|
if (i3 % 2 != 0) {
|
||
|
int i4 = 5 % 2;
|
||
|
}
|
||
|
while (c4593bdB.e < cArr.length) {
|
||
|
int i5 = 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.indexOf((CharSequence) "", '0'), 4 - TextUtils.lastIndexOf("", '0'), (char) (21609 - (AudioTrack.getMaxVolume() > BitmapDescriptorFactory.HUE_RED ? 1 : (AudioTrack.getMaxVolume() == BitmapDescriptorFactory.HUE_RED ? 0 : -1))));
|
||
|
byte b2 = (byte) 0;
|
||
|
byte b3 = (byte) (b2 - 1);
|
||
|
Object[] objArr3 = new Object[1];
|
||
|
f(b2, b3, (byte) (-b3), objArr3);
|
||
|
obj = cls.getMethod((String) objArr3[0], Integer.TYPE, Object.class, Object.class);
|
||
|
xzZ.y.put(-1229953068, obj);
|
||
|
}
|
||
|
jArr[i5] = ((Long) ((Method) obj).invoke(null, objArr2)).longValue() ^ (c ^ (-6958928035870403642L));
|
||
|
Object[] objArr4 = {c4593bdB, c4593bdB};
|
||
|
Object obj2 = xzZ.y.get(-1143917229);
|
||
|
if (obj2 == null) {
|
||
|
Class cls2 = (Class) xzZ.c(238 - (ViewConfiguration.getEdgeSlop() >> 16), TextUtils.lastIndexOf("", '0', 0) + 6, (char) (1 - (ViewConfiguration.getZoomControlsTimeout() > 0L ? 1 : (ViewConfiguration.getZoomControlsTimeout() == 0L ? 0 : -1))));
|
||
|
byte b4 = (byte) 0;
|
||
|
byte b5 = (byte) (b4 - 1);
|
||
|
Object[] objArr5 = new Object[1];
|
||
|
f(b4, b5, (byte) (b5 + 1), 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;
|
||
|
}
|
||
|
}
|
||
|
char[] cArr2 = new char[length];
|
||
|
c4593bdB.e = 0;
|
||
|
int i6 = $11 + 19;
|
||
|
$10 = i6 % 128;
|
||
|
int i7 = i6 % 2;
|
||
|
while (c4593bdB.e < cArr.length) {
|
||
|
cArr2[c4593bdB.e] = (char) jArr[c4593bdB.e];
|
||
|
Object[] objArr6 = {c4593bdB, c4593bdB};
|
||
|
Object obj3 = xzZ.y.get(-1143917229);
|
||
|
if (obj3 != null) {
|
||
|
method = obj3;
|
||
|
} else {
|
||
|
Class cls3 = (Class) xzZ.c(237 - TextUtils.lastIndexOf("", '0', 0), TextUtils.indexOf((CharSequence) "", '0') + 6, (char) Color.blue(0));
|
||
|
byte b6 = (byte) 0;
|
||
|
byte b7 = (byte) (b6 - 1);
|
||
|
Object[] objArr7 = new Object[1];
|
||
|
f(b6, b7, (byte) (b7 + 1), objArr7);
|
||
|
method = cls3.getMethod((String) objArr7[0], Object.class, Object.class);
|
||
|
xzZ.y.put(-1143917229, method);
|
||
|
}
|
||
|
((Method) method).invoke(null, objArr6);
|
||
|
}
|
||
|
objArr[0] = new String(cArr2);
|
||
|
}
|
||
|
|
||
|
static void c() {
|
||
|
c = -6989859150379460640L;
|
||
|
}
|
||
|
|
||
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||
|
public final void onActivityStopped(Activity activity) {
|
||
|
int i = 2 % 2;
|
||
|
int i2 = d + 71;
|
||
|
b = i2 % 128;
|
||
|
if (i2 % 2 != 0) {
|
||
|
int i3 = 57 / 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||
|
public final void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||
|
int i = 2 % 2;
|
||
|
int i2 = b + 65;
|
||
|
d = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
}
|
||
|
|
||
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||
|
public final void onActivityPaused(Activity activity) {
|
||
|
int i = 2 % 2;
|
||
|
int i2 = d + 51;
|
||
|
b = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
}
|
||
|
|
||
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||
|
public final void onActivityDestroyed(Activity activity) {
|
||
|
int i = 2 % 2;
|
||
|
int i2 = b + 93;
|
||
|
d = i2 % 128;
|
||
|
if (i2 % 2 == 0) {
|
||
|
int i3 = 45 / 0;
|
||
|
}
|
||
|
}
|
||
|
}
|