QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 ha.java 源代码,内容仅作参考
package kcsdkint;
import MTT.WelfareBusiness;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.text.ClipboardManager;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.widget.Toast;
import androidx.core.app.NotificationCompat;
import com.eclipsesource.mmv8.Platform;
import com.heytap.mcssdk.mode.CommandMessage;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.tencent.mtt.browser.file.facade.IFileStatService;
import com.tencent.mtt.compliance.MethodDelegate;
import com.tencent.mtt.hippy.qb.modules.appdownload.HippyAppConstants;
import com.tencent.open.SocialOperation;
import com.tencent.qqlive.module.videoreport.dtreport.constants.DTParamKey;
import com.tencent.qqlive.module.videoreport.inject.webview.jsbridge.jsinterface.handlers.BaseJsHandler;
import com.tencent.shadow.core.manager.installplugin.InstalledPluginDBHelper;
import com.xiaomi.mipush.sdk.Constants;
import dualsim.common.OrderCheckResult;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import kcsdkint.dg;
import kcsdkint.gx;
import kcsdkint.hh;
import kcsdkint.ju;
import kcsdkint.kc;
import kcsdkint.ko;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import tmsdk.common.lib.TccCryptor;
import trpc.mtt.qb_user_center_svr.QbUserCenter;
public final class ha {
private static String f84096b = "https";
Handler f84097a;
private HandlerThread f84099d;
private Map<String, Integer> e;
private Context h;
private gy i;
private dg j;
private Handler f84098c = new Handler(Looper.getMainLooper());
private Map<String, Object> f = null;
private boolean g = false;
public interface a {
void a();
}
public ha(Context context, gy gyVar) {
this.f84097a = null;
this.f84099d = null;
this.e = null;
this.h = context;
this.i = gyVar;
try {
this.f84099d = new HandlerThread("webview-work", -2);
this.f84099d.start();
this.f84097a = new Handler(this.f84099d.getLooper());
if (this.e == null) {
this.e = c();
}
this.j = (dg) Cdo.a(dg.class);
if (this.j != null) {
this.j.a(new dg.a() {
@Override
public final void a(final String str) {
if (ha.this.i == null || TextUtils.isEmpty(str)) {
return;
}
ha.this.f84098c.post(new Runnable() {
@Override
public final void run() {
ha.this.i.a(str);
}
});
}
});
}
} catch (Throwable unused) {
}
}
static int a(int i, String str, String str2, int i2, int i3) {
if (i == -1) {
return -2;
}
Bundle bundle = new Bundle();
bundle.putString("arg_str1", str);
bundle.putString("arg_str2", str2);
bundle.putInt("arg_int1", i2);
bundle.putInt("arg_int2", i3);
Intent launchIntentForPackage = gt.f().getPackageManager().getLaunchIntentForPackage("com.tencent.qqpimsecure");
if (launchIntentForPackage == null) {
return -1;
}
bundle.putString("platform_id", "qqsecureWebview");
if (i > 0) {
bundle.putInt("dest_view", i);
}
bundle.putBoolean("activity_clear_task", false);
launchIntentForPackage.putExtras(bundle);
launchIntentForPackage.setFlags(402653184);
gt.f().startActivity(launchIntentForPackage);
return 0;
}
public String a(String str, String str2, int i, String str3, String str4) {
String str5;
String str6 = null;
if (str3 == null) {
str5 = "check_arg:params is null";
} else {
try {
String string = new JSONObject(str3).getString(str4);
if (string == null) {
str5 = String.format("argument %s must not be null or empty", str4);
} else {
str6 = "";
if (!"".equals(string)) {
return string;
}
str5 = String.format("argument %s must not be null or empty", str4);
}
} catch (JSONException e) {
str5 = "invoke " + str + ", parse arguments exception: " + e.getMessage();
}
}
a(str2, i, str5);
return str6;
}
public void a(String str, int i, Object obj) {
a(str, i, obj, (a) null);
}
private void a(final String str, final int i, final Object obj, final a aVar) {
this.f84098c.post(new Runnable() {
@Override
public final void run() {
try {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(DTParamKey.REPORT_KEY_VISUAL_SESSION_ID, str);
StringBuilder sb = new StringBuilder();
sb.append(i);
jSONObject.put(BaseJsHandler.JS_CALLBACKID, sb.toString());
jSONObject.put("err_msg", "ok");
StringBuilder sb2 = new StringBuilder();
sb2.append(obj);
jSONObject.put("ret", sb2.toString());
} catch (JSONException e) {
e.printStackTrace();
}
String format = String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject.toString());
ha.this.i.a(format);
try {
jy.a("js_test", "[doCallback Object]".concat(String.valueOf(jm.b(kh.c("callbackId = " + i + " content = " + format).getBytes()))));
} catch (Throwable th) {
th.printStackTrace();
}
if (aVar != null) {
aVar.a();
}
} catch (Throwable th2) {
th2.printStackTrace();
}
}
});
}
public void a(final String str, final int i, final String str2) {
this.f84098c.post(new Runnable() {
@Override
public final void run() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(DTParamKey.REPORT_KEY_VISUAL_SESSION_ID, str);
StringBuilder sb = new StringBuilder();
sb.append(i);
jSONObject.put(BaseJsHandler.JS_CALLBACKID, sb.toString());
jSONObject.put("err_msg", str2);
jSONObject.put("ret", "-1");
ha.this.i.a(String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject.toString()));
jy.a("js_test", "doCallbackError = " + jSONObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
public void a(final String str, final int i, final JSONObject jSONObject) {
this.f84098c.post(new Runnable() {
final a f84147d = null;
@Override
public final void run() {
try {
JSONObject jSONObject2 = new JSONObject();
try {
jSONObject2.put(DTParamKey.REPORT_KEY_VISUAL_SESSION_ID, str);
StringBuilder sb = new StringBuilder();
sb.append(i);
jSONObject2.put(BaseJsHandler.JS_CALLBACKID, sb.toString());
jSONObject2.put("err_msg", "ok");
jSONObject2.put("ret", jSONObject);
} catch (JSONException e) {
e.printStackTrace();
}
String format = String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject2.toString());
ha.this.i.a(format);
try {
jy.a("js_test", "[doCallback Object]".concat(String.valueOf(jm.b(kh.c("callbackId = " + i + " content = " + format).getBytes()))));
} catch (Throwable th) {
th.printStackTrace();
}
if (this.f84147d != null) {
this.f84147d.a();
}
} catch (Throwable th2) {
th2.printStackTrace();
}
}
});
}
static void a(ha haVar, String str) {
Toast.makeText(haVar.h, str, 0).show();
}
static void a(ha haVar, String str, int i, float f, long j, String str2) {
final JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("state", String.valueOf(i));
jSONObject.put(NotificationCompat.CATEGORY_PROGRESS, String.valueOf(f));
jSONObject.put(HippyAppConstants.KEY_TOTAL_SZIE, String.valueOf(j));
jSONObject.put("packagename", str);
jSONObject.put(InstalledPluginDBHelper.COLUMN_PATH, str2);
jSONObject.put(IFileStatService.EVENT_REPORT_NAME, "downloadChange");
haVar.f84098c.post(new Runnable() {
@Override
public final void run() {
ha.this.i.a(String.format("javascript:handleMessageFromTcs('event:broadcast', '%s')", jSONObject.toString()));
}
});
} catch (JSONException unused) {
}
}
static void a(ha haVar, String str, int i, int i2, final boolean z, final long j) {
haVar.a(str, i, Integer.valueOf(i2), new a() {
@Override
public final void a() {
try {
if (z) {
ha.this.f84098c.postDelayed(new Runnable() {
@Override
public final void run() {
try {
if (ha.this.h instanceof Activity) {
((Activity) ha.this.h).finish();
}
} catch (Throwable unused) {
}
}
}, j);
}
} catch (Throwable unused) {
}
}
});
}
static void a(ha haVar, final String str, final String str2, final int i) {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
int a2 = kc.a(gt.f());
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("networkType", a2);
ha.b(ha.this, str2, i, jSONObject);
} catch (JSONException e) {
ha.this.a(str2, i, e.getMessage());
}
}
});
}
static void a(ha haVar, final String str, final String str2, final int i, final String str3) {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
String str4;
String str5;
int i2;
int i3;
boolean z;
int i4;
String str6 = "";
boolean equals = "gotoQQSecure".equals(str);
String.valueOf(ha.this.e.get(str));
hk.a();
String str7 = str3;
if (str7 == null) {
ha.this.a(str2, i, "check_arg:params is null");
return;
}
try {
JSONObject jSONObject = new JSONObject(str7);
int i5 = jSONObject.getInt(com.tencent.luggage.wxa.gq.a.aO);
try {
str4 = jSONObject.getString("str1");
} catch (JSONException unused) {
str4 = "";
}
try {
str5 = jSONObject.getString("str2");
} catch (JSONException unused2) {
str5 = "";
}
try {
i2 = jSONObject.getInt("int1");
} catch (JSONException unused3) {
i2 = 0;
}
try {
i3 = jSONObject.getInt("int2");
} catch (JSONException unused4) {
i3 = 0;
}
try {
str6 = jSONObject.getString("pkg");
} catch (JSONException unused5) {
}
try {
z = jSONObject.getBoolean("finishSelf");
} catch (JSONException unused6) {
z = false;
}
if (equals) {
int a2 = ha.a(i5, str4, str5, i2, i3);
if (a2 != 0) {
ha.this.a(str2, i, "not installed");
}
i4 = a2;
} else if (TextUtils.isEmpty(str6)) {
ha.this.a(str2, i, "check_arg:params is null");
return;
} else {
gt.f().startActivity(gt.f().getPackageManager().getLaunchIntentForPackage(str6));
i4 = -1;
}
ha.a(ha.this, str2, i, i4, z, i5 != -1 ? 2000 : 0);
} catch (JSONException e) {
ha.this.a(str2, i, "invoke " + str + ", parse arguments exception: " + e.getMessage());
}
}
});
}
static Map b() {
return c();
}
static void b(ha haVar, final String str, final int i, final JSONObject jSONObject) {
haVar.f84098c.post(new Runnable() {
final a f84155d = null;
@Override
public final void run() {
try {
jSONObject.put(DTParamKey.REPORT_KEY_VISUAL_SESSION_ID, str);
JSONObject jSONObject2 = jSONObject;
StringBuilder sb = new StringBuilder();
sb.append(i);
jSONObject2.put(BaseJsHandler.JS_CALLBACKID, sb.toString());
jSONObject.put("err_msg", "ok");
} catch (JSONException e) {
e.printStackTrace();
}
String format = String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject.toString());
if (format != null) {
ha.this.i.a(format);
}
try {
jy.a("js_test", "[doCallback Object]".concat(String.valueOf(jm.b(kh.c("callbackId = " + i + " content = " + format).getBytes()))));
} catch (Throwable th) {
th.printStackTrace();
}
a aVar = this.f84155d;
if (aVar != null) {
aVar.a();
}
}
});
}
static void b(ha haVar, final String str, final String str2, final int i) {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
try {
if (Build.VERSION.SDK_INT >= 9) {
CookieSyncManager.createInstance(ha.this.h);
CookieManager.getInstance().removeAllCookie();
CookieSyncManager.getInstance().sync();
}
} catch (Throwable th) {
ha.this.a(str2, i, "invoke " + str + "exception: " + th.getMessage());
}
}
});
}
static void b(ha haVar, final String str, final String str2, final int i, final String str3) {
if (hl.a(str3)) {
haVar.a(str2, i, "check_arg:params is null");
} else {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
try {
String optString = new JSONObject(str3).optString("info_value");
if (optString == null) {
optString = "";
}
ClipboardManager clipboardManager = (ClipboardManager) ha.this.h.getSystemService("clipboard");
if (clipboardManager != null) {
clipboardManager.setText(optString);
ha.a(ha.this, "已拷贝");
}
ha.this.a(str2, i, (Object) 1);
StringBuilder sb = new StringBuilder();
sb.append(String.valueOf(ha.this.e.get("copy2Clipboard")));
sb.append("_");
sb.append(optString);
hk.a();
} catch (Exception e) {
ha.this.a(str2, i, "invoke " + str + "exception: " + e.getMessage());
}
}
});
}
}
static void b(ha haVar, final String str, final String str2, final int i, final String str3, final String str4) {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
String string;
String message;
String str5;
String str6 = null;
if (!hl.a(str4)) {
try {
JSONObject jSONObject = new JSONObject(str4);
string = jSONObject.getString("key");
try {
Integer.valueOf(jSONObject.optString("simplot")).intValue();
} catch (Exception unused) {
}
} catch (Exception unused2) {
}
if (!hl.a(string)) {
jy.a("js_test", "invoke " + str3 + ", argument key must be set");
ha.this.a(str2, i, "invoke " + str3 + ", argument key must be set");
return;
}
?? equals = string.equals("imei");
try {
} catch (Exception e) {
message = e.getMessage();
equals = equals;
}
if (equals != 0) {
equals = 0;
Context unused3 = ha.this.h;
str5 = jo.a();
} else if (string.equals("guid")) {
equals = 1;
str5 = ((dj) Cdo.a(dj.class)).b();
} else {
if (string.equals("lc")) {
try {
str5 = ki.a(gt.b("lc"));
} catch (Exception e2) {
str5 = null;
str6 = e2.getMessage();
}
equals = 3;
if (str6 != null) {
ha.this.a(str2, i, str6);
} else {
if (str5 == null) {
str5 = "";
}
ha.this.a(str2, i, (Object) str5);
}
new ArrayList().add(Integer.valueOf((int) equals));
return;
}
if (string.equals("android_os_build_model")) {
equals = 4;
str5 = MethodDelegate.getModel();
} else if (string.equals("android_os_build_brand")) {
equals = 6;
str5 = Build.BRAND;
} else {
if (!string.equals("android_os_build_version_release")) {
equals = 99;
message = "unsupported key: ".concat(String.valueOf(string));
String str7 = message;
str5 = null;
str6 = str7;
if (str6 != null) {
}
new ArrayList().add(Integer.valueOf((int) equals));
return;
}
equals = 5;
str5 = Build.VERSION.RELEASE;
}
}
if (str6 != null) {
}
new ArrayList().add(Integer.valueOf((int) equals));
return;
}
string = null;
if (!hl.a(string)) {
}
}
});
}
static boolean b(ha haVar, String str, int i, String str2) {
if (!hl.a(str2)) {
return true;
}
haVar.a(str, i, "check_arg:params is null");
return false;
}
private static Map<String, Integer> c() {
HashMap hashMap = new HashMap();
hashMap.put(CommandMessage.APP_KEY, 3);
hashMap.put("platform", 4);
hashMap.put("apiVersion", 5);
hashMap.put("isTcsWebview", 6);
hashMap.put("checkPermission", 7);
hashMap.put(com.tencent.luggage.wxa.cy.g.NAME, 300);
hashMap.put("sendAppMessage", 301);
hashMap.put("share2App", 302);
hashMap.put("gotoQQSecure", 400);
hashMap.put("setTitle", 500);
hashMap.put("setRightTopBtnShowable", 501);
hashMap.put("setMenuItemsShowable", 502);
hashMap.put("customMenuItems", 505);
hashMap.put(com.tencent.luggage.wxa.lr.h.NAME, 600);
hashMap.put("getQQLoginState", 700);
hashMap.put("getQQLoginKey", 701);
hashMap.put("loginQQ", 702);
hashMap.put("logoutQQ", Integer.valueOf(com.tencent.luggage.wxa.rp.e.G));
hashMap.put("loginWX", Integer.valueOf(com.tencent.luggage.wxa.rp.e.H));
hashMap.put("getWXLoginState", Integer.valueOf(com.tencent.luggage.wxa.rp.e.I));
hashMap.put("login", 710);
hashMap.put("getActToken", Integer.valueOf(com.tencent.luggage.wxa.cp.e.CTRL_INDEX));
hashMap.put("isPkgInstalled", 800);
hashMap.put("isPkgOfficial", 801);
hashMap.put("getPkgVersionCode", 802);
hashMap.put("getPkgVersionName", Integer.valueOf(WelfareBusiness._WELFARE_FILE_JUNKCLEAN_REWARD_VIDEO));
hashMap.put("kcDownload", 901);
hashMap.put("pauseDownloadTask", 902);
hashMap.put("continueDownloadTask", 903);
hashMap.put("checkDownloadState", 904);
hashMap.put("installApp", 905);
hashMap.put("getInfo", 1200);
hashMap.put("getNetworkType", 1201);
hashMap.put("launch3rdApp", 1300);
hashMap.put("sendMessage", Integer.valueOf(WelfareBusiness._WELFARE_ZHIBO));
hashMap.put("copy2Clipboard", 1500);
hashMap.put("toggleSoftInput", 1600);
hashMap.put("clearAllCookie", Integer.valueOf(QbUserCenter.CommonRetCode.RET_INVOKE_LEVELACHIEVMENT_ERR_VALUE));
hashMap.put("insertQQSecureUsageRecord", 1602);
hashMap.put("stringEmid", 1604);
hashMap.put("actionEmid", 1605);
hashMap.put("kcManuallyLogin", 1607);
hashMap.put("getUCSign", 1608);
hashMap.put("onLogout", 1609);
hashMap.put("getKcState", 1610);
hashMap.put("SDKVersion", 1611);
hashMap.put("phoneNumber", 1612);
hashMap.put("JFtk", 1613);
return hashMap;
}
static void c(ha haVar, String str, String str2, int i) {
hh unused;
hh unused2;
unused = hh.a.f84201a;
String a2 = hh.a(str);
unused2 = hh.a.f84201a;
long c2 = hh.c(str);
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("sign", a2);
jSONObject.put("timestamp", String.valueOf(c2));
} catch (JSONException unused3) {
}
haVar.a(str2, i, jSONObject);
}
static void c(ha haVar, final String str, final String str2, final int i, final String str3) {
if (hl.a(str3)) {
haVar.a(str2, i, "check_arg:params is null");
} else {
((dl) Cdo.a(dl.class)).a(new Runnable() {
@Override
public final void run() {
String str4;
final String str5;
String str6;
int a2;
JSONObject jSONObject;
String str7 = null;
try {
jSONObject = new JSONObject(str3);
Integer.valueOf(jSONObject.optString("categoryId")).intValue();
str4 = jSONObject.optString("url");
} catch (Exception e) {
e = e;
str4 = null;
str5 = null;
}
try {
str5 = jSONObject.optString("pkgName");
try {
jSONObject.optString("channel_id");
str6 = jSONObject.optString("extStr");
} catch (Exception e2) {
e = e2;
str6 = null;
}
} catch (Exception e3) {
e = e3;
str5 = null;
str6 = str5;
ha.this.a(str2, i, "invoke " + str + " exception: " + e.getMessage());
if (str4 == null) {
}
}
try {
str7 = jSONObject.optString("showname");
} catch (Exception e4) {
e = e4;
ha.this.a(str2, i, "invoke " + str + " exception: " + e.getMessage());
if (str4 == null) {
}
}
if (str4 == null) {
ha.this.a(str2, i, "err_msg_err_params");
return;
}
if (TextUtils.isEmpty(str6)) {
str7 = "w_d_" + str5 + "_" + (System.currentTimeMillis() / 1000) + ".apk";
}
final String str8 = gt.f().getFilesDir() + File.separator + "kc_app_w_d" + File.separator + str7;
jt jtVar = new jt(gt.f());
jtVar.a(str8);
jtVar.b(str7);
int i2 = 10;
while (true) {
a2 = jtVar.a(gt.f(), str4, new ju.a() {
@Override
public final void a(long j) {
ha.a(ha.this, str5, 1, 0.0f, j, str8);
}
@Override
public final void a(long j, long j2) {
ha.a(ha.this, str5, 2, (float) j2, j, str8);
}
@Override
public final void b(long j) {
ha.a(ha.this, str5, 3, 100.0f, j, str8);
}
});
if (a2 != -7) {
break;
}
try {
Thread.sleep(500L);
} catch (InterruptedException e5) {
e5.printStackTrace();
}
int i3 = i2 - 1;
if (i2 <= 0) {
break;
} else {
i2 = i3;
}
}
ha haVar2 = ha.this;
String str9 = str2;
int i4 = i;
if (a2 == 0) {
haVar2.a(str9, i4, (Object) 0);
} else {
haVar2.a(str9, i4, "Download Failed:".concat(String.valueOf(a2)));
}
}
}, "tms_w_d");
}
}
static void d(ha haVar, final String str, final String str2, final int i, final String str3) {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
try {
if (str3 == null) {
ha.this.a(str2, i, "check_arg:params is null");
return;
}
JSONObject jSONObject = new JSONObject(str3);
int i2 = jSONObject.getInt("emid");
JSONArray jSONArray = jSONObject.getJSONArray("values");
String str4 = null;
for (int i3 = 0; i3 < jSONArray.length(); i3++) {
str4 = str4 == null ? jSONArray.getString(i3) : str4 + Constants.ACCEPT_TIME_SEPARATOR_SP + jSONArray.getString(i3);
}
if (i2 > 0 && !TextUtils.isEmpty(str4)) {
((dc) Cdo.a(dc.class)).a(i2, str4);
ha.this.a(str2, i, (Object) 0);
}
} catch (Throwable th) {
ha.this.a(str2, i, "invoke " + str + "exception: " + th.getMessage());
}
}
});
}
static boolean d(ha haVar) {
haVar.g = true;
return true;
}
static void e(ha haVar, final String str, final String str2, final int i, final String str3) {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
try {
if (str3 == null) {
ha.this.a(str2, i, "check_arg:params is null");
return;
}
JSONObject jSONObject = new JSONObject(str3);
int optInt = jSONObject.optInt("emid");
int optInt2 = jSONObject.optInt("errCode", 0);
if (optInt <= 0) {
return;
}
((dc) Cdo.a(dc.class)).a(optInt, optInt2);
ha.this.a(str2, i, (Object) 0);
} catch (Throwable th) {
ha.this.a(str2, i, "invoke " + str + "exception: " + th.getMessage());
}
}
});
}
static void f(ha haVar, final String str, final String str2, final int i, final String str3) {
haVar.f84097a.post(new Runnable() {
@Override
public final void run() {
try {
if (ha.b(ha.this, str2, i, str3)) {
String str4 = null;
try {
JSONObject jSONObject = new JSONObject(str3);
str4 = jSONObject.optString(InstalledPluginDBHelper.COLUMN_PATH);
jSONObject.optString("packagename");
} catch (Exception unused) {
}
if (TextUtils.isEmpty(str4)) {
ha.this.a(str2, i, "err_msg_err_params");
return;
}
Intent intent = new Intent("android.intent.action.VIEW");
intent.setFlags(268435456);
intent.setDataAndType(Uri.fromFile(new File(str4)), "application/vnd.android.package-archive");
gt.f().startActivity(intent);
ha.this.a(str2, i, (Object) 0);
}
} catch (Throwable th) {
th.printStackTrace();
}
}
});
}
static void g(ha haVar, String str, String str2, int i, String str3) {
String str4;
hh unused;
hh unused2;
hh unused3;
if (str3 == null) {
str4 = "check_arg:params is null";
} else {
try {
JSONObject jSONObject = new JSONObject(str3);
String string = jSONObject.getString("phoneNumber");
long parseLong = Long.parseLong(jSONObject.getString("timestamp"));
String string2 = jSONObject.getString("sign");
if (!TextUtils.isEmpty(string) && parseLong > 0 && !TextUtils.isEmpty(string2)) {
String a2 = hi.a(string);
hv.a();
hv.b().b(ko.e.K, a2);
unused = hh.a.f84201a;
hh.a(a2, string2);
unused2 = hh.a.f84201a;
hh.a(a2, parseLong);
unused3 = hh.a.f84201a;
hh.b(a2, System.currentTimeMillis());
}
haVar.a(str2, i, (Object) 0);
id.a(str3);
return;
} catch (Exception e) {
e.printStackTrace();
str4 = "invoke " + str + "exception: " + e.getMessage();
}
}
haVar.a(str2, i, str4);
}
static void h(ha haVar, final String str, final String str2, final int i, String str3) {
if (hl.a(str3)) {
return;
}
try {
final String a2 = hi.a(new JSONObject(str3).getString("phoneNumber"));
if (!TextUtils.isEmpty(a2) && a2.length() == 11) {
hi.a(a2, new Runnable() {
@Override
public final void run() {
ha.c(ha.this, a2, str2, i);
}
});
return;
}
haVar.a(str2, i, "Invalid param.");
} catch (Exception unused) {
haVar.a(str2, i, "Error.");
}
}
public final void a() {
try {
if (this.f84099d != null) {
this.f84099d.quit();
this.f84099d = null;
}
} catch (Exception unused) {
}
}
public final boolean a(String str, String str2) {
String str3;
String str4;
int i;
final int i2;
final String str5;
final String str6;
try {
} catch (Throwable th) {
th.printStackTrace();
}
if (TextUtils.isEmpty(str2)) {
return false;
}
if (this.j != null && this.j.a(str, str2)) {
return true;
}
String str7 = null;
if (!str2.startsWith("#js_invoke#")) {
if (str2.startsWith("#js_on#")) {
try {
JSONObject jSONObject = new JSONObject(str2.substring(7));
jSONObject.getString(DTParamKey.REPORT_KEY_VISUAL_SESSION_ID);
str7 = jSONObject.getString(IFileStatService.EVENT_REPORT_NAME);
} catch (JSONException unused) {
}
if (str7 != null) {
this.f84097a.post(new Runnable() {
@Override
public final void run() {
if (ha.this.e == null) {
ha.this.e = ha.b();
}
ha.d(ha.this);
}
});
}
return true;
}
return false;
}
try {
JSONObject jSONObject2 = new JSONObject(str2.substring(11));
str3 = jSONObject2.getString(DTParamKey.REPORT_KEY_VISUAL_SESSION_ID);
try {
i = jSONObject2.getInt(BaseJsHandler.JS_CALLBACKID);
try {
str4 = jSONObject2.getString("funcName");
try {
str7 = jSONObject2.getString("paramStr");
} catch (JSONException unused2) {
}
} catch (JSONException unused3) {
str4 = null;
}
} catch (JSONException unused4) {
str4 = null;
i = 0;
final String str8 = str3;
i2 = i;
str5 = str7;
str6 = str4;
jy.a("js_test", "[js_invoke] ".concat(String.valueOf(jm.b(kh.c("invoke: " + i2 + " " + str6 + " " + str5).getBytes()))));
if (this.f84097a != null) {
}
return true;
}
} catch (JSONException unused5) {
str3 = null;
str4 = null;
}
final String str82 = str3;
i2 = i;
str5 = str7;
str6 = str4;
try {
jy.a("js_test", "[js_invoke] ".concat(String.valueOf(jm.b(kh.c("invoke: " + i2 + " " + str6 + " " + str5).getBytes()))));
} catch (Throwable th2) {
th2.printStackTrace();
}
if (this.f84097a != null) {
this.f84097a.post(new Runnable() {
@Override
public final void run() {
ha haVar;
String str9;
int i3;
Object c2;
ha haVar2;
String str10;
int i4;
String str11;
hh unused6;
String str12 = str6;
if (str12 == null) {
ha.this.a(str82, i2, "check_arg:actionName is null");
return;
}
if ("isTcsWebview".equals(str12)) {
ha.this.a(str82, i2, Boolean.TRUE);
return;
}
String str13 = str6;
String str14 = CommandMessage.APP_KEY;
if (CommandMessage.APP_KEY.equals(str13)) {
haVar2 = ha.this;
str10 = str82;
i4 = i2;
str11 = gt.f().getPackageName();
} else {
str14 = "platform";
if ("platform".equals(str6)) {
haVar2 = ha.this;
str10 = str82;
i4 = i2;
str11 = Platform.ANDROID;
} else {
str14 = "apiVersion";
if (!"apiVersion".equals(str6)) {
if ("gotoQQSecure".equals(str6)) {
ha.a(ha.this, str6, str82, i2, str5);
} else {
str14 = "isPkgInstalled";
if ("isPkgInstalled".equals(str6)) {
String a2 = ha.this.a(str6, str82, i2, str5, "pkgName");
if (!hl.a(a2)) {
haVar = ha.this;
str9 = str82;
i3 = i2;
c2 = Boolean.valueOf(hk.a(a2));
haVar.a(str9, i3, c2);
}
} else {
str14 = "getPkgVersionCode";
if ("getPkgVersionCode".equals(str6)) {
String a3 = ha.this.a(str6, str82, i2, str5, "pkgName");
if (!hl.a(a3)) {
haVar = ha.this;
str9 = str82;
i3 = i2;
c2 = Integer.valueOf(hk.b(a3));
haVar.a(str9, i3, c2);
}
} else {
str14 = "getPkgVersionName";
if ("getPkgVersionName".equals(str6)) {
String a4 = ha.this.a(str6, str82, i2, str5, "pkgName");
if (!hl.a(a4)) {
haVar = ha.this;
str9 = str82;
i3 = i2;
c2 = hk.c(a4);
haVar.a(str9, i3, c2);
}
} else {
str14 = "isPkgOfficial";
if ("isPkgOfficial".equals(str6)) {
String str15 = str5;
if (str15 == null) {
ha.this.a(str82, i2, "check_arg:params is null");
return;
}
try {
JSONObject jSONObject3 = new JSONObject(str15);
String string = jSONObject3.getString("pkgName");
String string2 = jSONObject3.getString("certMd5");
if (hl.a(string) || hl.a(string2)) {
ha.this.a(str82, i2, "pkgName and certMd5 must not be null or empty");
} else {
ha.this.a(str82, i2, Boolean.valueOf(hk.a(string, string2)));
}
} catch (JSONException e) {
ha.this.a(str82, i2, "invoke " + str6 + ", parse arguments exception: " + e.getMessage());
return;
}
} else if ("getInfo".equals(str6)) {
ha haVar3 = ha.this;
String str16 = str6;
ha.b(haVar3, str16, str82, i2, str16, str5);
} else if ("launch3rdApp".equals(str6)) {
final ha haVar4 = ha.this;
final String str17 = str6;
final String str18 = str82;
final int i5 = i2;
final String str19 = str5;
haVar4.f84097a.post(new Runnable() {
@Override
public final void run() {
String str20;
String str21;
String str22;
String str23;
String str24;
String str25;
Intent launchIntentForPackage;
if (hl.a(str19)) {
ha.this.a(str18, i5, "check_arg:params is null");
return;
}
try {
try {
JSONObject jSONObject4 = new JSONObject(str19);
String str26 = null;
try {
str20 = jSONObject4.getString("pkgName");
} catch (JSONException unused7) {
str20 = null;
}
try {
str21 = jSONObject4.getString(SocialOperation.GAME_SIGNATURE);
} catch (JSONException unused8) {
str21 = null;
}
try {
str22 = jSONObject4.getString("activity");
} catch (JSONException unused9) {
str22 = null;
}
try {
str23 = jSONObject4.getString(RemoteMessageConst.MessageBody.PARAM);
} catch (JSONException unused10) {
str23 = null;
}
try {
str24 = jSONObject4.getString("action");
} catch (JSONException unused11) {
str24 = null;
}
try {
str26 = jSONObject4.getString("url");
} catch (JSONException unused12) {
}
int optInt = jSONObject4.optInt("tipType");
jSONObject4.optInt("tipTime");
String optString = jSONObject4.optString("tipMsg");
if (str24 != null) {
StringBuilder sb = new StringBuilder();
sb.append("1300");
sb.append("_action:");
sb.append(str24);
Intent intent = !hl.a(str26) ? new Intent(str24, Uri.parse(str26)) : new Intent(str24);
if (!hl.a(str23)) {
intent.putExtra(RemoteMessageConst.MessageBody.PARAM, str23);
}
intent.addFlags(268435456);
ha.this.h.getApplicationContext().startActivity(intent);
} else {
if (hl.a(str20)) {
ha.this.a(str18, i5, "bad argument, action or pkgName must be set");
return;
}
if (!hk.a(str20)) {
ha.this.a(str18, i5, "app not installed!");
return;
}
if (!hl.a(str21) && !hk.a(str20, str21)) {
ha.this.a(str18, i5, "signature not match!");
return;
}
if (hl.a(str22)) {
str25 = "1300_" + str20;
launchIntentForPackage = ha.this.h.getPackageManager().getLaunchIntentForPackage(str20);
if (launchIntentForPackage == null) {
ha.this.a(str18, i5, "app launch intent not found!");
return;
}
} else {
str25 = "1300_" + str20 + "_" + str22;
launchIntentForPackage = new Intent();
launchIntentForPackage.setClassName(str20, str22);
}
if (!hl.a(str23)) {
launchIntentForPackage.putExtra(RemoteMessageConst.MessageBody.PARAM, str23);
}
launchIntentForPackage.addFlags(268435456);
ha.this.h.getApplicationContext().startActivity(launchIntentForPackage);
if (!TextUtils.isEmpty(optString) && optInt != -1) {
StringBuilder sb2 = new StringBuilder();
sb2.append(str25);
sb2.append("_");
sb2.append(optInt);
if (optInt == 1) {
Toast.makeText(ha.this.h, optString, 0).show();
}
}
}
ha.this.a(str18, i5, (Object) 0);
} catch (Throwable th3) {
ha.this.a(str18, i5, "invoke " + str17 + ", exception: " + th3.getMessage());
}
} catch (JSONException e2) {
ha.this.a(str18, i5, "invoke " + str17 + ", parse arguments exception: " + e2.getMessage());
}
}
});
} else if ("copy2Clipboard".equals(str6)) {
ha.b(ha.this, str6, str82, i2, str5);
} else if ("kcDownload".equals(str6)) {
ha.c(ha.this, str6, str82, i2, str5);
} else if ("getNetworkType".equals(str6)) {
ha.a(ha.this, str6, str82, i2);
} else if ("clearAllCookie".equals(str6)) {
ha.b(ha.this, str6, str82, i2);
} else if ("stringEmid".equals(str6)) {
ha.d(ha.this, str6, str82, i2, str5);
} else if ("actionEmid".equals(str6)) {
ha.e(ha.this, str6, str82, i2, str5);
} else if ("installApp".equals(str6)) {
ha.f(ha.this, str6, str82, i2, str5);
} else if ("kcManuallyLogin".equals(str6)) {
ha.g(ha.this, str6, str82, i2, str5);
} else if ("getUCSign".equals(str6)) {
ha.h(ha.this, str6, str82, i2, str5);
} else if ("onLogout".equals(str6)) {
gw.a();
gw.b();
ha.this.a(str82, i2, (Object) 0);
gw.a().a("MANAUL_LOGOUT", false, null);
} else if ("SDKVersion".equals(str6)) {
ha.this.a(str82, i2, (Object) "6.3.7.6370");
} else if ("phoneNumber".equals(str6)) {
gw.a();
hr c3 = gw.c();
ha.this.a(str82, i2, (Object) ((c3 == null || TextUtils.isEmpty(c3.h)) ? "" : hx.b(c3.h)));
} else {
try {
if ("getKcState".equals(str6)) {
OrderCheckResult result = gw.a().getResult();
JSONObject jSONObject4 = new JSONObject();
StringBuilder sb = new StringBuilder();
sb.append(result.kingcard);
jSONObject4.put("kingcard", sb.toString());
jSONObject4.put("product", result.product);
jSONObject4.put("operator", result.operator);
jSONObject4.put("activationUrl", result.activationUrl);
ha.this.a(str82, i2, jSONObject4);
} else if ("JFtk".equals(str6)) {
final String string3 = new JSONObject(str5).getString("phoneNumber");
final Runnable runnable = new Runnable() {
@Override
public final void run() {
hh unused7;
unused7 = hh.a.f84201a;
String a5 = kh.a(string3);
ha.this.a(str82, i2, (Object) hh.a().a(ko.d.k + a5, (String) null));
}
};
if (!TextUtils.isEmpty(string3) && string3.length() >= 11) {
long a5 = ((dk) Cdo.a(dk.class)).a().a(ko.d.g, 7200L);
long currentTimeMillis = System.currentTimeMillis();
unused6 = hh.a.f84201a;
String a6 = kh.a(string3);
if (currentTimeMillis - hh.a().a(ko.d.l + a6, 0L) >= a5 * 1000) {
final String a7 = hi.a(string3);
hi.a(a7, new Runnable() {
final String f84204a;
final String f84205b;
final Runnable f84206c;
final class AnonymousClass1 implements du {
AnonymousClass1() {
}
@Override
public final void a(int i, int i2, int i3, cz czVar) {
hh unused;
hh unused2;
if (i2 == 0 && czVar != null && (czVar instanceof q)) {
q qVar = (q) czVar;
if (qVar.f84889b > 0 && !TextUtils.isEmpty(qVar.f84890c)) {
unused = hh.a.f84201a;
String str = r2;
long currentTimeMillis = System.currentTimeMillis();
String a2 = kh.a(str);
hh.a().b(ko.d.l + a2, currentTimeMillis);
unused2 = hh.a.f84201a;
String str2 = r2;
String a3 = ki.a(TccCryptor.encrypt((qVar.f84889b + "@" + qVar.f84890c).getBytes(), "m!a@r#k#E$T%".getBytes()));
String a4 = kh.a(str2);
hh.a().b(ko.d.k + a4, a3);
}
}
if (r3 != null) {
r3.run();
}
}
}
public AnonymousClass2(final String a72, final String string32, final Runnable runnable2) {
r1 = a72;
r2 = string32;
r3 = runnable2;
}
@Override
public final void run() {
hh unused7;
hh unused8;
unused7 = hh.a.f84201a;
String a8 = hh.a(r1);
unused8 = hh.a.f84201a;
long c4 = hh.c(r1);
r rVar = new r();
rVar.f84893a = r1;
rVar.f84895c = String.valueOf(c4);
rVar.f84894b = a8;
p pVar = new p();
pVar.f84885a = "76";
pVar.f84886b = 24;
pVar.f84887c = jw.a(rVar);
try {
((dj) Cdo.a(dj.class)).a(3515, pVar, new q(), 0, new du() {
AnonymousClass1() {
}
@Override
public final void a(int i6, int i22, int i32, cz czVar) {
hh unused9;
hh unused22;
if (i22 == 0 && czVar != null && (czVar instanceof q)) {
q qVar = (q) czVar;
if (qVar.f84889b > 0 && !TextUtils.isEmpty(qVar.f84890c)) {
unused9 = hh.a.f84201a;
String str20 = r2;
long currentTimeMillis2 = System.currentTimeMillis();
String a22 = kh.a(str20);
hh.a().b(ko.d.l + a22, currentTimeMillis2);
unused22 = hh.a.f84201a;
String str22 = r2;
String a32 = ki.a(TccCryptor.encrypt((qVar.f84889b + "@" + qVar.f84890c).getBytes(), "m!a@r#k#E$T%".getBytes()));
String a42 = kh.a(str22);
hh.a().b(ko.d.k + a42, a32);
}
}
if (r3 != null) {
r3.run();
}
}
});
} catch (Throwable unused9) {
Runnable runnable2 = r3;
if (runnable2 != null) {
runnable2.run();
}
}
}
});
}
}
runnable2.run();
} else if ("printLog".equals(str6)) {
JSONObject jSONObject5 = new JSONObject(str5);
jy.a(jSONObject5.getString("tag"), jSONObject5.getString("msg"));
} else if ("getDebugInfo".equals(str6)) {
JSONObject jSONObject6 = new JSONObject(str5);
final String string4 = jSONObject6.getString("phoneNumber");
final String string5 = jSONObject6.getString("sign");
final String string6 = jSONObject6.getString("timestamp");
final gx gxVar = gx.a.f84092a;
final gx.b bVar = new gx.b() {
@Override
public final void a(final String str20, final String str21) {
try {
((dl) Cdo.a(dl.class)).a(new Runnable() {
@Override
public final void run() {
try {
hu a8 = new ia().a();
ArrayList arrayList = new ArrayList();
gt.f();
for (Map.Entry<String, kc.a> entry : kc.a().entrySet()) {
if (entry != null) {
arrayList.add(entry.getKey() + Constants.ACCEPT_TIME_SEPARATOR_SERVER + entry.getValue().f84453a + Constants.ACCEPT_TIME_SEPARATOR_SP + entry.getValue().f84454b);
}
}
StringBuffer stringBuffer = new StringBuffer();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
stringBuffer.append((String) it.next());
stringBuffer.append(Constants.ACCEPT_TIME_SEPARATOR_SP);
}
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("autoNumber", a8.f84256b);
jSONObject7.put("autoError", a8.f84255a);
if (a8.f84257c != null) {
jSONObject7.put("errorDetail", a8.f84257c.f84259b + Constants.ACCEPT_TIME_SEPARATOR_SP + a8.f84257c.f84258a + Constants.ACCEPT_TIME_SEPARATOR_SP + a8.f84257c.f84260c + Constants.ACCEPT_TIME_SEPARATOR_SP + a8.f84257c.e + Constants.ACCEPT_TIME_SEPARATOR_SP + a8.f84257c.f84261d);
}
jSONObject7.put("ipv4", str20);
jSONObject7.put("ipv6", str21);
jSONObject7.put("localIp", stringBuffer.toString());
jSONObject7.put("guid", gw.a().getGuid());
String str22 = null;
try {
str22 = js.a("https://microwu.com:9001", 5000);
} catch (Throwable th3) {
th3.printStackTrace();
}
JSONObject jSONObject8 = new JSONObject();
jSONObject8.put("phoneNumber", string4);
jSONObject8.put("sign", string5);
jSONObject8.put("timestamp", string6);
jSONObject8.put("unicom", str22);
jSONObject8.put(com.tencent.luggage.wxa.dc.j.NAME, jSONObject7);
js.a("https://personalkingcard.3g.qq.com/activity/ltwk/ajax/saveUserLog", jSONObject8);
} catch (Throwable th4) {
th4.printStackTrace();
}
}
}, "usertest");
} catch (Throwable th3) {
th3.printStackTrace();
}
}
};
dj djVar = (dj) Cdo.a(dj.class);
l lVar = new l();
lVar.f84489a = System.currentTimeMillis();
djVar.a(com.tencent.luggage.wxa.mn.d.CTRL_INDEX, lVar, new m(), new du() {
@Override
public final void a(int i6, int i7, int i8, cz czVar) {
Log.i("UserTest", "public ip result:".concat(String.valueOf(i7)));
if (i7 != 0 || czVar == null) {
b bVar2 = bVar;
if (bVar2 != null) {
bVar2.a(null, null);
return;
}
return;
}
m mVar = (m) czVar;
b bVar3 = bVar;
if (bVar3 != null) {
bVar3.a(mVar.f84545b, mVar.f84546c);
}
}
}, 20000L);
ha.this.a(str82, i2, (Object) 0);
} else {
ha.this.a(str82, i2, "system:function_not_exist");
}
} catch (Throwable th3) {
jy.a("js_test", th3);
}
}
}
}
}
String.valueOf(ha.this.e.get(str14));
hk.a();
}
if (ha.this.f == null) {
ha.this.f.get(str6);
return;
}
return;
}
haVar2 = ha.this;
str10 = str82;
i4 = i2;
str11 = "101";
}
}
haVar2.a(str10, i4, (Object) str11);
String.valueOf(ha.this.e.get(str14));
hk.a();
if (ha.this.f == null) {
}
}
});
}
return true;
}
}