千寻位置 v2.8.9版本的 MD5 值为:c028423c956e81d2a162977350c0ec2e
以下内容为反编译后的 AppDebugInitKt.java 源代码,内容仅作参考
package com.qx.wz.qxwz.biz.init;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.StrictMode;
import android.util.Log;
import android.widget.Toast;
import com.google.android.exoplayer2.text.ttml.TtmlNode;
import com.qx.wz.buildinfo.BuildUtil;
import com.qx.wz.logger.AndroidLogAdapter;
import com.qx.wz.logger.DiskLogAdapter;
import com.qx.wz.logger.LogCacheAdapter;
import com.qx.wz.logger.LogStrategy;
import com.qx.wz.logger.Logger;
import com.qx.wz.logger.LoggerPrinter;
import com.qx.wz.logger.PrettyFormatStrategy;
import com.qx.wz.qxwz.BuildConfig;
import com.qx.wz.qxwz.QxwzApp;
import com.qx.wz.utils.SharedKey;
import com.qx.wz.utils.SharedUtil;
import com.qx.wz.utils.Static;
import com.qx.wz.utils.appconfig.HelperConfig;
import com.qx.wz.utils.appconfig.HelperConfigKt;
import com.qx.wz.utils.appconfig.UrlPolicyRpc;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(bv = {1, 0, 3}, d1 = {"\u00006\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007\u001a\u0006\u0010\b\u001a\u00020\t\u001a\u0006\u0010\n\u001a\u00020\t\u001a\b\u0010\u000b\u001a\u0004\u0018\u00010\u0007\u001a \u0010\f\u001a\u00020\t2\u0006\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u0010H\u0002\u001a\u0018\u0010\u0012\u001a\u00020\t2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0013\u001a\u00020\u0010H\u0002\u001a\b\u0010\u0014\u001a\u0004\u0018\u00010\u0007\u001a\b\u0010\u0015\u001a\u00020\tH\u0002\u001a\b\u0010\u0016\u001a\u00020\u0017H\u0002\u001a\u0006\u0010\u0018\u001a\u00020\u0017\u001a\u0018\u0010\u0019\u001a\u00020\t2\u0006\u0010\r\u001a\u00020\u000e2\b\u0010\u001a\u001a\u0004\u0018\u00010\u001b\u001a\b\u0010\u001c\u001a\u00020\tH\u0002\"\u001c\u0010\u0000\u001a\u0004\u0018\u00010\u0001X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0002\u0010\u0003\"\u0004\b\u0004\u0010\u0005¨\u0006\u001d"}, d2 = {"debugConfig", "Lcom/qx/wz/utils/appconfig/HelperConfig;", "getDebugConfig", "()Lcom/qx/wz/utils/appconfig/HelperConfig;", "setDebugConfig", "(Lcom/qx/wz/utils/appconfig/HelperConfig;)V", "debugCheck", "Lcom/qx/wz/utils/appconfig/UrlPolicyRpc;", "enableStrictMode", "", "getConfig", "getUrlPolicy", "handlerBody", "context", "Landroid/content/Context;", "key", "", TtmlNode.TAG_BODY, "handlerUrl", "url", "initLab", "initLogger", "isDebug", "", "isRemoteDeveloper", "recieveAppConfig", "intent", "Landroid/content/Intent;", "showBuildInfo", "app_qxwzRelease"}, k = 2, mv = {1, 1, 13})
public final class AppDebugInitKt {
@Nullable
private static HelperConfig debugConfig;
private static final void handlerUrl(String str, String str2) {
}
private static final void showBuildInfo() {
if (Static.DEBUG) {
BuildUtil.printBuidInfos();
}
}
private static final void initLogger() {
Logger.clearLogAdapters();
if (Static.DEBUG) {
Logger.printer(new LoggerPrinter() {
@Override
public boolean isDebug() {
return Static.DEBUG;
}
});
PrettyFormatStrategy build = PrettyFormatStrategy.newBuilder().logStrategy(new LogStrategy() {
private int index;
private final String[] prefix = {". ", " ."};
@Override
public void log(int priority, @NotNull String tag, @NotNull String message) {
Intrinsics.checkParameterIsNotNull(tag, "tag");
Intrinsics.checkParameterIsNotNull(message, "message");
this.index ^= 1;
Log.println(priority, this.prefix[this.index] + tag, message);
}
}).showThreadInfo(false).methodCount(1).methodOffset(0).build();
Intrinsics.checkExpressionValueIsNotNull(build, "PrettyFormatStrategy.new…gCat\n .build()");
Logger.addLogAdapter(new AndroidLogAdapter(build));
Logger.addLogAdapter(new DiskLogAdapter("QXWZ-APP"));
Logger.addLogAdapter(new LogCacheAdapter("QXWZ-APP"));
}
}
@Nullable
public static final UrlPolicyRpc initLab() {
if (debugConfig != null) {
return getUrlPolicy();
}
return null;
}
public static final void enableStrictMode() {
if (Static.DEBUG) {
"pro".equals(QxwzApp.instance.env);
if (Build.VERSION.SDK_INT >= 23) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().detectCustomSlowCalls().detectResourceMismatches().penaltyLog().penaltyDropBox().build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectActivityLeaks().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().detectLeakedRegistrationObjects().penaltyLog().build());
}
}
}
public static final void recieveAppConfig(@NotNull Context context, @Nullable Intent intent) {
Intrinsics.checkParameterIsNotNull(context, "context");
if (intent != null) {
String stringExtra = intent.getStringExtra("key");
String stringExtra2 = intent.getStringExtra(TtmlNode.TAG_BODY);
String stringExtra3 = intent.getStringExtra("url");
String str = stringExtra;
if (str == null || str.length() == 0) {
return;
}
String str2 = stringExtra2;
if (!(str2 == null || str2.length() == 0)) {
handlerBody(context, stringExtra, stringExtra2);
return;
}
String str3 = stringExtra3;
if (str3 == null || str3.length() == 0) {
return;
}
handlerUrl(stringExtra, stringExtra3);
}
}
private static final void handlerBody(Context context, String str, String str2) {
SharedUtil.setPreferStr(HelperConfigKt.getCONFGI_KEY(), str);
SharedUtil.setPreferStr(HelperConfigKt.getCONFGI_BODY(), str2);
debugCheck();
}
@Nullable
public static final UrlPolicyRpc debugCheck() {
getConfig();
UrlPolicyRpc initLab = initLab();
if (initLab != null) {
HttpInitKt.initEnv(initLab);
String str = QxwzApp.instance.channel;
Intrinsics.checkExpressionValueIsNotNull(str, "QxwzApp.instance.channel");
QxwzApp qxwzApp = QxwzApp.instance;
Intrinsics.checkExpressionValueIsNotNull(qxwzApp, "QxwzApp.instance");
HttpInitKt.initHttpRequest(initLab, str, qxwzApp);
} else {
initLab = null;
}
Static.DEBUG = isDebug();
initLogger();
showBuildInfo();
return initLab;
}
@Nullable
public static final HelperConfig getDebugConfig() {
return debugConfig;
}
public static final void setDebugConfig(@Nullable HelperConfig helperConfig) {
debugConfig = helperConfig;
}
public static final void getConfig() {
boolean z;
boolean z2;
HelperConfig dencryptConfig;
try {
String preferStr = SharedUtil.getPreferStr(HelperConfigKt.getCONFGI_KEY());
String preferStr2 = SharedUtil.getPreferStr(HelperConfigKt.getCONFGI_BODY());
String str = preferStr;
if (str != null && str.length() != 0) {
z = false;
if (z) {
String str2 = preferStr2;
if (str2 != null && str2.length() != 0) {
z2 = false;
if (!z2 || (dencryptConfig = HelperConfigKt.getDencryptConfig(preferStr, preferStr2)) == null) {
return;
}
if (!(dencryptConfig.getValidTime() > System.currentTimeMillis())) {
dencryptConfig = null;
}
if (dencryptConfig != null) {
SharedUtil.setPreferBool(SharedKey.URL_LAB_AIR_OPEN, dencryptConfig.isDailyAir() ? false : true);
debugConfig = dencryptConfig;
HelperConfig helperConfig = HelperConfigKt.getHelperConfig();
HelperConfig helperConfig2 = debugConfig;
if (helperConfig2 == null) {
Intrinsics.throwNpe();
}
helperConfig.setEnv(helperConfig2.getEnv());
HelperConfig helperConfig3 = debugConfig;
if (helperConfig3 == null) {
Intrinsics.throwNpe();
}
helperConfig.setRemoteDeveloper(helperConfig3.isRemoteDeveloper());
HelperConfig helperConfig4 = debugConfig;
if (helperConfig4 == null) {
Intrinsics.throwNpe();
}
helperConfig.setDailyAir(helperConfig4.isDailyAir());
HelperConfig helperConfig5 = debugConfig;
if (helperConfig5 == null) {
Intrinsics.throwNpe();
}
helperConfig.setValidTime(helperConfig5.getValidTime());
Toast.makeText(Static.CONTEXT, "使用配置的调试版本", 1).show();
return;
}
return;
}
z2 = true;
if (z2) {
return;
} else {
return;
}
}
return;
}
z = true;
if (z) {
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Nullable
public static final UrlPolicyRpc getUrlPolicy() {
String str = "https://restapp.qxwz.com/";
String str2 = BuildConfig.BASE_CONSOLE_URL;
String str3 = "qxwz.com";
HelperConfig helperConfig = debugConfig;
if (helperConfig == null) {
return null;
}
String env = helperConfig.getEnv();
int hashCode = env.hashCode();
if (hashCode != 111267) {
if (hashCode != 95346201) {
if (hashCode != 109757182) {
switch (hashCode) {
}
} else if (env.equals("stage")) {
str = "http://restapp.stage.qxwz.com";
str2 = "http://app.consple.qxwz-stage.com:80";
str3 = "https://m.stage.qxwz.com";
}
}
} else if (env.equals("pre")) {
str = "https://restapp.pre.qxwz.com/";
str2 = "https://app.pre.my.qxwz.com";
str3 = "https://m.pre.qxwz.com";
}
UrlPolicyRpc urlPolicyRpc = new UrlPolicyRpc();
urlPolicyRpc.setPolicyName(helperConfig.getEnv());
urlPolicyRpc.setBaseUrl(str);
urlPolicyRpc.setConsoleUrl(str2);
urlPolicyRpc.setH5Url(str3);
urlPolicyRpc.setPreset(true);
urlPolicyRpc.setSelect(false);
return urlPolicyRpc;
}
private static final boolean isDebug() {
return debugConfig != null;
}
public static final boolean isRemoteDeveloper() {
HelperConfig helperConfig = debugConfig;
if (helperConfig != null) {
return helperConfig.isRemoteDeveloper();
}
return false;
}
}