QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 v.java 源代码,内容仅作参考


package com.tencent.xweb;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Debug;
import com.tencent.xweb.JsRuntime;
import com.tencent.xweb.WebView;
import com.tencent.xweb.f;
import com.xiaomi.mipush.sdk.Constants;
import org.xwalk.core.Log;
import org.xwalk.core.XWalkEnvironment;

public class v {
    private static v l;

    WebView.c f82351a = WebView.c.WV_KIND_NONE;

    boolean f82352b = false;

    boolean f82353c = false;

    boolean f82354d = false;
    boolean e = false;
    boolean f = false;
    boolean g = false;
    boolean h = false;
    JsRuntime.JsRuntimeType i = JsRuntime.JsRuntimeType.RT_TYPE_AUTO;
    boolean j = false;
    boolean k = false;
    private Context m;

    public static v a() {
        return l;
    }

    public static void a(Context context) {
        String b2;
        if (l != null) {
            return;
        }
        l = new v();
        l.m = context.getApplicationContext();
        XWalkEnvironment.init(context);
        l.f82353c = context.getSharedPreferences("wcwebview", 0).getBoolean("bShowVersion", false);
        l.f82354d = context.getSharedPreferences("wcwebview", 0).getBoolean("bShowX5Version", false);
        l.e = context.getSharedPreferences("wcwebview", 0).getBoolean("bShowSavePage", false);
        try {
            l.i = JsRuntime.JsRuntimeType.valueOf(context.getSharedPreferences("wcwebview", 0).getString("V8type", "RT_TYPE_AUTO"));
        } catch (Exception unused) {
        }
        l.f82352b = XWalkEnvironment.getSharedPreferences().getBoolean("ENABLEREMOTEDEBUG", false);
        String testDownLoadUrl = XWalkEnvironment.getTestDownLoadUrl(context);
        l.j = (testDownLoadUrl == null || testDownLoadUrl.isEmpty()) ? false : true;
        l.g = context.getSharedPreferences("wcwebview", 0).getBoolean("bWaitforDebugger", false);
        v vVar = l;
        if (vVar.g && (b2 = vVar.b()) != null && b2.equals(XWalkEnvironment.getProcessName())) {
            Debug.waitForDebugger();
            Log.w("WebDebugCfg", "strDebugProcess is " + b2);
        }
        l.h = context.getSharedPreferences("wcwebview", 0).getBoolean("ignore_crashwatch", false);
        l.k = context.getSharedPreferences("wcwebview", 0).getBoolean("show_fps", false);
    }

    public WebView.c a(String str, boolean z) {
        StringBuilder sb;
        String str2;
        if (str == null || str.isEmpty() || this.m == null) {
            return WebView.c.WV_KIND_NONE;
        }
        SharedPreferences d2 = d();
        if (d2 == null) {
            return WebView.c.WV_KIND_NONE;
        }
        if (z) {
            sb = new StringBuilder();
            str2 = "ABTestWebView";
        } else {
            sb = new StringBuilder();
            str2 = "HardCodeWebView";
        }
        sb.append(str2);
        sb.append(str);
        String string = d2.getString(sb.toString(), "");
        if (string != null && !string.isEmpty()) {
            try {
                this.f82351a = WebView.c.valueOf(string);
            } catch (Exception unused) {
            }
            return this.f82351a;
        }
        this.f82351a = WebView.c.WV_KIND_NONE;
        return this.f82351a;
    }

    public String a(String[] strArr, f.a aVar) {
        SharedPreferences sharedPreferences;
        SharedPreferences.Editor edit;
        if (strArr == null || strArr.length == 0 || (sharedPreferences = this.m.getSharedPreferences("wcwebview", 4)) == null || (edit = sharedPreferences.edit()) == null) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        for (String str : strArr) {
            for (String str2 : f.f82248a) {
                if (str2.equalsIgnoreCase(str)) {
                    edit.putString("force_fr_" + str.toLowerCase(), aVar.toString());
                    sb.append(str2);
                    sb.append(Constants.ACCEPT_TIME_SEPARATOR_SP);
                }
            }
        }
        if (edit.commit()) {
            return sb.toString();
        }
        return "";
    }

