导航菜单

页面标题

页面副标题

安博 v1.0.0 - e.java 源代码

正在查看: 安博 v1.0.0 应用的 e.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package b;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Process;
import android.text.TextUtils;
import androidx.webkit.ProxyConfig;
import io.dcloud.WebAppActivity;
import io.dcloud.common.DHInterface.IActivityHandler;
import io.dcloud.common.DHInterface.IApp;
import io.dcloud.common.DHInterface.IBoot;
import io.dcloud.common.DHInterface.ICallBack;
import io.dcloud.common.DHInterface.IConfusionMgr;
import io.dcloud.common.DHInterface.IDCloudWebviewClientListener;
import io.dcloud.common.DHInterface.IFrameView;
import io.dcloud.common.DHInterface.IMgr;
import io.dcloud.common.DHInterface.IOnCreateSplashView;
import io.dcloud.common.DHInterface.IPdrModule;
import io.dcloud.common.DHInterface.ISysEventListener;
import io.dcloud.common.DHInterface.IWebviewStateListener;
import io.dcloud.common.DHInterface.ReceiveSystemEventVoucher;
import io.dcloud.common.adapter.io.DHFile;
import io.dcloud.common.adapter.io.UnicodeInputStream;
import io.dcloud.common.adapter.ui.AdaFrameView;
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.MessageHandler;
import io.dcloud.common.adapter.util.PermissionUtil;
import io.dcloud.common.adapter.util.PlatformUtil;
import io.dcloud.common.adapter.util.SP;
import io.dcloud.common.constant.IntentConst;
import io.dcloud.common.core.permission.PermissionControler;
import io.dcloud.common.ui.PrivacyManager;
import io.dcloud.common.util.AppRuntime;
import io.dcloud.common.util.AppStatus;
import io.dcloud.common.util.AppStatusBarManager;
import io.dcloud.common.util.BaseInfo;
import io.dcloud.common.util.IOUtil;
import io.dcloud.common.util.JSONUtil;
import io.dcloud.common.util.NetworkTypeUtil;
import io.dcloud.common.util.PdrUtil;
import io.dcloud.common.util.TestUtil;
import io.dcloud.common.util.ThreadPool;
import io.dcloud.common.util.ZipUtils;
import io.dcloud.feature.internal.sdk.SDK;
import io.src.dcloud.adapter.DCloudAdapterUtil;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

class e extends b.f implements IApp, ISysEventListener {
    public static String G1 = "webapp";
    ArrayList A0;
    private String Q0;
    private String e0;
    private String f0;
    private String g0;
    private String h0;
    g r;
    private IConfusionMgr s1;
    private String t1;
    b.a x;
    BaseInfo.BaseAppInfo s = null;
    byte t = 1;
    boolean u = false;
    boolean v = false;
    boolean w = false;

    String f29y = null;
    String z = "";
    String A = "";
    String B = "";
    String C = null;
    String D = "";
    String E = null;
    String F = null;
    String G = null;
    String H = null;
    String I = null;
    String J = null;
    String K = null;
    boolean L = true;
    boolean M = true;
    boolean N = true;
    boolean O = false;
    boolean P = false;
    boolean Q = true;
    boolean R = false;
    private String S = null;
    boolean T = false;
    private byte U = 1;
    private boolean V = false;
    private boolean W = false;
    private boolean X = true;
    private boolean Y = true;
    private int Z = 10000;
    private int a0 = 0;

    private int f24b0 = 0;

    private String f26c0 = null;
    private String d0 = null;
    boolean i0 = false;
    private String j0 = null;
    String k0 = null;
    String l0 = null;
    String m0 = null;
    boolean n0 = false;
    String o0 = "accept";
    String p0 = "file:///android_asset/data/dcloud_error.html";
    String q0 = null;
    private String r0 = null;
    String s0 = null;
    private String t0 = "-1";
    private JSONObject u0 = null;
    private String v0 = "";
    private boolean w0 = true;
    private boolean x0 = false;
    private String y0 = "uni-v3";
    private String z0 = "fast";
    HashMap B0 = null;
    JSONObject C0 = null;
    JSONObject D0 = null;
    JSONObject E0 = null;
    JSONObject F0 = null;
    JSONObject G0 = null;
    JSONObject H0 = null;
    JSONObject I0 = null;
    JSONObject J0 = null;
    JSONObject K0 = null;
    String L0 = null;
    String M0 = null;
    Intent N0 = null;
    IApp.IAppStatusListener O0 = null;
    String P0 = null;
    private String R0 = "none";
    boolean S0 = false;
    private boolean T0 = false;
    private boolean U0 = false;
    private String V0 = "default";
    private String W0 = null;
    private String X0 = null;
    private String Y0 = null;
    private String Z0 = "";
    protected boolean a1 = false;

    private boolean f25b1 = false;

    private boolean f27c1 = false;
    private String d1 = null;

    private String f28e1 = null;
    private boolean f1 = false;
    long g1 = 0;
    boolean h1 = true;
    boolean i1 = false;
    boolean j1 = false;
    ArrayList k1 = new ArrayList();
    ArrayList l1 = new ArrayList();
    String m1 = null;
    String n1 = null;
    private String o1 = "";
    private boolean p1 = false;
    private String q1 = null;
    private int r1 = 1;
    IWebviewStateListener u1 = null;
    boolean v1 = false;
    JSONObject w1 = null;
    private boolean x1 = false;
    private String y1 = "none";
    private String z1 = "force";
    private String A1 = null;
    private String B1 = null;
    boolean C1 = true;
    HashMap D1 = null;
    String E1 = null;
    boolean F1 = false;

    class a implements Runnable {
        a() {
        }

