助力中医 v1.2版本的 MD5 值为:06be904e0d24c6f44b9f2e5705674554
以下内容为反编译后的 a.java 源代码,内容仅作参考
package io.dcloud.e.b;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
import android.widget.CheckBox;
import com.dcloud.android.widget.dialog.DCloudAlertDialog;
import io.dcloud.PdrR;
import io.dcloud.WebAppActivity;
import io.dcloud.base.R;
import io.dcloud.common.DHInterface.AbsMgr;
import io.dcloud.common.DHInterface.IActivityHandler;
import io.dcloud.common.DHInterface.IApp;
import io.dcloud.common.DHInterface.ICallBack;
import io.dcloud.common.DHInterface.ICore;
import io.dcloud.common.DHInterface.IDCloudWebviewClientListener;
import io.dcloud.common.DHInterface.IMgr;
import io.dcloud.common.DHInterface.ISysEventListener;
import io.dcloud.common.DHInterface.IWebview;
import io.dcloud.common.DHInterface.IWebviewStateListener;
import io.dcloud.common.adapter.io.DHFile;
import io.dcloud.common.adapter.ui.webview.WebResUtil;
import io.dcloud.common.adapter.ui.webview.WebViewFactory;
import io.dcloud.common.adapter.util.DeviceInfo;
import io.dcloud.common.adapter.util.Logger;
import io.dcloud.common.adapter.util.PlatformUtil;
import io.dcloud.common.adapter.util.SP;
import io.dcloud.common.constant.AbsoluteConst;
import io.dcloud.common.constant.DOMException;
import io.dcloud.common.constant.DataInterface;
import io.dcloud.common.constant.IntentConst;
import io.dcloud.common.constant.StringConst;
import io.dcloud.common.util.AppRuntime;
import io.dcloud.common.util.BaseInfo;
import io.dcloud.common.util.CheckSignatureUtil;
import io.dcloud.common.util.DataUtil;
import io.dcloud.common.util.DialogUtil;
import io.dcloud.common.util.ErrorDialogUtil;
import io.dcloud.common.util.IOUtil;
import io.dcloud.common.util.JSONUtil;
import io.dcloud.common.util.PdrUtil;
import io.dcloud.common.util.StringUtil;
import io.dcloud.common.util.ThreadPool;
import io.dcloud.feature.internal.sdk.SDK;
import io.src.dcloud.adapter.DCloudAdapterUtil;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import net.lingala.zip4j.util.InternalZipConstants;
import org.json.JSONException;
import org.json.JSONObject;
public final class a extends AbsMgr implements IMgr.AppEvent {
private static String a;
io.dcloud.e.b.d b;
ArrayList<String> c;
ArrayList<io.dcloud.e.b.e> d;
io.dcloud.e.b.c e;
Class[] f;
private AlertDialog g;
JSONObject h;
private AlertDialog i;
private AlertDialog j;
public class C0037a implements ICallBack {
C0037a() {
}
@Override
public Object onCallBack(int i, Object obj) {
String unused = a.a = String.valueOf(obj);
return null;
}
}
public class b implements Runnable {
final Context a;
b(Context context) {
this.a = context;
}
@Override
public void run() {
String str = "uni-jsframework-dev.js";
try {
BaseInfo.uniVersionV3 = new JSONObject(new BufferedReader(new InputStreamReader(this.a.getAssets().open((!BaseInfo.SyncDebug || PlatformUtil.getResInputStream("uni-jsframework-dev.js") == null || SDK.isUniMPSDK()) ? "uni-jsframework.js" : "uni-jsframework.js"))).readLine().substring(2)).optString("version");
} catch (Exception unused) {
}
}
}
public class c implements DialogInterface.OnClickListener {
final Activity a;
final String b;
final io.dcloud.e.b.e c;
final CheckBox d;
final String e;
final io.dcloud.e.b.e f;
final io.dcloud.e.b.e g;
final boolean h;
c(Activity activity, String str, io.dcloud.e.b.e eVar, CheckBox checkBox, String str2, io.dcloud.e.b.e eVar2, io.dcloud.e.b.e eVar3, boolean z) {
this.a = activity;
this.b = str;
this.c = eVar;
this.d = checkBox;
this.e = str2;
this.f = eVar2;
this.g = eVar3;
this.h = z;
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (i != -2) {
if (i != -3 && i == -1) {
if (this.d.isChecked()) {
Activity activity = this.a;
SP.setBundleData(activity, "pdr", AbsoluteConst.TEST_RUN + this.b, "__am=t");
}
a.this.a(this.a, this.b, this.e, this.c, this.f, this.g, this.h);
a.this.g.dismiss();
return;
}
return;
}
a.this.g.dismiss();
IActivityHandler iActivityHandler = DCloudAdapterUtil.getIActivityHandler(this.a);
if (iActivityHandler != null) {
iActivityHandler.closeAppStreamSplash(this.b);
BaseInfo.setLoadingLaunchePage(false, "closeSplashScreen0");
if (a.this.e.e() == 0) {
this.a.finish();
return;
}
io.dcloud.e.b.e eVar = this.c;
if (eVar != null) {
eVar.w();
}
Intent intent = new Intent("android.intent.action.MAIN");
intent.addCategory("android.intent.category.HOME");
this.a.startActivity(intent);
}
}
}
public class d implements DialogInterface.OnClickListener {
final Activity a;
d(Activity activity) {
this.a = activity;
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse("https://ask.dcloud.net.cn/article/35627"));
this.a.startActivity(intent);
}
}
public class e implements DialogInterface.OnClickListener {
final Activity a;
e(Activity activity) {
this.a = activity;
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse("https://ask.dcloud.net.cn/article/35877"));
this.a.startActivity(intent);
}
}
public class f implements ICallBack {
final io.dcloud.e.b.e a;
f(io.dcloud.e.b.e eVar) {
this.a = eVar;
}
@Override
public Object onCallBack(int i, Object obj) {
if (AppRuntime.hasPrivacyForNotShown(this.a.getActivity())) {
return null;
}
((AbsMgr) a.this).mCore.onRestart(this.a.getActivity());
return null;
}
}
public class g implements ICallBack {
final io.dcloud.e.b.e a;
final boolean b;
final String c;
final ICallBack d;
g(io.dcloud.e.b.e eVar, boolean z, String str, ICallBack iCallBack) {
this.a = eVar;
this.b = z;
this.c = str;
this.d = iCallBack;
}
@Override
public Object onCallBack(int i, Object obj) {
if (!this.a.a(this.b)) {
Logger.e(Logger.AppMgr_TAG, "reboot " + this.c + " app failed !!!");
} else {
this.d.onCallBack(0, null);
}
return null;
}
}
public class h implements ICallBack {
final io.dcloud.e.b.e a;
final String b;
final String c;
final boolean d;
class C0038a implements ICallBack {
C0038a() {
}
@Override
public Object onCallBack(int i, Object obj) {
h hVar = h.this;
a.this.a(hVar.a, hVar.b, hVar.c, hVar.d);
return null;
}
}
h(io.dcloud.e.b.e eVar, String str, String str2, boolean z) {
this.a = eVar;
this.b = str;
this.c = str2;
this.d = z;
}
@Override
public Object onCallBack(int i, Object obj) {
if (!WebViewFactory.isOther() || WebViewFactory.isOtherInitialised() || WebViewFactory.isIsLoadOtherTimeOut()) {
a.this.a(this.a, this.b, this.c, this.d);
return null;
}
WebViewFactory.setOtherCallBack(new C0038a());
return null;
}
}
class i implements Runnable {
i() {
}
@Override
public void run() {
try {
DHFile.deleteFile(StringConst.STREAMAPP_KEY_ROOTPATH + "splash_temp/");
} catch (Exception e) {
e.printStackTrace();
}
}
}
public a(ICore iCore) {
super(iCore, Logger.AppMgr_TAG, IMgr.MgrType.AppMgr);
this.b = null;
this.c = new ArrayList<>(1);
this.d = new ArrayList<>(1);
this.e = null;
this.f = new Class[0];
this.h = null;
if (iCore != null) {
a(iCore.obtainContext());
}
c();
b();
d();
a();
this.e = new io.dcloud.e.b.c(this);
}
private void d(io.dcloud.e.b.e eVar) {
Object newInstance = PlatformUtil.newInstance("android.app.ActivityManager$TaskDescription", new Class[]{String.class, Bitmap.class}, new Object[]{eVar.obtainAppName(), BitmapFactory.decodeResource(getContext().getResources(), getContext().getApplicationInfo().icon)});
PlatformUtil.invokeMethod(eVar.getActivity(), "setTaskDescription", new Class[]{newInstance.getClass()}, newInstance);
}
io.dcloud.e.b.e c(String str) {
return a((Activity) null, str);
}
@Override
public void dispose() {
ArrayList<io.dcloud.e.b.e> arrayList = this.d;
if (arrayList != null) {
Iterator<io.dcloud.e.b.e> it = arrayList.iterator();
while (it.hasNext()) {
it.next().g();
}
}
this.d.clear();
this.c.clear();
io.dcloud.e.b.c cVar = this.e;
if (cVar != null) {
cVar.a();
}
this.e = null;
ThreadPool.self().addThreadTask(new i());
}
public void e(io.dcloud.e.b.e eVar) {
this.e.b(eVar.p);
b(eVar);
}
@Override
public Object processEvent(IMgr.MgrType mgrType, int i2, Object obj) {
io.dcloud.e.b.e eVar;
Object[] objArr;
io.dcloud.e.b.e a2;
boolean a3;
Object valueOf;
int intValue;
String str;
io.dcloud.e.b.e a4;
io.dcloud.e.b.e a5;
byte b2;
io.dcloud.e.b.e b3;
Intent intent;
String str2;
try {
} catch (Throwable th) {
th = th;
eVar = null;
}
if (!checkMgrId(mgrType)) {
r12 = this.mCore.dispatchEvent(mgrType, i2, obj);
} else {
boolean z = true;
switch (i2) {
case 0:
Object[] objArr2 = (Object[]) obj;
Activity activity = (Activity) objArr2[0];
String valueOf2 = String.valueOf(objArr2[1]);
String valueOf3 = String.valueOf(objArr2[2]);
Log.i("ylyl", " AppMGr START_APP " + valueOf2);
Logger.e("appMgr", "START_APP" + valueOf2);
io.dcloud.e.b.e a6 = a(activity, valueOf2);
boolean isEmpty = TextUtils.isEmpty(a6.r0);
io.dcloud.e.b.e b4 = this.e.b();
io.dcloud.e.b.e a7 = this.e.a(activity, a6);
if (a7 == null || a7 != a6 || a6.v) {
if (a6.q()) {
boolean z2 = a7 == null;
String bundleData = SP.getBundleData(activity, "pdr", AbsoluteConst.TEST_RUN + valueOf2);
if (!TextUtils.isEmpty(bundleData)) {
if (bundleData.equals("popped")) {
SP.removeBundleData(activity, "pdr", AbsoluteConst.TEST_RUN + valueOf2);
}
z2 = false;
}
boolean booleanExtra = !a6.v ? activity.getIntent().getBooleanExtra(IntentConst.IS_START_FIRST_WEB, false) : false;
if (!a6.n() && z2 && !booleanExtra && a6.u == 1) {
AlertDialog alertDialog = this.g;
if (alertDialog != null && alertDialog.isShowing()) {
this.g.dismiss();
}
DCloudAlertDialog initDialogTheme = DialogUtil.initDialogTheme(activity, true);
this.g = initDialogTheme;
initDialogTheme.setCanceledOnTouchOutside(false);
String string = activity.getString(R.string.dcloud_common_app_test_tips);
CheckBox checkBox = new CheckBox(activity);
checkBox.setText(R.string.dcloud_common_app_trust_tips);
checkBox.setTextColor(-65536);
this.g.setMessage(string);
this.g.setView(checkBox, DeviceInfo.getDeivceSuitablePixel(activity, 20), 0, 0, 0);
c cVar = new c(activity, valueOf2, b4, checkBox, valueOf3, a6, a7, isEmpty);
this.g.setButton(-2, activity.getResources().getString(17039360), cVar);
this.g.setButton(-1, activity.getResources().getString(17039370), cVar);
Logger.e("yl", "test show ");
this.g.show();
} else {
a(activity, valueOf2, valueOf3, b4, a6, a7, isEmpty);
}
} else {
a(activity, valueOf2, valueOf3, b4, a6, a7, isEmpty);
if (a6.o()) {
AlertDialog alertDialog2 = this.i;
if (alertDialog2 != null && alertDialog2.isShowing()) {
this.i.dismiss();
}
AlertDialog create = new AlertDialog.Builder(activity, PdrR.FEATURE_LOSS_STYLE).setTitle("HTML5+ Runtime").setIcon(17301659).setMessage(StringUtil.format(activity.getString(R.string.dcloud_common_app_tips1), a6.obtainConfigProperty(AbsoluteConst.APP_UNIAPP_VERSION), BaseInfo.uniVersionV3)).setPositiveButton(activity.getString(R.string.dcloud_common_view_details), new d(activity)).setNegativeButton(activity.getString(R.string.dcloud_common_ignore), (DialogInterface.OnClickListener) null).create();
this.i = create;
create.setCanceledOnTouchOutside(false);
this.i.show();
}
if (!PlatformUtil.checkClass("io.dcloud.feature.weex.WeexFeature") && BaseInfo.isUniAppAppid(a6) && BaseInfo.isWeexUniJs(a6)) {
AlertDialog alertDialog3 = this.j;
if (alertDialog3 != null && alertDialog3.isShowing()) {
this.j.dismiss();
}
AlertDialog create2 = new AlertDialog.Builder(activity, PdrR.FEATURE_LOSS_STYLE).setTitle("HTML5+ Runtime").setIcon(17301659).setMessage(activity.getString(R.string.dcloud_common_app_tips2)).setPositiveButton(activity.getString(R.string.dcloud_common_view_details), new e(activity)).setNegativeButton(activity.getString(R.string.dcloud_common_ignore), (DialogInterface.OnClickListener) null).create();
this.j = create2;
create2.setCanceledOnTouchOutside(false);
this.j.show();
}
}
}
return a6;
case 1:
Object[] objArr3 = (Object[]) obj;
if (objArr3[2] instanceof IApp) {
a2 = (io.dcloud.e.b.e) objArr3[2];
} else {
a2 = a(String.valueOf(objArr3[2]), false);
}
if (BaseInfo.sRuntimeMode == null && a2 == null && !io.dcloud.e.b.e.a((ISysEventListener.SysEventType) objArr3[0])) {
a3 = false;
if (!a3 && a2 != null && ((ISysEventListener.SysEventType) objArr3[0]).equals(ISysEventListener.SysEventType.onKeyUp)) {
intValue = ((Integer) ((Object[]) objArr3[1])[0]).intValue();
String str3 = (String) objArr3[2];
if (intValue == 4) {
processEvent(IMgr.MgrType.WindowMgr, 20, a2);
valueOf = Boolean.valueOf(z);
r12 = valueOf;
break;
}
}
z = a3;
valueOf = Boolean.valueOf(z);
r12 = valueOf;
}
a3 = this.e.a(a2, (ISysEventListener.SysEventType) objArr3[0], objArr3[1]);
if (!a3) {
intValue = ((Integer) ((Object[]) objArr3[1])[0]).intValue();
String str32 = (String) objArr3[2];
if (intValue == 4) {
}
}
z = a3;
valueOf = Boolean.valueOf(z);
r12 = valueOf;
case 2:
String valueOf4 = String.valueOf(obj);
if (PdrUtil.isDeviceRootDir(valueOf4)) {
int indexOf = valueOf4.indexOf(BaseInfo.sBaseFsAppsPath);
if (indexOf >= 0) {
String substring = valueOf4.substring(indexOf + BaseInfo.sBaseFsAppsPath.length());
str = substring.substring(0, substring.indexOf(InternalZipConstants.ZIP_FILE_SEPARATOR));
} else {
str = null;
}
r12 = TextUtils.isEmpty(str) ? null : WebResUtil.getEncryptionInputStream(valueOf4, c(str));
if (r12 == null) {
valueOf = DHFile.getInputStream(DHFile.createFileHandler(valueOf4));
r12 = valueOf;
break;
}
} else {
io.dcloud.e.b.e c2 = c(this.e.b().p);
if (valueOf4.startsWith(AbsoluteConst.MINI_SERVER_APP_WWW)) {
if (c2 != null) {
valueOf = c2.obtainResInStream(valueOf4);
r12 = valueOf;
}
} else if (valueOf4.startsWith(AbsoluteConst.MINI_SERVER_APP_DOC)) {
valueOf = DHFile.getInputStream(DHFile.createFileHandler(c2.obtainAppDocPath() + valueOf4.substring(5)));
r12 = valueOf;
}
}
break;
case 3:
String valueOf5 = String.valueOf(obj);
if ("snc:CID".equals(valueOf5)) {
a4 = this.e.b();
} else {
a4 = a(valueOf5, true);
}
if (a4.getActivity() instanceof WebAppActivity) {
WebAppActivity webAppActivity = (WebAppActivity) a4.getActivity();
if (webAppActivity != null && !webAppActivity.isFinishing()) {
if (io.dcloud.common.ui.b.a().c(webAppActivity.getContext())) {
Intent launchIntentForPackage = webAppActivity.getApplication().getPackageManager().getLaunchIntentForPackage(webAppActivity.getApplication().getPackageName());
launchIntentForPackage.addFlags(67108864);
webAppActivity.getApplication().startActivity(launchIntentForPackage);
Process.killProcess(Process.myPid());
break;
} else {
a(a4, valueOf5, false);
break;
}
} else {
a(a4, valueOf5, false);
break;
}
} else {
a(a4, valueOf5, false);
break;
}
break;
case 4:
Object[] objArr4 = (Object[]) obj;
String valueOf6 = String.valueOf(objArr4[0]);
JSONObject jSONObject = (JSONObject) objArr4[1];
IWebview iWebview = (IWebview) objArr4[2];
String string2 = JSONUtil.getString(jSONObject, "appid");
if (Boolean.parseBoolean(JSONUtil.getString(jSONObject, AbsoluteConst.INSTALL_OPTIONS_RECOGNISE)) && !TextUtils.isEmpty(valueOf6)) {
Locale locale = Locale.ENGLISH;
if (!valueOf6.toLowerCase(locale).endsWith(".wgtu") && !valueOf6.toLowerCase(locale).endsWith(".wgt") && !CheckSignatureUtil.check(valueOf6)) {
Object[] objArr5 = new Object[2];
objArr5[0] = Boolean.TRUE;
objArr5[1] = StringUtil.format(DOMException.JSON_ERROR_INFO, 10, iWebview.getContext().getString(R.string.dcloud_common_app_check_failed));
return objArr5;
}
}
if (PdrUtil.isEmpty(string2)) {
string2 = iWebview.obtainFrameView().obtainApp().obtainAppId();
}
long currentTimeMillis = System.currentTimeMillis();
Logger.d(Logger.AppMgr_TAG, "install begin _filePath = " + valueOf6 + ";_mayBeAppid = " + string2);
io.dcloud.e.b.e a8 = a(valueOf6, string2, jSONObject);
StringBuilder sb = new StringBuilder();
sb.append("install end useTime=");
sb.append(System.currentTimeMillis() - currentTimeMillis);
Logger.d(Logger.AppMgr_TAG, sb.toString());
objArr = new Object[]{Boolean.valueOf(a8.s.a), a8.s.b};
return objArr;
case 5:
io.dcloud.e.b.e c3 = c(String.valueOf(obj));
if (c3 != null) {
valueOf = c3.v();
r12 = valueOf;
break;
}
break;
case 6:
valueOf = c(String.valueOf(obj));
r12 = valueOf;
break;
case 7:
String str4 = (String) obj;
if (this.b == null) {
this.b = new io.dcloud.e.b.d(this);
}
this.b.a(str4);
Logger.d(Logger.AppMgr_TAG, "data=" + str4);
break;
case 8:
String[] strArr = (String[]) obj;
valueOf = a(strArr[0], strArr[1], strArr[2], Byte.parseByte(strArr[3]));
r12 = valueOf;
break;
case 9:
Object[] objArr6 = (Object[]) obj;
IApp iApp = (IApp) objArr6[0];
IWebviewStateListener iWebviewStateListener = (IWebviewStateListener) objArr6[1];
if (objArr6.length > 2) {
IDCloudWebviewClientListener iDCloudWebviewClientListener = (IDCloudWebviewClientListener) objArr6[2];
if (!PdrUtil.isEmpty(iDCloudWebviewClientListener)) {
valueOf = ((io.dcloud.e.b.e) iApp).a(iWebviewStateListener, iDCloudWebviewClientListener);
}
} else {
valueOf = ((io.dcloud.e.b.e) iApp).a(iWebviewStateListener);
}
r12 = valueOf;
break;
case 10:
if (obj instanceof String) {
a5 = a(String.valueOf(obj), false);
} else if (obj instanceof io.dcloud.e.b.e) {
a5 = (io.dcloud.e.b.e) obj;
} else {
a5 = obj instanceof Map ? a((String) ((Map) obj).get("appid"), false) : null;
}
if (a5 != null) {
a5.u();
break;
}
break;
case 11:
if (this.e.b() != null) {
objArr = this.e.b().p;
return objArr;
}
break;
case 12:
io.dcloud.e.b.e a9 = a((String) obj, false);
if (a9 != null) {
byte b5 = a9.u;
if (b5 == 3) {
byte b6 = a9.p() ? a9.u : (byte) 2;
a9.u = b6;
b2 = Byte.valueOf(b6);
} else {
b2 = Byte.valueOf(b5);
}
} else {
b2 = (byte) 1;
}
objArr = b2;
return objArr;
case 13:
io.dcloud.e.b.e eVar2 = (io.dcloud.e.b.e) obj;
if (eVar2 != null) {
objArr = Boolean.valueOf(eVar2.r());
return objArr;
}
return AbsoluteConst.FALSE;
case 14:
String valueOf7 = String.valueOf(obj);
if (valueOf7.endsWith(InternalZipConstants.ZIP_FILE_SEPARATOR)) {
valueOf7 = valueOf7.substring(0, valueOf7.length() - 1);
}
String substring2 = valueOf7.substring(valueOf7.lastIndexOf(InternalZipConstants.ZIP_FILE_SEPARATOR) + 1);
if (b(substring2)) {
b3 = c(substring2);
} else {
b3 = b(valueOf7, substring2);
}
eVar = b3;
if (!eVar.s.a) {
try {
c(eVar);
objArr = eVar;
} catch (Throwable th2) {
th = th2;
Logger.w("AppMgr.processEvent", th);
objArr = eVar;
return objArr;
}
return objArr;
}
break;
case 16:
Object[] objArr7 = (Object[]) obj;
((io.dcloud.e.b.e) ((IApp) objArr7[0])).a((String) objArr7[1], 1);
break;
case 19:
valueOf = this.e.c();
r12 = valueOf;
break;
case 20:
case 21:
if (obj instanceof String) {
str2 = (String) obj;
intent = null;
} else {
Object[] objArr8 = (Object[]) obj;
Activity activity2 = (Activity) objArr8[0];
intent = (Intent) objArr8[1];
str2 = (String) objArr8[2];
}
io.dcloud.e.b.e a10 = this.e.a(str2);
r12 = Boolean.TRUE;
if (a10 != null) {
io.dcloud.e.b.e b7 = this.e.b();
if (b7 != a10) {
if (b7 != null) {
b7.w();
}
if (intent != null) {
a10.setWebAppIntent(intent);
} else {
intent = a10.obtainWebAppIntent();
}
if (21 == i2) {
intent.putExtra(IntentConst.IS_WEBAPP_REPLY, true);
}
a10.getActivity().setIntent(intent);
Logger.d(Logger.AppMgr_TAG, str2 + " will unactive change to active STREAM_START_APP");
if (a10.u == 2) {
a10.c();
break;
}
}
} else {
valueOf = Boolean.FALSE;
r12 = valueOf;
break;
}
break;
case 24:
valueOf = a;
r12 = valueOf;
break;
case 27:
io.dcloud.e.b.e b8 = this.e.b();
if (b8 != null) {
a(b8, (String) null, true);
break;
} else {
Logger.e(Logger.AppMgr_TAG, "not app!!!");
break;
}
case 28:
if (this.e.b() != null) {
valueOf = this.e.b();
} else {
valueOf = a((String) obj, false);
}
r12 = valueOf;
break;
}
}
return r12;
}
void b() {
io.dcloud.e.b.g gVar;
HashMap<String, BaseInfo.BaseAppInfo> hashMap = BaseInfo.mBaseAppInfoSet;
if (hashMap == null || hashMap.isEmpty()) {
return;
}
Set<String> keySet = BaseInfo.mBaseAppInfoSet.keySet();
int size = keySet.size();
String[] strArr = new String[size];
keySet.toArray(strArr);
for (int i2 = 0; i2 < size; i2++) {
String str = strArr[i2];
BaseInfo.BaseAppInfo baseAppInfo = BaseInfo.mBaseAppInfoSet.get(str);
if (!BaseInfo.mUnInstalledAppInfoSet.containsKey(str) && !b(str)) {
io.dcloud.e.b.e b2 = b(BaseInfo.sBaseResAppsPath + str, str);
if (b2 != null && (gVar = b2.s) != null) {
if (gVar.a) {
Logger.e("AppMgr", str + " app error," + b2.s);
} else {
b2.t = baseAppInfo;
c(b2);
}
}
}
}
}
void c(io.dcloud.e.b.e eVar) {
this.c.add(eVar.obtainAppId());
this.d.add(eVar);
}
private void a() {
if (PdrUtil.isEmpty(a)) {
DataUtil.datToJsString(BaseInfo.sUniNViewServiceJsPath, new C0037a());
}
}
void c() {
io.dcloud.e.b.g gVar;
HashMap<String, BaseInfo.BaseAppInfo> hashMap = BaseInfo.mInstalledAppInfoSet;
if (hashMap == null || hashMap.isEmpty()) {
return;
}
Set<String> keySet = BaseInfo.mInstalledAppInfoSet.keySet();
int size = keySet.size();
String[] strArr = new String[size];
keySet.toArray(strArr);
boolean z = false;
for (int i2 = 0; i2 < size; i2++) {
String str = strArr[i2];
if (!BaseInfo.mUnInstalledAppInfoSet.containsKey(str) && !b(str)) {
io.dcloud.e.b.e b2 = b(BaseInfo.sCacheFsAppsPath + str, str);
if (b2 != null && (gVar = b2.s) != null && !gVar.a) {
b2.deleteAppTemp();
if (SDK.isUniMPSDK()) {
b2.j0 = true;
} else {
b2.j0 = false;
}
c(b2);
} else {
BaseInfo.mInstalledAppInfoSet.get(str).clearBundleData();
BaseInfo.mInstalledAppInfoSet.remove(str);
z = true;
}
}
}
if (z) {
BaseInfo.saveInstalledAppInfo(getContext());
}
}
private void a(Context context) {
if (TextUtils.isEmpty(BaseInfo.uniVersionV3)) {
ThreadPool.self().addThreadTask(new b(context), true);
}
}
void d() {
File file = new File(BaseInfo.sURDFilePath);
if (!file.exists()) {
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
DHFile.copyAssetsFile("data/dcloud_url.json", file.getAbsolutePath());
}
if (file.exists()) {
try {
this.h = new JSONObject(new String(DHFile.readAll(file)));
} catch (JSONException e2) {
e2.printStackTrace();
}
}
}
private void a(io.dcloud.e.b.e eVar, String str, boolean z) {
if (eVar != null) {
String obtainConfigProperty = eVar.obtainConfigProperty(IApp.ConfigProperty.CONFIG_UNIAPP_CONTROL);
f fVar = new f(eVar);
if (!TextUtils.isEmpty(obtainConfigProperty) && obtainConfigProperty.equals(AbsoluteConst.UNI_V3)) {
if (eVar.getActivity() != null) {
BaseInfo.isFirstRun = false;
eVar.showSplash();
AppRuntime.restartWeex(eVar.getActivity().getApplication(), new g(eVar, z, str, fVar), eVar.p);
return;
}
return;
} else if (!eVar.a(z)) {
Logger.e(Logger.AppMgr_TAG, "reboot " + str + " app failed !!!");
return;
} else {
fVar.onCallBack(0, null);
return;
}
}
Logger.e(Logger.AppMgr_TAG, "not found " + str + " app!!!");
}
void b(io.dcloud.e.b.e eVar) {
this.c.remove(eVar.p);
this.d.remove(eVar);
}
private boolean b(String str) {
return this.c.contains(str);
}
private io.dcloud.e.b.e b(String str, String str2) {
return a(str, str2);
}
private void a(io.dcloud.e.b.e eVar) {
if (SDK.isUniMPSDK() && SDK.isEnableBackground) {
d(eVar);
}
}
public void a(Activity activity, String str, String str2, io.dcloud.e.b.e eVar, io.dcloud.e.b.e eVar2, io.dcloud.e.b.e eVar3, boolean z) {
Log.i("ylyl", "startOneApp " + str);
BaseInfo.sLastRunApp = str;
BaseInfo.CmtInfo cmitInfo = BaseInfo.getCmitInfo(str);
if (cmitInfo.needUpdate) {
cmitInfo.templateVersion = eVar2.D;
cmitInfo.rptCrs = eVar2.M;
cmitInfo.rptJse = eVar2.N;
cmitInfo.plusLauncher = BaseInfo.getLaunchType(eVar2.obtainWebAppIntent());
cmitInfo.sfd = DataInterface.getStreamappFrom(eVar2.obtainWebAppIntent());
cmitInfo.needUpdate = false;
}
if (!io.dcloud.e.c.g.c() && eVar2.u == 4) {
ErrorDialogUtil.checkAppKeyErrorTips(activity);
return;
}
if (eVar2.u == 3) {
eVar2.u = eVar2.p() ? eVar2.u : (byte) 2;
}
if (eVar != null && eVar != eVar2 && eVar != eVar3) {
eVar.w();
}
byte b2 = eVar2.u;
if (b2 == 1 || ((z && !eVar2.w) || ((eVar2.x && eVar2.v) || !z))) {
Logger.d(Logger.AppMgr_TAG, str + " will unrunning change to active");
eVar2.a(activity);
processEvent(IMgr.MgrType.WindowMgr, 4, new Object[]{eVar2, str});
eVar2.a(new h(eVar2, str, str2, z));
} else if (b2 == 2) {
Logger.d(Logger.AppMgr_TAG, str + " will unactive change to active");
eVar2.c();
} else {
Logger.d(Logger.AppMgr_TAG, str + " is active");
}
if (SDK.isUniMPSDK() && Build.VERSION.SDK_INT >= 21) {
a(eVar2);
}
if (eVar3 == null || eVar3 == eVar2) {
return;
}
eVar3.u();
}
public void a(io.dcloud.e.b.e eVar, String str, String str2, boolean z) {
if (this.e == null) {
return;
}
boolean f2 = z ? eVar.f(str2) : eVar.g(str2);
if (!eVar.w && eVar.v) {
eVar.f(str2);
}
if (f2) {
this.e.a(str, eVar);
return;
}
Logger.e(Logger.AppMgr_TAG, str + " run failed!!!");
}
io.dcloud.e.b.e a(Activity activity, String str) {
return a(activity, str, true);
}
private io.dcloud.e.b.e a(String str, boolean z) {
return a((Activity) null, str, z);
}
private io.dcloud.e.b.e a(Activity activity, String str, boolean z) {
int indexOf;
io.dcloud.e.b.e eVar = (!this.c.contains(str) || (indexOf = this.c.indexOf(str)) < 0) ? null : this.d.get(indexOf);
if (eVar == null && z) {
eVar = new io.dcloud.e.b.e(this, str, (byte) 0);
eVar.setAppDataPath(BaseInfo.sCacheFsAppsPath + str + DeviceInfo.sSeparatorChar + BaseInfo.REAL_PRIVATE_WWW_DIR);
if (eVar.a == null) {
eVar.a = activity;
}
if (activity != null) {
eVar.setWebAppIntent(activity.getIntent());
}
eVar.b(str, null);
if (eVar.s.a) {
eVar.p = str;
}
c(eVar);
} else if (eVar != null && activity != null) {
if (eVar.a == null) {
eVar.a = activity;
}
if (eVar.a.getIntent() != null) {
if (eVar.manifestBeParsed()) {
eVar.setWebAppIntent(eVar.a.getIntent());
}
} else {
eVar.a.setIntent(eVar.obtainWebAppIntent());
}
if (!eVar.v) {
eVar.b(str, null);
}
}
return eVar;
}
io.dcloud.e.b.e a(String str, String str2, String str3, byte b2) {
io.dcloud.e.b.e a2 = a(str, false);
if (a2 == null) {
a2 = new io.dcloud.e.b.e(this, str, b2);
a2.u = (byte) 3;
a2.p = str;
if (!PdrUtil.isEmpty(str2)) {
a2.setAppDataPath(str2);
}
a2.l0 = str3;
c(a2);
this.e.a(str, a2);
}
return a2;
}
io.dcloud.e.b.e a(String str, String str2) {
return a(str, str2, (JSONObject) null);
}
io.dcloud.e.b.e a(String str, String str2, JSONObject jSONObject) {
Exception e2;
PackageInfo packageInfo;
io.dcloud.e.b.e a2 = a(str2, false);
if (a2 != null) {
try {
a2.s.a();
} catch (Exception e3) {
e2 = e3;
e2.printStackTrace();
Logger.e(Logger.AppMgr_TAG, "installWebApp " + str + " is Illegal path");
return a2;
}
}
boolean z = true;
if (!DHFile.isExist(str) && !PdrUtil.isDeviceRootDir(str)) {
boolean contains = str.substring(str.lastIndexOf(47)).contains(".wgt");
r4 = contains ? PlatformUtil.getResInputStream(str) : null;
if (a2 == null) {
a2 = new io.dcloud.e.b.e(this, str2, (byte) 1);
}
if (!contains && r4 == null) {
a2.setAppDataPath(str + DeviceInfo.sSeparatorChar + BaseInfo.REAL_PRIVATE_WWW_DIR);
a2.b(str2, jSONObject);
IOUtil.close(r4);
return a2;
}
a2.b(r4);
IOUtil.close(r4);
return a2;
}
boolean isFile = new File(str).isFile();
if (isFile) {
if (isFile && str.toLowerCase(Locale.ENGLISH).endsWith(".wgtu")) {
if (a2 != null) {
z = false;
}
if (z) {
a2 = new io.dcloud.e.b.e(this, str2, (byte) 0);
}
a2.a(str, jSONObject);
io.dcloud.e.b.g gVar = a2.s;
gVar.c = false;
gVar.d = false;
} else if (isFile && str.toLowerCase(Locale.ENGLISH).endsWith(".wgt")) {
boolean z2 = a2 == null;
a2.s.d = true;
if (z2) {
io.dcloud.e.b.e eVar = new io.dcloud.e.b.e(this, str2, (byte) 0);
try {
eVar.p = str2;
eVar.setAppDataPath(BaseInfo.sCacheFsAppsPath + str2 + DeviceInfo.sSeparatorChar + BaseInfo.REAL_PRIVATE_WWW_DIR);
a2 = eVar;
} catch (Exception e4) {
e2 = e4;
a2 = eVar;
e2.printStackTrace();
Logger.e(Logger.AppMgr_TAG, "installWebApp " + str + " is Illegal path");
return a2;
}
}
boolean c2 = a2.c(str, jSONObject);
a2.s.d = false;
if (c2 && z2) {
c(a2);
}
} else if (isFile && str.toLowerCase(Locale.ENGLISH).endsWith(".apk")) {
try {
packageInfo = PlatformUtil.parseApkInfo(getContext(), str);
} catch (Exception e5) {
e5.printStackTrace();
a2.s.b = StringUtil.format(DOMException.JSON_ERROR_INFO, 10, e5.getMessage());
packageInfo = null;
}
if (packageInfo == null) {
a2.s.a = true;
} else {
a2.s.a = false;
String str3 = packageInfo.versionName;
String str4 = packageInfo.packageName;
String charSequence = getContext().getPackageManager().getApplicationLabel(packageInfo.applicationInfo).toString();
if (charSequence == null) {
charSequence = "";
}
a2.s.b = StringUtil.format("{pname:'%s',version:'%s',name:'%s'}", str4, str3, charSequence);
PlatformUtil.openFileBySystem(getContext(), str, null, null, null);
}
} else {
io.dcloud.e.b.g gVar2 = a2.s;
gVar2.a = true;
gVar2.b = StringUtil.format(DOMException.JSON_ERROR_INFO, Integer.valueOf((int) DOMException.CODE_RUNTIME_WGT_OR_WGTU_ERROR_MALFORMED), DOMException.MSG_RUNTIME_WGT_OR_WGTU_ERROR_MALFORMED);
}
} else {
if (a2 != null) {
a2.b((byte) 0);
} else {
a2 = new io.dcloud.e.b.e(this, str2, (byte) 0);
}
a2.setAppDataPath(str + DeviceInfo.sSeparatorChar + BaseInfo.REAL_PRIVATE_WWW_DIR);
a2.b(str2, jSONObject);
}
IOUtil.close(r4);
return a2;
}
}