    public String a(String[] strArr, f.b bVar) {
        SharedPreferences sharedPreferences;
        SharedPreferences.Editor edit;
        if (strArr == null || strArr.length == 0 || (sharedPreferences = this.m.getSharedPreferences("wcwebview", 4)) == null || (edit = sharedPreferences.edit()) == null) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        for (String str : strArr) {
            for (String str2 : f.f82248a) {
                if (str2.equalsIgnoreCase(str)) {
                    edit.putString("force_use_office_reader_" + str.toLowerCase(), bVar.toString());
                    sb.append(str2);
                    sb.append(Constants.ACCEPT_TIME_SEPARATOR_SP);
                }
            }
        }
        if (edit.commit()) {
            return sb.toString();
        }
        return "";
    }

    public void a(JsRuntime.JsRuntimeType jsRuntimeType) {
        if (this.i == jsRuntimeType) {
            return;
        }
        this.i = jsRuntimeType;
        this.m.getSharedPreferences("wcwebview", 0).edit().putString("V8type", jsRuntimeType.toString()).commit();
    }

    public void a(String str) {
        this.m.getSharedPreferences("wcwebview", 4).edit().putString("strDebugProcess", str).commit();
    }

    public void a(String str, WebView.c cVar) {
        if (this.m == null || str == null || str.isEmpty()) {
            return;
        }
        d().edit().putString("HardCodeWebView" + str, cVar.toString()).commit();
    }

    public void a(boolean z) {
        this.g = z;
        this.m.getSharedPreferences("wcwebview", 0).edit().putBoolean("bWaitforDebugger", z).commit();
    }

    public WebView.c b(String str) {
        if (str == null || str.isEmpty() || this.m == null) {
            return WebView.c.WV_KIND_NONE;
        }
        SharedPreferences d2 = d();
        if (d2 == null) {
            return WebView.c.WV_KIND_NONE;
        }
        String string = d2.getString("HardCodeWebView" + str, "");
        if (string != null && !string.isEmpty()) {
            XWalkEnvironment.addXWalkInitializeLog("has hardcode type = " + string);
        }
        if (string == null || string.isEmpty() || string.equals(WebView.c.WV_KIND_NONE.toString())) {
            string = d2.getString("ABTestWebView" + str, "");
            if (string != null && !string.isEmpty()) {
                XWalkEnvironment.addXWalkInitializeLog("has abtest type = " + string);
            }
        }
        if (string != null && !string.isEmpty()) {
            try {
                this.f82351a = WebView.c.valueOf(string);
            } catch (Exception unused) {
            }
            return this.f82351a;
        }
        this.f82351a = WebView.c.WV_KIND_NONE;
        return this.f82351a;
    }

    public String b() {
        return this.m.getSharedPreferences("wcwebview", 4).getString("strDebugProcess", "");
    }

    public void b(String str, WebView.c cVar) {
        if (this.m == null || str == null || str.isEmpty()) {
            return;
        }
        d().edit().putString("ABTestWebView" + str, cVar.toString()).commit();
    }

    public void b(boolean z) {
        this.h = z;
        this.m.getSharedPreferences("wcwebview", 0).edit().putBoolean("ignore_crashwatch", z).commit();
    }

    public f.a c(String str) {
        SharedPreferences sharedPreferences = this.m.getSharedPreferences("wcwebview", 4);
        if (sharedPreferences == null) {
            return f.a.NONE;
        }
        return b.q(sharedPreferences.getString("force_fr_" + str.toLowerCase(), ""));
    }

    public void c(boolean z) {
        if (z == this.f82352b) {
            return;
        }
        this.f82352b = z;
        XWalkEnvironment.getSharedPreferences().edit().putBoolean("ENABLEREMOTEDEBUG", z).commit();
    }

    public boolean c() {
        return this.h;
    }

    public SharedPreferences d() {
        return XWalkEnvironment.getMMKVSharedPreferences("xweb_debug");
    }

    public f.b d(String str) {
        try {
            SharedPreferences sharedPreferences = this.m.getSharedPreferences("wcwebview", 4);
            if (sharedPreferences == null) {
                return f.b.none;
            }
            return b.p(sharedPreferences.getString("force_use_office_reader_" + str.toLowerCase(), ""));
        } catch (Exception e) {
            Log.e("WebDebugCfg", "getForceUseOfficeReader error ", e);
            return f.b.none;
        }
    }

