同程有借 v1.0.0版本的 MD5 值为:e33397cdbab33543d0c134ec96d77fb8
以下内容为反编译后的 AppMainForInnHome.java 源代码,内容仅作参考
package com.ly.fn.ins.android.base.app;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bonree.sdk.agent.engine.external.AppStateInfo;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.ly.fn.ins.android.AppSettings;
import com.ly.fn.ins.android.base.app.InnActivityLifecycle;
import com.ly.fn.ins.android.bridge.TcWalletPlugin;
import com.ly.fn.ins.android.utils.ClipboardUtil;
import com.ly.fn.ins.android.utils.RequestSignCache;
import com.ly.fn.ins.android.utils.SensorsTrack;
import com.ly.fn.ins.android.utils.WebviewLaunchUtils;
import com.ly.fn.ins.android.utils.XuexinNotifyManager;
import com.ly.fn.ins.android.utils.loc.AMapLocationManager;
import com.ly.fn.ins.android.views.LottieJumpRefreshHeader;
import com.ly.fn.ins.android.views.LottieRefreshFooter;
import com.ly.tcloan.R;
import com.moture.lib.core.app.AppActivities;
import com.moture.lib.core.app.AppMain;
import com.moture.lib.core.app.AppUtil;
import com.moture.lib.core.misc.helper.SharedPreferencesHelper;
import com.moture.lib.core.misc.json.JsonHelper;
import com.moture.lib.core.misc.logger.AndroidLogAdapter;
import com.moture.lib.core.misc.logger.FormatStrategy;
import com.moture.lib.core.misc.logger.LogLevelType;
import com.moture.lib.core.misc.logger.LogModuleConfig;
import com.moture.lib.core.misc.logger.LogRemoteConfig;
import com.moture.lib.core.misc.logger.Logger;
import com.moture.lib.core.utils.FontUtil;
import com.moture.lib.router.URLBridge;
import com.moture.lib.router.anno.RouterConfig;
import com.moture.lib.upgrade.service.AppUpgradeDownloadService;
import com.moture.plugin.core.BridgeUtil;
import com.moture.plugin.core.BridgeWebView;
import com.moture.plugin.core.ConstantPluginName;
import com.moture.plugin.face.FaceJavascriptInterface;
import com.moture.plugin.http.utils.CryptoStateHelper;
import com.moture.plugin.idcard.IdCardJavascriptInterface;
import com.moture.plugin.share.ShareJavascriptInterface;
import com.moture.plugin.share.share.util.WeiXinSnsHelper;
import com.moture.plugin.utils.OnBackgroundListener;
import com.moture.plugin.utils.response.SystemInfoExtend;
import com.moture.plugin.web.activity.WebviewActivity;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.umeng.analytics.MobclickAgent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import okhttp3.t;
import org.json.JSONObject;
@RouterConfig(scheme = "tcloan", xmlName = "tcloan")
public class AppMainForInnHome extends AppMain {
private static long f10419f;
public static int f10420g;
private InnActivityLifecycle f10421a = new InnActivityLifecycle();
private final Handler f10422b = new Handler(Looper.getMainLooper());
private int f10423c = com.ly.fn.ins.android.base.push.c.f10445a;
private LogRemoteConfig f10424d = null;
private final Runnable f10425e = new e();
class a implements d6.b {
a() {
}
@Override
public b6.c a(Context context, b6.f fVar) {
return new LottieRefreshFooter(context).setDrawableSizePx(AppUtil.getDimensionPixelSize(R.dimen.dp_15));
}
}
public class b extends com.moture.lib.analytics.f {
b(FormatStrategy formatStrategy) {
super(formatStrategy);
}
@Override
public boolean isLoggable(int i9, @Nullable String str) {
AppMainForInnHome appMainForInnHome = AppMainForInnHome.this;
return i9 >= appMainForInnHome.j(str, appMainForInnHome.f10424d);
}
}
public class c extends d3.b<LogRemoteConfig> {
c() {
}
@Override
public void onSuccess(LogRemoteConfig logRemoteConfig) {
super.onSuccess(logRemoteConfig);
AppMainForInnHome.this.f10424d = logRemoteConfig;
}
}
public class d implements InnActivityLifecycle.a {
d() {
}
@Override
public void a(Activity activity) {
SensorsTrack.backgroundSwitch(activity);
AppMainForInnHome.f10420g++;
if (SharedPreferencesHelper.getInstance().getBoolean(SystemInfoExtend.SP_PRIVACY_CHECK_AGREE, false).booleanValue()) {
AppMainForInnHome.this.f10422b.postDelayed(AppMainForInnHome.this.f10425e, 1000L);
}
}
@Override
public void b(Activity activity) {
AppMainForInnHome.this.f10422b.removeCallbacks(AppMainForInnHome.this.f10425e);
if (activity instanceof OnBackgroundListener) {
((OnBackgroundListener) activity).onBackground();
}
}
}
class e implements Runnable {
e() {
}
@Override
public void run() {
try {
Activity firstActivity = AppActivities.getFirstActivity();
if (firstActivity == null) {
return;
}
String walletJumpUrlData = ClipboardUtil.getWalletJumpUrlData(firstActivity);
if (AppMainForInnHome.this.f10423c == com.ly.fn.ins.android.base.push.c.f10445a && !TextUtils.isEmpty(walletJumpUrlData)) {
WebviewLaunchUtils.launchJFWebviewActivity(firstActivity, walletJumpUrlData);
}
AppMainForInnHome.this.f10423c = com.ly.fn.ins.android.base.push.c.f10445a;
} catch (Exception e9) {
e9.printStackTrace();
}
}
}
public class f implements y4.b {
f(AppMainForInnHome appMainForInnHome) {
}
@Override
public String a() {
return y4.a.a(this);
}
@Override
public String b() {
return y4.a.b(this);
}
@Override
public String c() {
return d3.c.f17726b;
}
@Override
@NonNull
public String d() {
return d3.c.f17725a;
}
@Override
public Map<String, String> e() {
HashMap hashMap = new HashMap();
hashMap.put(d3.c.f17729e, d3.c.f17730f);
String str = d3.c.f17731g;
hashMap.put(str, "android App@Tcloan/" + AppUtil.appVersionName());
return hashMap;
}
@Override
public String f() {
return CryptoStateHelper.getCryptoState() ? AppSettings.KEY_SEC_ID : "";
}
@Override
@NonNull
public String getToken() {
return com.ly.fn.ins.android.base.app.c.e().h();
}
}
public class g implements y4.f {
g(AppMainForInnHome appMainForInnHome) {
}
@Override
public void a(String str, String str2, String str3, String str4, String str5) {
try {
HashMap hashMap = new HashMap();
hashMap.put("urlPath", str2);
JsonElement parseString = JsonParser.parseString(str3);
if (parseString != null && !parseString.isJsonPrimitive() && !parseString.isJsonNull()) {
hashMap.put("bodyStr", JsonParser.parseString(str3).getAsJsonObject());
hashMap.put("timeStamp", str4);
RequestSignCache.getInstance().putSignInfo(str, JsonHelper.getInstance().toJson(hashMap), str5);
}
hashMap.put("bodyStr", str3);
hashMap.put("timeStamp", str4);
RequestSignCache.getInstance().putSignInfo(str, JsonHelper.getInstance().toJson(hashMap), str5);
} catch (Exception e9) {
e9.printStackTrace();
}
}
}
public class h implements y4.d {
h(AppMainForInnHome appMainForInnHome) {
}
@Override
public t a() {
return y4.c.a(this);
}
@Override
public List b() {
return y4.c.b(this);
}
@Override
public List<t> c() {
ArrayList arrayList = new ArrayList();
arrayList.add(new i3.a());
arrayList.add(new i3.b());
return arrayList;
}
@Override
public List<t> d() {
ArrayList arrayList = new ArrayList();
arrayList.add(new i3.c());
arrayList.add(new i3.d());
return arrayList;
}
}
class i implements d6.c {
i() {
}
@Override
public b6.d a(Context context, b6.f fVar) {
return new LottieJumpRefreshHeader(context);
}
}
static {
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new i());
SmartRefreshLayout.setDefaultRefreshFooterCreator(new a());
WebviewActivity.registerModulePlugin(TcWalletPlugin.class, "tcloan");
WebviewActivity.registerModulePlugin(ShareJavascriptInterface.class, ConstantPluginName.SharePluginName);
WebviewActivity.registerModulePlugin(FaceJavascriptInterface.class, ConstantPluginName.FacePluginName);
WebviewActivity.registerModulePlugin(IdCardJavascriptInterface.class, ConstantPluginName.IdCardPluginName);
}
public static void appExit() {
AMapLocationManager.onDestroy();
MobclickAgent.onKillProcess(AppMain.getApp());
if (AppUpgradeDownloadService.o()) {
AppMain.appFinish();
} else {
AppMain.appExit();
}
}
private static void h() {
f10419f = System.currentTimeMillis();
}
public static void i() {
System.currentTimeMillis();
f10419f = 0L;
}
public int j(String str, LogRemoteConfig logRemoteConfig) {
if (logRemoteConfig == null) {
return 6;
}
int levelStrToInt = LogLevelType.levelStrToInt(logRemoteConfig.defaultLevel);
List<LogModuleConfig> list = logRemoteConfig.modules;
if (list == null || list.isEmpty()) {
return levelStrToInt;
}
for (LogModuleConfig logModuleConfig : list) {
if (str.equalsIgnoreCase(logModuleConfig.moduleContext)) {
return LogLevelType.levelStrToInt(logModuleConfig.level);
}
}
return levelStrToInt;
}
private void k() {
l();
n();
o();
AppUtil.setDebug(false);
FontUtil.initFont();
URLBridge.init(AppMain.getApp(), getClass());
URLBridge.withUrl(com.ly.fn.ins.android.i.f11432a).bridge(AppMain.getApp());
this.f10421a.addBackgroundListener(new d());
}
private void l() {
t4.a.g(e3.a.f17850a);
t4.a.i(AppSettings.KEY_ENCRYPT);
t4.a.j(new f(this));
t4.a.l(new g(this));
t4.a.k(new h(this));
t4.a.h(z4.f.c());
t4.a.a();
}
private void m() {
Logger.addLogAdapter(new AndroidLogAdapter());
Logger.addLogAdapter(new b(com.moture.lib.analytics.g.b(this).b(!TextUtils.equals(e3.a.f17850a, "https://apiwallet.lyfintech.com") ? "http://datacollect.qa.tcashfree.cn/route" : "http://datacollect.tcashfree.cn/route").c(false, AppSettings.KEY_SEC_ID).e(false, d3.c.f17726b, com.ly.fn.ins.android.base.app.c.e().h()).d(15000).a()));
w2.c cVar = new w2.c();
com.ly.fn.ins.android.base.app.d g9 = com.ly.fn.ins.android.base.app.c.e().g();
if (g9 != null && !TextUtils.isEmpty(g9.memberId)) {
cVar.memeberId = g9.memberId;
}
com.moture.lib.net.a.d(((d3.a) com.moture.lib.net.a.a(d3.a.class)).z(cVar), new c());
}
private void n() {
try {
SharedPreferencesHelper.getInstance().putBoolean(BridgeWebView.WEBVIEW_DEBUG_ABLE, false);
JSONObject jSONObject = new JSONObject(BridgeUtil.assetFile2Str(this, "webview.json"));
if (jSONObject.has(BridgeWebView.WEBVIEW_USER_AGENT)) {
SharedPreferencesHelper.getInstance().putString(BridgeWebView.WEBVIEW_USER_AGENT, jSONObject.getString(BridgeWebView.WEBVIEW_USER_AGENT));
}
if (jSONObject.has(WebviewActivity.APP_URL_SCHEME_KEY)) {
SharedPreferencesHelper.getInstance().putString(WebviewActivity.APP_URL_SCHEME_KEY, jSONObject.getString(WebviewActivity.APP_URL_SCHEME_KEY));
}
if (jSONObject.has(WeiXinSnsHelper.WEIXIN_APP_ID)) {
SharedPreferencesHelper.getInstance().putString(WeiXinSnsHelper.WEIXIN_APP_ID, jSONObject.getString(WeiXinSnsHelper.WEIXIN_APP_ID));
}
} catch (Exception e9) {
e9.printStackTrace();
}
}
private void o() {
com.ly.fn.ins.android.base.app.a.a();
}
@Override
public void attachBaseContext(Context context) {
AppStateInfo.attachBaseContextBegin(this, context);
super.attachBaseContext(context);
AppStateInfo.attachBaseContextEnd();
}
@Override
public void initDeviceInfo() {
}
@Override
public void initLogAdapter() {
}
@Override
public void onCreate() {
AppStateInfo.onCreateAppBegin(getClass().getName());
super.onCreate();
registerActivityLifecycleCallbacks(this.f10421a);
registerActivityLifecycleCallbacks(new XuexinNotifyManager());
k();
try {
m();
} catch (Exception e9) {
e9.printStackTrace();
}
AppStateInfo.onCreateAppEnd(getClass().getName());
}
@Override
public void onTrimMemory(int i9) {
super.onTrimMemory(i9);
if (i9 == 20) {
h();
}
}
}