what-the-bank/sources/com/huawei/hms/support/hwid/service/HuaweiIdAuthAPIServiceImpl....

1108 lines
46 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.support.hwid.service;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.ImageFormat;
import android.os.Process;
import android.telephony.cdma.CdmaCellLocation;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.ExpandableListView;
import com.google.android.gms.internal.common.zzd;
import com.google.common.base.Ascii;
import com.huawei.hms.api.Api;
import com.huawei.hms.api.HuaweiApiAvailability;
import com.huawei.hms.api.HuaweiApiClient;
import com.huawei.hms.api.HuaweiApiClientImpl;
import com.huawei.hms.common.ApiException;
import com.huawei.hms.common.api.OptionalPendingResult;
import com.huawei.hms.common.api.internal.OptionalPendingResultImpl;
import com.huawei.hms.core.aidl.IMessageEntity;
import com.huawei.hms.hwid.as;
import com.huawei.hms.hwid.x;
import com.huawei.hms.support.api.PendingResultImpl;
import com.huawei.hms.support.api.ResolveResult;
import com.huawei.hms.support.api.client.ApiClient;
import com.huawei.hms.support.api.client.PendingResult;
import com.huawei.hms.support.api.client.ResultCallback;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.api.core.ConnectService;
import com.huawei.hms.support.api.entity.auth.PermissionInfo;
import com.huawei.hms.support.api.entity.auth.Scope;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import com.huawei.hms.support.api.entity.common.CommonNaming;
import com.huawei.hms.support.api.entity.core.JosGetNoticeResp;
import com.huawei.hms.support.api.entity.hwid.RevokeAccessResp;
import com.huawei.hms.support.api.entity.hwid.SignInReq;
import com.huawei.hms.support.api.entity.hwid.SignInResp;
import com.huawei.hms.support.api.entity.hwid.SignOutReq;
import com.huawei.hms.support.api.entity.hwid.SignOutResp;
import com.huawei.hms.support.api.hwid.SignInResult;
import com.huawei.hms.support.hwid.HuaweiIdAuthAPIManager;
import com.huawei.hms.support.hwid.HuaweiIdAuthManager;
import com.huawei.hms.support.hwid.request.HuaweiIdAuthParams;
import com.huawei.hms.support.hwid.result.AuthHuaweiId;
import com.huawei.hms.support.hwid.result.HuaweiIdAuthResult;
import com.huawei.hms.ui.SafeBundle;
import com.huawei.hms.utils.Checker;
import com.huawei.hms.utils.Util;
import com.pingan.ai.p;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import net.sf.scuba.smartcards.ISO7816;
import o.HiE;
import o.Nhs;
import o.QNe;
import o.xzZ;
/* loaded from: classes2.dex */
public class HuaweiIdAuthAPIServiceImpl implements HuaweiIdAuthAPIService {
private HuaweiApiClient a = null;
private WeakReference<Activity> b = null;
private static final byte[] $$a = {Ascii.NAK, Ascii.DC2, ISO7816.INS_DELETE_FILE, -22};
private static final int $$b = 151;
private static int $10 = 0;
private static int $11 = 1;
private static int g = 0;
private static int f = 1;
private static long e = 9051040786702654117L;
private static int c = 452713125;
private static char d = 41433;
/* JADX WARN: Removed duplicated region for block: B:10:0x0024 */
/* JADX WARN: Removed duplicated region for block: B:7:0x001c */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0024 -> B:4:0x0028). 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 i(int r6, byte r7, byte r8, java.lang.Object[] r9) {
/*
int r7 = r7 * 4
int r7 = 3 - r7
byte[] r0 = com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.$$a
int r8 = r8 + 114
int r6 = r6 * 2
int r6 = r6 + 1
byte[] r1 = new byte[r6]
r2 = 0
if (r0 != 0) goto L14
r3 = r6
r5 = r2
goto L28
L14:
r3 = r2
L15:
byte r4 = (byte) r8
int r5 = r3 + 1
r1[r3] = r4
if (r5 != r6) goto L24
java.lang.String r6 = new java.lang.String
r6.<init>(r1, r2)
r9[r2] = r6
return
L24:
int r7 = r7 + 1
r3 = r0[r7]
L28:
int r8 = r8 + r3
r3 = r5
goto L15
*/
throw new UnsupportedOperationException("Method not decompiled: com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.i(int, byte, byte, java.lang.Object[]):void");
}
static /* synthetic */ HuaweiApiClient a(HuaweiIdAuthAPIServiceImpl huaweiIdAuthAPIServiceImpl) {
int i = 2 % 2;
int i2 = g;
int i3 = i2 + 31;
f = i3 % 128;
int i4 = i3 % 2;
HuaweiApiClient huaweiApiClient = huaweiIdAuthAPIServiceImpl.a;
int i5 = i2 + 99;
f = i5 % 128;
if (i5 % 2 == 0) {
int i6 = 49 / 0;
}
return huaweiApiClient;
}
static /* synthetic */ void a(HuaweiIdAuthAPIServiceImpl huaweiIdAuthAPIServiceImpl, int i) {
int i2 = 2 % 2;
int i3 = g + 67;
f = i3 % 128;
int i4 = i3 % 2;
huaweiIdAuthAPIServiceImpl.a(i);
int i5 = g + 9;
f = i5 % 128;
if (i5 % 2 == 0) {
int i6 = 30 / 0;
}
}
static /* synthetic */ WeakReference b(HuaweiIdAuthAPIServiceImpl huaweiIdAuthAPIServiceImpl) {
int i = 2 % 2;
int i2 = g;
int i3 = i2 + 21;
f = i3 % 128;
int i4 = i3 % 2;
Object obj = null;
WeakReference<Activity> weakReference = huaweiIdAuthAPIServiceImpl.b;
if (i4 == 0) {
throw null;
}
int i5 = i2 + 99;
f = i5 % 128;
if (i5 % 2 != 0) {
return weakReference;
}
obj.hashCode();
throw null;
}
static List<Scope> a(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
int i2 = f + 73;
g = i2 % 128;
int i3 = i2 % 2;
List<Scope> scopes = ((HuaweiApiClientImpl) huaweiApiClient).getScopes();
int i4 = f + 69;
g = i4 % 128;
if (i4 % 2 == 0) {
return scopes;
}
throw null;
}
static List<PermissionInfo> b(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
int i2 = f + 125;
g = i2 % 128;
HuaweiApiClientImpl huaweiApiClientImpl = (HuaweiApiClientImpl) huaweiApiClient;
if (i2 % 2 != 0) {
huaweiApiClientImpl.getPermissionInfos();
throw null;
}
List<PermissionInfo> permissionInfos = huaweiApiClientImpl.getPermissionInfos();
int i3 = f + 111;
g = i3 % 128;
int i4 = i3 % 2;
return permissionInfos;
}
private static void h(char c2, int i, char[] cArr, char[] cArr2, char[] cArr3, Object[] objArr) {
int i2 = 2;
int i3 = 2 % 2;
Nhs nhs = new Nhs();
int length = cArr.length;
char[] cArr4 = new char[length];
int length2 = cArr3.length;
char[] cArr5 = new char[length2];
System.arraycopy(cArr, 0, cArr4, 0, length);
System.arraycopy(cArr3, 0, cArr5, 0, length2);
cArr4[0] = (char) (cArr4[0] ^ c2);
cArr5[2] = (char) (cArr5[2] + ((char) i));
int length3 = cArr2.length;
char[] cArr6 = new char[length3];
nhs.a = 0;
int i4 = $10 + 41;
$11 = i4 % 128;
int i5 = i4 % 2;
while (nhs.a < length3) {
int i6 = $11 + 65;
$10 = i6 % 128;
int i7 = i6 % i2;
try {
Object[] objArr2 = {nhs};
Object obj = xzZ.y.get(263693715);
if (obj == null) {
obj = ((Class) xzZ.c(44 - ImageFormat.getBitsPerPixel(0), 5 - (KeyEvent.getMaxKeyCode() >> 16), (char) View.resolveSizeAndState(0, 0, 0))).getMethod("t", Object.class);
xzZ.y.put(263693715, obj);
}
int intValue = ((Integer) ((Method) obj).invoke(null, objArr2)).intValue();
Object[] objArr3 = {nhs};
Object obj2 = xzZ.y.get(-484664112);
if (obj2 == null) {
Class cls = (Class) xzZ.c(352 - Gravity.getAbsoluteGravity(0, 0), 5 - KeyEvent.normalizeMetaState(0), (char) (52129 - (Process.getElapsedCpuTime() > 0L ? 1 : (Process.getElapsedCpuTime() == 0L ? 0 : -1))));
byte b2 = (byte) 0;
byte b3 = b2;
Object[] objArr4 = new Object[1];
i(b2, b3, (byte) (b3 + 1), objArr4);
obj2 = cls.getMethod((String) objArr4[0], Object.class);
xzZ.y.put(-484664112, obj2);
}
int intValue2 = ((Integer) ((Method) obj2).invoke(null, objArr3)).intValue();
Object[] objArr5 = {nhs, Integer.valueOf(cArr4[nhs.a % 4] * 32718), Integer.valueOf(cArr5[intValue])};
Object obj3 = xzZ.y.get(430099516);
if (obj3 == null) {
obj3 = ((Class) xzZ.c(747 - TextUtils.indexOf((CharSequence) "", '0', 0, 0), 5 - (ViewConfiguration.getScrollDefaultDelay() >> 16), (char) (ViewConfiguration.getKeyRepeatDelay() >> 16))).getMethod(p.a, Object.class, Integer.TYPE, Integer.TYPE);
xzZ.y.put(430099516, obj3);
}
((Method) obj3).invoke(null, objArr5);
Object[] objArr6 = {Integer.valueOf(cArr4[intValue2] * 32718), Integer.valueOf(cArr5[intValue])};
Object obj4 = xzZ.y.get(1019894806);
if (obj4 == null) {
Class cls2 = (Class) xzZ.c(403 - (ViewConfiguration.getZoomControlsTimeout() > 0L ? 1 : (ViewConfiguration.getZoomControlsTimeout() == 0L ? 0 : -1)), 5 - View.getDefaultSize(0, 0), (char) (21608 - View.combineMeasuredStates(0, 0)));
byte b4 = (byte) 0;
byte b5 = b4;
Object[] objArr7 = new Object[1];
i(b4, b5, b5, objArr7);
obj4 = cls2.getMethod((String) objArr7[0], Integer.TYPE, Integer.TYPE);
xzZ.y.put(1019894806, obj4);
}
cArr5[intValue2] = ((Character) ((Method) obj4).invoke(null, objArr6)).charValue();
cArr4[intValue2] = nhs.c;
cArr6[nhs.a] = (char) ((((cArr4[intValue2] ^ cArr2[nhs.a]) ^ (e ^ 9051040786702654117L)) ^ ((int) (c ^ 9051040786702654117L))) ^ ((char) (d ^ 9051040786702654117L)));
nhs.a++;
int i8 = $10 + 83;
$11 = i8 % 128;
if (i8 % 2 == 0) {
int i9 = 3 % 5;
}
i2 = 2;
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
objArr[0] = new String(cArr6);
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public PendingResult<SignInResult> signIn(Activity activity, HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
as.b("HuaweiIdAuthAPIServiceImpl", "Enter signIn", true);
Checker.checkNonNull(activity, "Activity must not be null.");
Checker.checkNonNull(huaweiApiClient, "HuaweiApiClient must not be null.");
List<Scope> a2 = a(huaweiApiClient);
List<PermissionInfo> b2 = b(huaweiApiClient);
HashSet hashSet = new HashSet();
Iterator<Scope> it = a2.iterator();
int i2 = g + 39;
f = i2 % 128;
int i3 = i2 % 2;
while (it.hasNext()) {
hashSet.add(it.next().getScopeUri());
}
HashSet hashSet2 = new HashSet();
Iterator<PermissionInfo> it2 = b2.iterator();
while (it2.hasNext()) {
int i4 = g + 121;
f = i4 % 128;
if (i4 % 2 == 0) {
hashSet2.add(it2.next().getPermission());
int i5 = 62 / 0;
} else {
hashSet2.add(it2.next().getPermission());
}
}
SignInReq signInReq = new SignInReq(hashSet, hashSet2);
this.a = huaweiApiClient;
this.b = new WeakReference<>(activity);
PendingResultImpl<SignInResult, SignInResp> pendingResultImpl = new PendingResultImpl<SignInResult, SignInResp>(this, huaweiApiClient, CommonNaming.signin, signInReq) { // from class: com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.1
final HuaweiIdAuthAPIServiceImpl a;
{
this.a = this;
}
@Override // com.huawei.hms.support.api.PendingResultImpl
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public SignInResult onComplete(SignInResp signInResp) {
StringBuilder sb = new StringBuilder("signIn onComplete:");
sb.append(signInResp.getRetCode());
as.b("HuaweiIdAuthAPIServiceImpl", sb.toString(), true);
HuaweiIdAuthAPIServiceImpl.a(this.a, signInResp.getRetCode());
Intent data = signInResp.getData();
data.putExtra(CommonConstant.RETKEY.RETCODE, signInResp.getRetCode());
return this.a.getHwIdSignInResultFromIntent(data);
}
};
int i6 = g + 81;
f = i6 % 128;
if (i6 % 2 == 0) {
int i7 = 15 / 0;
}
return pendingResultImpl;
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public PendingResult<SignInResult> signInBackend(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
as.b("HuaweiIdAuthAPIServiceImpl", "Enter signInBackend", true);
Checker.checkNonNull(huaweiApiClient, "HuaweiApiClient must not be null.");
this.a = huaweiApiClient;
List<Scope> a2 = a(huaweiApiClient);
List<PermissionInfo> b2 = b(huaweiApiClient);
HashSet hashSet = new HashSet();
Iterator<Scope> it = a2.iterator();
int i2 = f + 115;
g = i2 % 128;
int i3 = i2 % 2;
while (it.hasNext()) {
hashSet.add(it.next().getScopeUri());
}
HashSet hashSet2 = new HashSet();
Iterator<PermissionInfo> it2 = b2.iterator();
while (!(!it2.hasNext())) {
int i4 = g + 57;
f = i4 % 128;
if (i4 % 2 == 0) {
hashSet2.add(it2.next().getPermission());
Object obj = null;
obj.hashCode();
throw null;
}
hashSet2.add(it2.next().getPermission());
int i5 = g + 49;
f = i5 % 128;
int i6 = i5 % 2;
}
return new PendingResultImpl<SignInResult, SignInResp>(this, huaweiApiClient, CommonNaming.singinbackend, new SignInReq(hashSet, hashSet2)) { // from class: com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.2
final HuaweiIdAuthAPIServiceImpl a;
{
this.a = this;
}
@Override // com.huawei.hms.support.api.PendingResultImpl
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public SignInResult onComplete(SignInResp signInResp) {
StringBuilder sb = new StringBuilder("signInBackend onComplete:");
sb.append(signInResp.getRetCode());
as.b("HuaweiIdAuthAPIServiceImpl", sb.toString(), true);
Intent data = signInResp.getData();
data.putExtra(CommonConstant.RETKEY.RETCODE, signInResp.getRetCode());
return this.a.getHwIdSignInResultFromIntent(data);
}
};
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public PendingResult<Status> signOut(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
int i2 = g + 125;
f = i2 % 128;
int i3 = i2 % 2;
as.b("HuaweiIdAuthAPIServiceImpl", "Enter signOut", true);
if (huaweiApiClient.isConnected()) {
return new c(huaweiApiClient, CommonNaming.signout, new SignOutReq());
}
int i4 = f + 51;
g = i4 % 128;
int i5 = i4 % 2;
PendingResult<Status> d2 = d(huaweiApiClient);
int i6 = g + 19;
f = i6 % 128;
if (i6 % 2 != 0) {
return d2;
}
Object obj = null;
obj.hashCode();
throw null;
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public SignInResult getHwIdSignInResultFromIntent(Intent intent) {
PendingIntent activity;
int i = 2 % 2;
if (intent != null) {
int i2 = f + 63;
g = i2 % 128;
Object obj = null;
if (i2 % 2 != 0) {
intent.getExtras();
obj.hashCode();
throw null;
}
if (intent.getExtras() != null) {
SafeBundle safeBundle = new SafeBundle(intent.getExtras());
int i3 = safeBundle.getInt(CommonConstant.RETKEY.RETCODE, 0);
if (i3 == 0) {
String string = safeBundle.getString(CommonConstant.RETKEY.GENDER);
String string2 = safeBundle.getString(CommonConstant.RETKEY.USERID, "");
String string3 = safeBundle.getString(CommonConstant.RETKEY.STATUS);
String string4 = safeBundle.getString(CommonConstant.RETKEY.SCOPE);
String string5 = safeBundle.getString(CommonConstant.RETKEY.ID_TOKEN);
String string6 = safeBundle.getString(CommonConstant.RETKEY.EMAIL);
String string7 = safeBundle.getString(CommonConstant.RETKEY.FAMILY_NAME);
String string8 = safeBundle.getString(CommonConstant.RETKEY.GIVEN_NAME);
String string9 = safeBundle.getString(CommonConstant.RETKEY.AGE_RANGE);
String string10 = safeBundle.getString(CommonConstant.RETKEY.HOME_ZONE);
AuthHuaweiId build = AuthHuaweiId.build(safeBundle.getString(CommonConstant.RETKEY.OPENID, ""), string2, safeBundle.getString(CommonConstant.RETKEY.DISPLAYNAME, ""), safeBundle.getString(CommonConstant.RETKEY.PHOTOURL), safeBundle.getString(CommonConstant.RETKEY.ACCESS_TOKEN, ""), safeBundle.getString(CommonConstant.RETKEY.SERVICECOUNTRYCODE, ""), conversionStatus(string3), conversionGender(string), conversionScopes(string4), safeBundle.getString(CommonConstant.RETKEY.SERVICEAUTHCODE, ""), safeBundle.getString(CommonConstant.RETKEY.UNIONID, ""), safeBundle.getString(CommonConstant.RETKEY.COUNTRYCODE, ""));
build.setIdToken(string5);
build.setEmail(string6);
build.setFamilyName(string7);
build.setGivenName(string8);
build.setAgeRange(string9);
build.setHomeZone(conversionHomeZone(string10));
Status status = new Status(i3);
SignInResult signInResult = new SignInResult(status);
signInResult.setStatus(status);
signInResult.setAuthHuaweiId(build);
as.b("HuaweiIdAuthAPIServiceImpl", "getSignInResult success", true);
return signInResult;
}
if (i3 != 2002) {
int i4 = f;
int i5 = i4 + 17;
g = i5 % 128;
int i6 = i5 % 2;
if (i3 != 2004) {
int i7 = i4 + 11;
g = i7 % 128;
int i8 = i7 % 2;
activity = null;
Status status2 = new Status(i3, (String) null, activity);
SignInResult signInResult2 = new SignInResult(status2);
signInResult2.setStatus(status2);
signInResult2.setData(intent);
as.b("HuaweiIdAuthAPIServiceImpl", "getSignInResult fail", true);
return signInResult2;
}
}
Random random = new Random();
as.b("HuaweiIdAuthAPIServiceImpl", "SDK version >= 23", true);
activity = PendingIntent.getActivity(this.a.getContext(), random.nextInt(), intent, zzd.zza);
int i9 = g + 49;
f = i9 % 128;
int i10 = i9 % 2;
Status status22 = new Status(i3, (String) null, activity);
SignInResult signInResult22 = new SignInResult(status22);
signInResult22.setStatus(status22);
signInResult22.setData(intent);
as.b("HuaweiIdAuthAPIServiceImpl", "getSignInResult fail", true);
return signInResult22;
}
}
SignInResult signInResult3 = new SignInResult(new Status(2003));
as.d("HuaweiIdAuthAPIServiceImpl", "getSignInResult error", true);
return signInResult3;
}
/* JADX WARN: Code restructure failed: missing block: B:13:0x0055, code lost:
com.huawei.hms.hwid.as.b("HuaweiIdAuthAPIServiceImpl", "getSignInResult fail", true);
*/
/* JADX WARN: Code restructure failed: missing block: B:15:0x0027, code lost:
if (r8.getExtras() != null) goto L11;
*/
/* JADX WARN: Code restructure failed: missing block: B:6:0x0020, code lost:
if (r8.getExtras() != null) goto L11;
*/
/* JADX WARN: Code restructure failed: missing block: B:7:0x0029, code lost:
r4 = new com.huawei.hms.ui.SafeBundle(r8.getExtras());
r8 = r4.getInt(com.huawei.hms.support.api.entity.common.CommonConstant.RETKEY.RETCODE, 0);
r5 = new com.huawei.hms.support.api.client.Status(r8);
*/
/* JADX WARN: Code restructure failed: missing block: B:8:0x003d, code lost:
if (r8 != 0) goto L14;
*/
/* JADX WARN: Code restructure failed: missing block: B:9:0x003f, code lost:
r8 = com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.g + 117;
com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.f = r8 % 128;
r8 = r8 % 2;
r1.setAuthHuaweiId(a(r4));
com.huawei.hms.hwid.as.b("HuaweiIdAuthAPIServiceImpl", "getSignInResult success", true);
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public com.huawei.hms.support.hwid.result.HuaweiIdAuthResult getHuaweiIdSignInResultFromIntent(android.content.Intent r8) {
/*
r7 = this;
r0 = 2
int r1 = r0 % r0
com.huawei.hms.support.hwid.result.HuaweiIdAuthResult r1 = new com.huawei.hms.support.hwid.result.HuaweiIdAuthResult
r1.<init>()
r2 = 1
java.lang.String r3 = "HuaweiIdAuthAPIServiceImpl"
if (r8 == 0) goto L5b
int r4 = com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.g
int r4 = r4 + 27
int r5 = r4 % 128
com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.f = r5
int r4 = r4 % r0
r5 = 0
if (r4 != 0) goto L23
android.os.Bundle r4 = r8.getExtras()
r6 = 38
int r6 = r6 / r5
if (r4 == 0) goto L5b
goto L29
L23:
android.os.Bundle r4 = r8.getExtras()
if (r4 == 0) goto L5b
L29:
com.huawei.hms.ui.SafeBundle r4 = new com.huawei.hms.ui.SafeBundle
android.os.Bundle r8 = r8.getExtras()
r4.<init>(r8)
java.lang.String r8 = "RET_CODE"
int r8 = r4.getInt(r8, r5)
com.huawei.hms.support.api.client.Status r5 = new com.huawei.hms.support.api.client.Status
r5.<init>(r8)
if (r8 != 0) goto L55
int r8 = com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.g
int r8 = r8 + 117
int r6 = r8 % 128
com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.f = r6
int r8 = r8 % r0
com.huawei.hms.support.hwid.result.AuthHuaweiId r8 = r7.a(r4)
r1.setAuthHuaweiId(r8)
java.lang.String r8 = "getSignInResult success"
com.huawei.hms.hwid.as.b(r3, r8, r2)
goto L67
L55:
java.lang.String r8 = "getSignInResult fail"
com.huawei.hms.hwid.as.b(r3, r8, r2)
goto L67
L5b:
com.huawei.hms.support.api.client.Status r5 = new com.huawei.hms.support.api.client.Status
r8 = 2003(0x7d3, float:2.807E-42)
r5.<init>(r8)
java.lang.String r8 = "getSignInResult error"
com.huawei.hms.hwid.as.d(r3, r8, r2)
L67:
r1.setStatus(r5)
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.getHuaweiIdSignInResultFromIntent(android.content.Intent):com.huawei.hms.support.hwid.result.HuaweiIdAuthResult");
}
private AuthHuaweiId a(SafeBundle safeBundle) {
String[] split;
int length;
int i;
int i2 = 2 % 2;
if (safeBundle == null) {
as.b("HuaweiIdAuthAPIServiceImpl", "bd is null", true);
AuthHuaweiId authHuaweiId = new AuthHuaweiId();
int i3 = f + 79;
g = i3 % 128;
int i4 = i3 % 2;
return authHuaweiId;
}
String string = safeBundle.getString(CommonConstant.RETKEY.ACCESS_TOKEN, "");
String string2 = safeBundle.getString(CommonConstant.RETKEY.SERVICEAUTHCODE, "");
String string3 = safeBundle.getString(CommonConstant.RETKEY.DISPLAYNAME, "");
String string4 = safeBundle.getString(CommonConstant.RETKEY.USERID, "");
String string5 = safeBundle.getString(CommonConstant.RETKEY.OPENID, "");
String string6 = safeBundle.getString(CommonConstant.RETKEY.PHOTOURL);
String string7 = safeBundle.getString(CommonConstant.RETKEY.SERVICECOUNTRYCODE, "");
String string8 = safeBundle.getString(CommonConstant.RETKEY.COUNTRYCODE, "");
String string9 = safeBundle.getString(CommonConstant.RETKEY.UNIONID, "");
int a2 = a(safeBundle.getString(CommonConstant.RETKEY.GENDER));
int b2 = b(safeBundle.getString(CommonConstant.RETKEY.STATUS));
int c2 = c(safeBundle.getString(CommonConstant.RETKEY.HOME_ZONE));
String string10 = safeBundle.getString(CommonConstant.RETKEY.SCOPE);
HashSet hashSet = new HashSet();
if (string10 != null) {
int i5 = g + 125;
f = i5 % 128;
if (i5 % 2 == 0) {
split = string10.split(" ");
length = split.length;
i = 1;
} else {
split = string10.split(" ");
length = split.length;
i = 0;
}
while (i < length) {
hashSet.add(new Scope(split[i]));
i++;
split = split;
}
}
AuthHuaweiId build = AuthHuaweiId.build(string5, string4, string3, string6, string, string7, b2, a2, hashSet, string2, string9, string8);
build.setIdToken(safeBundle.getString(CommonConstant.RETKEY.ID_TOKEN));
build.setEmail(safeBundle.getString(CommonConstant.RETKEY.EMAIL));
build.setFamilyName(safeBundle.getString(CommonConstant.RETKEY.FAMILY_NAME));
build.setGivenName(safeBundle.getString(CommonConstant.RETKEY.GIVEN_NAME));
build.setAgeRange(safeBundle.getString(CommonConstant.RETKEY.AGE_RANGE));
build.setHomeZone(c2);
return build;
}
private int a(String str) {
int i = 2 % 2;
int i2 = f + 45;
g = i2 % 128;
int i3 = i2 % 2;
if (TextUtils.isEmpty(str)) {
str = "-1";
}
try {
int parseInt = Integer.parseInt(str);
int i4 = g + 109;
f = i4 % 128;
int i5 = i4 % 2;
return parseInt;
} catch (NumberFormatException unused) {
return -1;
}
}
private int b(String str) {
int i = 2 % 2;
int i2 = 0;
if (!(!TextUtils.isEmpty(str))) {
int i3 = f + 101;
g = i3 % 128;
if (i3 % 2 != 0) {
Object[] objArr = new Object[1];
h((char) (19138 >> ExpandableListView.getPackedPositionType(0L)), 549733371 % (KeyEvent.getMaxKeyCode() * 76), new char[]{64344, 50243, 53024, 60225}, new char[]{54504}, new char[]{0, 0, 0, 0}, objArr);
str = ((String) objArr[0]).intern();
} else {
Object[] objArr2 = new Object[1];
h((char) (ExpandableListView.getPackedPositionType(0L) + 16847), (KeyEvent.getMaxKeyCode() >> 16) + 549733371, new char[]{64344, 50243, 53024, 60225}, new char[]{54504}, new char[]{0, 0, 0, 0}, objArr2);
str = ((String) objArr2[0]).intern();
}
}
try {
i2 = Integer.parseInt(str);
int i4 = g + 63;
f = i4 % 128;
int i5 = i4 % 2;
} catch (NumberFormatException unused) {
}
return i2;
}
private int c(String str) {
int i = 2 % 2;
int i2 = f + 59;
g = i2 % 128;
int i3 = i2 % 2;
int i4 = 0;
if (TextUtils.isEmpty(str)) {
Object[] objArr = new Object[1];
h((char) (16847 - (CdmaCellLocation.convertQuartSecToDecDegrees(0) > 0.0d ? 1 : (CdmaCellLocation.convertQuartSecToDecDegrees(0) == 0.0d ? 0 : -1))), KeyEvent.normalizeMetaState(0) + 549733371, new char[]{64344, 50243, 53024, 60225}, new char[]{54504}, new char[]{0, 0, 0, 0}, objArr);
str = ((String) objArr[0]).intern();
}
try {
i4 = Integer.parseInt(str);
} catch (NumberFormatException unused) {
as.d("HuaweiIdAuthAPIServiceImpl", "parse homeZone error.", true);
}
int i5 = f + 97;
g = i5 % 128;
int i6 = i5 % 2;
return i4;
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public HuaweiIdAuthResult parseHuaweiIdFromIntent(Intent intent) {
int i = 2 % 2;
int i2 = g + 21;
f = i2 % 128;
int i3 = i2 % 2;
HuaweiIdAuthResult a2 = x.a(intent);
int i4 = f + 95;
g = i4 % 128;
int i5 = i4 % 2;
return a2;
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public Intent getSignInIntent(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
int i2 = g + 39;
f = i2 % 128;
if (i2 % 2 != 0) {
Context context = huaweiApiClient.getContext();
HuaweiIdAuthParams signInOption = getSignInOption(huaweiApiClient);
if (signInOption == null) {
return null;
}
Intent a2 = x.a(context, signInOption, huaweiApiClient.getSubAppInfo() != null ? huaweiApiClient.getSubAppInfo().getSubAppID() : null);
int i3 = g + 21;
f = i3 % 128;
int i4 = i3 % 2;
return a2;
}
huaweiApiClient.getContext();
getSignInOption(huaweiApiClient);
throw null;
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public PendingResult<Status> cancelAuthorization(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
as.b("HuaweiIdAuthAPIServiceImpl", "Enter cancelAuthorization", true);
this.a = huaweiApiClient;
b bVar = new b(huaweiApiClient, CommonNaming.revokeAccess, c(huaweiApiClient));
int i2 = f + 93;
g = i2 % 128;
if (i2 % 2 == 0) {
return bVar;
}
throw null;
}
@Override // com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIService
public OptionalPendingResult<HuaweiIdAuthResult> silentSignIn(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
as.b("HuaweiIdAuthAPIServiceImpl", "Enter silentSignIn", true);
Checker.checkNonNull(huaweiApiClient, "HuaweiApiClient must not be null.");
this.a = huaweiApiClient;
OptionalPendingResultImpl optionalPendingResultImpl = new OptionalPendingResultImpl(new PendingResultImpl<HuaweiIdAuthResult, SignInResp>(this, huaweiApiClient, CommonNaming.singinbackend, c(huaweiApiClient)) { // from class: com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.3
final HuaweiIdAuthAPIServiceImpl a;
{
this.a = this;
}
@Override // com.huawei.hms.support.api.PendingResultImpl
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public HuaweiIdAuthResult onComplete(SignInResp signInResp) {
StringBuilder sb = new StringBuilder("signInBackend onComplete:");
sb.append(signInResp.getRetCode());
as.b("HuaweiIdAuthAPIServiceImpl", sb.toString(), true);
Intent data = signInResp.getData();
data.putExtra(CommonConstant.RETKEY.RETCODE, signInResp.getRetCode());
return this.a.getHuaweiIdSignInResultFromIntent(data);
}
});
int i2 = g + 29;
f = i2 % 128;
int i3 = i2 % 2;
return optionalPendingResultImpl;
}
private SignInReq c(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
List<Scope> a2 = a(huaweiApiClient);
List<PermissionInfo> b2 = b(huaweiApiClient);
HashSet hashSet = new HashSet();
Iterator<Scope> it = a2.iterator();
while (it.hasNext()) {
int i2 = g + 1;
f = i2 % 128;
int i3 = i2 % 2;
hashSet.add(it.next().getScopeUri());
int i4 = f + 113;
g = i4 % 128;
int i5 = i4 % 2;
}
HashSet hashSet2 = new HashSet();
Iterator<PermissionInfo> it2 = b2.iterator();
while (!(!it2.hasNext())) {
hashSet2.add(it2.next().getPermission());
}
return new SignInReq(hashSet, hashSet2);
}
private void a(int i) {
int i2 = 2 % 2;
int i3 = g + 119;
int i4 = i3 % 128;
f = i4;
int i5 = i3 % 2;
if (i == 0) {
int i6 = i4 + 75;
g = i6 % 128;
int i7 = i6 % 2;
if (HuaweiApiAvailability.getInstance().isHuaweiMobileNoticeAvailable(this.a.getContext()) == 0) {
new Timer().schedule(new TimerTask(this) { // from class: com.huawei.hms.support.hwid.service.HuaweiIdAuthAPIServiceImpl.4
final HuaweiIdAuthAPIServiceImpl a;
{
this.a = this;
}
@Override // java.util.TimerTask, java.lang.Runnable
public void run() {
ConnectService.getNotice(HuaweiIdAuthAPIServiceImpl.a(this.a), 1, "6.11.0.301").setResultCallback(new a());
}
}, 200L);
}
}
}
/* loaded from: classes2.dex */
static class c extends PendingResultImpl<Status, SignOutResp> {
public c(ApiClient apiClient, String str, IMessageEntity iMessageEntity) {
super(apiClient, str, iMessageEntity);
}
@Override // com.huawei.hms.support.api.PendingResultImpl
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public Status onComplete(SignOutResp signOutResp) {
Status status = new Status(0);
as.b("HuaweiIdAuthAPIServiceImpl", "signOut onComplete", true);
return status;
}
}
/* loaded from: classes2.dex */
static class b extends PendingResultImpl<Status, RevokeAccessResp> {
public b(ApiClient apiClient, String str, IMessageEntity iMessageEntity) {
super(apiClient, str, iMessageEntity);
}
@Override // com.huawei.hms.support.api.PendingResultImpl
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public Status onComplete(RevokeAccessResp revokeAccessResp) {
as.b("HuaweiIdAuthAPIServiceImpl", "RevokeAccessPendingResult onComplete", true);
return new Status(revokeAccessResp.getRetCode());
}
}
/* loaded from: classes2.dex */
class a implements ResultCallback<ResolveResult<JosGetNoticeResp>> {
final HuaweiIdAuthAPIServiceImpl a;
private a(HuaweiIdAuthAPIServiceImpl huaweiIdAuthAPIServiceImpl) {
this.a = huaweiIdAuthAPIServiceImpl;
}
@Override // com.huawei.hms.support.api.client.ResultCallback
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public void onResult(ResolveResult<JosGetNoticeResp> resolveResult) {
JosGetNoticeResp value;
Intent noticeIntent;
if (resolveResult == null || !resolveResult.getStatus().isSuccess() || (noticeIntent = (value = resolveResult.getValue()).getNoticeIntent()) == null || value.getStatusCode() != 0) {
return;
}
as.a("HuaweiIdAuthAPIServiceImpl", "get notice has intent.", true);
Activity validActivity = Util.getValidActivity((Activity) HuaweiIdAuthAPIServiceImpl.b(this.a).get(), HuaweiIdAuthAPIServiceImpl.a(this.a).getTopActivity());
if (validActivity == null) {
as.d("HuaweiIdAuthAPIServiceImpl", "showNotice no valid activity!", true);
return;
}
try {
validActivity.startActivity(noticeIntent);
} catch (Exception e) {
StringBuilder sb = new StringBuilder("startActivity exception");
sb.append(e.getClass().getSimpleName());
as.d("HuaweiIdAuthAPIServiceImpl", sb.toString(), true);
}
}
}
protected HuaweiIdAuthParams getSignInOption(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
Map<Api<?>, Api.ApiOptions> apiMap = huaweiApiClient.getApiMap();
if (apiMap != null) {
int i2 = f + 5;
g = i2 % 128;
int i3 = i2 % 2;
Api.ApiOptions apiOptions = apiMap.get(HuaweiIdAuthAPIManager.HUAWEI_OAUTH_API);
if (apiOptions != null) {
int i4 = f + 29;
int i5 = i4 % 128;
g = i5;
int i6 = i4 % 2;
if (apiOptions instanceof HuaweiIdAuthParams) {
int i7 = i5 + 87;
f = i7 % 128;
int i8 = i7 % 2;
return (HuaweiIdAuthParams) apiOptions;
}
}
}
int i9 = f + 57;
g = i9 % 128;
Object obj = null;
if (i9 % 2 == 0) {
return null;
}
obj.hashCode();
throw null;
}
private PendingResult<Status> d(HuaweiApiClient huaweiApiClient) {
int i = 2 % 2;
as.b("HuaweiIdAuthAPIServiceImpl", "Enter signOutNoConnected", true);
HiE<Void> signOut = HuaweiIdAuthManager.getService(huaweiApiClient.getContext(), getSignInOption(huaweiApiClient)).signOut();
SignOutNoConnectPendingResult signOutNoConnectPendingResult = new SignOutNoConnectPendingResult(huaweiApiClient, CommonNaming.signout, new SignOutReq());
signOut.a(new SignOutOnCompleteListener(signOutNoConnectPendingResult));
int i2 = f + 69;
g = i2 % 128;
if (i2 % 2 == 0) {
return signOutNoConnectPendingResult;
}
throw null;
}
/* JADX INFO: Access modifiers changed from: protected */
/* loaded from: classes2.dex */
public static class SignOutNoConnectPendingResult extends PendingResultImpl<Status, SignOutResp> {
private ResultCallback a;
public SignOutNoConnectPendingResult(ApiClient apiClient, String str, IMessageEntity iMessageEntity) {
super(apiClient, str, iMessageEntity);
}
@Override // com.huawei.hms.support.api.PendingResultImpl
public Status onComplete(SignOutResp signOutResp) {
Status status = new Status(0);
as.b("HuaweiIdAuthAPIServiceImpl", "signOut onComplete", true);
return status;
}
@Override // com.huawei.hms.support.api.PendingResultImpl, com.huawei.hms.support.api.client.PendingResult
public void setResultCallback(ResultCallback<Status> resultCallback) {
this.a = resultCallback;
}
public ResultCallback getCallback() {
return this.a;
}
}
/* JADX INFO: Access modifiers changed from: protected */
/* loaded from: classes2.dex */
public static class SignOutOnCompleteListener implements QNe<Void> {
private final SignOutNoConnectPendingResult a;
public SignOutOnCompleteListener(SignOutNoConnectPendingResult signOutNoConnectPendingResult) {
this.a = signOutNoConnectPendingResult;
}
@Override // o.QNe
public void onComplete(HiE<Void> hiE) {
as.b("HuaweiIdAuthAPIServiceImpl", "SignOutOnCompleteListener onComplete", true);
if (this.a == null) {
as.d("HuaweiIdAuthAPIServiceImpl", "signOutResultPendingResult is null", true);
return;
}
Status status = Status.FAILURE;
if (hiE.b()) {
status = Status.SUCCESS;
} else {
Exception e = hiE.e();
if (e == null || !(e instanceof ApiException)) {
as.d("HuaweiIdAuthAPIServiceImpl", "wrong exception while failed", true);
} else {
status = new Status(((ApiException) e).getStatusCode());
}
}
ResultCallback callback = this.a.getCallback();
if (callback == null) {
as.d("HuaweiIdAuthAPIServiceImpl", "set Result callback after signOut completed", true);
} else {
callback.onResult(status);
}
}
}
protected static int conversionGender(String str) {
int i = 2 % 2;
int i2 = f + 89;
g = i2 % 128;
int i3 = i2 % 2;
if (TextUtils.isEmpty(str)) {
str = "-1";
}
try {
int parseInt = Integer.parseInt(str);
int i4 = f + 13;
g = i4 % 128;
int i5 = i4 % 2;
return parseInt;
} catch (NumberFormatException unused) {
return -1;
}
}
protected static int conversionHomeZone(String str) {
int i = 2 % 2;
int i2 = 0;
if (TextUtils.isEmpty(str)) {
int i3 = g + 1;
f = i3 % 128;
if (i3 % 2 == 0) {
Object[] objArr = new Object[1];
h((char) (13370 % (KeyEvent.getMaxKeyCode() >>> 14)), Color.rgb(1, 1, 1) + 566510587, new char[]{64344, 50243, 53024, 60225}, new char[]{54504}, new char[]{0, 0, 0, 0}, objArr);
str = ((String) objArr[0]).intern();
} else {
Object[] objArr2 = new Object[1];
h((char) ((KeyEvent.getMaxKeyCode() >> 16) + 16847), Color.rgb(0, 0, 0) + 566510587, new char[]{64344, 50243, 53024, 60225}, new char[]{54504}, new char[]{0, 0, 0, 0}, objArr2);
str = ((String) objArr2[0]).intern();
}
}
try {
i2 = Integer.parseInt(str);
} catch (NumberFormatException unused) {
}
int i4 = g + 123;
f = i4 % 128;
int i5 = i4 % 2;
return i2;
}
protected static int conversionStatus(String str) {
int i;
int i2 = 2 % 2;
if (TextUtils.isEmpty(str)) {
int i3 = f + 27;
g = i3 % 128;
if (i3 % 2 != 0) {
Object[] objArr = new Object[1];
h((char) (5633 << TextUtils.indexOf((CharSequence) "", 'j', 1)), 549733371 >>> (KeyEvent.getMaxKeyCode() >>> 9), new char[]{64344, 50243, 53024, 60225}, new char[]{54504}, new char[]{0, 0, 0, 0}, objArr);
str = ((String) objArr[0]).intern();
} else {
Object[] objArr2 = new Object[1];
h((char) (TextUtils.indexOf((CharSequence) "", '0', 0) + 16848), 549733371 - (KeyEvent.getMaxKeyCode() >> 16), new char[]{64344, 50243, 53024, 60225}, new char[]{54504}, new char[]{0, 0, 0, 0}, objArr2);
str = ((String) objArr2[0]).intern();
}
}
try {
i = Integer.parseInt(str);
} catch (NumberFormatException unused) {
i = 0;
}
int i4 = f + 57;
g = i4 % 128;
if (i4 % 2 != 0) {
int i5 = 74 / 0;
}
return i;
}
public static HashSet<Scope> conversionScopes(String str) {
int i = 2 % 2;
HashSet<Scope> hashSet = new HashSet<>();
if (str != null) {
String[] split = str.split(" ");
int length = split.length;
int i2 = f + 67;
g = i2 % 128;
int i3 = i2 % 2;
int i4 = 0;
while (i4 < length) {
hashSet.add(new Scope(split[i4]));
i4++;
int i5 = f + 15;
g = i5 % 128;
int i6 = i5 % 2;
}
}
return hashSet;
}
}