    public void d(boolean z) {
        if (z == this.k) {
            return;
        }
        this.k = z;
        this.m.getSharedPreferences("wcwebview", 0).edit().putBoolean("show_fps", z).commit();
    }

    public void e(boolean z) {
        if (z == this.f82353c) {
            return;
        }
        this.f82353c = z;
        this.m.getSharedPreferences("wcwebview", 0).edit().putBoolean("bShowVersion", this.f82353c).commit();
    }

    public boolean e() {
        return this.f82352b;
    }

    public void f(boolean z) {
        if (z == this.f82354d) {
            return;
        }
        this.f82354d = z;
        this.m.getSharedPreferences("wcwebview", 0).edit().putBoolean("bShowX5Version", this.f82354d).commit();
    }

    public boolean f() {
        return this.k;
    }

    public void g(boolean z) {
        if (z == this.e) {
            return;
        }
        this.e = z;
        this.m.getSharedPreferences("wcwebview", 0).edit().putBoolean("bShowSavePage", this.e).commit();
    }

    public boolean g() {
        return this.f82353c;
    }

    public void h(boolean z) {
        SharedPreferences.Editor edit;
        int a2;
        SharedPreferences sharedPreferences = this.m.getSharedPreferences("wcwebview", 4);
        if (sharedPreferences == null || (edit = sharedPreferences.edit()) == null) {
            return;
        }
        edit.putBoolean("fr_disable_cache", z);
        edit.commit();
        if (z) {
            for (com.tencent.luggage.wxa.ud.g gVar : com.tencent.luggage.wxa.ud.h.b()) {
                if ((gVar instanceof com.tencent.luggage.wxa.ud.m) && (a2 = gVar.a(true)) >= 0) {
                    String c2 = gVar.c(a2);
                    if (!c2.isEmpty()) {
                        com.tencent.xweb.util.c.b(c2);
                    }
                }
            }
        }
    }

    public boolean h() {
        return this.e;
    }

    public void i(boolean z) {
        SharedPreferences.Editor edit;
        SharedPreferences sharedPreferences = this.m.getSharedPreferences("wcwebview", 4);
        if (sharedPreferences == null || (edit = sharedPreferences.edit()) == null) {
            return;
        }
        edit.putBoolean("fr_disable_crash_detect", z);
        edit.commit();
    }

    public boolean i() {
        return this.f82354d;
    }

    public void j(boolean z) {
        Context context;
        String str;
        if (z == this.j) {
            return;
        }
        this.j = z;
        if (!this.j) {
            context = this.m;
            str = "";
        } else if (XWalkEnvironment.isIaDevice()) {
            context = this.m;
            str = "https://dldir1.qq.com/weixin/android/wxweb/updateConfig_x86_test.xml";
        } else {
            context = this.m;
            str = "https://dldir1.qq.com/weixin/android/wxweb/updateConfig_test.xml";
        }
        XWalkEnvironment.setTestDownLoadUrl(context, str);
        SharedPreferences.Editor edit = XWalkEnvironment.getSharedPreferencesForUpdateConfig().edit();
        edit.putLong("nLastFetchConfigTime", 0L);
        edit.commit();
        com.tencent.xweb.internal.l.a(WebView.c.WV_KIND_CW).excute("STR_CMD_CLEAR_SCHEDULER", null);
    }

    public boolean j() {
        SharedPreferences sharedPreferences = this.m.getSharedPreferences("wcwebview", 4);
        if (sharedPreferences == null) {
            return false;
        }
        return sharedPreferences.getBoolean("fr_disable_cache", false);
    }

    public void k(boolean z) {
        this.m.getSharedPreferences("wcwebview", 4).edit().putBoolean("m_bEnableLocalDebug", z).commit();
        XWalkEnvironment.initTurnOnKVLog();
    }

    public boolean k() {
        SharedPreferences sharedPreferences = this.m.getSharedPreferences("wcwebview", 4);
        if (sharedPreferences == null) {
            return false;
        }
        return sharedPreferences.getBoolean("fr_disable_crash_detect", false);
    }

    public JsRuntime.JsRuntimeType l() {
        return this.i;
    }

    public boolean m() {
        return this.j;
    }

    public boolean n() {
        return this.m.getSharedPreferences("wcwebview", 4).getBoolean("m_bEnableLocalDebug", false);
    }
}