正在查看: Hopscotch v9.7.2 应用的 NudgeActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Hopscotch v9.7.2 应用的 NudgeActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package in.hopscotch.android.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import com.facebook.react.bridge.ReadableMap;
import in.hopscotch.android.api.RetrofitApiBuilder;
import in.hopscotch.android.application.r;
import net.mischneider.MSREventBridgeModule;
public class NudgeActivity extends androidx.appcompat.app.i implements net.mischneider.a, r.a {
private static final String TAG = "NudgeActivity";
private in.hopscotch.android.databinding.u0 binding;
private String currentRoute;
private String fromLocation;
private String fromRedirect;
private String fromScreen;
private String initialRouteName;
private String moduleName;
private String previousRoute;
private String redirectType;
public static Intent R0(Context context, String str, Bundle bundle) {
Intent intent = new Intent(context, (Class<?>) NudgeActivity.class);
intent.putExtra("FROM_SCREEN", str);
intent.putExtra("from_location", "Nudge");
intent.putExtra("initialRouteName", !TextUtils.isEmpty(null) ? null : "LOGIN_WITH_OTP");
intent.putExtra("IS_POPUP_WINDOW", true);
intent.putExtra("userData", bundle);
intent.putExtra("INTENT_FLAG_SIGN_ACTION", TextUtils.isEmpty(null) ? "REDIRECT_LANDING" : null);
return intent;
}
@Override
public final void B() {
InputMethodManager inputMethodManager;
RetrofitApiBuilder.getInstance().cancelAllRequests();
View currentFocus = getCurrentFocus();
if (currentFocus != null && (inputMethodManager = (InputMethodManager) getSystemService("input_method")) != null) {
inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 2);
}
if (isTaskRoot()) {
startActivity(in.hopscotch.android.application.a0.a(this));
} else {
in.hopscotch.android.application.a0.f(this, getIntent());
}
finish();
}
public final void d(String str, ReadableMap readableMap, MSREventBridgeModule.b.a aVar) {
Log.e(TAG, "onEventCallback: " + str);
}
public final void onCreate(Bundle bundle) {
super/*androidx.fragment.app.n*/.onCreate(bundle);
in.hopscotch.android.util.e0.b().h();
LayoutInflater layoutInflater = getLayoutInflater();
int i = in.hopscotch.android.databinding.u0.e;
in.hopscotch.android.databinding.u0 u0Var = (in.hopscotch.android.databinding.u0) androidx.databinding.p.M(layoutInflater, 2131558475, (ViewGroup) null, false, androidx.databinding.g.e());
this.binding = u0Var;
setContentView(u0Var.E());
in.hopscotch.android.application.r.b().h(this);
this.binding.d.setEventBridgeEventReceiver(this);
this.fromScreen = getIntent().getStringExtra("FROM_SCREEN");
this.fromLocation = getIntent().getStringExtra("from_location");
String stringExtra = getIntent().getStringExtra("initialRouteName");
this.initialRouteName = stringExtra;
this.currentRoute = stringExtra;
this.previousRoute = null;
Bundle bundle2 = new Bundle();
bundle2.putString("initialRouteName", this.initialRouteName);
this.redirectType = getIntent().getStringExtra("INTENT_FLAG_SIGN_ACTION");
this.fromRedirect = getIntent().getStringExtra("fromRedirect");
Bundle bundleExtra = getIntent().getBundleExtra("userData");
if (bundleExtra == null) {
bundleExtra = new Bundle();
}
if (!TextUtils.isEmpty(this.redirectType)) {
bundleExtra.putString("loginRedirectType", this.redirectType);
}
this.moduleName = "HSCustomer";
boolean z = bundleExtra.getBoolean("nudgeData");
in.hopscotch.android.domain.response.base.d serializable = bundleExtra.getSerializable("nudgeDetails");
Bundle bundle3 = new Bundle();
bundle3.putBoolean("nudgeData", z);
bundle2.putBundle("userData", bundle3);
if (z && serializable != null) {
this.moduleName = "HSNudge";
bundle2.putSerializable("nudgeData", in.hopscotch.android.common.util.d.b().a().h(serializable));
}
this.binding.d.startReactApplication(in.hopscotch.android.application.r.b().c(), this.moduleName, bundle2);
}
public final void onDestroy() {
in.hopscotch.android.application.r.b().h(null);
in.hopscotch.android.application.r.b().e(this);
this.binding.d.unmountReactApplication();
super.onDestroy();
}
public final void onPause() {
in.hopscotch.android.application.r.b().f(this);
super/*androidx.fragment.app.n*/.onPause();
}
public final void onResume() {
in.hopscotch.android.application.r.b().g(this);
super/*androidx.fragment.app.n*/.onResume();
}
public final void r0(ReadableMap readableMap, String str) {
if (str.equalsIgnoreCase("nudgeModuleLoaded")) {
return;
}
if (str.equalsIgnoreCase("exitNudgeModule")) {
B();
return;
}
if (str.equalsIgnoreCase("nudgeAction") && readableMap != null && readableMap.hasKey("actionTarget")) {
String string = readableMap.getString("actionTarget");
if (TextUtils.isEmpty(string)) {
return;
}
startActivity(in.hopscotch.android.util.s0.a(this, string, this.moduleName, (String) null, (String) null, this.fromScreen, this.fromLocation, (Bundle) null));
finish();
}
}
}