        @Override
        public void run() {
            try {
                DHFile.deleteFile(BaseInfo.sBaseWap2AppTemplatePath + "wap2app_temp/");
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    class b implements Runnable {
        b() {
        }

        @Override
        public void run() {
            try {
                DHFile.deleteFile(BaseInfo.sBaseWap2AppTemplatePath + "wap2app_temp/");
                DHFile.deleteFile(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template.zip");
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    class c implements Runnable {
        final ICallBack a;

        class a implements MessageHandler.IMessages {
            a() {
            }

            public void execute(Object obj) {
                c.this.a.onCallBack(0, null);
            }
        }

        c(ICallBack iCallBack) {
            this.a = iCallBack;
        }

        @Override
        public void run() {
            String str = BaseInfo.sCacheFsAppsPath + e.this.o + DeviceInfo.sSeparatorChar + BaseInfo.APP_WWW_FS_DIR;
            long currentTimeMillis = System.currentTimeMillis();
            Logger.d(e.G1, e.this.o + " copy resoure begin!!!");
            DHFile.delete(str);
            DHFile.copyDir(e.this.j0, str);
            long currentTimeMillis2 = System.currentTimeMillis();
            Logger.d(e.G1, e.this.o + " copy resoure end!!! useTime=" + (currentTimeMillis2 - currentTimeMillis));
            e.this.U = (byte) 0;
            e.this.setAppDataPath(str);
            e eVar = e.this;
            BaseInfo.BaseAppInfo baseAppInfo = eVar.s;
            if (baseAppInfo != null) {
                baseAppInfo.saveToBundleData(eVar.getActivity());
            }
            MessageHandler.sendMessage(new a(), (Object) null);
        }
    }

    class d implements Runnable {
        final String a;

        d(String str) {
            this.a = str;
        }

        @Override
        public void run() {
            TestUtil.PointTime.commitTid(e.this.getActivity(), this.a, (String) null, e.this.M0, 1);
        }
    }

    class RunnableC0005e implements Runnable {
        RunnableC0005e() {
        }

        @Override
        public void run() {
            try {
                DHFile.deleteFile(e.this.obtainAppTempPath());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    static class f {
        static final int[] a;

        static {
            int[] iArr = new int[IApp.ConfigProperty.ThridInfo.values().length];
            a = iArr;
            try {
                iArr[IApp.ConfigProperty.ThridInfo.OverrideUrlJsonData.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.OverrideResourceJsonData.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.SecondWebviewJsonData.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.LaunchWebviewJsonData.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.TitleNViewJsonData.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.SitemapJsonData.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.URDJsonData.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.DirectPageJsonData.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                a[IApp.ConfigProperty.ThridInfo.Tabbar.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
        }
    }

    e(b.a aVar, String str, byte b2) {
        this.r = null;
        this.x = null;
        this.A0 = null;
        this.x = aVar;
        this.o = str;
        b(b2);
        this.s1 = c.b.c();
        this.r = new g();
        this.A0 = new ArrayList(2);
        this.q = AppRuntime.isUniApp(str);
    }

    private void d() {
    }

    private void e() {
        JSONObject jSONObject = this.J0;
        if (jSONObject != null) {
            try {
                String optString = jSONObject.optString("webviewid");
                if (TextUtils.isEmpty(optString)) {
                    this.J0.put("webviewid", "direct_page");
                }
                if (this.o.equals(optString)) {
                    this.I0 = this.J0.optJSONObject("titleNView");
                    return;
                }
                JSONObject optJSONObject = this.J0.has("titleNView") ? this.J0.optJSONObject("titleNView") : null;
                if (optJSONObject == null) {
                    optJSONObject = new JSONObject();
                    this.J0.put("titleNView", optJSONObject);
                }
                optJSONObject.put("autoBackButton", true);
                if (optJSONObject.has("homeButton")) {
                    return;
                }
                optJSONObject.put("homeButton", true);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }

    private boolean e(String str) {
        return false;
    }

    private void f() {
        try {
            int rename = DHFile.rename(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/", BaseInfo.sBaseWap2AppTemplatePath + "wap2app_temp/");
            DHFile.copyDir("data/wap2app", BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/");
            if (rename == 1) {
                ThreadPool.self().addThreadTask(new a());
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private JSONObject h() {
        JSONObject jSONObject = null;
        try {
            InputStream obtainResInStream = obtainResInStream("_www/__template.json");
            if (obtainResInStream == null) {
                return null;
            }
            jSONObject = a(obtainResInStream);
            IOUtil.close(obtainResInStream);
            return jSONObject;
        } catch (Exception e) {
            e.printStackTrace();
            return jSONObject;
        }
    }

    private JSONObject i() {
        ThreadPool self;
        b bVar;
        JSONObject jSONObject = null;
        try {
            boolean z = true;
            boolean z2 = false;
            if (BaseInfo.sCoverApkRuning) {
                if (new File(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/__template.json").exists()) {
                    InputStream inputStream = PlatformUtil.getInputStream(BaseInfo.sBaseConfigTemplatePath);
                    JSONObject a2 = a(inputStream);
                    String optString = a2.optString("version");
                    IOUtil.close(inputStream);
                    InputStream inputStream2 = DHFile.getInputStream(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/__template.json");
                    JSONObject a3 = a(inputStream2);
                    String optString2 = a3.optString("version");
                    IOUtil.close(inputStream2);
                    BaseInfo.mWap2appTemplateFiles.clear();
                    BaseInfo.mW2AE.clear();
                    if (BaseInfo.BaseAppInfo.compareVersion(optString, optString2)) {
                        f();
                        jSONObject = a2;
                        z2 = true;
                    } else {
                        jSONObject = a3;
                    }
                }
            }
            if (DHFile.isExist(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template.zip")) {
                DHFile.rename(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/", BaseInfo.sBaseWap2AppTemplatePath + "wap2app_temp/");
                try {
                    try {
                        ZipUtils.upZipFile(new File(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template.zip"), BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/");
                        self = ThreadPool.self();
                        bVar = new b();
                    } catch (IOException e) {
                        e.printStackTrace();
                        self = ThreadPool.self();
                        bVar = new b();
                        z = z2;
                    }
                    self.addThreadTask(bVar);
                } catch (Throwable th) {
                    ThreadPool.self().addThreadTask(new b());
                    throw th;
                }
            } else {
                if (new File(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/__template.json").exists()) {
                    z = z2;
                } else {
                    f();
                }
            }
            if (!z && !TextUtils.isEmpty(BaseInfo.sWap2AppTemplateVersion) && BaseInfo.mWap2appTemplateFiles.size() != 0 && this.s1.getData("__w2a__template__") != null) {
                return jSONObject;
            }
            if (!DHFile.isExist(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/__template.json")) {
                return jSONObject;
            }
            InputStream inputStream3 = DHFile.getInputStream(BaseInfo.sBaseWap2AppTemplatePath + "wap2app__template/__template.json");
            JSONObject a4 = a(inputStream3);
            IOUtil.close(inputStream3);
            BaseInfo.mWap2appTemplateFiles.clear();
            BaseInfo.mW2AE.clear();
            this.s1.removeData("__w2a__template__");
            return a4;
        } catch (Exception e2) {
            e2.printStackTrace();
            return jSONObject;
        }
    }

    private void l() {
        String[] split;
        this.D1 = new HashMap();
        String string = SP.getOrCreateBundle(getActivity(), this.o + "_1").getString("Authorize", null);
        this.E1 = string;
        if (string == null || (split = string.split("&")) == null || split.length <= 0) {
            return;
        }
        for (String str : split) {
            if (!TextUtils.isEmpty(str)) {
                String[] split2 = str.split("=");
                this.D1.put(split2[0], Integer.valueOf(Integer.parseInt(split2[1])));
            }
        }
    }

    private void x() {
        throw new UnsupportedOperationException("Method not decompiled: b.e.x():void");
    }

    @Override
    public void addAllFeaturePermission() {
        PermissionControler.registerRootPermission(this.o);
    }

    @Override
    public void addFeaturePermission(String str) {
        this.A0.add(str.toLowerCase(Locale.ENGLISH));
    }

    @Override
    public void applyMani() {
        try {
            a(DHFile.getInputStream(DHFile.createFileHandler(a(BaseInfo.sConfigXML))), this.o, null);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void applySmartUpdate() {
        a(false);
    }

    void b(InputStream inputStream) {
    }

    boolean b(java.lang.String r7, org.json.JSONObject r8) {
        throw new UnsupportedOperationException("Method not decompiled: b.e.b(java.lang.String, org.json.JSONObject):boolean");
    }

    void c() {
        WebAppActivity webAppActivity = this.a;
        if (webAppActivity != null && (webAppActivity instanceof WebAppActivity)) {
            webAppActivity.onAppActive(this.o);
            this.a.onAppActive(this);
        }
        diyStatusBarState();
        setStatus((byte) 3);
        this.f32b.onAppActive(this);
        callSysEventListener(ISysEventListener.SysEventType.onWebAppForeground, IntentConst.obtainArgs(obtainWebAppIntent(), this.o));
    }

    @Override
    public boolean callSysEventListener(ISysEventListener.SysEventType sysEventType, Object obj) {
        HashMap hashMap = this.B0;
        boolean z = false;
        if (hashMap == null) {
            return false;
        }
        ArrayList arrayList = (ArrayList) hashMap.get(sysEventType);
        ArrayList arrayList2 = (ArrayList) this.B0.get(ISysEventListener.SysEventType.AllSystemEvent);
        ArrayList arrayList3 = new ArrayList();
        if (arrayList != null) {
            arrayList3.addAll(arrayList);
        }
        if (arrayList2 != null) {
            arrayList3.addAll(arrayList2);
        }
        for (int size = arrayList3.size() - 1; size >= 0; size--) {
            ISysEventListener iSysEventListener = (ISysEventListener) arrayList3.get(size);
            if (a(iSysEventListener, sysEventType) && (z || iSysEventListener.onExecute(sysEventType, obj)) && !a(sysEventType)) {
                break;
            }
        }
        return z;
    }

    @Override
    public boolean checkIsCustomPath() {
        return this.n0;
    }

    @Override
    public void checkOrLoadlaunchWebview() {
        b.a aVar = this.x;
        if (aVar != null) {
            AdaFrameView adaFrameView = (AdaFrameView) aVar.processEvent(IMgr.MgrType.WindowMgr, 46, obtainAppId());
            Logger.d("Direct_page", "checkOrLoadlaunchWebview " + manifestBeParsed() + ";adaFrameView=" + adaFrameView);
            this.v1 = manifestBeParsed() ^ true;
            if (adaFrameView == null || !manifestBeParsed()) {
                return;
            }
            adaFrameView.obtainWebView().checkIfNeedLoadOriginalUrl();
        }
    }

    @Override
    public boolean checkPrivateDir(String str) {
        return str.startsWith(obtainAppDataPath()) || str.startsWith("_www");
    }

    @Override
    public String checkPrivateDirAndCopy2Temp(String str) {
        if (obtainRunningAppMode() == 1 && checkPrivateDir(str)) {
            String str2 = "/" + BaseInfo.APP_WWW_FS_DIR;
            String substring = str.substring(str.indexOf(str2) + str2.length());
            String str3 = this.j0 + substring;
            str = obtainAppTempPath() + substring;
            if (!DHFile.exists(str)) {
                DHFile.copyAssetsFile(str3, str);
            }
        }
        return str;
    }

    @Override
    public boolean checkSchemeWhite(String str) {
        if (!q()) {
            return true;
        }
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        Iterator it = this.l1.iterator();
        while (it.hasNext()) {
            String str2 = (String) it.next();
            if (!TextUtils.equals(str2, ProxyConfig.MATCH_ALL_SCHEMES)) {
                if (str.startsWith(str2 + ":")) {
                }
            }
            return true;
        }
        return false;
    }

    @Override
    public boolean checkWhiteUrl(String str) {
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        return this.k1.contains(ProxyConfig.MATCH_ALL_SCHEMES) || this.k1.contains(str);
    }

    @Override
    public void clearRuntimeArgs() {
        this.D = "";
    }

    @Override
    public String convert2AbsFullPath(String str, String str2) {
        boolean z = true;
        try {
            if (!PdrUtil.isEmpty(str2)) {
                if (this.U == 1 && PlatformUtil.isResFileExists(str2)) {
                    return str2;
                }
                if (DHFile.isExist(str2)) {
                    return str2;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (PdrUtil.isEmpty(str2)) {
            return str2;
        }
        int indexOf = str2.indexOf("?");
        if (indexOf > 0) {
            str2 = str2.substring(0, indexOf);
        }
        if (str2.startsWith("_documents/")) {
            return BaseInfo.sDocumentFullPath + str2.substring(11);
        }
        if (str2.startsWith("_documents")) {
            return BaseInfo.sDocumentFullPath + str2.substring(10);
        }
        if (str2.startsWith("_doc/")) {
            return obtainAppDocPath() + str2.substring(5);
        }
        if (str2.startsWith("_doc")) {
            return obtainAppDocPath() + str2.substring(4);
        }
        if (str2.startsWith("_downloads/")) {
            return BaseInfo.sDownloadFullPath + str2.substring(11);
        }
        if (str2.startsWith("_downloads")) {
            return BaseInfo.sDownloadFullPath + str2.substring(10);
        }
        if (str2.startsWith("_www/")) {
            byte b2 = this.U;
            if (b2 != 1) {
                if (b2 != 0) {
                    return str2;
                }
                return this.j0 + str2.substring(5);
            }
            return BaseInfo.sBaseResAppsPath + this.o + "/" + BaseInfo.APP_WWW_FS_DIR + str2.substring(5);
        }
        if (str2.startsWith("_www")) {
            byte b3 = this.U;
            if (b3 != 1) {
                if (b3 != 0) {
                    return str2;
                }
                return this.j0 + str2.substring(4);
            }
            return BaseInfo.sBaseResAppsPath + this.o + "/" + BaseInfo.APP_WWW_FS_DIR + str2.substring(4);
        }
        if (str2.startsWith("file://")) {
            return str2.substring(7);
        }
        if (str2.startsWith("content://") || str2.startsWith(DeviceInfo.sDeviceRootDir)) {
            return str2;
        }
        if (str2.startsWith("http://localhost")) {
            String substring = str2.substring(16);
            return convert2AbsFullPath(null, substring.substring(substring.indexOf("/") + 1));
        }
        if (!str2.startsWith("/") && str != null) {
            z = false;
        } else if (str2.startsWith("/")) {
            str2 = str2.substring(1);
        }
        if (str != null) {
            if (str.startsWith("file:///android_asset/")) {
                str = str.substring(22);
            } else if (str.startsWith("file://")) {
                str = str.substring(7);
            }
        }
        if (str != null && !z) {
            return PdrUtil.standardizedURL(str, str2);
        }
        if (!z) {
            return str2;
        }
        String obtainAppDataPath = obtainAppDataPath();
        if (str != null && !PdrUtil.isEquals(str, obtainAppDataPath) && str.contains("/www/")) {
            obtainAppDataPath = str.substring(0, str.indexOf("/www/") + 5);
        }
        return obtainAppDataPath + b(str2);
    }

    @Override
    public String convert2LocalFullPath(String str, String str2) {
        String convert2AbsFullPath = convert2AbsFullPath(str, str2);
        byte b2 = this.U;
        if (b2 != 1 && !DeviceInfo.isPrivateDirectory) {
            return convert2AbsFullPath;
        }
        InputStream resInputStream = b2 == 1 ? PlatformUtil.getResInputStream(convert2AbsFullPath) : PlatformUtil.getInputStream(convert2AbsFullPath);
        if (resInputStream != null) {
            convert2AbsFullPath = obtainAppTempPath() + System.currentTimeMillis();
            try {
                DHFile.writeFile(resInputStream, convert2AbsFullPath);
                resInputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return convert2AbsFullPath;
    }

    @Override
    public String convert2RelPath(String str) {
        try {
            int length = obtainAppDataPath().length();
            int length2 = obtainAppDocPath().length();
            int length3 = BaseInfo.sDocumentFullPath.length();
            int length4 = BaseInfo.sDownloadFullPath.length();
            if (str.startsWith(obtainAppDataPath())) {
                str = "_www" + str.substring(length - 1);
            } else {
                int i = length - 1;
                if (str.startsWith(obtainAppDataPath().substring(0, i))) {
                    str = "_www" + str.substring(i, str.length());
                } else if (str.startsWith(obtainAppDocPath())) {
                    str = "_doc" + str.substring(length2 - 1);
                } else {
                    int i2 = length2 - 1;
                    if (str.startsWith(obtainAppDocPath().substring(0, i2))) {
                        str = "_doc" + str.substring(i2);
                    } else if (str.startsWith(BaseInfo.sDocumentFullPath)) {
                        str = "_documents" + str.substring(length3 - 1);
                    } else {
                        int i3 = length3 - 1;
                        if (str.startsWith(BaseInfo.sDocumentFullPath.substring(0, i3))) {
                            str = "_documents" + str.substring(i3);
                        } else if (str.startsWith(BaseInfo.sDownloadFullPath)) {
                            str = "_downloads" + str.substring(length4 - 1);
                        } else {
                            int i4 = length4 - 1;
                            if (str.startsWith(BaseInfo.sDownloadFullPath.substring(0, i4))) {
                                str = "_downloads" + str.substring(i4);
                            }
                        }
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return str;
    }

    @Override
    public String convert2WebviewFullPath(String str, String str2) {
        boolean z;
        if (PdrUtil.isEmpty(str2)) {
            return str2;
        }
        if (this.T) {
            if (str2.startsWith("http://")) {
                return str2;
            }
            return this.r0 + str2;
        }
        if (str2.startsWith("file://") || str2.startsWith("http://") || str2.startsWith("https://")) {
            return str2;
        }
        try {
            if (DHFile.isExist(str2)) {
                return "file:///" + b(str2);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (str2.startsWith(DeviceInfo.sDeviceRootDir)) {
            return "file://" + str2;
        }
        if (str2.startsWith("/")) {
            z = true;
            str2 = str2.substring(1);
        } else {
            z = false;
        }
        if (str2.startsWith("_www")) {
            return obtainWebviewBaseUrl() + b(str2.substring(4));
        }
        if (str2.startsWith("_documents")) {
            return "file://" + BaseInfo.sDocumentFullPath + b(str2.substring(10));
        }
        if (str2.startsWith("_doc")) {
            return "file://" + obtainAppDocPath() + b(str2.substring(4));
        }
        if (str2.startsWith("_downloads")) {
            return "file://" + BaseInfo.sDownloadFullPath + b(str2.substring(10));
        }
        if (str != null && !z) {
            return PdrUtil.standardizedURL(str, str2);
        }
        String obtainWebviewBaseUrl = obtainWebviewBaseUrl();
        if (str != null && !PdrUtil.isEquals(str, obtainWebviewBaseUrl) && str.contains("/www/")) {
            obtainWebviewBaseUrl = str.substring(0, str.indexOf("/www/") + 5);
        }
        return obtainWebviewBaseUrl + b(str2);
    }

    JSONObject d(String str) {
        if (this.w1 == null) {
            m();
        }
        if (this.w1 == null || TextUtils.isEmpty(str)) {
            return null;
        }
        return PdrUtil.getSitemapParameters(this.w1, obtainAppId(), str);
    }

    @Override
    public void deleteAppTemp() {
        ThreadPool.self().addThreadTask(new RunnableC0005e(), true);
    }

    @Override
    public void diyStatusBarState() {
        AppStatusBarManager appStatusBarManager = this.m;
        if (appStatusBarManager == null) {
            return;
        }
        if (this.i) {
            appStatusBarManager.setFullScreen(getActivity(), this.i);
        } else {
            if (appStatusBarManager.checkImmersedStatusBar(getActivity(), this.a1)) {
                BaseInfo.isImmersive = true;
                this.m.setImmersive(getActivity(), true);
            } else {
                BaseInfo.isImmersive = false;
                this.m.setImmersive(getActivity(), false);
            }
            if (Build.VERSION.SDK_INT >= 21 && getActivity() != null) {
                if (PdrUtil.isEmpty(this.W0)) {
                    this.m.setStatusBarColor(getActivity(), BaseInfo.mDeStatusBarBackground);
                } else {
                    this.m.setStatusBarColor(getActivity(), this.W0.startsWith("#") ? PdrUtil.stringToColor(this.W0) : 0);
                }
            }
            this.m.setStatusBarMode(getActivity(), this.Z0);
        }
        if (this.m.isFullScreenOrImmersive()) {
            updateScreenInfo(2);
        }
    }

    @Override
    public String forceShortCut() {
        return this.z1;
    }

    boolean g(String str) {
        setRuntimeArgs(str);
        setStatus((byte) 3);
        Object processEvent = this.x.processEvent(IMgr.MgrType.WindowMgr, 41, new Object[]{this, convert2WebviewFullPath(null, this.q0), Boolean.valueOf(this.S0)});
        if (processEvent == null) {
            return true;
        }
        return Boolean.parseBoolean(String.valueOf(processEvent));
    }

    @Override
    public IConfusionMgr getConfusionMgr() {
        return this.s1;
    }

    @Override
    public String getDirectPage() {
        return this.m1;
    }

    @Override
    public IApp.IAppStatusListener getIAppStatusListener() {
        return this.O0;
    }

    @Override
    public String getOriginalDirectPage() {
        return this.n1;
    }

    @Override
    public String getPathByType(byte b2) {
        if (b2 == 0) {
            return obtainAppDataPath();
        }
        if (b2 == 1) {
            return obtainAppDocPath();
        }
        if (b2 == 2) {
            return BaseInfo.sDocumentFullPath;
        }
        if (b2 == 3) {
            return BaseInfo.sDownloadFullPath;
        }
        if (b2 != -1) {
            return null;
        }
        return BaseInfo.sBaseResAppsPath + this.o + "/" + BaseInfo.APP_WWW_FS_DIR;
    }

    @Override
    public String getPopGesture() {
        return this.R0;
    }

    @Override
    public int getQuitModel() {
        return this.r1;
    }

    @Override
    public String getSystemInfo() {
        try {
            if (DeviceInfo.sSystemInfo == null) {
                return null;
            }
            JSONObject jSONObject = new JSONObject(DeviceInfo.sSystemInfo.toString());
            jSONObject.put("uniCompileVersion", this.t0);
            jSONObject.put("uniRuntimeVersion", BaseInfo.uniVersionV3);
            jSONObject.put("browserName", WebViewFactory.isOther() ? "x5webview" : "chrome");
            jSONObject.put("appId", BaseInfo.sCurrentAppOriginalAppid);
            jSONObject.put("appName", this.s0);
            if (SDK.isUniMP) {
                jSONObject.put("appVersion", this.z);
                jSONObject.put("appVersionCode", this.A);
            } else {
                jSONObject.put("appVersion", b(getActivity()));
                jSONObject.put("appVersionCode", a((Context) getActivity()));
            }
            jSONObject.put("appWgtVersion", this.z);
            return jSONObject.toString();
        } catch (Exception unused) {
            return null;
        }
    }

    @Override
    public boolean isOnAppRunningMode() {
        return this.U == 1;
    }

    @Override
    public boolean isUniApp() {
        return this.q;
    }

    public float j() {
        return (PermissionControler.checkPermission(this.o, "Device".toLowerCase(Locale.ENGLISH)) && getActivity() != null && NetworkTypeUtil.getNetworkType(getActivity()) == 4) ? 1000.0f : 0.0f;
    }

    void k() {
        if (PdrUtil.isEmpty(this.j0) || !DeviceInfo.startsWithSdcard(this.j0)) {
            setAppDataPath(BaseInfo.sCacheFsAppsPath + this.o + "/" + BaseInfo.REAL_PRIVATE_WWW_DIR);
        }
        if (PdrUtil.isEmpty(this.A1) || !DeviceInfo.startsWithSdcard(this.A1)) {
            setAppDocPath(BaseInfo.sBaseFsAppsPath + this.o + "/" + BaseInfo.REAL_PRIVATE_DOC_DIR);
        }
        if (PdrUtil.isEmpty(this.B1) || !DeviceInfo.startsWithSdcard(this.B1)) {
            this.B1 = BaseInfo.sCacheFsAppsPath + this.o + "/" + BaseInfo.APP_WEB_CHACHE;
        }
    }

    void m() {
        File file = new File(c(this.o));
        if (file.exists()) {
            try {
                JSONObject jSONObject = new JSONObject(IOUtil.toString(new FileInputStream(file)));
                this.w1 = jSONObject;
                this.B = jSONObject.optString("version");
                return;
            } catch (Exception e) {
                e.printStackTrace();
                return;
            }
        }
        byte[] fileContent = PlatformUtil.getFileContent("data/sitemap/" + this.o + ".json", 0);
        if (fileContent != null) {
            DHFile.writeFile(fileContent, 0, c(this.o));
            m();
        }
    }

    @Override
    public boolean manifestBeParsed() {
        return this.u || SDK.IntegratedMode.WEBVIEW == BaseInfo.sRuntimeMode;
    }

    public boolean n() {
        if (q() && this.u) {
            return this.O;
        }
        return true;
    }

    @Override
    public boolean needRefreshApp() {
        return this.j1;
    }

    @Override
    public boolean needReload() {
        return this.i1;
    }

    public boolean o() {
        throw new UnsupportedOperationException("Method not decompiled: b.e.o():boolean");
    }

    @Override
    public String obtainAdaptationJs() {
        if (this.S == null && !PdrUtil.isEmpty(this.J)) {
            byte[] fileContent = PlatformUtil.getFileContent(a(this.J), obtainRunningAppMode() == 1 ? 0 : 2);
            if (fileContent != null) {
                this.S = new String(fileContent);
            } else {
                this.S = "";
            }
        }
        return this.S;
    }

    @Override
    public String obtainAppDataPath() {
        String str = this.j0;
        if (str != null) {
            return str;
        }
        return this.o + "/www/";
    }

    @Override
    public String obtainAppDocPath() {
        return this.A1;
    }

    @Override
    public String obtainAppId() {
        return this.o;
    }

    @Override
    public String obtainAppInfo() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("appid", this.o);
            jSONObject.put("versionName", this.z);
            jSONObject.put("name", this.s0);
            jSONObject.put("versionCode", this.A);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return jSONObject.toString();
    }

    @Override
    public String obtainAppLog() {
        return BaseInfo.sBaseFsAppsPath + this.o + "/log/";
    }

    @Override
    public String obtainAppName() {
        return this.s0;
    }

    @Override
    public byte obtainAppStatus() {
        return this.t;
    }

    @Override
    public String obtainAppTempPath() {
        return BaseInfo.sBaseFsAppsPath + this.o + "/temp/";
    }

    @Override
    public String obtainAppVersionCode() {
        return this.A;
    }

    @Override
    public String obtainAppVersionName() {
        return this.z;
    }

    @Override
    public String obtainAppWebCachePath() {
        return this.B1;
    }

    @Override
    public String obtainConfigProperty(String str) {
        String str2;
        if (PdrUtil.isEquals(str, "adid")) {
            str2 = this.M0;
        } else if (PdrUtil.isEquals(str, "launchError")) {
            str2 = this.L0;
        } else if (PdrUtil.isEquals(str, "autoclose")) {
            str2 = String.valueOf(this.X);
        } else if (PdrUtil.isEquals(str, "timeout")) {
            str2 = String.valueOf(this.Z);
        } else if (PdrUtil.isEquals(str, "delay")) {
            str2 = String.valueOf(this.a0);
        } else if (PdrUtil.isEquals(str, "splashscreen")) {
            str2 = String.valueOf(this.V);
        } else if (PdrUtil.isEquals(str, "waiting")) {
            str2 = String.valueOf(this.W);
        } else if (PdrUtil.isEquals(str, "h5plus")) {
            str2 = String.valueOf(this.Q);
        } else if (PdrUtil.isEquals(str, "funSetUA")) {
            str2 = String.valueOf(this.R);
        } else if (PdrUtil.isEquals(str, "useragent")) {
            str2 = this.K;
        } else if (PdrUtil.isEquals(str, "error")) {
            str2 = this.p0;
        } else if (PdrUtil.isEquals(str, "fullscreen")) {
            str2 = String.valueOf(this.i);
        } else if (PdrUtil.isEquals(str, "untrustedca")) {
            str2 = this.o0;
        } else if (PdrUtil.isEquals(str, "loadedTime")) {
            str2 = this.P0;
        } else if (PdrUtil.isEquals(str, "ramcachemode")) {
            str2 = this.Q0;
        } else if (PdrUtil.isEquals(str, "jserror")) {
            str2 = this.M + "";
        } else if (PdrUtil.isEquals(str, "crash")) {
            str2 = this.L + "";
        } else if (PdrUtil.isEquals(str, "use_encryption")) {
            str2 = this.T0 + "";
        } else if (PdrUtil.isEquals(str, "w2a_delay")) {
            str2 = String.valueOf(this.f24b0);
        } else if (PdrUtil.isEquals(str, "w2a_autoclose")) {
            str2 = String.valueOf(this.Y);
        } else if (PdrUtil.isEquals(str, "wap2app_running_mode")) {
            str2 = this.N + "";
        } else if (PdrUtil.isEquals(str, "injection")) {
            str2 = this.h1 + "";
        } else if (PdrUtil.isEquals(str, "event")) {
            str2 = this.f26c0;
        } else if (PdrUtil.isEquals(str, "target")) {
            str2 = this.d0;
        } else if (PdrUtil.isEquals(str, "L_plusrequire")) {
            str2 = this.e0;
        } else if (PdrUtil.isEquals(str, "S_pluserquire")) {
            str2 = this.f0;
        } else if (PdrUtil.isEquals(str, "L_geolocation")) {
            str2 = this.g0;
        } else if (PdrUtil.isEquals(str, "S_geolocation")) {
            str2 = this.h0;
        } else if (PdrUtil.isEquals(str, "StatusBarBackground")) {
            str2 = this.W0 + "";
        } else if (PdrUtil.isEquals(str, "status_bar_mode")) {
            str2 = this.Z0;
        } else if (PdrUtil.isEquals(str, "immersed")) {
            str2 = this.a1 + "";
        } else if (PdrUtil.isEquals(str, "launch_is_statusbar")) {
            str2 = String.valueOf(this.f25b1);
        } else if (PdrUtil.isEquals(str, "launch_statusbar_color")) {
            str2 = this.d1;
        } else if (PdrUtil.isEquals(str, "second_is_statusbar")) {
            str2 = String.valueOf(this.f27c1);
        } else if (PdrUtil.isEquals(str, "second_statusbar_color")) {
            str2 = this.f28e1;
        } else if (PdrUtil.isEquals(str, "coordType")) {
            str2 = this.o1;
        } else if (PdrUtil.isEquals(str, "uniapp_weex_js_service")) {
            str2 = String.valueOf(this.f1);
        } else if (PdrUtil.isEquals(str, "appUniVersion")) {
            str2 = this.t0;
        } else if (PdrUtil.isEquals(str, "control")) {
            str2 = this.q ? this.y0 : "h5+";
        } else if (PdrUtil.isEquals(str, "uni_nvue_data")) {
            JSONObject jSONObject = this.u0;
            str2 = jSONObject == null ? null : jSONObject.toString();
        } else if (PdrUtil.isEquals(str, "concatenate")) {
            str2 = this.P + "";
        } else if (PdrUtil.isEquals(str, "nvueLaunchMode")) {
            str2 = this.z0;
        } else if (PdrUtil.isEquals(str, "debugRefresh")) {
            str2 = this.q1;
        } else if (PdrUtil.isEquals(str, "uni_restart_to_direct")) {
            str2 = String.valueOf(this.p1);
        } else if (PdrUtil.isEquals(str, "isUniapp")) {
            str2 = String.valueOf(this.q);
        } else if (PdrUtil.isEquals(str, "use_v3_encryption")) {
            str2 = String.valueOf(this.U0);
        } else {
            if (!PdrUtil.isEquals(str, "unimp_run_extra_info")) {
                return null;
            }
            str2 = this.t1;
        }
        return str2;
    }

    @Override
    public IWebviewStateListener obtainLaunchPageStateListener() {
        return this.u1;
    }

    @Override
    public Object obtainMgrData(IMgr.MgrType mgrType, int i, Object[] objArr) {
        return this.x.processEvent(mgrType, i, objArr);
    }

    @Override
    public String obtainOriginalAppId() {
        return this.f29y;
    }

    @Override
    public InputStream obtainResInStream(String str, String str2) {
        String convert2AbsFullPath = convert2AbsFullPath(str, str2);
        byte b2 = this.U;
        if (b2 == 1) {
            if (!PdrUtil.isDeviceRootDir(convert2AbsFullPath)) {
                return PlatformUtil.getResInputStream(convert2AbsFullPath);
            }
            try {
                return DHFile.getInputStream(DHFile.createFileHandler(convert2AbsFullPath));
            } catch (IOException e) {
                Logger.w("WebApp.obtainResInStream", e);
            }
        } else if (b2 == 0) {
            try {
                return DHFile.getInputStream(DHFile.createFileHandler(convert2AbsFullPath));
            } catch (IOException e2) {
                Logger.w("WebApp.obtainResInStream", e2);
            }
        }
        return null;
    }

    @Override
    public byte obtainRunningAppMode() {
        return this.U;
    }

    @Override
    public String obtainRuntimeArgs(boolean z) {
        return z ? JSONObject.quote(this.D) : this.D;
    }

    @Override
    public AppStatusBarManager obtainStatusBarMgr() {
        return this.m;
    }

    @Override
    public JSONObject obtainThridInfo(IApp.ConfigProperty.ThridInfo thridInfo) {
        switch (f.a[thridInfo.ordinal()]) {
            case 1:
                return this.C0;
            case 2:
                return this.E0;
            case 3:
                return this.F0;
            case 4:
                return this.G0;
            case 5:
                return this.I0;
            case 6:
                m();
                return this.w1;
            case 7:
                return this.x.g;
            case 8:
                return this.J0;
            case 9:
                return this.D0;
            default:
                return null;
        }
    }

    @Override
    public String obtainVersionSitemap() {
        return this.B;
    }

    @Override
    public Intent obtainWebAppIntent() {
        return this.N0;
    }

    @Override
    public String obtainWebviewBaseUrl() {
        return a(this.U);
    }

    public boolean onExecute(ISysEventListener.SysEventType sysEventType, Object obj) {
        byte b2 = this.t;
        if (b2 == 3) {
            return callSysEventListener(sysEventType, obj);
        }
        if (b2 == 1 && (sysEventType == ISysEventListener.SysEventType.onWebAppStop || sysEventType == ISysEventListener.SysEventType.onStop)) {
            s();
        }
        return false;
    }

    @Override
    public void onSplashClosed() {
        diyStatusBarState();
    }

    public boolean p() {
        return this.t == 3;
    }

    public boolean q() {
        Intent obtainWebAppIntent = obtainWebAppIntent();
        if (obtainWebAppIntent != null) {
            boolean z = this.F1;
            this.F1 = obtainWebAppIntent.getBooleanExtra("is_stream_app", z) | z;
        }
        return this.F1;
    }

    public boolean r() {
        Logger.d("appmgr", this.o + " onStop");
        IApp.IAppStatusListener iAppStatusListener = this.O0;
        if (iAppStatusListener != null) {
            return iAppStatusListener.onStop();
        }
        return true;
    }

    @Override
    public void registerSysEventListener(ISysEventListener iSysEventListener, ISysEventListener.SysEventType sysEventType) {
        if (this.B0 == null) {
            this.B0 = new HashMap(1);
        }
        ArrayList arrayList = (ArrayList) this.B0.get(sysEventType);
        if (arrayList == null) {
            arrayList = new ArrayList();
            this.B0.put(sysEventType, arrayList);
        }
        arrayList.add(iSysEventListener);
    }

    public void s() {
        this.k1.clear();
        this.l1.clear();
        WebAppActivity webAppActivity = this.a;
        if (webAppActivity != null && (webAppActivity instanceof WebAppActivity)) {
            webAppActivity.onAppStop(this.o);
        }
        Logger.d("appmgr", "webapp.onStoped");
        BaseInfo.s_Runing_App_Count--;
        callSysEventListener(ISysEventListener.SysEventType.onWebAppStop, this);
        d();
        PermissionUtil.removeTempPermission(this.a, this.o);
        b();
        deleteAppTemp();
        PermissionControler.unregisterRootPermission(this.o);
        this.x.e(this);
        if (getIAppStatusListener() != null) {
            getIAppStatusListener().onStoped(false, (String) null);
        }
        this.x.processEvent(IMgr.MgrType.WindowMgr, 25, this);
        PrivacyManager.getInstance().unRegisterPrivacyAgreeAllListener();
    }

    @Override
    public void setAppDataPath(String str) {
        if (this.U == 1) {
            if (str.startsWith(BaseInfo.sBaseResAppsPath)) {
                this.j0 = str;
                return;
            }
            this.j0 = BaseInfo.sBaseResAppsPath + this.o + "/" + BaseInfo.APP_WWW_FS_DIR;
            return;
        }
        if (new File(str).exists()) {
            this.j0 = str;
            return;
        }
        if (str.startsWith(DeviceInfo.sCacheRootDir)) {
            this.j0 = str;
            return;
        }
        this.j0 = DeviceInfo.sCacheRootDir + "/" + str;
    }

    @Override
    public void setAppDocPath(String str) {
        this.A1 = PdrUtil.appendByDeviceRootDir(str);
    }

    @Override
    public void setConfigProperty(String str, String str2) {
        if (PdrUtil.isEquals(str, "autoclose")) {
            this.X = PdrUtil.parseBoolean(str2, this.X, false);
            return;
        }
        if (PdrUtil.isEquals(str, "commit")) {
            a();
            return;
        }
        if (PdrUtil.isEquals(str, "timeout")) {
            this.Z = PdrUtil.parseInt(str2, this.Z);
            return;
        }
        if (PdrUtil.isEquals(str, "delay")) {
            this.a0 = PdrUtil.parseInt(str2, this.a0);
            return;
        }
        if (PdrUtil.isEquals(str, "splashscreen")) {
            this.V = PdrUtil.parseBoolean(str2, this.V, false);
            return;
        }
        if (PdrUtil.isEquals(str, "waiting")) {
            this.W = PdrUtil.parseBoolean(str2, this.W, false);
            return;
        }
        if (PdrUtil.isEquals(str, "name")) {
            this.s0 = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "name")) {
            this.F = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "email")) {
            this.G = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "url")) {
            this.I = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "name")) {
            this.z = str2;
            BaseInfo.sLastAppVersionName = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "code")) {
            this.A = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "liberate")) {
            this.i0 = PdrUtil.parseBoolean(str2, this.V, false);
            return;
        }
        if (PdrUtil.isEquals(str, "h5plus")) {
            this.Q = PdrUtil.parseBoolean(str2, true, false);
            return;
        }
        if (PdrUtil.isEquals(str, "funSetUA")) {
            this.R = PdrUtil.parseBoolean(str2, true, false);
            return;
        }
        if (PdrUtil.isEquals(str, "useragent")) {
            this.K = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "fullscreen")) {
            this.i = PdrUtil.parseBoolean(str2, this.i, false);
            return;
        }
        if (PdrUtil.isEquals(str, "webcache_path")) {
            this.B1 = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "wap2app_running_mode")) {
            this.N = PdrUtil.parseBoolean(str2, false, false);
            return;
        }
        if (PdrUtil.isEquals(str, "loadedTime")) {
            this.P0 = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "StatusBarBackground")) {
            this.W0 = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "status_bar_mode")) {
            this.Z0 = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "immersed")) {
            this.a1 = Boolean.valueOf(str2).booleanValue();
            return;
        }
        if (PdrUtil.isEquals(str, "launch_is_statusbar")) {
            this.f25b1 = Boolean.valueOf(str2).booleanValue();
            return;
        }
        if (PdrUtil.isEquals(str, "launch_statusbar_color")) {
            this.d1 = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "second_is_statusbar")) {
            this.f27c1 = Boolean.valueOf(str2).booleanValue();
            return;
        }
        if (PdrUtil.isEquals(str, "second_statusbar_color")) {
            this.f28e1 = str2;
            return;
        }
        if (PdrUtil.isEquals(str, "uniapp_weex_js_service")) {
            this.f1 = Boolean.valueOf(str2).booleanValue();
            return;
        }
        if (PdrUtil.isEquals(str, "debugRefresh")) {
            this.q1 = str2;
        } else if (PdrUtil.isEquals(str, "uni_restart_to_direct")) {
            this.p1 = Boolean.valueOf(str2).booleanValue();
        } else if (PdrUtil.isEquals(str, "unimp_run_extra_info")) {
            this.t1 = str2;
        }
    }

    @Override
    public void setDirectPage(String str) {
        this.m1 = str;
    }

    @Override
    public void setHideNavBarState(boolean z) {
        this.p = z;
    }

    @Override
    public void setIAppStatusListener(IApp.IAppStatusListener iAppStatusListener) {
        this.O0 = iAppStatusListener;
    }

    @Override
    public void setLaunchPageStateListener(IWebviewStateListener iWebviewStateListener) {
        this.u1 = iWebviewStateListener;
    }

    @Override
    public void setNeedRefreshApp(boolean z) {
        this.j1 = z;
    }

    @Override
    public void setQuitModel(int i) {
        this.r1 = i;
    }

    @Override
    public void setRuntimeArgs(String str) {
        if (PdrUtil.isEmpty(str)) {
            return;
        }
        this.D = str;
    }

    @Override
    public void setStatus(byte b2) {
        this.t = b2;
        if (b2 == 3) {
            this.g1 = System.currentTimeMillis();
        }
    }

    @Override
    public void setWebAppActivity(Activity activity) {
        this.a = activity;
        a(activity);
    }

    @Override
    public void setWebAppIntent(android.content.Intent r18) {
        throw new UnsupportedOperationException("Method not decompiled: b.e.setWebAppIntent(android.content.Intent):void");
    }

    @Override
    public String shortcutQuit() {
        return this.y1;
    }

    @Override
    public void showSplash() {
        IOnCreateSplashView activity = getActivity();
        if (activity instanceof IOnCreateSplashView) {
            activity.setIntent(this.N0);
            activity.onCreateSplash(activity);
        }
    }

    @Override
    public boolean startFromShortCut() {
        return this.x1;
    }

    void t() {
        PermissionControler.registerPermission(this.o, this.A0);
    }

    public String toString() {
        return this.s0 + "-" + this.o + "-" + super.toString();
    }

    public void u() {
        b(false);
        setStatus((byte) 1);
        AppStatus.setAppStatus(this.o, 0);
        this.x.processEvent(IMgr.MgrType.FeatureMgr, 3, this.o);
        Logger.d("appmgr", this.o + " will active change to unrunning");
        this.x.processEvent(null, 0, this);
        WebViewFactory.sUsePermissionWebviews.clear();
    }

    @Override
    public void unregisterSysEventListener(ISysEventListener iSysEventListener, ISysEventListener.SysEventType sysEventType) {
        ArrayList arrayList;
        HashMap hashMap = this.B0;
        if (hashMap == null || (arrayList = (ArrayList) hashMap.get(sysEventType)) == null) {
            return;
        }
        arrayList.remove(iSysEventListener);
        if (arrayList.isEmpty()) {
            this.B0.remove(sysEventType);
        }
    }

    @Override
    public void updateDirectPage(String str) {
        if (TextUtils.isEmpty(str)) {
            str = this.m1;
        }
        JSONObject d2 = d(str);
        if (d2 != null) {
            this.J0 = d2;
            e();
            this.x.processEvent(IMgr.MgrType.WindowMgr, 48, this);
        }
    }

    public String v() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("appid", this.o);
            jSONObject.put("version", this.z);
            jSONObject.put("name", this.s0);
            jSONObject.put("versionCode", this.A);
            jSONObject.put("description", this.E);
            jSONObject.put("author", this.F);
            jSONObject.put("email", this.G);
            jSONObject.put("license", this.H);
            jSONObject.put("licensehref", this.I);
            jSONObject.put("features", new JSONArray((Collection) this.A0));
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return jSONObject.toString();
    }

    void w() {
        b(true);
    }

    @Override
    public String obtainAuthority(String str) {
        String str2 = BaseInfo.sGlobalAuthority;
        if ((str2 != null && TextUtils.equals(ProxyConfig.MATCH_ALL_SCHEMES, str2)) || !q() || TextUtils.isEmpty(str) || e(this.o)) {
            return IApp.AUTHORITY_AUTHORIZED;
        }
        JSONObject jSONObject = this.H0;
        if (jSONObject == null) {
            return IApp.AUTHORITY_UNDETERMINED;
        }
        Iterator<String> keys = jSONObject.keys();
        while (keys.hasNext()) {
            String next = keys.next();
            if (str.equalsIgnoreCase(next)) {
                return this.H0.optString(next, IApp.AUTHORITY_UNDETERMINED);
            }
        }
        return IApp.AUTHORITY_UNDETERMINED;
    }

    boolean a(java.io.InputStream r62, java.lang.String r63, org.json.JSONObject r64) {
        throw new UnsupportedOperationException("Method not decompiled: b.e.a(java.io.InputStream, java.lang.String, org.json.JSONObject):boolean");
    }

    public void g() {
        ArrayList arrayList = this.A0;
        if (arrayList != null) {
            arrayList.clear();
            this.A0 = null;
        }
        HashMap hashMap = this.B0;
        if (hashMap != null) {
            hashMap.clear();
            this.B0 = null;
        }
        this.s1.removeData(this.o);
        this.x = null;
        this.s = null;
        this.f1 = false;
    }

    private static PackageInfo c(Context context) {
        try {
            return context.getPackageManager().getPackageInfo(context.getPackageName(), 16384);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    boolean c(java.lang.String r10, org.json.JSONObject r11) {
        throw new UnsupportedOperationException("Method not decompiled: b.e.c(java.lang.String, org.json.JSONObject):boolean");
    }

    boolean f(String str) {
        if (!this.u && this.w) {
            return false;
        }
        Logger.e("Webapp start " + this.o);
        WebAppActivity webAppActivity = this.a;
        if (webAppActivity != null && (webAppActivity instanceof WebAppActivity)) {
            webAppActivity.onAppStart(this.o);
            this.a.onAppStart(this);
        }
        BaseInfo.s_Runing_App_Count++;
        this.v = true;
        this.w = !this.u;
        setRuntimeArgs(str);
        return a(5);
    }

    @Override
    public InputStream obtainResInStream(String str) {
        return obtainResInStream(null, str);
    }

    private String c(String str) {
        return BaseInfo.sBaseFsSitMapPath + str + "/_sitemap.json";
    }

    @Override
    public String convert2AbsFullPath(String str) {
        return convert2AbsFullPath(null, str);
    }

    void b(byte b2) {
        this.U = b2;
    }

    private static String b(String str) {
        return (str == null || str.length() <= 0 || str.charAt(0) != '/') ? str : b(str.substring(1));
    }

    void b(boolean z) {
        this.f32b.onAppUnActive(this);
        if (z) {
            callSysEventListener(ISysEventListener.SysEventType.onWebAppPause, this);
            callSysEventListener(ISysEventListener.SysEventType.onWebAppBackground, this);
        }
        IApp.IAppStatusListener iAppStatusListener = this.O0;
        if (iAppStatusListener != null) {
            iAppStatusListener.onPause(this, (IApp) null);
        }
        setStatus((byte) 2);
    }

    private void b() {
        if (q() || !d.b.c(getActivity())) {
            return;
        }
        ThreadPool.self().addThreadTask(new d(obtainAppId()));
    }

    public static String b(Context context) {
        return c(context).versionName;
    }

    private JSONObject a(InputStream inputStream) {
        try {
            if (!this.q) {
                inputStream = new UnicodeInputStream(inputStream, Charset.defaultCharset().name());
            }
            return new JSONObject(new String(IOUtil.getBytes(inputStream)));
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    void a(Activity activity) {
        super.a(activity);
        AppStatusBarManager appStatusBarManager = this.m;
        if (appStatusBarManager != null) {
            appStatusBarManager.checkImmersedStatusBar(activity, this.a1);
            this.m.isFullScreen = isFullScreen();
        }
        this.l.mJsonViewOption = JSONUtil.createJSONObject("{}");
        this.f = PdrUtil.parseInt(SP.getBundleData(getActivity(), BaseInfo.PDR, "StatusBarHeight"), 0);
        updateScreenInfo(4);
        this.x1 = false;
        IActivityHandler iActivityHandler = DCloudAdapterUtil.getIActivityHandler(getActivity());
        if (!q() && iActivityHandler != null) {
            HashMap hashMap = new HashMap();
            hashMap.put("v", this.z);
            hashMap.put("appid", this.o);
            hashMap.put("name", this.s0);
            hashMap.put("adid", this.M0);
            hashMap.put("bg", this.X0);
            hashMap.put("img", convert2AbsFullPath(this.Y0));
            io.dcloud.a.a(getActivity(), this.o, "save", hashMap);
        }
        Intent intent = activity.getIntent();
        if (intent != null) {
            Bundle extras = intent.getExtras();
            if (extras != null && extras.containsKey("from_short_cut_start") && extras.getBoolean("from_short_cut_start")) {
                this.x1 = true;
            }
            if (extras != null && extras.containsKey("create_shortcut")) {
                this.z1 = extras.getString("create_shortcut");
            }
            if (extras != null && extras.containsKey("shortcutQuit")) {
                this.y1 = extras.getString("shortcutQuit");
            }
            if (extras != null && extras.containsKey("__scq")) {
                this.y1 = extras.getString("__scq");
            }
            if (intent.hasExtra("__sc")) {
                this.z1 = intent.getStringExtra("__sc");
            }
            if (TextUtils.isEmpty(this.z1)) {
                String launchType = BaseInfo.getLaunchType(intent);
                this.z1 = "force";
                if (launchType.equals("scheme")) {
                    this.z1 = "query";
                    return;
                }
                if (this.O) {
                    this.z1 = "force";
                    return;
                }
                String string = SP.getOrCreateBundle(activity, "pdr").getString("test_runing" + this.o, null);
                if (!TextUtils.isEmpty(string) && string.equals("__am=t")) {
                    this.z1 = "force";
                } else {
                    this.z1 = "none";
                }
            }
        }
    }

    String a(String str) {
        return this.j0 + str;
    }

    void a(ICallBack iCallBack) {
        if ((BaseInfo.ISDEBUG || this.i0) && this.U == 1) {
            ThreadPool.self().addThreadTask(new c(iCallBack), true);
        } else {
            iCallBack.onCallBack(0, null);
        }
    }

    private boolean a(int i) {
        PermissionUtil.sUseStreamAppPermissionDialogCount = 0;
        WebViewFactory.sUsePermissionWebviews.clear();
        PermissionUtil.removeTempPermission(this.a, this.o);
        Logger.e(G1, "start0 mAppid===" + this.o);
        BaseInfo.sCurrentAppOriginalAppid = this.f29y;
        BaseInfo.putStartupTimeData(this.o, String.valueOf(System.currentTimeMillis()));
        BaseInfo.sProcessId = Process.myPid();
        String str = G1;
        StringBuilder sb = new StringBuilder();
        sb.append(this.o);
        sb.append(this.U == 1 ? " APP_RUNNING_MODE" : " FS_RUNNING_MODE");
        Logger.i(str, sb.toString());
        t();
        setStatus((byte) 3);
        IApp.IAppStatusListener iAppStatusListener = this.O0;
        if (iAppStatusListener != null) {
            iAppStatusListener.onStart();
        }
        Logger.i(G1, "mLaunchPath=" + this.k0);
        Logger.i("download_manager", "webapp start task begin success appid=" + this.o + " mLaunchPath=" + this.k0);
        String str2 = TestUtil.START_STREAM_APP;
        StringBuilder sb2 = new StringBuilder("webapp start appid=");
        sb2.append(this.o);
        TestUtil.print(str2, sb2.toString());
        BaseInfo.setLoadingLaunchePage(true, "start0");
        String stringExtra = getActivity().getIntent().getStringExtra("__launch_path__");
        if (stringExtra != null && !"".equals(stringExtra.trim())) {
            getActivity().getIntent().removeExtra("__launch_path__");
            if (!"about:blank".equals(stringExtra)) {
                stringExtra = convert2WebviewFullPath(null, stringExtra);
            }
            this.n0 = true;
        } else if (BaseInfo.isWap2AppAppid(this.o) && !TextUtils.isEmpty(this.m0)) {
            stringExtra = convert2WebviewFullPath(null, this.m0);
        } else {
            stringExtra = convert2WebviewFullPath(null, this.k0);
        }
        if (a((IApp) this) && !new File(a(BaseInfo.sConfigXML)).exists()) {
            stringExtra = TextUtils.isEmpty(this.l0) ? this.n1 : this.l0;
        }
        Uri data = getActivity().getIntent().getData();
        if (data != null && data.toString().endsWith(".html")) {
            stringExtra = data.toString();
        }
        if (this.p1) {
            stringExtra = convert2WebviewFullPath(null, "__uniappview.html");
        }
        Object processEvent = this.x.processEvent(IMgr.MgrType.WindowMgr, i, new Object[]{this, stringExtra, Boolean.valueOf(this.S0), this.V0});
        if (processEvent == null) {
            return true;
        }
        return Boolean.parseBoolean(String.valueOf(processEvent));
    }

    private boolean a(IApp iApp) {
        return (TextUtils.isEmpty(iApp.getOriginalDirectPage()) || iApp.obtainWebAppIntent().hasExtra("direct_page")) ? false : true;
    }

    boolean a(boolean z) {
        if (z) {
            this.q1 = null;
            this.x.processEvent(IMgr.MgrType.WindowMgr, 76, this);
        }
        setAppDataPath(BaseInfo.sCacheFsAppsPath + this.o + DeviceInfo.sSeparatorChar + BaseInfo.REAL_PRIVATE_WWW_DIR);
        boolean b2 = b(this.o, null);
        if (!b2) {
            return b2;
        }
        setConfigProperty("funSetUA", String.valueOf(false));
        PermissionUtil.clearUseRejectedCache();
        showSplash();
        this.x.processEvent(IMgr.MgrType.FeatureMgr, 3, this.o);
        callSysEventListener(ISysEventListener.SysEventType.onWebAppReStart, null);
        this.f1 = false;
        TestUtil.record("run_5app_time_key");
        return a(10);
    }

    private void a() {
        IPdrModule a2;
        if (this.q) {
            return;
        }
        if (!SDK.isUniMPSDK()) {
            c.a.f().a(this.a);
        }
        if (q() || (a2 = c.e.a().a("commit")) == null) {
            return;
        }
        String str = this.M0;
        JSONObject jSONObject = this.x.g;
        a2.execute("start_up", new Object[]{this, str, jSONObject != null ? jSONObject.optString("version") : "0.1"});
    }

    public static int a(Context context) {
        return c(context).versionCode;
    }

    IFrameView a(IWebviewStateListener iWebviewStateListener) {
        t();
        return (IFrameView) this.x.processEvent(IMgr.MgrType.WindowMgr, 17, new Object[]{this, convert2WebviewFullPath(null, this.k0), iWebviewStateListener});
    }

    IFrameView a(IWebviewStateListener iWebviewStateListener, IDCloudWebviewClientListener iDCloudWebviewClientListener) {
        t();
        return (IFrameView) this.x.processEvent(IMgr.MgrType.WindowMgr, 17, new Object[]{this, convert2WebviewFullPath(null, this.k0), iWebviewStateListener, iDCloudWebviewClientListener});
    }

    private boolean a(ISysEventListener iSysEventListener, ISysEventListener.SysEventType sysEventType) {
        if (!(iSysEventListener instanceof IBoot) || PdrUtil.parseBoolean(String.valueOf(this.x.processEvent(null, 1, iSysEventListener)), false, false)) {
            return true;
        }
        return !(sysEventType == ISysEventListener.SysEventType.onStart || sysEventType == ISysEventListener.SysEventType.onStop || sysEventType == ISysEventListener.SysEventType.onPause || sysEventType == ISysEventListener.SysEventType.onResume) || (iSysEventListener instanceof ReceiveSystemEventVoucher);
    }

    public static boolean a(ISysEventListener.SysEventType sysEventType) {
        return (sysEventType == ISysEventListener.SysEventType.onKeyDown || sysEventType == ISysEventListener.SysEventType.onKeyUp || sysEventType == ISysEventListener.SysEventType.onKeyLongPress) ? false : true;
    }

    boolean a(java.lang.String r14, org.json.JSONObject r15) {
        throw new UnsupportedOperationException("Method not decompiled: b.e.a(java.lang.String, org.json.JSONObject):boolean");
    }

    private String a(byte b2) {
        byte b3 = this.U;
        if (b3 != 1) {
            if (b3 != 0) {
                return null;
            }
            return "file://" + this.j0;
        }
        return BaseInfo.sBaseResAppsFullPath + this.o + "/" + BaseInfo.APP_WWW_FS_DIR;
    }

    public void a(String str, int i) {
        this.D1.put(str, Integer.valueOf(i));
        if (TextUtils.isEmpty(this.E1)) {
            this.E1 = str + "=" + i;
        } else {
            this.E1 += "&" + str + "=" + i;
        }
        SP.getOrCreateBundle(getActivity(), this.o + "_1").edit().putString("Authorize", this.E1).commit();
    }

    private boolean a(org.json.JSONObject r4, b.g r5) {
        throw new UnsupportedOperationException("Method not decompiled: b.e.a(org.json.JSONObject, b.g):boolean");
    }
}