正在查看: Oolka v2.4.42 应用的 UpswingSdkModule.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Oolka v2.4.42 应用的 UpswingSdkModule.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.oolka.com;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import one.upswing.sdk.CustomerInitiationResponse;
import one.upswing.sdk.FailureCustomerInitiationResponse;
import one.upswing.sdk.SuccessCustomerInitiationResponse;
import one.upswing.sdk.UpswingSdk;
import one.upswing.sdk.UpswingSdkKt;
import one.upswing.sdk.partner.UpswingTheme;
import org.jetbrains.annotations.NotNull;
@Metadata
@SourceDebugExtension({"SMAP\nUpswingSdkModule.kt\nKotlin\n*S Kotlin\n*F\n+ 1 UpswingSdkModule.kt\napp/oolka/com/UpswingSdkModule\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,71:1\n1#2:72\n*E\n"})
public final class UpswingSdkModule extends ReactContextBaseJavaModule {
public UpswingSdkModule(@NotNull ReactApplicationContext reactApplicationContext) {
super(reactApplicationContext);
Intrinsics.checkNotNullParameter(reactApplicationContext, "reactContext");
}
private final UpswingSdk getUpswingSDK() {
Activity currentActivity = getCurrentActivity();
if (currentActivity == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
Intrinsics.checkNotNullExpressionValue(currentActivity, "requireNotNull(...)");
DeviceEventManagerModule.RCTDeviceEventEmitter jSModule = getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
Intrinsics.checkNotNullExpressionValue(jSModule, "getJSModule(...)");
UpswingSdk.Builder builder = new UpswingSdk.Builder(currentActivity, "OLKA", new b(jSModule));
Activity currentActivity2 = getCurrentActivity();
if (currentActivity2 != null) {
return builder.setStatusBarColor(androidx.core.content.b.c(currentActivity2, d.a)).setUIMode(UpswingTheme.SYSTEM).build();
}
throw new IllegalArgumentException("Required value was null.".toString());
}
@NotNull
public String getName() {
return "UpswingSdkModule";
}
@ReactMethod
public final void invokeUpswing() {
UpswingSdk upswingSDK = getUpswingSDK();
Uri parse = Uri.parse("https://upswing.access.partner/OLKA?action=webview&redirect=launch/ul");
Intrinsics.checkNotNullExpressionValue(parse, "parse(...)");
upswingSDK.initializeSdkViaDeepLink(parse);
}
@ReactMethod
public final void invokeUpswingViaDeeplink(@NotNull String str) {
Intrinsics.checkNotNullParameter(str, "route");
StringBuilder sb = new StringBuilder();
sb.append("success called with route: ");
sb.append(str);
UpswingSdk upswingSDK = getUpswingSDK();
Uri parse = Uri.parse("https://upswing.access.partner/OLKA?action=webview&redirect=" + str);
Intrinsics.checkNotNullExpressionValue(parse, "parse(...)");
upswingSDK.initializeSdkViaDeepLink(parse);
}
@ReactMethod
public final void upswingFailure() {
Function1<CustomerInitiationResponse, Unit> c = a.b.a().c();
if (c != null) {
c.invoke(FailureCustomerInitiationResponse.INSTANCE);
}
}
@ReactMethod
public final void upswingLogout() {
Context applicationContext;
Activity currentActivity = getCurrentActivity();
if (currentActivity == null || (applicationContext = currentActivity.getApplicationContext()) == null) {
return;
}
UpswingSdkKt.upswingSdkLogout(applicationContext);
}
@ReactMethod
public final void upswingSuccess(@NotNull String str, @NotNull String str2) {
Intrinsics.checkNotNullParameter(str, "ici");
Intrinsics.checkNotNullParameter(str2, "gst");
Function1<CustomerInitiationResponse, Unit> c = a.b.a().c();
if (c != null) {
c.invoke(new SuccessCustomerInitiationResponse(str, str2));
}
}
}