what-the-bank/sources/com/huawei/hms/hwid/n.java

77 lines
3.3 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.hwid;
import android.text.TextUtils;
import com.huawei.hms.common.ApiException;
import com.huawei.hms.common.ResolvableApiException;
import com.huawei.hms.common.internal.ResponseErrorCode;
import com.huawei.hms.common.internal.TaskApiCall;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.api.entity.core.CommonCode;
import com.huawei.hms.support.api.hwid.SignOutResult;
import o.nNj;
import org.json.JSONException;
/* loaded from: classes2.dex */
public class n extends TaskApiCall<c, Void> {
@Override // com.huawei.hms.common.internal.TaskApiCall
public int getApiLevel() {
return 1;
}
public n(String str, String str2, String str3) {
super(str, str2, str3);
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // com.huawei.hms.common.internal.TaskApiCall
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public void doExecute(c cVar, ResponseErrorCode responseErrorCode, String str, nNj<Void> nnj) {
if (responseErrorCode == null) {
as.b("[AccountSDK]AccountSignOutTaskApiCall", "response is null.", true);
nnj.c(new ApiException(new Status(2003, "response is null.")));
return;
}
a(responseErrorCode, str);
int errorCode = responseErrorCode.getErrorCode();
if (errorCode != 0 && CommonCode.Resolution.HAS_RESOLUTION.equals(responseErrorCode.getResolution())) {
as.b("[AccountSDK]AccountSignOutTaskApiCall", "apk version is low or is not exist.", true);
Status status = new Status(errorCode, responseErrorCode.getErrorReason());
ao.a(responseErrorCode, status);
nnj.c(new ResolvableApiException(status));
return;
}
if (!TextUtils.isEmpty(str)) {
if ("{}".equals(str)) {
as.b("[AccountSDK]AccountSignOutTaskApiCall", "SignOut complete, body is null", true);
nnj.c(new ApiException(new Status(errorCode, responseErrorCode.getErrorReason())));
return;
}
try {
SignOutResult fromJson = new SignOutResult().fromJson(str);
if (fromJson.isSuccess()) {
nnj.b(null);
return;
} else {
nnj.c(new ApiException(fromJson.getStatus()));
return;
}
} catch (JSONException e) {
StringBuilder sb = new StringBuilder("JSONException:");
sb.append(e.getClass().getSimpleName());
as.b("[AccountSDK]AccountSignOutTaskApiCall", sb.toString(), true);
nnj.c(new ApiException(new Status(errorCode, responseErrorCode.getErrorReason())));
return;
}
}
nnj.c(new ApiException(new Status(errorCode, responseErrorCode.getErrorReason())));
}
private void a(ResponseErrorCode responseErrorCode, String str) {
StringBuilder sb = new StringBuilder();
StringBuilder sb2 = new StringBuilder("headerErrorCode:");
sb2.append(responseErrorCode.getErrorCode());
sb.append(sb2.toString());
as.b("[AccountSDK]AccountSignOutTaskApiCall", sb.toString(), true);
}
}