QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 QuickLoginWebViewLoader.java 源代码,内容仅作参考
package oicq.wlogin_sdk.quicklogin;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.util.Log;
import android.view.accessibility.AccessibilityManager;
import android.webkit.WebSettings;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.tencent.qqlive.module.videoreport.inject.webview.dtwebview.DtWebView;
import java.lang.reflect.Method;
import oicq.wlogin_sdk.tools.util;
public class QuickLoginWebViewLoader {
static int finishAnimEnter = 0;
static int finishAnimExit = 0;
static final String link = "https://xui.ptlogin2.qq.com/cgi-bin/xlogin";
static boolean sslErrorProcessed;
public static void disableAccessibility(Context context) {
if (Build.VERSION.SDK_INT == 17) {
try {
AccessibilityManager accessibilityManager = (AccessibilityManager) context.getSystemService("accessibility");
if (accessibilityManager.isEnabled()) {
Method declaredMethod = accessibilityManager.getClass().getDeclaredMethod("setState", Integer.TYPE);
declaredMethod.setAccessible(true);
declaredMethod.invoke(accessibilityManager, 0);
}
} catch (Error | Exception unused) {
}
}
}
public static void load(Activity activity, Intent intent) {
long j;
String str;
String str2;
String str3 = "";
finishAnimEnter = intent.getIntExtra("finishAnimEnter", 0);
finishAnimExit = intent.getIntExtra("finishAnimExit", 0);
QuikLoginJSInterface quikLoginJSInterface = new QuikLoginJSInterface(activity);
sslErrorProcessed = false;
if (intent == null) {
util.LOGI("QuickLoginWebViewLoader.load parameter data is null", null);
return;
}
long longExtra = intent.getLongExtra("appid", 0L);
String stringExtra = intent.getStringExtra("account");
int i = true == intent.getBooleanExtra("isUserAccountLocked", false) ? 1 : 0;
int i2 = true == intent.getBooleanExtra("forceWebLogin", false) ? 1 : 0;
if (0 == longExtra) {
util.LOGI("QuickLoginWebViewActivity get appid failed");
return;
}
String stringExtra2 = intent.getStringExtra("titleBackgroundColor");
if (stringExtra2 == null || stringExtra2.length() == 0) {
stringExtra2 = "#3F51B5";
}
String stringExtra3 = intent.getStringExtra("titleTextColor");
if (stringExtra3 == null || stringExtra3.length() == 0) {
stringExtra3 = "#FFFFFF";
}
RelativeLayout relativeLayout = new RelativeLayout(activity);
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
int height = activity.getWindowManager().getDefaultDisplay().getHeight();
int i3 = (int) (height * 0.07d);
TextView textView = new TextView(activity);
int i4 = i2;
try {
textView.setBackgroundColor(Color.parseColor(stringExtra2));
textView.setTextColor(Color.parseColor(stringExtra3));
j = longExtra;
str = util.FILE_DIR;
} catch (IllegalArgumentException unused) {
util.LOGI("color error titleBackgroundColor " + stringExtra2 + " titleTextColor " + stringExtra3, "");
j = longExtra;
str = util.FILE_DIR;
Log.e(str, "color error titleBackgroundColor " + stringExtra2 + " titleTextColor " + stringExtra3);
}
textView.setText("");
textView.setLayoutParams(new RelativeLayout.LayoutParams(-1, i3));
relativeLayout.addView(textView);
Button button = new Button(activity);
try {
button.setBackgroundColor(Color.parseColor(stringExtra2));
button.setTextColor(Color.parseColor(stringExtra3));
} catch (IllegalArgumentException unused2) {
util.LOGI("color error titleBackgroundColor " + stringExtra2 + " titleTextColor " + stringExtra3, "");
Log.e(str, "color error titleBackgroundColor " + stringExtra2 + " titleTextColor " + stringExtra3);
}
button.setText("关闭");
button.setPadding(15, button.getPaddingTop(), 15, button.getPaddingBottom());
button.setLayoutParams(new RelativeLayout.LayoutParams(-2, i3));
relativeLayout.addView(button);
button.setOnClickListener(new a(activity));
try {
DtWebView dtWebView = new DtWebView(activity);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, height - i3);
layoutParams.setMargins(0, i3, 0, 0);
dtWebView.setLayoutParams(layoutParams);
relativeLayout.addView(dtWebView);
activity.setContentView(relativeLayout);
WebSettings settings = dtWebView.getSettings();
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
if (17 <= Build.VERSION.SDK_INT) {
dtWebView.addJavascriptInterface(new QuikLoginJSInterface(activity), "WTLogin");
str2 = "javascript:function wtCB(uin, sig, input) { WTLogin.ptloginCallBack(uin, sig, input); }function wtAlert(input) { WTLogin.ptAlertCallBack(input); }";
} else {
str2 = "javascript:function wtCB(uin, sig, input) { return prompt(JSON.stringify({ uin:''+uin, sig:''+sig, input:''+input})); }";
}
disableAccessibility(activity);
settings.setJavaScriptEnabled(true);
if (Build.VERSION.SDK_INT >= 11) {
dtWebView.removeJavascriptInterface("searchBoxJavaBridge_");
dtWebView.removeJavascriptInterface("accessibility");
dtWebView.removeJavascriptInterface("accessibilityTraversal");
}
if (17 > Build.VERSION.SDK_INT) {
dtWebView.setWebChromeClient(new b(quikLoginJSInterface));
}
dtWebView.setWebViewClient(new c(activity, dtWebView, str2));
if (stringExtra != null && stringExtra.length() != 0) {
str3 = "&default_uin=" + stringExtra + "&pt_lock_uin=" + i;
}
activity.runOnUiThread(new g(dtWebView, "https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=" + j + "&style=42&s_url=http://wtlogin.qq.com/&pt_no_onekey=1&pt_no_auth=1&daid=499&wt_force_pwd=" + i4 + str3, str2));
} catch (Error e) {
util.LOGI("create webview failed " + e.getMessage(), "");
} catch (Exception e2) {
util.LOGI("create webview failed " + e2.getMessage(), "");
}
}
}