正在查看: Vi App v10.18.0 应用的 AmazonPayManager.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Vi App v10.18.0 应用的 AmazonPayManager.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.amazon.apay.hardened.external;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import androidx.browser.customtabs.CustomTabsIntent;
import com.amazon.apay.hardened.activity.APayBrowserActivity;
import com.amazon.apay.hardened.external.model.APayCallback;
import com.amazon.apay.hardened.external.model.APayError;
import com.amazon.apay.hardened.external.model.APayRequestContext;
import com.amazon.apay.hardened.util.ValidationUtil;
import com.amazon.apay.instrumentation.logger.CrashEventsLogger;
import com.amazon.apay.instrumentation.logger.KuberMetricEventsLogger;
import com.amazon.apay.instrumentation.model.ClientSdkData;
import com.amazon.identity.auth.device.AuthError;
import com.amazon.identity.auth.device.api.Listener;
import com.amazon.identity.auth.device.api.authorization.AuthorizationManager;
import com.amazon.identity.auth.device.authorization.AuthorizationResponseParser;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import timber.log.Timber;
public final class AmazonPayManager {
public static CustomTabsIntent customTabsIntent;
public static class a implements Listener<Void, AuthError> {
public final APayCallback a;
public a(APayCallback aPayCallback) {
this.a = aPayCallback;
}
@Override
public void onError(AuthError authError) {
AuthError authError2 = authError;
com.amazon.apay.hardened.manager.b.a("SignOutError", "KUBER_HARDENED_SDK.SIGN_OUT_OPERATION", String.valueOf(authError2.getType()), authError2.getMessage() != null ? authError2.getMessage() : "null");
this.a.onError(new APayError(APayError.ErrorType.AUTH_ERROR, "SIGN_OUT_FAILED", authError2.getMessage(), authError2));
}
@Override
public void onSuccess(Void r2) {
com.amazon.apay.hardened.manager.b.a("SignOutSuccess", "KUBER_HARDENED_SDK.SIGN_OUT_OPERATION");
this.a.onSuccess();
}
}
public static class b extends Timber.Tree {
public void log(int i, @Nullable String str, @NotNull String str2, @Nullable Throwable th) {
}
}
public static void a(APayRequestContext aPayRequestContext, com.amazon.apay.hardened.constant.a aVar) {
Timber.plant(new b());
Timber.d("AmazonPayManager:init invoked: %s", new Object[]{aVar});
Context context = aPayRequestContext.getContext();
String clientId = aPayRequestContext.getClientId();
Timber.d("in InstrumentationManager init", new Object[0]);
ClientSdkData clientSdkData = new ClientSdkData("f6feefbb-ec15-40fc-a95d-920d767d36f0", context.getApplicationContext(), "KUBER_HARDENED_SDK", "H.1.1.13", String.format("{\"MerchantID\":\"%s\"}", clientId));
com.amazon.apay.hardened.manager.b.a = KuberMetricEventsLogger.INSTANCE.getInstance(clientSdkData);
com.amazon.apay.hardened.manager.b.b = CrashEventsLogger.INSTANCE.getInstance(clientSdkData);
com.amazon.apay.hardened.manager.b.a("MetricsInit", "KUBER_HARDENED_SDK.BUSINESS_METRICS");
Context context2 = aPayRequestContext.getContext();
ValidationUtil.a(context2, "Context");
if (!(context2 instanceof Activity)) {
throw new IllegalArgumentException("Do not pass ApplicationContext. Pass activity context instead.");
}
customTabsIntent = aPayRequestContext.getCustomTabsIntent();
}
public static void authorize(APayRequestContext aPayRequestContext, String str) {
com.amazon.apay.hardened.constant.a aVar = com.amazon.apay.hardened.constant.a.AUTHORIZE;
a(aPayRequestContext, aVar);
Object[] objArr = new Object[2];
objArr[0] = String.valueOf(aPayRequestContext.getCustomTabsIntent() != null);
objArr[1] = String.valueOf(aPayRequestContext.getCancelIntent() != null);
Timber.i("authorize called. Custom tab intent supplied: %s , cancel Intent supplied = %s", objArr);
com.amazon.apay.hardened.manager.b.a("AuthorizeCalled", "KUBER_HARDENED_SDK.AUTH_OPERATION");
ValidationUtil.a(aPayRequestContext.getCompletionIntent(), "Completion Intent");
ValidationUtil.a(str, "Code Challenge");
Intent intent = new Intent(aPayRequestContext.getContext(), (Class<?>) APayBrowserActivity.class);
intent.putExtra("codeChallenge", str);
intent.putExtra("operation", aVar);
intent.putExtra(AuthorizationResponseParser.CLIENT_ID_STATE, aPayRequestContext.getClientId());
intent.putExtra("COMPLETION_INTENT", aPayRequestContext.getCompletionIntent());
intent.putExtra("CANCEL_INTENT", aPayRequestContext.getCancelIntent());
aPayRequestContext.getContext().startActivity(intent);
}
public static void charge(APayRequestContext aPayRequestContext, String str) {
com.amazon.apay.hardened.constant.a aVar = com.amazon.apay.hardened.constant.a.CHARGE;
a(aPayRequestContext, aVar);
Object[] objArr = new Object[2];
objArr[0] = str;
objArr[1] = String.valueOf(customTabsIntent != null);
Timber.i("charge called with payUrl %s. Custom tab intent supplied: %s", objArr);
com.amazon.apay.hardened.manager.b.a("ChargeCalled", "KUBER_HARDENED_SDK.CHARGE_OPERATION");
ValidationUtil.a(str);
ValidationUtil.a(aPayRequestContext.getCompletionIntent(), "CompletionIntent");
Intent intent = new Intent(aPayRequestContext.getContext(), (Class<?>) APayBrowserActivity.class);
intent.putExtra("PAY_URL", str);
intent.putExtra("operation", aVar);
intent.putExtra(AuthorizationResponseParser.CLIENT_ID_STATE, aPayRequestContext.getClientId());
intent.putExtra("COMPLETION_INTENT", aPayRequestContext.getCompletionIntent());
intent.putExtra("CANCEL_INTENT", aPayRequestContext.getCancelIntent());
aPayRequestContext.getContext().startActivity(intent);
}
public static Intent getAuthorizationIntent(APayRequestContext aPayRequestContext, String str) {
com.amazon.apay.hardened.constant.a aVar = com.amazon.apay.hardened.constant.a.GET_AUTHORIZATION_INTENT;
a(aPayRequestContext, aVar);
Object[] objArr = new Object[1];
objArr[0] = String.valueOf(customTabsIntent != null);
Timber.i("getAuthorizationIntent called. Custom tab intent supplied: %s", objArr);
com.amazon.apay.hardened.manager.b.a("GetAuthIntentCalled", "KUBER_HARDENED_SDK.AUTH_OPERATION");
ValidationUtil.a(str, "Code Challenge");
Intent intent = new Intent(aPayRequestContext.getContext(), (Class<?>) APayBrowserActivity.class);
intent.putExtra("codeChallenge", str);
intent.putExtra("operation", aVar);
intent.putExtra(AuthorizationResponseParser.CLIENT_ID_STATE, aPayRequestContext.getClientId());
return intent;
}
public static Intent getChargeIntent(APayRequestContext aPayRequestContext, String str) {
com.amazon.apay.hardened.constant.a aVar = com.amazon.apay.hardened.constant.a.GET_CHARGE_INTENT;
a(aPayRequestContext, aVar);
Object[] objArr = new Object[2];
objArr[0] = str;
objArr[1] = String.valueOf(customTabsIntent != null);
Timber.i("getChargeIntent called with payUrl %s. Custom tab intent supplied: %s", objArr);
com.amazon.apay.hardened.manager.b.a("ChargeIntentCalled", "KUBER_HARDENED_SDK.CHARGE_OPERATION");
ValidationUtil.a(str);
Intent intent = new Intent(aPayRequestContext.getContext(), (Class<?>) APayBrowserActivity.class);
intent.putExtra("PAY_URL", str);
intent.putExtra("operation", aVar);
intent.putExtra(AuthorizationResponseParser.CLIENT_ID_STATE, aPayRequestContext.getClientId());
return intent;
}
public static void signOut(APayRequestContext aPayRequestContext, APayCallback aPayCallback) {
a(aPayRequestContext, com.amazon.apay.hardened.constant.a.SIGN_OUT);
Timber.i("AmazonPayManager:signOut invoked", new Object[0]);
com.amazon.apay.hardened.manager.b.a("SignOutCalled", "KUBER_HARDENED_SDK.SIGN_OUT_OPERATION");
ValidationUtil.a(aPayCallback, "APayCallback");
AuthorizationManager.signOut(aPayRequestContext.getContext(), new a(aPayCallback));
}
}