Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package com.tencent.open;
import android.app.Activity;
import android.os.Bundle;
import com.tencent.connect.auth.QQToken;
import com.tencent.tauth.IUiListener;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class SocialApi {
private SocialApiIml a;
public SocialApi(QQToken qQToken) {
this.a = new SocialApiIml(qQToken);
}
public void ask(Activity activity, Bundle bundle, IUiListener iUiListener) {
this.a.ask(activity, bundle, iUiListener);
}
public void gift(Activity activity, Bundle bundle, IUiListener iUiListener) {
this.a.gift(activity, bundle, iUiListener);
}
public void invite(Activity activity, Bundle bundle, IUiListener iUiListener) {
this.a.invite(activity, bundle, iUiListener);
}
public void story(Activity activity, Bundle bundle, IUiListener iUiListener) {
this.a.story(activity, bundle, iUiListener);
}
}

View File

@@ -0,0 +1,256 @@
package com.tencent.open;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.webkit.CookieSyncManager;
import android.webkit.WebSettings;
import com.facebook.AccessToken;
import com.tencent.connect.auth.QQToken;
import com.tencent.connect.common.BaseApi;
import com.tencent.connect.common.UIListenerManager;
import com.tencent.open.a.f;
import com.tencent.open.utils.HttpUtils;
import com.tencent.open.utils.d;
import com.tencent.open.utils.e;
import com.tencent.open.utils.g;
import com.tencent.open.utils.i;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class SocialApiIml extends BaseApi {
private Activity c;
/* compiled from: ProGuard */
private class a implements IUiListener {
private IUiListener b;
private String c;
private String d;
private Bundle e;
private Activity f;
a(Activity activity, IUiListener iUiListener, String str, String str2, Bundle bundle) {
this.b = iUiListener;
this.c = str;
this.d = str2;
this.e = bundle;
}
@Override // com.tencent.tauth.IUiListener
public void onCancel() {
this.b.onCancel();
}
@Override // com.tencent.tauth.IUiListener
public void onComplete(Object obj) {
String str;
try {
str = ((JSONObject) obj).getString(SocialConstants.PARAM_ENCRY_EOKEN);
} catch (JSONException e) {
e.printStackTrace();
f.b("openSDK_LOG.SocialApiIml", "OpenApi, EncrytokenListener() onComplete error", e);
str = null;
}
this.e.putString("encrytoken", str);
SocialApiIml socialApiIml = SocialApiIml.this;
socialApiIml.a((Context) socialApiIml.c, this.c, this.e, this.d, this.b);
if (TextUtils.isEmpty(str)) {
f.b("openSDK_LOG.SocialApiIml", "The token get from qq or qzone is empty. Write temp token to localstorage.");
SocialApiIml.this.writeEncryToken(this.f);
}
}
@Override // com.tencent.tauth.IUiListener
public void onError(UiError uiError) {
f.b("openSDK_LOG.SocialApiIml", "OpenApi, EncryptTokenListener() onError" + uiError.b);
this.b.onError(uiError);
}
}
public SocialApiIml(QQToken qQToken) {
super(qQToken);
}
public void ask(Activity activity, Bundle bundle, IUiListener iUiListener) {
a(activity, SocialConstants.ACTION_ASK, bundle, iUiListener);
}
@Override // com.tencent.connect.common.BaseApi
protected Intent b(String str) {
Intent intent = new Intent();
intent.setClassName("com.qzone", str);
Intent intent2 = new Intent();
intent2.setClassName("com.tencent.mobileqq", str);
Intent intent3 = new Intent();
intent3.setClassName("com.tencent.minihd.qq", str);
if (i.d(d.a()) && g.a(d.a(), intent3)) {
return intent3;
}
if (g.a(d.a(), intent2) && g.c(d.a(), "4.7") >= 0) {
return intent2;
}
if (g.a(d.a(), intent) && g.a(g.a(d.a(), "com.qzone"), "4.2") >= 0 && g.a(d.a(), intent.getComponent().getPackageName(), "ec96e9ac1149251acbb1b0c5777cae95")) {
return intent;
}
return null;
}
public void gift(Activity activity, Bundle bundle, IUiListener iUiListener) {
a(activity, SocialConstants.ACTION_GIFT, bundle, iUiListener);
}
public void invite(Activity activity, Bundle bundle, IUiListener iUiListener) {
this.c = activity;
Intent c = c(SocialConstants.ACTIVITY_FRIEND_CHOOSER);
if (c == null) {
f.c("openSDK_LOG.SocialApiIml", "--invite--friend chooser not found");
c = c(SocialConstants.ACTIVITY_INVITE);
}
bundle.putAll(b());
a(activity, c, SocialConstants.ACTION_INVITE, bundle, com.tencent.open.utils.f.a().a(d.a(), "http://qzs.qq.com/open/mobile/invite/sdk_invite.html?"), iUiListener, false);
}
public void story(Activity activity, Bundle bundle, IUiListener iUiListener) {
this.c = activity;
Intent c = c(SocialConstants.ACTIVITY_STORY);
bundle.putAll(b());
a(activity, c, SocialConstants.ACTION_STORY, bundle, com.tencent.open.utils.f.a().a(d.a(), "http://qzs.qq.com/open/mobile/sendstory/sdk_sendstory_v1.3.html?"), iUiListener, false);
}
@SuppressLint({"SetJavaScriptEnabled"})
public void writeEncryToken(Context context) {
String str;
String a2 = this.b.a();
String b = this.b.b();
String c = this.b.c();
if (a2 == null || a2.length() <= 0 || b == null || b.length() <= 0 || c == null || c.length() <= 0) {
str = null;
} else {
str = i.f("tencent&sdk&qazxc***14969%%" + a2 + b + c + "qzone3.4");
}
com.tencent.open.c.b bVar = new com.tencent.open.c.b(context);
WebSettings settings = bVar.getSettings();
settings.setDomStorageEnabled(true);
settings.setJavaScriptEnabled(true);
settings.setDatabaseEnabled(true);
String str2 = "<!DOCTYPE HTML><html lang=\"en-US\"><head><meta charset=\"UTF-8\"><title>localStorage Test</title><script type=\"text/javascript\">document.domain = 'qq.com';localStorage[\"" + this.b.c() + "_" + this.b.b() + "\"]=\"" + str + "\";</script></head><body></body></html>";
String a3 = com.tencent.open.utils.f.a().a(context, "http://qzs.qq.com");
bVar.loadDataWithBaseURL(a3, str2, "text/html", "utf-8", a3);
}
public SocialApiIml(com.tencent.connect.auth.c cVar, QQToken qQToken) {
super(cVar, qQToken);
}
private void a(Activity activity, String str, Bundle bundle, IUiListener iUiListener) {
this.c = activity;
Intent c = c(SocialConstants.ACTIVITY_FRIEND_CHOOSER);
if (c == null) {
f.c("openSDK_LOG.SocialApiIml", "--askgift--friend chooser not found");
c = c(SocialConstants.ACTIVITY_ASK_GIFT);
}
Intent intent = c;
bundle.putAll(b());
if (SocialConstants.ACTION_ASK.equals(str)) {
bundle.putString("type", SocialConstants.TYPE_REQUEST);
} else if (SocialConstants.ACTION_GIFT.equals(str)) {
bundle.putString("type", SocialConstants.TYPE_FREEGIFT);
}
a(activity, intent, str, bundle, com.tencent.open.utils.f.a().a(d.a(), "http://qzs.qq.com/open/mobile/request/sdk_request.html?"), iUiListener, false);
}
private void a(Activity activity, Intent intent, String str, Bundle bundle, String str2, IUiListener iUiListener, boolean z) {
StringBuilder sb = new StringBuilder();
sb.append("-->handleIntent action = ");
sb.append(str);
sb.append(", activityIntent = null ? ");
boolean z2 = true;
sb.append(intent == null);
f.c("openSDK_LOG.SocialApiIml", sb.toString());
if (intent != null) {
a(activity, intent, str, bundle, iUiListener);
return;
}
e a2 = e.a(d.a(), this.b.b());
if (!z && !a2.b("C_LoginH5")) {
z2 = false;
}
if (z2) {
a(activity, str, bundle, str2, iUiListener);
} else {
a(activity, bundle, iUiListener);
}
}
private void a(Activity activity, Intent intent, String str, Bundle bundle, IUiListener iUiListener) {
f.c("openSDK_LOG.SocialApiIml", "-->handleIntentWithAgent action = " + str);
intent.putExtra("key_action", str);
intent.putExtra("key_params", bundle);
UIListenerManager.a().a(11105, iUiListener);
a(activity, intent, 11105);
}
private void a(Activity activity, String str, Bundle bundle, String str2, IUiListener iUiListener) {
f.c("openSDK_LOG.SocialApiIml", "-->handleIntentWithH5 action = " + str);
Intent b = b("com.tencent.open.agent.AgentActivity");
IUiListener aVar = new a(activity, iUiListener, str, str2, bundle);
Intent b2 = b("com.tencent.open.agent.EncryTokenActivity");
if (b2 != null && b != null && b.getComponent() != null && b2.getComponent() != null && b.getComponent().getPackageName().equals(b2.getComponent().getPackageName())) {
b2.putExtra(SocialConstants.PARAM_CONSUMER_KEY, this.b.b());
b2.putExtra(SocialConstants.PARAM_OPEN_ID, this.b.c());
b2.putExtra(AccessToken.ACCESS_TOKEN_KEY, this.b.a());
b2.putExtra("key_action", SocialConstants.ACTION_CHECK_TOKEN);
if (a(b2)) {
f.c("openSDK_LOG.SocialApiIml", "-->handleIntentWithH5--found token activity");
UIListenerManager.a().a(11106, aVar);
a(activity, b2, 11106);
return;
}
return;
}
f.c("openSDK_LOG.SocialApiIml", "-->handleIntentWithH5--token activity not found");
String f = i.f("tencent&sdk&qazxc***14969%%" + this.b.a() + this.b.b() + this.b.c() + "qzone3.4");
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(SocialConstants.PARAM_ENCRY_EOKEN, f);
} catch (JSONException e) {
e.printStackTrace();
}
aVar.onComplete(jSONObject);
}
/* JADX INFO: Access modifiers changed from: private */
public void a(Context context, String str, Bundle bundle, String str2, IUiListener iUiListener) {
f.a("openSDK_LOG.SocialApiIml", "OpenUi, showDialog --start");
CookieSyncManager.createInstance(context);
bundle.putString(SocialConstants.PARAM_CONSUMER_KEY, this.b.b());
if (this.b.d()) {
bundle.putString(AccessToken.ACCESS_TOKEN_KEY, this.b.a());
}
String c = this.b.c();
if (c != null) {
bundle.putString(SocialConstants.PARAM_OPEN_ID, c);
}
try {
bundle.putString("pf", d.a().getSharedPreferences("pfStore", 0).getString("pf", "openmobile_android"));
} catch (Exception e) {
e.printStackTrace();
bundle.putString("pf", "openmobile_android");
}
String str3 = str2 + HttpUtils.encodeUrl(bundle);
f.b("openSDK_LOG.SocialApiIml", "OpenUi, showDialog TDialog");
if (!SocialConstants.ACTION_CHALLENGE.equals(str) && !SocialConstants.ACTION_BRAG.equals(str)) {
new TDialog(this.c, str, str3, iUiListener, this.b).show();
} else {
f.b("openSDK_LOG.SocialApiIml", "OpenUi, showDialog PKDialog");
new c(this.c, str, str3, iUiListener, this.b).show();
}
}
}

View File

@@ -0,0 +1,63 @@
package com.tencent.open;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class SocialConstants {
public static final String ACTION_ASK = "action_ask";
public static final String ACTION_BRAG = "action_brag";
public static final String ACTION_CHALLENGE = "action_challenge";
public static final String ACTION_CHECK_TOKEN = "action_check_token";
public static final String ACTION_GIFT = "action_gift";
public static final String ACTION_GRADE = "action_grade";
public static final String ACTION_INVITE = "action_invite";
public static final String ACTION_REACTIVE = "action_reactive";
public static final String ACTION_STORY = "action_story";
public static final String ACTION_VOICE = "action_voice";
public static final String ACTIVITY_ASK_GIFT = "com.tencent.open.agent.RequestFreegiftActivity";
public static final String ACTIVITY_BRAG = "com.tencent.open.agent.BragActivity";
public static final String ACTIVITY_CHALLENGE = "com.tencent.open.agent.ChallengeActivity";
public static final String ACTIVITY_CHECK_FUNCTION = "com.tencent.open.agent.CheckFunctionActivity";
public static final String ACTIVITY_FRIEND_CHOOSER = "com.tencent.open.agent.SocialFriendChooser";
public static final String ACTIVITY_GRADE = "com.tencent.open.agent.AppGradeActivity";
public static final String ACTIVITY_INVITE = "com.tencent.open.agent.AppInvitationActivity";
public static final String ACTIVITY_REACTIVE = "com.tencent.open.agent.ReactiveActivity";
public static final String ACTIVITY_STORY = "com.tencent.open.agent.SendStoryActivity";
public static final String ACTIVITY_VOICE = "com.tencent.open.agent.voice";
public static final String PARAM_ACT = "act";
public static final String PARAM_APPNAME = "appName";
public static final String PARAM_APP_CUSTOM = "appcustom";
public static final String PARAM_APP_DESC = "desc";
public static final String PARAM_APP_ICON = "picurl";
public static final String PARAM_APP_ID = "appid";
public static final String PARAM_APP_SOURCE = "site";
public static final String PARAM_AVATAR_URI = "picture";
public static final String PARAM_COMMENT = "description";
public static final String PARAM_CONSUMER_KEY = "oauth_consumer_key";
public static final String PARAM_ENCRY_EOKEN = "encry_token";
public static final String PARAM_EXCLUDE = "exclude";
public static final String PARAM_HOPEN_ID = "hopenid";
public static final String PARAM_IMAGE = "pics";
public static final String PARAM_IMAGE_URL = "imageUrl";
public static final String PARAM_IMG_DATA = "image_date";
public static final String PARAM_IMG_URL = "img";
public static final String PARAM_ONLY = "only";
public static final String PARAM_OPEN_ID = "openid";
public static final String PARAM_PLAY_URL = "playurl";
public static final String PARAM_RECEIVER = "receiver";
public static final String PARAM_REC_IMG = "recImg";
public static final String PARAM_REC_IMG_DESC = "recImgDec";
public static final String PARAM_SEND_IMG = "sendImg";
public static final String PARAM_SEND_MSG = "msg";
public static final String PARAM_SHARE_URL = "shareurl";
public static final String PARAM_SOURCE = "source";
public static final String PARAM_SPECIFIED = "specified";
public static final String PARAM_SUMMARY = "summary";
public static final String PARAM_TARGET_URL = "targetUrl";
public static final String PARAM_TITLE = "title";
public static final String PARAM_TYPE = "type";
public static final String PARAM_TYPE_ID = "typeid";
public static final String PARAM_URL = "url";
public static final String TYPE_FREEGIFT = "freegift";
public static final String TYPE_REACTIVE = "reactive";
public static final String TYPE_REQUEST = "request";
}

View File

@@ -0,0 +1,410 @@
package com.tencent.open;
import android.R;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.tencent.connect.auth.QQToken;
import com.tencent.open.a;
import com.tencent.open.a.f;
import com.tencent.open.b.g;
import com.tencent.open.utils.i;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import com.ubt.jimu.base.dialog.SimpleQuestionDialog;
import java.lang.ref.WeakReference;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class TDialog extends b {
static final FrameLayout.LayoutParams c = new FrameLayout.LayoutParams(-1, -1);
static Toast d = null;
private static WeakReference<ProgressDialog> f;
private WeakReference<Context> e;
private String g;
private OnTimeListener h;
private IUiListener i;
private FrameLayout j;
private com.tencent.open.c.b k;
private Handler l;
private boolean m;
private QQToken n;
/* compiled from: ProGuard */
private class FbWebViewClient extends WebViewClient {
private FbWebViewClient() {
}
@Override // android.webkit.WebViewClient
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
TDialog.this.k.setVisibility(0);
}
@Override // android.webkit.WebViewClient
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
f.a("openSDK_LOG.TDialog", "Webview loading URL: " + str);
super.onPageStarted(webView, str, bitmap);
}
@Override // android.webkit.WebViewClient
public void onReceivedError(WebView webView, int i, String str, String str2) {
super.onReceivedError(webView, i, str, str2);
TDialog.this.h.onError(new UiError(i, str, str2));
if (TDialog.this.e != null && TDialog.this.e.get() != null) {
Toast.makeText((Context) TDialog.this.e.get(), "网络连接异常或系统错误", 0).show();
}
TDialog.this.dismiss();
}
@Override // android.webkit.WebViewClient
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
f.a("openSDK_LOG.TDialog", "Redirect URL: " + str);
if (str.startsWith(com.tencent.open.utils.f.a().a((Context) TDialog.this.e.get(), "auth://tauth.qq.com/"))) {
TDialog.this.h.onComplete(i.c(str));
if (TDialog.this.isShowing()) {
TDialog.this.dismiss();
}
return true;
}
if (str.startsWith("auth://cancel")) {
TDialog.this.h.onCancel();
if (TDialog.this.isShowing()) {
TDialog.this.dismiss();
}
return true;
}
if (str.startsWith("auth://close")) {
if (TDialog.this.isShowing()) {
TDialog.this.dismiss();
}
return true;
}
if (!str.startsWith("download://")) {
return str.startsWith("auth://progress");
}
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(Uri.decode(str.substring(11))));
intent.addFlags(268435456);
if (TDialog.this.e != null && TDialog.this.e.get() != null) {
((Context) TDialog.this.e.get()).startActivity(intent);
}
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
}
/* compiled from: ProGuard */
private class JsListener extends a.b {
private JsListener() {
}
public void onAddShare(String str) {
f.b("openSDK_LOG.TDialog", "JsListener onAddShare");
onComplete(str);
}
public void onCancel(String str) {
f.e("openSDK_LOG.TDialog", "JsListener onCancel --msg = " + str);
TDialog.this.l.obtainMessage(2, str).sendToTarget();
TDialog.this.dismiss();
}
public void onCancelAddShare(String str) {
f.e("openSDK_LOG.TDialog", "JsListener onCancelAddShare" + str);
onCancel(SimpleQuestionDialog.KEY_CANCELBUTTON);
}
public void onCancelInvite() {
f.e("openSDK_LOG.TDialog", "JsListener onCancelInvite");
onCancel("");
}
public void onCancelLogin() {
onCancel("");
}
public void onComplete(String str) {
TDialog.this.l.obtainMessage(1, str).sendToTarget();
f.e("openSDK_LOG.TDialog", "JsListener onComplete" + str);
TDialog.this.dismiss();
}
public void onInvite(String str) {
onComplete(str);
}
public void onLoad(String str) {
TDialog.this.l.obtainMessage(4, str).sendToTarget();
}
public void showMsg(String str) {
TDialog.this.l.obtainMessage(3, str).sendToTarget();
}
}
/* compiled from: ProGuard */
private static class OnTimeListener implements IUiListener {
String a;
String b;
private WeakReference<Context> c;
private String d;
private IUiListener e;
public OnTimeListener(Context context, String str, String str2, String str3, IUiListener iUiListener) {
this.c = new WeakReference<>(context);
this.d = str;
this.a = str2;
this.b = str3;
this.e = iUiListener;
}
@Override // com.tencent.tauth.IUiListener
public void onCancel() {
IUiListener iUiListener = this.e;
if (iUiListener != null) {
iUiListener.onCancel();
this.e = null;
}
}
@Override // com.tencent.tauth.IUiListener
public void onComplete(Object obj) {
JSONObject jSONObject = (JSONObject) obj;
g.a().a(this.d + "_H5", SystemClock.elapsedRealtime(), 0L, 0L, jSONObject.optInt("ret", -6), this.a, false);
IUiListener iUiListener = this.e;
if (iUiListener != null) {
iUiListener.onComplete(jSONObject);
this.e = null;
}
}
@Override // com.tencent.tauth.IUiListener
public void onError(UiError uiError) {
String str;
if (uiError.b != null) {
str = uiError.b + this.a;
} else {
str = this.a;
}
g a = g.a();
a.a(this.d + "_H5", SystemClock.elapsedRealtime(), 0L, 0L, uiError.a, str, false);
IUiListener iUiListener = this.e;
if (iUiListener != null) {
iUiListener.onError(uiError);
this.e = null;
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a(String str) {
try {
onComplete(i.d(str));
} catch (JSONException e) {
e.printStackTrace();
onError(new UiError(-4, "服务器返回数据格式有误!", str));
}
}
}
/* compiled from: ProGuard */
private class THandler extends Handler {
private OnTimeListener b;
public THandler(OnTimeListener onTimeListener, Looper looper) {
super(looper);
this.b = onTimeListener;
}
@Override // android.os.Handler
public void handleMessage(Message message) {
f.b("openSDK_LOG.TDialog", "--handleMessage--msg.WHAT = " + message.what);
int i = message.what;
if (i == 1) {
this.b.a((String) message.obj);
return;
}
if (i == 2) {
this.b.onCancel();
return;
}
if (i == 3) {
if (TDialog.this.e == null || TDialog.this.e.get() == null) {
return;
}
TDialog.c((Context) TDialog.this.e.get(), (String) message.obj);
return;
}
if (i == 4 || i != 5 || TDialog.this.e == null || TDialog.this.e.get() == null) {
return;
}
TDialog.d((Context) TDialog.this.e.get(), (String) message.obj);
}
}
public TDialog(Context context, String str, String str2, IUiListener iUiListener, QQToken qQToken) {
super(context, R.style.Theme.Translucent.NoTitleBar);
this.m = false;
this.n = null;
this.e = new WeakReference<>(context);
this.g = str2;
this.h = new OnTimeListener(context, str, str2, qQToken.b(), iUiListener);
this.l = new THandler(this.h, context.getMainLooper());
this.i = iUiListener;
this.n = qQToken;
}
@Override // android.app.Dialog
public void onBackPressed() {
OnTimeListener onTimeListener = this.h;
if (onTimeListener != null) {
onTimeListener.onCancel();
}
super.onBackPressed();
}
@Override // com.tencent.open.b, android.app.Dialog
protected void onCreate(Bundle bundle) {
requestWindowFeature(1);
super.onCreate(bundle);
a();
b();
}
/* JADX INFO: Access modifiers changed from: private */
public static void c(Context context, String str) {
try {
JSONObject d2 = i.d(str);
int i = d2.getInt("type");
String string = d2.getString(SocialConstants.PARAM_SEND_MSG);
if (i == 0) {
if (d == null) {
d = Toast.makeText(context, string, 0);
} else {
d.setView(d.getView());
d.setText(string);
d.setDuration(0);
}
d.show();
return;
}
if (i == 1) {
if (d == null) {
d = Toast.makeText(context, string, 1);
} else {
d.setView(d.getView());
d.setText(string);
d.setDuration(1);
}
d.show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
/* JADX INFO: Access modifiers changed from: private */
public static void d(Context context, String str) {
if (context == null || str == null) {
return;
}
try {
JSONObject d2 = i.d(str);
int i = d2.getInt("action");
String string = d2.getString(SocialConstants.PARAM_SEND_MSG);
if (i == 1) {
if (f != null && f.get() != null) {
f.get().setMessage(string);
if (!f.get().isShowing()) {
f.get().show();
}
}
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage(string);
f = new WeakReference<>(progressDialog);
progressDialog.show();
} else if (i == 0) {
if (f == null) {
return;
}
if (f.get() != null && f.get().isShowing()) {
f.get().dismiss();
f = null;
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
private void a() {
new TextView(this.e.get()).setText("test");
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
this.k = new com.tencent.open.c.b(this.e.get());
this.k.setLayoutParams(layoutParams);
this.j = new FrameLayout(this.e.get());
layoutParams.gravity = 17;
this.j.setLayoutParams(layoutParams);
this.j.addView(this.k);
setContentView(this.j);
}
@SuppressLint({"SetJavaScriptEnabled"})
private void b() {
this.k.setVerticalScrollBarEnabled(false);
this.k.setHorizontalScrollBarEnabled(false);
this.k.setWebViewClient(new FbWebViewClient());
this.k.setWebChromeClient(this.b);
this.k.clearFormData();
WebSettings settings = this.k.getSettings();
if (settings == null) {
return;
}
settings.setSavePassword(false);
settings.setSaveFormData(false);
settings.setCacheMode(-1);
settings.setNeedInitialFocus(false);
settings.setBuiltInZoomControls(true);
settings.setSupportZoom(true);
settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
settings.setJavaScriptEnabled(true);
WeakReference<Context> weakReference = this.e;
if (weakReference != null && weakReference.get() != null) {
settings.setDatabaseEnabled(true);
settings.setDatabasePath(this.e.get().getApplicationContext().getDir("databases", 0).getPath());
}
settings.setDomStorageEnabled(true);
this.a.a(new JsListener(), "sdk_js_if");
this.k.loadUrl(this.g);
this.k.setLayoutParams(c);
this.k.setVisibility(4);
this.k.getSettings().setSavePassword(false);
}
@Override // com.tencent.open.b
protected void a(String str) {
f.b("openSDK_LOG.TDialog", "--onConsoleMessage--");
try {
this.a.a(this.k, str);
} catch (Exception unused) {
}
}
}

View File

@@ -0,0 +1,132 @@
package com.tencent.open;
import android.net.Uri;
import android.webkit.WebView;
import com.tencent.open.a.f;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class a {
protected HashMap<String, b> a = new HashMap<>();
/* compiled from: ProGuard */
public static class b {
/* JADX WARN: Code restructure failed: missing block: B:44:0x013c, code lost:
r13.a((java.lang.Object) null);
*/
/* JADX WARN: Code restructure failed: missing block: B:45:0x013f, code lost:
return;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public void call(java.lang.String r11, java.util.List<java.lang.String> r12, com.tencent.open.a.C0016a r13) {
/*
Method dump skipped, instructions count: 353
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.a.b.call(java.lang.String, java.util.List, com.tencent.open.a$a):void");
}
public boolean customCallback() {
return false;
}
}
public void a(b bVar, String str) {
this.a.put(str, bVar);
}
public void a(String str, String str2, List<String> list, C0016a c0016a) {
f.a("openSDK_LOG.JsBridge", "getResult---objName = " + str + " methodName = " + str2);
int size = list.size();
for (int i = 0; i < size; i++) {
try {
list.set(i, URLDecoder.decode(list.get(i), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
b bVar = this.a.get(str);
if (bVar != null) {
f.b("openSDK_LOG.JsBridge", "call----");
bVar.call(str2, list, c0016a);
} else {
f.b("openSDK_LOG.JsBridge", "not call----objName NOT FIND");
if (c0016a != null) {
c0016a.a();
}
}
}
/* compiled from: ProGuard */
/* renamed from: com.tencent.open.a$a, reason: collision with other inner class name */
public static class C0016a {
protected WeakReference<WebView> a;
protected long b;
protected String c;
public C0016a(WebView webView, long j, String str) {
this.a = new WeakReference<>(webView);
this.b = j;
this.c = str;
}
public void a(Object obj) {
String obj2;
WebView webView = this.a.get();
if (webView == null) {
return;
}
if (obj instanceof String) {
obj2 = "'" + ((Object) ((String) obj).replace("\\", "\\\\").replace("'", "\\'")) + "'";
} else {
obj2 = ((obj instanceof Number) || (obj instanceof Long) || (obj instanceof Integer) || (obj instanceof Double) || (obj instanceof Float)) ? obj.toString() : obj instanceof Boolean ? obj.toString() : "'undefined'";
}
webView.loadUrl("javascript:window.JsBridge&&JsBridge.callback(" + this.b + ",{'r':0,'result':" + obj2 + "});");
}
public void a() {
WebView webView = this.a.get();
if (webView == null) {
return;
}
webView.loadUrl("javascript:window.JsBridge&&JsBridge.callback(" + this.b + ",{'r':1,'result':'no such method'})");
}
public void a(String str) {
WebView webView = this.a.get();
if (webView != null) {
webView.loadUrl("javascript:" + str);
}
}
}
public boolean a(WebView webView, String str) {
f.a("openSDK_LOG.JsBridge", "-->canHandleUrl---url = " + str);
if (str == null || !Uri.parse(str).getScheme().equals("jsbridge")) {
return false;
}
ArrayList arrayList = new ArrayList(Arrays.asList((str + "/#").split("/")));
if (arrayList.size() < 6) {
return false;
}
String str2 = (String) arrayList.get(2);
String str3 = (String) arrayList.get(3);
List<String> subList = arrayList.subList(4, arrayList.size() - 1);
C0016a c0016a = new C0016a(webView, 4L, str);
webView.getUrl();
a(str2, str3, subList, c0016a);
return true;
}
}

View File

@@ -0,0 +1,145 @@
package com.tencent.open.a;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import com.ijm.dataencryption.de.DataDecryptTool;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class a extends i implements Handler.Callback {
private b a;
private FileWriter b;
private File c;
private char[] d;
private volatile g e;
private volatile g f;
private volatile g g;
private volatile g h;
private volatile boolean i;
private HandlerThread j;
private Handler k;
public a(b bVar) {
this(c.b, true, h.a, bVar);
}
private void f() {
if (Thread.currentThread() == this.j && !this.i) {
this.i = true;
i();
try {
this.h.a(g(), this.d);
} catch (IOException unused) {
} catch (Throwable th) {
this.h.b();
throw th;
}
this.h.b();
this.i = false;
}
}
private Writer g() {
File a = c().a();
if ((a != null && !a.equals(this.c)) || (this.b == null && a != null)) {
this.c = a;
h();
try {
this.b = new FileWriter(this.c, true);
} catch (IOException unused) {
return null;
}
}
return this.b;
}
private void h() {
try {
if (this.b != null) {
this.b.flush();
this.b.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
private void i() {
synchronized (this) {
if (this.g == this.e) {
this.g = this.f;
this.h = this.e;
} else {
this.g = this.e;
this.h = this.f;
}
}
}
public void a() {
if (this.k.hasMessages(DataDecryptTool.DECRYPT_SP_FILE)) {
this.k.removeMessages(DataDecryptTool.DECRYPT_SP_FILE);
}
this.k.sendEmptyMessage(DataDecryptTool.DECRYPT_SP_FILE);
}
public void b() {
h();
this.j.quit();
}
public b c() {
return this.a;
}
@Override // android.os.Handler.Callback
public boolean handleMessage(Message message) {
if (message.what != 1024) {
return true;
}
f();
return true;
}
public a(int i, boolean z, h hVar, b bVar) {
super(i, z, hVar);
this.i = false;
a(bVar);
this.e = new g();
this.f = new g();
this.g = this.e;
this.h = this.f;
this.d = new char[bVar.d()];
g();
this.j = new HandlerThread(bVar.c(), bVar.f());
HandlerThread handlerThread = this.j;
if (handlerThread != null) {
handlerThread.start();
}
if (!this.j.isAlive() || this.j.getLooper() == null) {
return;
}
this.k = new Handler(this.j.getLooper(), this);
}
@Override // com.tencent.open.a.i
protected void a(int i, Thread thread, long j, String str, String str2, Throwable th) {
a(e().a(i, thread, j, str, str2, th));
}
protected void a(String str) {
this.g.a(str);
if (this.g.a() >= c().d()) {
a();
}
}
public void a(b bVar) {
this.a = bVar;
}
}

View File

@@ -0,0 +1,116 @@
package com.tencent.open.a;
import com.tencent.open.a.d;
import com.ubt.jimu.base.util.FileUtil;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class b {
private static SimpleDateFormat a = d.C0017d.a("yy.MM.dd.HH");
private File g;
private String b = "Tracer.File";
private int c = Integer.MAX_VALUE;
private int d = Integer.MAX_VALUE;
private int e = FileUtil.ZIP_BUFFER_SIZE;
private long f = 10000;
private int h = 10;
private String i = ".log";
private long j = Long.MAX_VALUE;
public b(File file, int i, int i2, int i3, String str, long j, int i4, String str2, long j2) {
a(file);
b(i);
a(i2);
c(i3);
a(str);
a(j);
d(i4);
b(str2);
b(j2);
}
private File c(long j) {
File b = b();
try {
return new File(b, c(d(j)));
} catch (Throwable th) {
th.printStackTrace();
return b;
}
}
private String d(long j) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(j);
return new SimpleDateFormat("yy.MM.dd.HH").format(calendar.getTime());
}
public File a() {
return c(System.currentTimeMillis());
}
public File b() {
File e = e();
e.mkdirs();
return e;
}
public File e() {
return this.g;
}
public int f() {
return this.h;
}
public void a(String str) {
this.b = str;
}
public void a(int i) {
this.c = i;
}
public void b(int i) {
this.d = i;
}
public void a(long j) {
this.f = j;
}
public void b(String str) {
this.i = str;
}
private String c(String str) {
return "com.tencent.mobileqq_connectSdk." + str + ".log";
}
public void a(File file) {
this.g = file;
}
public void b(long j) {
this.j = j;
}
public int d() {
return this.e;
}
public String c() {
return this.b;
}
public void d(int i) {
this.h = i;
}
public void c(int i) {
this.e = i;
}
}

View File

@@ -0,0 +1,24 @@
package com.tencent.open.a;
import com.ijm.dataencryption.de.DataDecryptTool;
import com.thoughtworks.xstream.XStream;
import java.io.File;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class c {
public static int a = 62;
public static int b = 60;
public static String c = "OpenSDK.Client.File.Tracer";
public static String d = "Tencent" + File.separator + "msflogs" + File.separator + "com" + File.separator + "tencent" + File.separator + "mobileqq" + File.separator;
public static String e = ".log";
public static long f = 8388608;
public static int g = 262144;
public static int h = DataDecryptTool.DECRYPT_SP_FILE;
public static int i = XStream.PRIORITY_VERY_HIGH;
public static String j = "debug.file.blockcount";
public static String k = "debug.file.keepperiod";
public static String l = "debug.file.tracelevel";
public static int m = 24;
public static long n = 604800000;
}

View File

@@ -0,0 +1,90 @@
package com.tencent.open.a;
import android.annotation.SuppressLint;
import android.os.Environment;
import android.os.StatFs;
import java.io.File;
import java.text.SimpleDateFormat;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class d {
/* compiled from: ProGuard */
public static final class a {
public static final boolean a(int i, int i2) {
return i2 == (i & i2);
}
}
/* compiled from: ProGuard */
public static final class b {
public static boolean a() {
String externalStorageState = Environment.getExternalStorageState();
return "mounted".equals(externalStorageState) || "mounted_ro".equals(externalStorageState);
}
public static c b() {
if (a()) {
return c.b(Environment.getExternalStorageDirectory());
}
return null;
}
}
/* compiled from: ProGuard */
public static class c {
private File a;
private long b;
private long c;
public File a() {
return this.a;
}
public long b() {
return this.b;
}
public long c() {
return this.c;
}
public String toString() {
return String.format("[%s : %d / %d]", a().getAbsolutePath(), Long.valueOf(c()), Long.valueOf(b()));
}
public void a(File file) {
this.a = file;
}
public void b(long j) {
this.c = j;
}
public static c b(File file) {
c cVar = new c();
cVar.a(file);
StatFs statFs = new StatFs(file.getAbsolutePath());
long blockSize = statFs.getBlockSize();
long blockCount = statFs.getBlockCount();
long availableBlocks = statFs.getAvailableBlocks();
cVar.a(blockCount * blockSize);
cVar.b(availableBlocks * blockSize);
return cVar;
}
public void a(long j) {
this.b = j;
}
}
/* compiled from: ProGuard */
/* renamed from: com.tencent.open.a.d$d, reason: collision with other inner class name */
public static final class C0017d {
@SuppressLint({"SimpleDateFormat"})
public static SimpleDateFormat a(String str) {
return new SimpleDateFormat(str);
}
}
}

View File

@@ -0,0 +1,35 @@
package com.tencent.open.a;
import android.util.Log;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public final class e extends i {
public static final e a = new e();
@Override // com.tencent.open.a.i
protected void a(int i, Thread thread, long j, String str, String str2, Throwable th) {
if (i == 1) {
Log.v(str, str2, th);
return;
}
if (i == 2) {
Log.d(str, str2, th);
return;
}
if (i == 4) {
Log.i(str, str2, th);
return;
}
if (i == 8) {
Log.w(str, str2, th);
} else if (i == 16) {
Log.e(str, str2, th);
} else {
if (i != 32) {
return;
}
Log.e(str, str2, th);
}
}
}

View File

@@ -0,0 +1,113 @@
package com.tencent.open.a;
import android.os.Environment;
import android.text.TextUtils;
import com.tencent.open.a.d;
import java.io.File;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class f {
public static f a = null;
protected static final b c = new b(c(), c.m, c.g, c.h, c.c, c.i, 10, c.e, c.n);
private static boolean d = false;
protected a b = new a(c);
private f() {
}
public static f a() {
if (a == null) {
synchronized (f.class) {
if (a == null) {
a = new f();
d = true;
}
}
}
return a;
}
public static final void b(String str, String str2) {
a().a(2, str, str2, null);
}
public static final void c(String str, String str2) {
a().a(4, str, str2, null);
}
public static final void d(String str, String str2) {
a().a(8, str, str2, null);
}
public static final void e(String str, String str2) {
a().a(16, str, str2, null);
}
public static final void b(String str, String str2, Throwable th) {
a().a(16, str, str2, th);
}
protected static File c() {
String str = c.d;
boolean z = false;
try {
d.c b = d.b.b();
if (b != null) {
if (b.c() > c.f) {
z = true;
}
}
} catch (Throwable th) {
th.printStackTrace();
}
return z ? new File(Environment.getExternalStorageDirectory(), str) : new File(com.tencent.open.utils.d.c(), str);
}
protected void d() {
a aVar = this.b;
if (aVar != null) {
aVar.a();
this.b.b();
this.b = null;
}
}
public static void b() {
synchronized (f.class) {
a().d();
if (a != null) {
a = null;
}
}
}
protected void a(int i, String str, String str2, Throwable th) {
a aVar;
if (d) {
String b = com.tencent.open.utils.d.b();
if (!TextUtils.isEmpty(b)) {
String str3 = b + " SDK_VERSION:3.3.0.lite";
if (this.b == null) {
return;
}
e.a.b(32, Thread.currentThread(), System.currentTimeMillis(), "openSDK_LOG", str3, null);
this.b.b(32, Thread.currentThread(), System.currentTimeMillis(), "openSDK_LOG", str3, null);
d = false;
}
}
e.a.b(i, Thread.currentThread(), System.currentTimeMillis(), str, str2, th);
if (!d.a.a(c.b, i) || (aVar = this.b) == null) {
return;
}
aVar.b(i, Thread.currentThread(), System.currentTimeMillis(), str, str2, th);
}
public static final void a(String str, String str2) {
a().a(1, str, str2, null);
}
public static final void a(String str, String str2, Throwable th) {
a().a(2, str, str2, th);
}
}

View File

@@ -0,0 +1,76 @@
package com.tencent.open.a;
import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class g implements Iterable<String> {
private ConcurrentLinkedQueue<String> a;
private AtomicInteger b;
public g() {
this.a = null;
this.b = null;
this.a = new ConcurrentLinkedQueue<>();
this.b = new AtomicInteger(0);
}
public int a(String str) {
int length = str.length();
this.a.add(str);
return this.b.addAndGet(length);
}
public void b() {
this.a.clear();
this.b.set(0);
}
@Override // java.lang.Iterable
public Iterator<String> iterator() {
return this.a.iterator();
}
public void a(Writer writer, char[] cArr) throws IOException {
if (writer == null || cArr == null || cArr.length == 0) {
return;
}
int length = cArr.length;
Iterator<String> it = iterator();
int i = length;
int i2 = 0;
while (it.hasNext()) {
String next = it.next();
int length2 = next.length();
int i3 = 0;
while (length2 > 0) {
int i4 = i > length2 ? length2 : i;
int i5 = i3 + i4;
next.getChars(i3, i5, cArr, i2);
i -= i4;
i2 += i4;
length2 -= i4;
if (i == 0) {
writer.write(cArr, 0, length);
i = length;
i3 = i5;
i2 = 0;
} else {
i3 = i5;
}
}
}
if (i2 > 0) {
writer.write(cArr, 0, i2);
}
writer.flush();
}
public int a() {
return this.b.get();
}
}

View File

@@ -0,0 +1,51 @@
package com.tencent.open.a;
import android.text.format.Time;
import android.util.Log;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public final class h {
public static final h a = new h();
public final String a(int i) {
return i != 1 ? i != 2 ? i != 4 ? i != 8 ? i != 16 ? i != 32 ? "-" : "A" : "E" : "W" : "I" : "D" : "V";
}
public String a(int i, Thread thread, long j, String str, String str2, Throwable th) {
long j2 = j % 1000;
Time time = new Time();
time.set(j);
StringBuilder sb = new StringBuilder();
sb.append(a(i));
sb.append('/');
sb.append(time.format("%Y-%m-%d %H:%M:%S"));
sb.append('.');
if (j2 < 10) {
sb.append("00");
} else if (j2 < 100) {
sb.append('0');
}
sb.append(j2);
sb.append(' ');
sb.append('[');
if (thread == null) {
sb.append("N/A");
} else {
sb.append(thread.getName());
}
sb.append(']');
sb.append('[');
sb.append(str);
sb.append(']');
sb.append(' ');
sb.append(str2);
sb.append('\n');
if (th != null) {
sb.append("* Exception : \n");
sb.append(Log.getStackTraceString(th));
sb.append('\n');
}
return sb.toString();
}
}

View File

@@ -0,0 +1,52 @@
package com.tencent.open.a;
import com.tencent.open.a.d;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public abstract class i {
private volatile int a;
private volatile boolean b;
private h c;
public i() {
this(c.a, true, h.a);
}
public void a(int i) {
this.a = i;
}
protected abstract void a(int i, Thread thread, long j, String str, String str2, Throwable th);
public void b(int i, Thread thread, long j, String str, String str2, Throwable th) {
if (d() && d.a.a(this.a, i)) {
a(i, thread, j, str, str2, th);
}
}
public boolean d() {
return this.b;
}
public h e() {
return this.c;
}
public i(int i, boolean z, h hVar) {
this.a = c.a;
this.b = true;
this.c = h.a;
a(i);
a(z);
a(hVar);
}
public void a(boolean z) {
this.b = z;
}
public void a(h hVar) {
this.c = hVar;
}
}

View File

@@ -0,0 +1,53 @@
package com.tencent.open;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.webkit.ConsoleMessage;
import android.webkit.WebChromeClient;
import com.tencent.open.a.f;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public abstract class b extends Dialog {
protected a a;
@SuppressLint({"NewApi"})
protected final WebChromeClient b;
public b(Context context, int i) {
super(context, i);
this.b = new WebChromeClient() { // from class: com.tencent.open.b.1
@Override // android.webkit.WebChromeClient
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
if (consoleMessage == null) {
return false;
}
f.c("openSDK_LOG.JsDialog", "WebChromeClient onConsoleMessage" + consoleMessage.message() + " -- From 111 line " + consoleMessage.lineNumber() + " of " + consoleMessage.sourceId());
if (Build.VERSION.SDK_INT <= 7) {
return true;
}
b.this.a(consoleMessage == null ? "" : consoleMessage.message());
return true;
}
@Override // android.webkit.WebChromeClient
public void onConsoleMessage(String str, int i2, String str2) {
f.c("openSDK_LOG.JsDialog", "WebChromeClient onConsoleMessage" + str + " -- From 222 line " + i2 + " of " + str2);
if (Build.VERSION.SDK_INT == 7) {
b.this.a(str);
}
}
};
}
protected abstract void a(String str);
@Override // android.app.Dialog
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.a = new a();
}
}

View File

@@ -0,0 +1,169 @@
package com.tencent.open.b;
import android.content.Context;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import com.ijm.dataencryption.de.DataDecryptTool;
import com.ubt.jimu.transport.model.TransportFile;
import com.ubtrobot.jimu.robotapi.PeripheralType;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class a {
protected static final Uri a = Uri.parse("content://telephony/carriers/preferapn");
public static String a(Context context) {
int d = d(context);
if (d == 2) {
return "wifi";
}
if (d == 1) {
return "cmwap";
}
if (d == 4) {
return "cmnet";
}
if (d == 16) {
return "uniwap";
}
if (d == 8) {
return "uninet";
}
if (d == 64) {
return "wap";
}
if (d == 32) {
return "net";
}
if (d == 512) {
return "ctwap";
}
if (d == 256) {
return "ctnet";
}
if (d == 2048) {
return "3gnet";
}
if (d == 1024) {
return "3gwap";
}
String b = b(context);
return (b == null || b.length() == 0) ? TransportFile.TYPE_NONE : b;
}
public static String b(Context context) {
try {
Cursor query = context.getContentResolver().query(a, null, null, null, null);
if (query == null) {
return null;
}
query.moveToFirst();
if (query.isAfterLast()) {
if (query != null) {
query.close();
}
return null;
}
String string = query.getString(query.getColumnIndex("apn"));
if (query != null) {
query.close();
}
return string;
} catch (SecurityException e) {
com.tencent.open.a.f.e("openSDK_LOG.APNUtil", "getApn has exception: " + e.getMessage());
return "";
} catch (Exception e2) {
com.tencent.open.a.f.e("openSDK_LOG.APNUtil", "getApn has exception: " + e2.getMessage());
return "";
}
}
public static String c(Context context) {
try {
Cursor query = context.getContentResolver().query(a, null, null, null, null);
if (query == null) {
return null;
}
query.moveToFirst();
if (query.isAfterLast()) {
if (query != null) {
query.close();
}
return null;
}
String string = query.getString(query.getColumnIndex("proxy"));
if (query != null) {
query.close();
}
return string;
} catch (SecurityException e) {
com.tencent.open.a.f.e("openSDK_LOG.APNUtil", "getApnProxy has exception: " + e.getMessage());
return "";
}
}
public static int d(Context context) {
ConnectivityManager connectivityManager;
NetworkInfo activeNetworkInfo;
try {
connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
} catch (Exception e) {
com.tencent.open.a.f.e("openSDK_LOG.APNUtil", "getMProxyType has exception: " + e.getMessage());
}
if (connectivityManager == null || (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null) {
return PeripheralType.SERVO;
}
if (activeNetworkInfo.getTypeName().toUpperCase().equals("WIFI")) {
return 2;
}
String lowerCase = activeNetworkInfo.getExtraInfo().toLowerCase();
if (lowerCase.startsWith("cmwap")) {
return 1;
}
if (!lowerCase.startsWith("cmnet") && !lowerCase.startsWith("epc.tmobile.com")) {
if (lowerCase.startsWith("uniwap")) {
return 16;
}
if (lowerCase.startsWith("uninet")) {
return 8;
}
if (lowerCase.startsWith("wap")) {
return 64;
}
if (lowerCase.startsWith("net")) {
return 32;
}
if (lowerCase.startsWith("ctwap")) {
return DataDecryptTool.DECRYPT_DB_FILE;
}
if (lowerCase.startsWith("ctnet")) {
return DataDecryptTool.DECRYPT_ALL_FILE;
}
if (lowerCase.startsWith("3gwap")) {
return DataDecryptTool.DECRYPT_SP_FILE;
}
if (lowerCase.startsWith("3gnet")) {
return 2048;
}
if (lowerCase.startsWith("#777")) {
String c = c(context);
if (c != null) {
if (c.length() > 0) {
return DataDecryptTool.DECRYPT_DB_FILE;
}
}
return DataDecryptTool.DECRYPT_ALL_FILE;
}
return PeripheralType.SERVO;
}
return 4;
}
public static String e(Context context) {
NetworkInfo activeNetworkInfo;
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
return (connectivityManager == null || (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null) ? "MOBILE" : activeNetworkInfo.getTypeName();
}
}

View File

@@ -0,0 +1,19 @@
package com.tencent.open.b;
import android.os.Bundle;
import java.io.Serializable;
import java.util.HashMap;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class b implements Serializable {
public final HashMap<String, String> a = new HashMap<>();
public b(Bundle bundle) {
if (bundle != null) {
for (String str : bundle.keySet()) {
this.a.put(str, bundle.getString(str));
}
}
}
}

View File

@@ -0,0 +1,149 @@
package com.tencent.open.b;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import java.util.Locale;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class c {
static String a;
static String b;
static String c;
private static String d;
private static String e;
public static String a() {
WifiManager wifiManager;
WifiInfo connectionInfo;
try {
Context a2 = com.tencent.open.utils.d.a();
return (a2 == null || (wifiManager = (WifiManager) a2.getSystemService("wifi")) == null || (connectionInfo = wifiManager.getConnectionInfo()) == null) ? "" : connectionInfo.getMacAddress();
} catch (SecurityException e2) {
com.tencent.open.a.f.b("openSDK_LOG.MobileInfoUtil", "getLocalMacAddress>>>", e2);
return "";
}
}
public static String b() {
return Locale.getDefault().getLanguage();
}
public static String c(Context context) {
String str = b;
if (str != null && str.length() > 0) {
return b;
}
if (context == null) {
return "";
}
try {
b = ((TelephonyManager) context.getSystemService("phone")).getSimSerialNumber();
return b;
} catch (Exception unused) {
return "";
}
}
public static String d(Context context) {
String str = c;
if (str != null && str.length() > 0) {
return c;
}
if (context == null) {
return "";
}
try {
c = Settings.Secure.getString(context.getContentResolver(), "android_id");
return c;
} catch (Exception unused) {
return "";
}
}
public static String e(Context context) {
try {
if (e == null) {
WindowManager windowManager = (WindowManager) context.getSystemService("window");
DisplayMetrics displayMetrics = new DisplayMetrics();
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
StringBuilder sb = new StringBuilder();
sb.append("imei=");
sb.append(b(context));
sb.append('&');
sb.append("model=");
sb.append(Build.MODEL);
sb.append('&');
sb.append("os=");
sb.append(Build.VERSION.RELEASE);
sb.append('&');
sb.append("apilevel=");
sb.append(Build.VERSION.SDK_INT);
sb.append('&');
String b2 = a.b(context);
if (b2 == null) {
b2 = "";
}
sb.append("network=");
sb.append(b2);
sb.append('&');
sb.append("sdcard=");
sb.append(Environment.getExternalStorageState().equals("mounted") ? 1 : 0);
sb.append('&');
sb.append("display=");
sb.append(displayMetrics.widthPixels);
sb.append('*');
sb.append(displayMetrics.heightPixels);
sb.append('&');
sb.append("manu=");
sb.append(Build.MANUFACTURER);
sb.append("&");
sb.append("wifi=");
sb.append(a.e(context));
e = sb.toString();
}
return e;
} catch (Exception unused) {
return null;
}
}
public static String b(Context context) {
String str = a;
if (str != null && str.length() > 0) {
return a;
}
if (context == null) {
return "";
}
try {
a = ((TelephonyManager) context.getSystemService("phone")).getDeviceId();
return a;
} catch (Exception unused) {
return "";
}
}
public static String a(Context context) {
if (!TextUtils.isEmpty(d)) {
return d;
}
if (context == null) {
return "";
}
d = "";
WindowManager windowManager = (WindowManager) context.getSystemService("window");
if (windowManager != null) {
d = windowManager.getDefaultDisplay().getWidth() + "x" + windowManager.getDefaultDisplay().getHeight();
}
return d;
}
}

View File

@@ -0,0 +1,56 @@
package com.tencent.open.b;
import android.os.SystemClock;
import com.tencent.open.utils.i;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class d {
protected static d a;
protected d() {
}
public static synchronized d a() {
d dVar;
synchronized (d.class) {
if (a == null) {
a = new d();
}
dVar = a;
}
return dVar;
}
public void a(String str, String str2, String str3, String str4, String str5, String str6) {
g.a().a(i.a(str, str3, str4, str5, str2, str6), str2, true);
}
public void a(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8) {
g.a().a(i.a(str, str4, str5, str3, str2, str6, "", str7, str8, "", "", ""), str2, false);
}
public void a(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, String str10) {
g.a().a(i.a(str, str4, str5, str3, str2, str6, str7, "", "", str8, str9, str10), str2, false);
}
public void a(int i, String str, String str2, String str3, String str4, Long l, int i2, int i3, String str5) {
long elapsedRealtime = SystemClock.elapsedRealtime() - l.longValue();
if (l.longValue() == 0 || elapsedRealtime < 0) {
elapsedRealtime = 0;
}
StringBuffer stringBuffer = new StringBuffer("http://c.isdspeed.qq.com/code.cgi");
stringBuffer.append("?domain=mobile.opensdk.com&cgi=opensdk&type=");
stringBuffer.append(i);
stringBuffer.append("&code=");
stringBuffer.append(i2);
stringBuffer.append("&time=");
stringBuffer.append(elapsedRealtime);
stringBuffer.append("&rate=");
stringBuffer.append(i3);
stringBuffer.append("&uin=");
stringBuffer.append(str2);
stringBuffer.append("&data=");
g.a().a(stringBuffer.toString(), "GET", i.a(String.valueOf(i), String.valueOf(i2), String.valueOf(elapsedRealtime), String.valueOf(i3), str, str2, str3, str4, str5), true);
}
}

View File

@@ -0,0 +1,21 @@
package com.tencent.open.b;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class e {
public static int a(String str) {
int a;
if (com.tencent.open.utils.d.a() == null || (a = com.tencent.open.utils.e.a(com.tencent.open.utils.d.a(), str).a("Common_BusinessReportFrequency")) == 0) {
return 100;
}
return a;
}
public static int a() {
int a = com.tencent.open.utils.e.a(com.tencent.open.utils.d.a(), (String) null).a("Common_HttpRetryCount");
if (a == 0) {
return 2;
}
return a;
}
}

View File

@@ -0,0 +1,373 @@
package com.tencent.open.b;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class f extends SQLiteOpenHelper {
protected static final String[] a = {"key"};
protected static f b;
public f(Context context) {
super(context, "sdk_report.db", (SQLiteDatabase.CursorFactory) null, 2);
}
public static synchronized f a() {
f fVar;
synchronized (f.class) {
if (b == null) {
b = new f(com.tencent.open.utils.d.a());
}
fVar = b;
}
return fVar;
}
/* JADX WARN: Code restructure failed: missing block: B:18:0x0032, code lost:
return;
*/
/* JADX WARN: Code restructure failed: missing block: B:22:0x002e, code lost:
if (r0 == null) goto L21;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public synchronized void b(java.lang.String r6) {
/*
r5 = this;
monitor-enter(r5)
boolean r0 = android.text.TextUtils.isEmpty(r6) // Catch: java.lang.Throwable -> L39
if (r0 == 0) goto L9
monitor-exit(r5)
return
L9:
android.database.sqlite.SQLiteDatabase r0 = r5.getWritableDatabase() // Catch: java.lang.Throwable -> L39
if (r0 != 0) goto L11
monitor-exit(r5)
return
L11:
java.lang.String r1 = "via_cgi_report"
java.lang.String r2 = "type = ?"
r3 = 1
java.lang.String[] r3 = new java.lang.String[r3] // Catch: java.lang.Throwable -> L24 java.lang.Exception -> L26
r4 = 0
r3[r4] = r6 // Catch: java.lang.Throwable -> L24 java.lang.Exception -> L26
r0.delete(r1, r2, r3) // Catch: java.lang.Throwable -> L24 java.lang.Exception -> L26
if (r0 == 0) goto L31
L20:
r0.close() // Catch: java.lang.Throwable -> L39
goto L31
L24:
r6 = move-exception
goto L33
L26:
r6 = move-exception
java.lang.String r1 = "openSDK_LOG.ReportDatabaseHelper"
java.lang.String r2 = "clearReportItem has exception."
com.tencent.open.a.f.b(r1, r2, r6) // Catch: java.lang.Throwable -> L24
if (r0 == 0) goto L31
goto L20
L31:
monitor-exit(r5)
return
L33:
if (r0 == 0) goto L38
r0.close() // Catch: java.lang.Throwable -> L39
L38:
throw r6 // Catch: java.lang.Throwable -> L39
L39:
r6 = move-exception
monitor-exit(r5)
throw r6
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.b.f.b(java.lang.String):void");
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onCreate(SQLiteDatabase sQLiteDatabase) {
sQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS via_cgi_report( _id INTEGER PRIMARY KEY,key TEXT,type TEXT,blob BLOB);");
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
sQLiteDatabase.execSQL("DROP TABLE IF EXISTS via_cgi_report");
onCreate(sQLiteDatabase);
}
/* JADX WARN: Code restructure failed: missing block: B:18:0x0089, code lost:
if (r1 != null) goto L49;
*/
/* JADX WARN: Code restructure failed: missing block: B:19:0x008b, code lost:
r1.close();
*/
/* JADX WARN: Code restructure failed: missing block: B:21:0x00a3, code lost:
return r0;
*/
/* JADX WARN: Code restructure failed: missing block: B:79:0x009f, code lost:
if (r1 != null) goto L49;
*/
/* JADX WARN: Removed duplicated region for block: B:36:0x0075 A[Catch: all -> 0x007f, Exception -> 0x0081, TRY_ENTER, TryCatch #13 {Exception -> 0x0081, all -> 0x007f, blocks: (B:23:0x0030, B:25:0x0036, B:26:0x0039, B:32:0x0053, B:34:0x0056, B:36:0x0075, B:37:0x0078, B:67:0x0062, B:60:0x0065, B:61:0x0068, B:54:0x006c, B:49:0x006f), top: B:22:0x0030 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public synchronized java.util.List<java.io.Serializable> a(java.lang.String r12) {
/*
r11 = this;
monitor-enter(r11)
java.util.ArrayList r0 = new java.util.ArrayList // Catch: java.lang.Throwable -> Laf
r0.<init>() // Catch: java.lang.Throwable -> Laf
java.util.List r0 = java.util.Collections.synchronizedList(r0) // Catch: java.lang.Throwable -> Laf
boolean r1 = android.text.TextUtils.isEmpty(r12) // Catch: java.lang.Throwable -> Laf
if (r1 == 0) goto L12
monitor-exit(r11)
return r0
L12:
android.database.sqlite.SQLiteDatabase r1 = r11.getReadableDatabase() // Catch: java.lang.Throwable -> Laf
if (r1 != 0) goto L1a
monitor-exit(r11)
return r0
L1a:
r10 = 0
java.lang.String r3 = "via_cgi_report"
r4 = 0
java.lang.String r5 = "type = ?"
r2 = 1
java.lang.String[] r6 = new java.lang.String[r2] // Catch: java.lang.Throwable -> L8f java.lang.Exception -> L92
r2 = 0
r6[r2] = r12 // Catch: java.lang.Throwable -> L8f java.lang.Exception -> L92
r7 = 0
r8 = 0
r9 = 0
r2 = r1
android.database.Cursor r12 = r2.query(r3, r4, r5, r6, r7, r8, r9) // Catch: java.lang.Throwable -> L8f java.lang.Exception -> L92
if (r12 == 0) goto L84
int r2 = r12.getCount() // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
if (r2 <= 0) goto L84
r12.moveToFirst() // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
L39:
java.lang.String r2 = "blob"
int r2 = r12.getColumnIndex(r2) // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
byte[] r2 = r12.getBlob(r2) // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
java.io.ByteArrayInputStream r3 = new java.io.ByteArrayInputStream // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
r3.<init>(r2) // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
java.io.ObjectInputStream r2 = new java.io.ObjectInputStream // Catch: java.lang.Throwable -> L5e java.lang.Exception -> L69
r2.<init>(r3) // Catch: java.lang.Throwable -> L5e java.lang.Exception -> L69
java.lang.Object r4 = r2.readObject() // Catch: java.lang.Throwable -> L5c java.lang.Exception -> L6a
java.io.Serializable r4 = (java.io.Serializable) r4 // Catch: java.lang.Throwable -> L5c java.lang.Exception -> L6a
r2.close() // Catch: java.io.IOException -> L56 java.lang.Throwable -> L7f java.lang.Exception -> L81
L56:
r3.close() // Catch: java.io.IOException -> L5a java.lang.Throwable -> L7f java.lang.Exception -> L81
goto L73
L5a:
goto L73
L5c:
r4 = move-exception
goto L60
L5e:
r4 = move-exception
r2 = r10
L60:
if (r2 == 0) goto L65
r2.close() // Catch: java.io.IOException -> L65 java.lang.Throwable -> L7f java.lang.Exception -> L81
L65:
r3.close() // Catch: java.io.IOException -> L68 java.lang.Throwable -> L7f java.lang.Exception -> L81
L68:
throw r4 // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
L69:
r2 = r10
L6a:
if (r2 == 0) goto L6f
r2.close() // Catch: java.io.IOException -> L6f java.lang.Throwable -> L7f java.lang.Exception -> L81
L6f:
r3.close() // Catch: java.io.IOException -> L72 java.lang.Throwable -> L7f java.lang.Exception -> L81
L72:
r4 = r10
L73:
if (r4 == 0) goto L78
r0.add(r4) // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
L78:
boolean r2 = r12.moveToNext() // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L81
if (r2 != 0) goto L39
goto L84
L7f:
r0 = move-exception
goto La4
L81:
r2 = move-exception
r10 = r12
goto L93
L84:
if (r12 == 0) goto L89
r12.close() // Catch: java.lang.Throwable -> Laf
L89:
if (r1 == 0) goto La2
L8b:
r1.close() // Catch: java.lang.Throwable -> Laf
goto La2
L8f:
r0 = move-exception
r12 = r10
goto La4
L92:
r2 = move-exception
L93:
java.lang.String r12 = "openSDK_LOG.ReportDatabaseHelper"
java.lang.String r3 = "getReportItemFromDB has exception."
com.tencent.open.a.f.b(r12, r3, r2) // Catch: java.lang.Throwable -> L8f
if (r10 == 0) goto L9f
r10.close() // Catch: java.lang.Throwable -> Laf
L9f:
if (r1 == 0) goto La2
goto L8b
La2:
monitor-exit(r11)
return r0
La4:
if (r12 == 0) goto La9
r12.close() // Catch: java.lang.Throwable -> Laf
La9:
if (r1 == 0) goto Lae
r1.close() // Catch: java.lang.Throwable -> Laf
Lae:
throw r0 // Catch: java.lang.Throwable -> Laf
Laf:
r12 = move-exception
monitor-exit(r11)
throw r12
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.b.f.a(java.lang.String):java.util.List");
}
/* JADX WARN: Code restructure failed: missing block: B:69:0x0096, code lost:
return;
*/
/* JADX WARN: Code restructure failed: missing block: B:77:0x0092, code lost:
if (r1 == null) goto L55;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public synchronized void a(java.lang.String r9, java.util.List<java.io.Serializable> r10) {
/*
r8 = this;
monitor-enter(r8)
int r0 = r10.size() // Catch: java.lang.Throwable -> La0
if (r0 != 0) goto L9
monitor-exit(r8)
return
L9:
r1 = 20
if (r0 > r1) goto Le
goto L10
Le:
r0 = 20
L10:
boolean r1 = android.text.TextUtils.isEmpty(r9) // Catch: java.lang.Throwable -> La0
if (r1 == 0) goto L18
monitor-exit(r8)
return
L18:
r8.b(r9) // Catch: java.lang.Throwable -> La0
android.database.sqlite.SQLiteDatabase r1 = r8.getWritableDatabase() // Catch: java.lang.Throwable -> La0
if (r1 != 0) goto L23
monitor-exit(r8)
return
L23:
r1.beginTransaction() // Catch: java.lang.Throwable -> La0
android.content.ContentValues r2 = new android.content.ContentValues // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
r2.<init>() // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
r3 = 0
L2c:
if (r3 >= r0) goto L7a
java.lang.Object r4 = r10.get(r3) // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
java.io.Serializable r4 = (java.io.Serializable) r4 // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
if (r4 == 0) goto L74
java.lang.String r5 = "type"
r2.put(r5, r9) // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
java.io.ByteArrayOutputStream r5 = new java.io.ByteArrayOutputStream // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
r6 = 512(0x200, float:7.17E-43)
r5.<init>(r6) // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
r6 = 0
java.io.ObjectOutputStream r7 = new java.io.ObjectOutputStream // Catch: java.lang.Throwable -> L55 java.io.IOException -> L5f
r7.<init>(r5) // Catch: java.lang.Throwable -> L55 java.io.IOException -> L5f
r7.writeObject(r4) // Catch: java.lang.Throwable -> L52 java.io.IOException -> L60
r7.close() // Catch: java.io.IOException -> L4e java.lang.Throwable -> L86 java.lang.Exception -> L88
L4e:
r5.close() // Catch: java.io.IOException -> L66 java.lang.Throwable -> L86 java.lang.Exception -> L88
goto L66
L52:
r9 = move-exception
r6 = r7
goto L56
L55:
r9 = move-exception
L56:
if (r6 == 0) goto L5b
r6.close() // Catch: java.io.IOException -> L5b java.lang.Throwable -> L86 java.lang.Exception -> L88
L5b:
r5.close() // Catch: java.io.IOException -> L5e java.lang.Throwable -> L86 java.lang.Exception -> L88
L5e:
throw r9 // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
L5f:
r7 = r6
L60:
if (r7 == 0) goto L4e
r7.close() // Catch: java.io.IOException -> L4e java.lang.Throwable -> L86 java.lang.Exception -> L88
goto L4e
L66:
java.lang.String r4 = "blob"
byte[] r5 = r5.toByteArray() // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
r2.put(r4, r5) // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
java.lang.String r4 = "via_cgi_report"
r1.insert(r4, r6, r2) // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
L74:
r2.clear() // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
int r3 = r3 + 1
goto L2c
L7a:
r1.setTransactionSuccessful() // Catch: java.lang.Throwable -> L86 java.lang.Exception -> L88
r1.endTransaction() // Catch: java.lang.Throwable -> La0
if (r1 == 0) goto L95
L82:
r1.close() // Catch: java.lang.Throwable -> La0
goto L95
L86:
r9 = move-exception
goto L97
L88:
java.lang.String r9 = "openSDK_LOG.ReportDatabaseHelper"
java.lang.String r10 = "saveReportItemToDB has exception."
com.tencent.open.a.f.e(r9, r10) // Catch: java.lang.Throwable -> L86
r1.endTransaction() // Catch: java.lang.Throwable -> La0
if (r1 == 0) goto L95
goto L82
L95:
monitor-exit(r8)
return
L97:
r1.endTransaction() // Catch: java.lang.Throwable -> La0
if (r1 == 0) goto L9f
r1.close() // Catch: java.lang.Throwable -> La0
L9f:
throw r9 // Catch: java.lang.Throwable -> La0
La0:
r9 = move-exception
monitor-exit(r8)
throw r9
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.b.f.a(java.lang.String, java.util.List):void");
}
}

View File

@@ -0,0 +1,667 @@
package com.tencent.open.b;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.os.SystemClock;
import android.text.TextUtils;
import com.tencent.open.SocialConstants;
import com.tencent.open.utils.HttpUtils;
import com.tencent.open.utils.h;
import com.tencent.open.utils.i;
import com.thoughtworks.xstream.XStream;
import com.ubt.jimu.course.view.fragment.JimuMissionListFragment;
import java.io.IOException;
import java.io.Serializable;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.TimeZone;
import java.util.concurrent.Executor;
import org.apache.http.conn.ConnectTimeoutException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class g {
protected static g a;
protected HandlerThread e;
protected Handler f;
protected Random b = new Random();
protected List<Serializable> d = Collections.synchronizedList(new ArrayList());
protected List<Serializable> c = Collections.synchronizedList(new ArrayList());
protected Executor g = h.b();
protected Executor h = h.b();
private g() {
this.e = null;
if (this.e == null) {
this.e = new HandlerThread("opensdk.report.handlerthread", 10);
this.e.start();
}
if (!this.e.isAlive() || this.e.getLooper() == null) {
return;
}
this.f = new Handler(this.e.getLooper()) { // from class: com.tencent.open.b.g.1
@Override // android.os.Handler
public void handleMessage(Message message) {
int i = message.what;
if (i == 1000) {
g.this.b();
} else if (i == 1001) {
g.this.e();
}
super.handleMessage(message);
}
};
}
public static synchronized g a() {
g gVar;
synchronized (g.class) {
if (a == null) {
a = new g();
}
gVar = a;
}
return gVar;
}
protected void b() {
this.h.execute(new Runnable() { // from class: com.tencent.open.b.g.4
/* JADX WARN: Removed duplicated region for block: B:21:0x00a5 A[Catch: Exception -> 0x00b8, TryCatch #0 {Exception -> 0x00b8, blocks: (B:3:0x0008, B:7:0x0011, B:10:0x0023, B:21:0x00a5, B:22:0x00b0, B:28:0x0094, B:30:0x0099, B:36:0x009e, B:14:0x003b, B:16:0x008a), top: B:2:0x0008, inners: #1, #2, #3 }] */
/* JADX WARN: Removed duplicated region for block: B:33:0x00a3 A[EDGE_INSN: B:33:0x00a3->B:20:0x00a3 BREAK A[LOOP:0: B:12:0x0039->B:34:?], SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:34:? A[LOOP:0: B:12:0x0039->B:34:?, LOOP_END, SYNTHETIC] */
@Override // java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public void run() {
/*
r14 = this;
java.lang.String r0 = "report_cgi"
java.lang.String r1 = "http://wspeed.qq.com/w.cgi"
java.lang.String r2 = "-->doReportCgi, doupload exception"
java.lang.String r3 = "openSDK_LOG.ReportManager"
com.tencent.open.b.g r4 = com.tencent.open.b.g.this // Catch: java.lang.Exception -> Lb8
android.os.Bundle r4 = r4.c() // Catch: java.lang.Exception -> Lb8
if (r4 != 0) goto L11
return
L11:
android.content.Context r5 = com.tencent.open.utils.d.a() // Catch: java.lang.Exception -> Lb8
r6 = 0
com.tencent.open.utils.e r5 = com.tencent.open.utils.e.a(r5, r6) // Catch: java.lang.Exception -> Lb8
java.lang.String r7 = "Common_HttpRetryCount"
int r5 = r5.a(r7) // Catch: java.lang.Exception -> Lb8
if (r5 != 0) goto L23
r5 = 3
L23:
java.lang.StringBuilder r7 = new java.lang.StringBuilder // Catch: java.lang.Exception -> Lb8
r7.<init>() // Catch: java.lang.Exception -> Lb8
java.lang.String r8 = "-->doReportCgi, retryCount: "
r7.append(r8) // Catch: java.lang.Exception -> Lb8
r7.append(r5) // Catch: java.lang.Exception -> Lb8
java.lang.String r7 = r7.toString() // Catch: java.lang.Exception -> Lb8
com.tencent.open.a.f.b(r3, r7) // Catch: java.lang.Exception -> Lb8
r7 = 0
r8 = 0
L39:
r9 = 1
int r8 = r8 + r9
android.content.Context r10 = com.tencent.open.utils.d.a() // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
org.apache.http.client.HttpClient r10 = com.tencent.open.utils.HttpUtils.getHttpClient(r10, r6, r1) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
org.apache.http.client.methods.HttpPost r11 = new org.apache.http.client.methods.HttpPost // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r11.<init>(r1) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
java.lang.String r12 = "Accept-Encoding"
java.lang.String r13 = "gzip"
r11.addHeader(r12, r13) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
java.lang.String r12 = "Content-Type"
java.lang.String r13 = "application/x-www-form-urlencoded"
r11.setHeader(r12, r13) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
java.lang.String r12 = com.tencent.open.utils.HttpUtils.encodeUrl(r4) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
byte[] r12 = com.tencent.open.utils.i.i(r12) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
org.apache.http.entity.ByteArrayEntity r13 = new org.apache.http.entity.ByteArrayEntity // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r13.<init>(r12) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r11.setEntity(r13) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
org.apache.http.HttpResponse r10 = r10.execute(r11) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
org.apache.http.StatusLine r10 = r10.getStatusLine() // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
int r10 = r10.getStatusCode() // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
java.lang.StringBuilder r11 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r11.<init>() // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
java.lang.String r12 = "-->doReportCgi, statusCode: "
r11.append(r12) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r11.append(r10) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
java.lang.String r11 = r11.toString() // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
com.tencent.open.a.f.b(r3, r11) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r11 = 200(0xc8, float:2.8E-43)
if (r10 != r11) goto La3
com.tencent.open.b.f r10 = com.tencent.open.b.f.a() // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r10.b(r0) // Catch: java.lang.Exception -> L93 java.net.SocketTimeoutException -> L98 org.apache.http.conn.ConnectTimeoutException -> L9d
r7 = 1
goto La3
L93:
r1 = move-exception
com.tencent.open.a.f.b(r3, r2, r1) // Catch: java.lang.Exception -> Lb8
goto La3
L98:
r9 = move-exception
com.tencent.open.a.f.b(r3, r2, r9) // Catch: java.lang.Exception -> Lb8
goto La1
L9d:
r9 = move-exception
com.tencent.open.a.f.b(r3, r2, r9) // Catch: java.lang.Exception -> Lb8
La1:
if (r8 < r5) goto L39
La3:
if (r7 != 0) goto Lb0
com.tencent.open.b.f r1 = com.tencent.open.b.f.a() // Catch: java.lang.Exception -> Lb8
com.tencent.open.b.g r2 = com.tencent.open.b.g.this // Catch: java.lang.Exception -> Lb8
java.util.List<java.io.Serializable> r2 = r2.c // Catch: java.lang.Exception -> Lb8
r1.a(r0, r2) // Catch: java.lang.Exception -> Lb8
Lb0:
com.tencent.open.b.g r0 = com.tencent.open.b.g.this // Catch: java.lang.Exception -> Lb8
java.util.List<java.io.Serializable> r0 = r0.c // Catch: java.lang.Exception -> Lb8
r0.clear() // Catch: java.lang.Exception -> Lb8
goto Lbe
Lb8:
r0 = move-exception
java.lang.String r1 = "-->doReportCgi, doupload exception out."
com.tencent.open.a.f.b(r3, r1, r0)
Lbe:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.b.g.AnonymousClass4.run():void");
}
});
}
protected Bundle c() {
if (this.c.size() == 0) {
return null;
}
b bVar = (b) this.c.get(0);
if (bVar == null) {
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->prepareCgiData, the 0th cgireportitem is null.");
return null;
}
String str = bVar.a.get(SocialConstants.PARAM_APP_ID);
List<Serializable> a2 = f.a().a("report_cgi");
if (a2 != null) {
this.c.addAll(a2);
}
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->prepareCgiData, mCgiList size: " + this.c.size());
if (this.c.size() == 0) {
return null;
}
Bundle bundle = new Bundle();
try {
bundle.putString(SocialConstants.PARAM_APP_ID, str);
bundle.putString("releaseversion", "OpenSdk_3.3.0.lite");
bundle.putString("device", Build.DEVICE);
bundle.putString("qua", "V1_AND_OpenSDK_3.3.0.lite_1077_RDM_B");
bundle.putString("key", "apn,frequency,commandid,resultcode,tmcost,reqsize,rspsize,detail,touin,deviceinfo");
for (int i = 0; i < this.c.size(); i++) {
b bVar2 = (b) this.c.get(i);
bundle.putString(i + "_1", bVar2.a.get("apn"));
bundle.putString(i + "_2", bVar2.a.get("frequency"));
bundle.putString(i + "_3", bVar2.a.get("commandid"));
bundle.putString(i + "_4", bVar2.a.get("resultCode"));
bundle.putString(i + "_5", bVar2.a.get("timeCost"));
bundle.putString(i + "_6", bVar2.a.get("reqSize"));
bundle.putString(i + "_7", bVar2.a.get("rspSize"));
bundle.putString(i + "_8", bVar2.a.get("detail"));
bundle.putString(i + "_9", bVar2.a.get("uin"));
bundle.putString(i + "_10", c.e(com.tencent.open.utils.d.a()) + "&" + bVar2.a.get("deviceInfo"));
}
com.tencent.open.a.f.a("openSDK_LOG.ReportManager", "-->prepareCgiData, end. params: " + bundle.toString());
return bundle;
} catch (Exception e) {
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->prepareCgiData, exception.", e);
return null;
}
}
protected Bundle d() {
List<Serializable> a2 = f.a().a("report_via");
if (a2 != null) {
this.d.addAll(a2);
}
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->prepareViaData, mViaList size: " + this.d.size());
if (this.d.size() == 0) {
return null;
}
JSONArray jSONArray = new JSONArray();
for (Serializable serializable : this.d) {
JSONObject jSONObject = new JSONObject();
b bVar = (b) serializable;
for (String str : bVar.a.keySet()) {
try {
String str2 = bVar.a.get(str);
if (str2 == null) {
str2 = "";
}
jSONObject.put(str, str2);
} catch (JSONException e) {
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->prepareViaData, put bundle to json array exception", e);
}
}
jSONArray.put(jSONObject);
}
com.tencent.open.a.f.a("openSDK_LOG.ReportManager", "-->prepareViaData, JSONArray array: " + jSONArray.toString());
Bundle bundle = new Bundle();
JSONObject jSONObject2 = new JSONObject();
try {
jSONObject2.put("data", jSONArray);
bundle.putString("data", jSONObject2.toString());
return bundle;
} catch (JSONException e2) {
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->prepareViaData, put bundle to json array exception", e2);
return null;
}
}
protected void e() {
this.g.execute(new Runnable() { // from class: com.tencent.open.b.g.5
@Override // java.lang.Runnable
public void run() {
int i;
try {
Bundle d = g.this.d();
if (d == null) {
return;
}
com.tencent.open.a.f.a("openSDK_LOG.ReportManager", "-->doReportVia, params: " + d.toString());
int a2 = e.a();
int i2 = 0;
long elapsedRealtime = SystemClock.elapsedRealtime();
boolean z = false;
int i3 = 0;
long j = 0;
long j2 = 0;
do {
int i4 = i2 + 1;
try {
try {
try {
try {
i.a openUrl2 = HttpUtils.openUrl2(com.tencent.open.utils.d.a(), "http://appsupport.qq.com/cgi-bin/appstage/mstats_batch_report", "POST", d);
try {
i = i.d(openUrl2.a).getInt("ret");
} catch (JSONException unused) {
i = -4;
}
if (i == 0 || !TextUtils.isEmpty(openUrl2.a)) {
i4 = a2;
z = true;
}
j = openUrl2.b;
j2 = openUrl2.c;
i2 = i4;
} catch (HttpUtils.HttpStatusException e) {
try {
i3 = Integer.parseInt(e.getMessage().replace(HttpUtils.HttpStatusException.ERROR_INFO, ""));
} catch (Exception unused2) {
}
} catch (SocketTimeoutException unused3) {
elapsedRealtime = SystemClock.elapsedRealtime();
i2 = i4;
i3 = -8;
j = 0;
j2 = 0;
} catch (Exception unused4) {
i2 = a2;
i3 = -6;
j = 0;
j2 = 0;
}
} catch (HttpUtils.NetworkUnavailableException unused5) {
g.this.d.clear();
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "doReportVia, NetworkUnavailableException.");
return;
} catch (ConnectTimeoutException unused6) {
elapsedRealtime = SystemClock.elapsedRealtime();
i2 = i4;
i3 = -7;
j = 0;
j2 = 0;
}
} catch (IOException e2) {
i3 = HttpUtils.getErrorCodeFromException(e2);
i2 = i4;
j = 0;
j2 = 0;
}
} catch (JSONException unused7) {
i2 = i4;
i3 = -4;
j = 0;
j2 = 0;
}
} while (i2 < a2);
g.this.a("mapp_apptrace_sdk", elapsedRealtime, j, j2, i3, null, false);
if (z) {
f.a().b("report_via");
} else {
f.a().a("report_via", g.this.d);
}
g.this.d.clear();
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->doReportVia, uploadSuccess: " + z);
} catch (Exception e3) {
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "-->doReportVia, exception in serial executor.", e3);
}
}
});
}
public void a(final Bundle bundle, String str, final boolean z) {
if (bundle == null) {
return;
}
com.tencent.open.a.f.a("openSDK_LOG.ReportManager", "-->reportVia, bundle: " + bundle.toString());
if (a("report_via", str) || z) {
this.g.execute(new Runnable() { // from class: com.tencent.open.b.g.2
@Override // java.lang.Runnable
public void run() {
try {
Bundle bundle2 = new Bundle();
bundle2.putString("uin", "1000");
bundle2.putString("imei", c.b(com.tencent.open.utils.d.a()));
bundle2.putString("imsi", c.c(com.tencent.open.utils.d.a()));
bundle2.putString("android_id", c.d(com.tencent.open.utils.d.a()));
bundle2.putString("mac", c.a());
bundle2.putString("platform", "1");
bundle2.putString("os_ver", Build.VERSION.RELEASE);
bundle2.putString(JimuMissionListFragment.POSITION, i.c(com.tencent.open.utils.d.a()));
bundle2.putString("network", a.a(com.tencent.open.utils.d.a()));
bundle2.putString("language", c.b());
bundle2.putString("resolution", c.a(com.tencent.open.utils.d.a()));
bundle2.putString("apn", a.b(com.tencent.open.utils.d.a()));
bundle2.putString("model_name", Build.MODEL);
bundle2.putString("timezone", TimeZone.getDefault().getID());
bundle2.putString("sdk_ver", "3.3.0.lite");
bundle2.putString("qz_ver", i.d(com.tencent.open.utils.d.a(), "com.qzone"));
bundle2.putString("qq_ver", i.c(com.tencent.open.utils.d.a(), "com.tencent.mobileqq"));
bundle2.putString("qua", i.e(com.tencent.open.utils.d.a(), com.tencent.open.utils.d.b()));
bundle2.putString("packagename", com.tencent.open.utils.d.b());
bundle2.putString("app_ver", i.d(com.tencent.open.utils.d.a(), com.tencent.open.utils.d.b()));
if (bundle != null) {
bundle2.putAll(bundle);
}
g.this.d.add(new b(bundle2));
int size = g.this.d.size();
int a2 = com.tencent.open.utils.e.a(com.tencent.open.utils.d.a(), (String) null).a("Agent_ReportTimeInterval");
if (a2 == 0) {
a2 = XStream.PRIORITY_VERY_HIGH;
}
if (!g.this.a("report_via", size) && !z) {
if (g.this.f.hasMessages(1001)) {
return;
}
Message obtain = Message.obtain();
obtain.what = 1001;
g.this.f.sendMessageDelayed(obtain, a2);
return;
}
g.this.e();
g.this.f.removeMessages(1001);
} catch (Exception e) {
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "--> reporVia, exception in sub thread.", e);
}
}
});
}
}
public void a(String str, long j, long j2, long j3, int i) {
a(str, j, j2, j3, i, "", false);
}
public void a(final String str, final long j, final long j2, final long j3, final int i, final String str2, final boolean z) {
com.tencent.open.a.f.a("openSDK_LOG.ReportManager", "-->reportCgi, command: " + str + " | startTime: " + j + " | reqSize:" + j2 + " | rspSize: " + j3 + " | responseCode: " + i + " | detail: " + str2);
if (a("report_cgi", "" + i) || z) {
this.h.execute(new Runnable() { // from class: com.tencent.open.b.g.3
@Override // java.lang.Runnable
public void run() {
try {
long elapsedRealtime = SystemClock.elapsedRealtime() - j;
Bundle bundle = new Bundle();
String a2 = a.a(com.tencent.open.utils.d.a());
bundle.putString("apn", a2);
bundle.putString(SocialConstants.PARAM_APP_ID, "1000067");
bundle.putString("commandid", str);
bundle.putString("detail", str2);
StringBuilder sb = new StringBuilder();
sb.append("network=");
sb.append(a2);
sb.append('&');
sb.append("sdcard=");
sb.append(Environment.getExternalStorageState().equals("mounted") ? 1 : 0);
sb.append('&');
sb.append("wifi=");
sb.append(a.e(com.tencent.open.utils.d.a()));
bundle.putString("deviceInfo", sb.toString());
int a3 = 100 / g.this.a(i);
if (a3 <= 0) {
a3 = 1;
} else if (a3 > 100) {
a3 = 100;
}
bundle.putString("frequency", a3 + "");
bundle.putString("reqSize", j2 + "");
bundle.putString("resultCode", i + "");
bundle.putString("rspSize", j3 + "");
bundle.putString("timeCost", elapsedRealtime + "");
bundle.putString("uin", "1000");
g.this.c.add(new b(bundle));
int size = g.this.c.size();
int a4 = com.tencent.open.utils.e.a(com.tencent.open.utils.d.a(), (String) null).a("Agent_ReportTimeInterval");
if (a4 == 0) {
a4 = XStream.PRIORITY_VERY_HIGH;
}
if (!g.this.a("report_cgi", size) && !z) {
if (!g.this.f.hasMessages(1000)) {
Message obtain = Message.obtain();
obtain.what = 1000;
g.this.f.sendMessageDelayed(obtain, a4);
}
}
g.this.b();
g.this.f.removeMessages(1000);
} catch (Exception e) {
com.tencent.open.a.f.b("openSDK_LOG.ReportManager", "--> reportCGI, exception in sub thread.", e);
}
}
});
}
}
/* JADX WARN: Code restructure failed: missing block: B:10:0x0055, code lost:
if (r5.b.nextInt(100) < r6) goto L16;
*/
/* JADX WARN: Code restructure failed: missing block: B:11:0x0057, code lost:
r2 = true;
*/
/* JADX WARN: Code restructure failed: missing block: B:18:0x003f, code lost:
if (r5.b.nextInt(100) < r6) goto L16;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
protected boolean a(java.lang.String r6, java.lang.String r7) {
/*
r5 = this;
java.lang.StringBuilder r0 = new java.lang.StringBuilder
r0.<init>()
java.lang.String r1 = "-->availableFrequency, report: "
r0.append(r1)
r0.append(r6)
java.lang.String r1 = " | ext: "
r0.append(r1)
r0.append(r7)
java.lang.String r0 = r0.toString()
java.lang.String r1 = "openSDK_LOG.ReportManager"
com.tencent.open.a.f.b(r1, r0)
boolean r0 = android.text.TextUtils.isEmpty(r6)
r2 = 0
if (r0 == 0) goto L26
return r2
L26:
java.lang.String r0 = "report_cgi"
boolean r0 = r6.equals(r0)
r3 = 1
r4 = 100
if (r0 == 0) goto L43
int r6 = java.lang.Integer.parseInt(r7) // Catch: java.lang.Exception -> L42
int r6 = r5.a(r6)
java.util.Random r7 = r5.b
int r7 = r7.nextInt(r4)
if (r7 >= r6) goto L5b
goto L57
L42:
return r2
L43:
java.lang.String r0 = "report_via"
boolean r6 = r6.equals(r0)
if (r6 == 0) goto L59
int r6 = com.tencent.open.b.e.a(r7)
java.util.Random r7 = r5.b
int r7 = r7.nextInt(r4)
if (r7 >= r6) goto L5b
L57:
r2 = 1
goto L5b
L59:
r6 = 100
L5b:
java.lang.StringBuilder r7 = new java.lang.StringBuilder
r7.<init>()
java.lang.String r0 = "-->availableFrequency, result: "
r7.append(r0)
r7.append(r2)
java.lang.String r0 = " | frequency: "
r7.append(r0)
r7.append(r6)
java.lang.String r6 = r7.toString()
com.tencent.open.a.f.b(r1, r6)
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.b.g.a(java.lang.String, java.lang.String):boolean");
}
/* JADX WARN: Code restructure failed: missing block: B:14:0x0033, code lost:
if (r0 == 0) goto L6;
*/
/* JADX WARN: Code restructure failed: missing block: B:4:0x0019, code lost:
if (r0 == 0) goto L6;
*/
/* JADX WARN: Code restructure failed: missing block: B:5:0x001b, code lost:
r0 = 5;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
protected boolean a(java.lang.String r5, int r6) {
/*
r4 = this;
java.lang.String r0 = "report_cgi"
boolean r0 = r5.equals(r0)
r1 = 5
r2 = 0
r3 = 0
if (r0 == 0) goto L1d
android.content.Context r0 = com.tencent.open.utils.d.a()
com.tencent.open.utils.e r0 = com.tencent.open.utils.e.a(r0, r2)
java.lang.String r2 = "Common_CGIReportMaxcount"
int r0 = r0.a(r2)
if (r0 != 0) goto L37
L1b:
r0 = 5
goto L37
L1d:
java.lang.String r0 = "report_via"
boolean r0 = r5.equals(r0)
if (r0 == 0) goto L36
android.content.Context r0 = com.tencent.open.utils.d.a()
com.tencent.open.utils.e r0 = com.tencent.open.utils.e.a(r0, r2)
java.lang.String r2 = "Agent_ReportBatchCount"
int r0 = r0.a(r2)
if (r0 != 0) goto L37
goto L1b
L36:
r0 = 0
L37:
java.lang.StringBuilder r1 = new java.lang.StringBuilder
r1.<init>()
java.lang.String r2 = "-->availableCount, report: "
r1.append(r2)
r1.append(r5)
java.lang.String r5 = " | dataSize: "
r1.append(r5)
r1.append(r6)
java.lang.String r5 = " | maxcount: "
r1.append(r5)
r1.append(r0)
java.lang.String r5 = r1.toString()
java.lang.String r1 = "openSDK_LOG.ReportManager"
com.tencent.open.a.f.b(r1, r5)
if (r6 < r0) goto L61
r5 = 1
return r5
L61:
return r3
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.b.g.a(java.lang.String, int):boolean");
}
protected int a(int i) {
if (i == 0) {
int a2 = com.tencent.open.utils.e.a(com.tencent.open.utils.d.a(), (String) null).a("Common_CGIReportFrequencySuccess");
if (a2 == 0) {
return 10;
}
return a2;
}
int a3 = com.tencent.open.utils.e.a(com.tencent.open.utils.d.a(), (String) null).a("Common_CGIReportFrequencyFailed");
if (a3 == 0) {
return 100;
}
return a3;
}
public void a(final String str, final String str2, final Bundle bundle, final boolean z) {
h.a(new Runnable() { // from class: com.tencent.open.b.g.6
/* JADX WARN: Removed duplicated region for block: B:27:0x00e2 A[Catch: Exception -> 0x00f4, TryCatch #5 {Exception -> 0x00f4, blocks: (B:3:0x0002, B:5:0x0006, B:8:0x000c, B:11:0x0013, B:13:0x003c, B:14:0x0040, B:16:0x004e, B:17:0x0084, B:27:0x00e2, B:29:0x00e8, B:46:0x00cd, B:37:0x00d3, B:43:0x00d9, B:50:0x0062, B:52:0x0070, B:53:0x00ee), top: B:2:0x0002 }] */
/* JADX WARN: Removed duplicated region for block: B:29:0x00e8 A[Catch: Exception -> 0x00f4, TryCatch #5 {Exception -> 0x00f4, blocks: (B:3:0x0002, B:5:0x0006, B:8:0x000c, B:11:0x0013, B:13:0x003c, B:14:0x0040, B:16:0x004e, B:17:0x0084, B:27:0x00e2, B:29:0x00e8, B:46:0x00cd, B:37:0x00d3, B:43:0x00d9, B:50:0x0062, B:52:0x0070, B:53:0x00ee), top: B:2:0x0002 }] */
/* JADX WARN: Removed duplicated region for block: B:40:0x00e0 A[EDGE_INSN: B:40:0x00e0->B:26:0x00e0 BREAK A[LOOP:0: B:19:0x0094->B:41:?], SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:41:? A[LOOP:0: B:19:0x0094->B:41:?, LOOP_END, SYNTHETIC] */
@Override // java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public void run() {
/*
Method dump skipped, instructions count: 250
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.b.g.AnonymousClass6.run():void");
}
});
}
}

View File

@@ -0,0 +1,351 @@
package com.tencent.open;
import android.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Paint;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.tencent.connect.auth.QQToken;
import com.tencent.open.a;
import com.tencent.open.a.f;
import com.tencent.open.b.g;
import com.tencent.open.c.a;
import com.tencent.open.utils.i;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import java.lang.ref.WeakReference;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class c extends com.tencent.open.b implements a.InterfaceC0018a {
static Toast c;
private String d;
private IUiListener e;
private C0019c f;
private Handler g;
private com.tencent.open.c.a h;
private com.tencent.open.c.b i;
private WeakReference<Context> j;
private int k;
/* compiled from: ProGuard */
private class a extends WebViewClient {
private a() {
}
@Override // android.webkit.WebViewClient
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
c.this.i.setVisibility(0);
}
@Override // android.webkit.WebViewClient
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
f.a("openSDK_LOG.PKDialog", "Webview loading URL: " + str);
super.onPageStarted(webView, str, bitmap);
}
@Override // android.webkit.WebViewClient
public void onReceivedError(WebView webView, int i, String str, String str2) {
super.onReceivedError(webView, i, str, str2);
c.this.f.onError(new UiError(i, str, str2));
if (c.this.j != null && c.this.j.get() != null) {
Toast.makeText((Context) c.this.j.get(), "网络连接异常或系统错误", 0).show();
}
c.this.dismiss();
}
@Override // android.webkit.WebViewClient
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
f.a("openSDK_LOG.PKDialog", "Redirect URL: " + str);
if (str.startsWith(com.tencent.open.utils.f.a().a((Context) c.this.j.get(), "auth://tauth.qq.com/"))) {
c.this.f.onComplete(i.c(str));
c.this.dismiss();
return true;
}
if (str.startsWith("auth://cancel")) {
c.this.f.onCancel();
c.this.dismiss();
return true;
}
if (!str.startsWith("auth://close")) {
return false;
}
c.this.dismiss();
return true;
}
}
/* compiled from: ProGuard */
private class b extends a.b {
private b() {
}
}
/* compiled from: ProGuard */
/* renamed from: com.tencent.open.c$c, reason: collision with other inner class name */
private static class C0019c implements IUiListener {
String a;
String b;
private WeakReference<Context> c;
private String d;
private IUiListener e;
public C0019c(Context context, String str, String str2, String str3, IUiListener iUiListener) {
this.c = new WeakReference<>(context);
this.d = str;
this.a = str2;
this.b = str3;
this.e = iUiListener;
}
@Override // com.tencent.tauth.IUiListener
public void onCancel() {
IUiListener iUiListener = this.e;
if (iUiListener != null) {
iUiListener.onCancel();
this.e = null;
}
}
@Override // com.tencent.tauth.IUiListener
public void onComplete(Object obj) {
JSONObject jSONObject = (JSONObject) obj;
g.a().a(this.d + "_H5", SystemClock.elapsedRealtime(), 0L, 0L, jSONObject.optInt("ret", -6), this.a, false);
IUiListener iUiListener = this.e;
if (iUiListener != null) {
iUiListener.onComplete(jSONObject);
this.e = null;
}
}
@Override // com.tencent.tauth.IUiListener
public void onError(UiError uiError) {
String str;
if (uiError.b != null) {
str = uiError.b + this.a;
} else {
str = this.a;
}
g a = g.a();
a.a(this.d + "_H5", SystemClock.elapsedRealtime(), 0L, 0L, uiError.a, str, false);
IUiListener iUiListener = this.e;
if (iUiListener != null) {
iUiListener.onError(uiError);
this.e = null;
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a(String str) {
try {
onComplete(i.d(str));
} catch (JSONException e) {
e.printStackTrace();
onError(new UiError(-4, "服务器返回数据格式有误!", str));
}
}
}
/* compiled from: ProGuard */
private class d extends Handler {
private C0019c b;
public d(C0019c c0019c, Looper looper) {
super(looper);
this.b = c0019c;
}
@Override // android.os.Handler
public void handleMessage(Message message) {
f.b("openSDK_LOG.PKDialog", "msg = " + message.what);
int i = message.what;
if (i == 1) {
this.b.a((String) message.obj);
return;
}
if (i == 2) {
this.b.onCancel();
return;
}
if (i == 3) {
if (c.this.j == null || c.this.j.get() == null) {
return;
}
c.c((Context) c.this.j.get(), (String) message.obj);
return;
}
if (i == 4 || i != 5 || c.this.j == null || c.this.j.get() == null) {
return;
}
c.d((Context) c.this.j.get(), (String) message.obj);
}
}
public c(Context context, String str, String str2, IUiListener iUiListener, QQToken qQToken) {
super(context, R.style.Theme.Translucent.NoTitleBar);
this.j = new WeakReference<>(context);
this.d = str2;
this.f = new C0019c(context, str, str2, qQToken.b(), iUiListener);
this.g = new d(this.f, context.getMainLooper());
this.e = iUiListener;
this.k = Math.round(context.getResources().getDisplayMetrics().density * 185.0f);
f.e("openSDK_LOG.PKDialog", "density=" + context.getResources().getDisplayMetrics().density + "; webviewHeight=" + this.k);
}
/* JADX INFO: Access modifiers changed from: private */
public static void d(Context context, String str) {
if (context == null || str == null) {
return;
}
try {
JSONObject d2 = i.d(str);
d2.getInt("action");
d2.getString(SocialConstants.PARAM_SEND_MSG);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override // android.app.Dialog
public void onBackPressed() {
super.onBackPressed();
}
@Override // com.tencent.open.b, android.app.Dialog
protected void onCreate(Bundle bundle) {
requestWindowFeature(1);
super.onCreate(bundle);
getWindow().setSoftInputMode(16);
getWindow().setSoftInputMode(1);
b();
c();
}
@SuppressLint({"SetJavaScriptEnabled"})
private void c() {
this.i.setVerticalScrollBarEnabled(false);
this.i.setHorizontalScrollBarEnabled(false);
this.i.setWebViewClient(new a());
this.i.setWebChromeClient(this.b);
this.i.clearFormData();
WebSettings settings = this.i.getSettings();
if (settings == null) {
return;
}
settings.setSavePassword(false);
settings.setSaveFormData(false);
settings.setCacheMode(-1);
settings.setNeedInitialFocus(false);
settings.setBuiltInZoomControls(true);
settings.setSupportZoom(true);
settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
settings.setJavaScriptEnabled(true);
WeakReference<Context> weakReference = this.j;
if (weakReference != null && weakReference.get() != null) {
settings.setDatabaseEnabled(true);
settings.setDatabasePath(this.j.get().getApplicationContext().getDir("databases", 0).getPath());
}
settings.setDomStorageEnabled(true);
this.a.a(new b(), "sdk_js_if");
this.i.clearView();
this.i.loadUrl(this.d);
this.i.getSettings().setSavePassword(false);
}
private void b() {
this.h = new com.tencent.open.c.a(this.j.get());
this.h.setBackgroundColor(1711276032);
this.h.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.i = new com.tencent.open.c.b(this.j.get());
this.i.setBackgroundColor(0);
this.i.setBackgroundDrawable(null);
if (Build.VERSION.SDK_INT >= 11) {
try {
View.class.getMethod("setLayerType", Integer.TYPE, Paint.class).invoke(this.i, 1, new Paint());
} catch (Exception e) {
e.printStackTrace();
}
}
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, this.k);
layoutParams.addRule(13, -1);
this.i.setLayoutParams(layoutParams);
this.h.addView(this.i);
this.h.a(this);
setContentView(this.h);
}
@Override // com.tencent.open.c.a.InterfaceC0018a
public void a(int i) {
WeakReference<Context> weakReference = this.j;
if (weakReference != null && weakReference.get() != null) {
if (i < this.k && 2 == this.j.get().getResources().getConfiguration().orientation) {
this.i.getLayoutParams().height = i;
} else {
this.i.getLayoutParams().height = this.k;
}
}
f.e("openSDK_LOG.PKDialog", "onKeyboardShown keyboard show");
}
@Override // com.tencent.open.c.a.InterfaceC0018a
public void a() {
this.i.getLayoutParams().height = this.k;
f.e("openSDK_LOG.PKDialog", "onKeyboardHidden keyboard hide");
}
@Override // com.tencent.open.b
protected void a(String str) {
f.b("openSDK_LOG.PKDialog", "--onConsoleMessage--");
try {
this.a.a(this.i, str);
} catch (Exception unused) {
}
}
/* JADX INFO: Access modifiers changed from: private */
public static void c(Context context, String str) {
try {
JSONObject d2 = i.d(str);
int i = d2.getInt("type");
String string = d2.getString(SocialConstants.PARAM_SEND_MSG);
if (i == 0) {
if (c == null) {
c = Toast.makeText(context, string, 0);
} else {
c.setView(c.getView());
c.setText(string);
c.setDuration(0);
}
c.show();
return;
}
if (i == 1) {
if (c == null) {
c = Toast.makeText(context, string, 1);
} else {
c.setView(c.getView());
c.setText(string);
c.setDuration(1);
}
c.show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,55 @@
package com.tencent.open.c;
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.view.View;
import android.widget.RelativeLayout;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class a extends RelativeLayout {
private static final String a = a.class.getName();
private Rect b;
private boolean c;
private InterfaceC0018a d;
/* compiled from: ProGuard */
/* renamed from: com.tencent.open.c.a$a, reason: collision with other inner class name */
public interface InterfaceC0018a {
void a();
void a(int i);
}
public a(Context context) {
super(context);
this.b = null;
this.c = false;
this.d = null;
if (this.b == null) {
this.b = new Rect();
}
}
public void a(InterfaceC0018a interfaceC0018a) {
this.d = interfaceC0018a;
}
@Override // android.widget.RelativeLayout, android.view.View
protected void onMeasure(int i, int i2) {
int size = View.MeasureSpec.getSize(i2);
Activity activity = (Activity) getContext();
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(this.b);
int height = (activity.getWindowManager().getDefaultDisplay().getHeight() - this.b.top) - size;
InterfaceC0018a interfaceC0018a = this.d;
if (interfaceC0018a != null && size != 0) {
if (height > 100) {
interfaceC0018a.a((Math.abs(this.b.height()) - getPaddingBottom()) - getPaddingTop());
} else {
interfaceC0018a.a();
}
}
super.onMeasure(i, i2);
}
}

View File

@@ -0,0 +1,30 @@
package com.tencent.open.c;
import android.content.Context;
import android.webkit.WebSettings;
import android.webkit.WebView;
import java.lang.reflect.Method;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class b extends WebView {
public b(Context context) {
super(context);
}
@Override // android.webkit.WebView, android.view.ViewGroup, android.view.View
protected void onAttachedToWindow() {
super.onAttachedToWindow();
WebSettings settings = getSettings();
if (settings == null) {
return;
}
try {
Method method = settings.getClass().getMethod("removeJavascriptInterface", String.class);
if (method != null) {
method.invoke(this, "searchBoxJavaBridge_");
}
} catch (Exception unused) {
}
}
}

View File

@@ -0,0 +1,96 @@
package com.tencent.open.c;
import android.content.Context;
import android.view.KeyEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import com.tencent.open.a.f;
import com.tencent.open.web.security.SecureJsInterface;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class c extends b {
public static boolean a;
private KeyEvent b;
private com.tencent.open.web.security.a c;
public c(Context context) {
super(context);
}
@Override // android.webkit.WebView, android.view.ViewGroup, android.view.View
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
int unicodeChar;
f.b("openSDK_LOG.SecureWebView", "-->dispatchKeyEvent, is device support: " + a);
if (!a) {
return super.dispatchKeyEvent(keyEvent);
}
if (keyEvent.getAction() != 0) {
return super.dispatchKeyEvent(keyEvent);
}
int keyCode = keyEvent.getKeyCode();
if (keyCode == 4) {
return super.dispatchKeyEvent(keyEvent);
}
if (keyCode == 66) {
return super.dispatchKeyEvent(keyEvent);
}
if (keyCode == 67) {
com.tencent.open.web.security.a.b = true;
return super.dispatchKeyEvent(keyEvent);
}
if (keyEvent.getUnicodeChar() == 0) {
return super.dispatchKeyEvent(keyEvent);
}
if (!SecureJsInterface.isPWDEdit || (((unicodeChar = keyEvent.getUnicodeChar()) < 33 || unicodeChar > 95) && (unicodeChar < 97 || unicodeChar > 125))) {
return super.dispatchKeyEvent(keyEvent);
}
this.b = new KeyEvent(0, 17);
return super.dispatchKeyEvent(this.b);
}
@Override // android.webkit.WebView, android.view.View
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
f.c("openSDK_LOG.SecureWebView", "-->create input connection, is edit: " + SecureJsInterface.isPWDEdit);
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
f.a("openSDK_LOG.SecureWebView", "-->onCreateInputConnection, inputConn is " + onCreateInputConnection);
if (onCreateInputConnection == null) {
a = false;
return onCreateInputConnection;
}
a = true;
this.c = new com.tencent.open.web.security.a(super.onCreateInputConnection(editorInfo), false);
return this.c;
}
@Override // android.webkit.WebView, android.view.View, android.view.KeyEvent.Callback
public boolean onKeyDown(int i, KeyEvent keyEvent) {
int unicodeChar;
f.b("openSDK_LOG.SecureWebView", "-->onKeyDown, is device support: " + a);
if (!a) {
return super.onKeyDown(i, keyEvent);
}
if (keyEvent.getAction() != 0) {
return super.onKeyDown(i, keyEvent);
}
int keyCode = keyEvent.getKeyCode();
if (keyCode == 4) {
return super.onKeyDown(i, keyEvent);
}
if (keyCode == 66) {
return super.onKeyDown(i, keyEvent);
}
if (keyCode == 67) {
com.tencent.open.web.security.a.b = true;
return super.onKeyDown(i, keyEvent);
}
if (keyEvent.getUnicodeChar() == 0) {
return super.onKeyDown(i, keyEvent);
}
if (!SecureJsInterface.isPWDEdit || (((unicodeChar = keyEvent.getUnicodeChar()) < 33 || unicodeChar > 95) && (unicodeChar < 97 || unicodeChar > 125))) {
return super.onKeyDown(i, keyEvent);
}
this.b = new KeyEvent(0, 17);
return super.onKeyDown(this.b.getKeyCode(), this.b);
}
}

View File

@@ -0,0 +1,655 @@
package com.tencent.open.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Proxy;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import com.ijm.dataencryption.de.DataDecryptTool;
import com.tencent.bugly.BuglyStrategy;
import com.tencent.connect.auth.QQToken;
import com.tencent.open.utils.i;
import com.tencent.tauth.IRequestListener;
import java.io.ByteArrayOutputStream;
import java.io.CharConversionException;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
import java.io.InvalidObjectException;
import java.io.NotActiveException;
import java.io.NotSerializableException;
import java.io.OptionalDataException;
import java.io.StreamCorruptedException;
import java.io.SyncFailedException;
import java.io.UTFDataFormatException;
import java.io.UnsupportedEncodingException;
import java.io.WriteAbortedException;
import java.net.BindException;
import java.net.ConnectException;
import java.net.HttpRetryException;
import java.net.MalformedURLException;
import java.net.NoRouteToHostException;
import java.net.PortUnreachableException;
import java.net.ProtocolException;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.URLEncoder;
import java.net.UnknownHostException;
import java.net.UnknownServiceException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileLockInterruptionException;
import java.nio.charset.MalformedInputException;
import java.nio.charset.UnmappableCharacterException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.InvalidPropertiesFormatException;
import java.util.zip.GZIPInputStream;
import java.util.zip.ZipException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLKeyException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLProtocolException;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import org.apache.http.ConnectionClosedException;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.MalformedChunkCodingException;
import org.apache.http.NoHttpResponseException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.HttpResponseException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpProtocolParams;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class HttpUtils {
/* compiled from: ProGuard */
public static class HttpStatusException extends Exception {
public static final String ERROR_INFO = "http status code error:";
public HttpStatusException(String str) {
super(str);
}
}
/* compiled from: ProGuard */
public static class NetworkUnavailableException extends Exception {
public static final String ERROR_INFO = "network unavailable";
public NetworkUnavailableException(String str) {
super(str);
}
}
/* compiled from: ProGuard */
public static class a extends SSLSocketFactory {
private final SSLContext a;
public a(KeyStore keyStore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(keyStore);
b bVar;
this.a = SSLContext.getInstance("TLS");
try {
bVar = new b();
} catch (Exception unused) {
bVar = null;
}
this.a.init(null, new TrustManager[]{bVar}, null);
}
@Override // org.apache.http.conn.ssl.SSLSocketFactory, org.apache.http.conn.scheme.LayeredSocketFactory
public Socket createSocket(Socket socket, String str, int i, boolean z) throws IOException, UnknownHostException {
return this.a.getSocketFactory().createSocket(socket, str, i, z);
}
@Override // org.apache.http.conn.ssl.SSLSocketFactory, org.apache.http.conn.scheme.SocketFactory
public Socket createSocket() throws IOException {
return this.a.getSocketFactory().createSocket();
}
}
/* compiled from: ProGuard */
public static class b implements X509TrustManager {
X509TrustManager a;
b() throws Exception {
KeyStore keyStore;
FileInputStream fileInputStream;
Throwable th;
TrustManager[] trustManagers;
try {
keyStore = KeyStore.getInstance("JKS");
} catch (Exception unused) {
keyStore = null;
}
if (keyStore != null) {
try {
fileInputStream = new FileInputStream("trustedCerts");
} catch (Throwable th2) {
fileInputStream = null;
th = th2;
}
try {
keyStore.load(fileInputStream, "passphrase".toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509", "SunJSSE");
trustManagerFactory.init(keyStore);
trustManagers = trustManagerFactory.getTrustManagers();
fileInputStream.close();
} catch (Throwable th3) {
th = th3;
if (fileInputStream != null) {
fileInputStream.close();
}
throw th;
}
} else {
TrustManagerFactory trustManagerFactory2 = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory2.init((KeyStore) null);
trustManagers = trustManagerFactory2.getTrustManagers();
}
for (int i = 0; i < trustManagers.length; i++) {
if (trustManagers[i] instanceof X509TrustManager) {
this.a = (X509TrustManager) trustManagers[i];
return;
}
}
throw new Exception("Couldn't initialize");
}
@Override // javax.net.ssl.X509TrustManager
public void checkClientTrusted(X509Certificate[] x509CertificateArr, String str) throws CertificateException {
this.a.checkClientTrusted(x509CertificateArr, str);
}
@Override // javax.net.ssl.X509TrustManager
public void checkServerTrusted(X509Certificate[] x509CertificateArr, String str) throws CertificateException {
this.a.checkServerTrusted(x509CertificateArr, str);
}
@Override // javax.net.ssl.X509TrustManager
public X509Certificate[] getAcceptedIssuers() {
return this.a.getAcceptedIssuers();
}
}
/* compiled from: ProGuard */
public static class c {
public final String a;
public final int b;
private c(String str, int i) {
this.a = str;
this.b = i;
}
}
private HttpUtils() {
}
private static void a(Context context, QQToken qQToken, String str) {
if (str.indexOf("add_share") > -1 || str.indexOf("upload_pic") > -1 || str.indexOf("add_topic") > -1 || str.indexOf("set_user_face") > -1 || str.indexOf("add_t") > -1 || str.indexOf("add_pic_t") > -1 || str.indexOf("add_pic_url") > -1 || str.indexOf("add_video") > -1) {
com.tencent.connect.a.a.a(context, qQToken, "requireApi", str);
}
}
private static String b(Context context) {
if (Build.VERSION.SDK_INT >= 11) {
return System.getProperty("http.proxyHost");
}
if (context == null) {
return Proxy.getDefaultHost();
}
String host = Proxy.getHost(context);
return TextUtils.isEmpty(host) ? Proxy.getDefaultHost() : host;
}
public static String encodePostBody(Bundle bundle, String str) {
if (bundle == null) {
return "";
}
StringBuilder sb = new StringBuilder();
int i = -1;
int size = bundle.size();
for (String str2 : bundle.keySet()) {
i++;
Object obj = bundle.get(str2);
if (obj instanceof String) {
sb.append("Content-Disposition: form-data; name=\"" + str2 + "\"\r\n\r\n" + ((String) obj));
if (i < size - 1) {
sb.append("\r\n--" + str + "\r\n");
}
}
}
return sb.toString();
}
public static String encodeUrl(Bundle bundle) {
if (bundle == null) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean z = true;
for (String str : bundle.keySet()) {
Object obj = bundle.get(str);
if ((obj instanceof String) || (obj instanceof String[])) {
if (obj instanceof String[]) {
if (z) {
z = false;
} else {
sb.append("&");
}
sb.append(URLEncoder.encode(str) + "=");
String[] stringArray = bundle.getStringArray(str);
if (stringArray != null) {
for (int i = 0; i < stringArray.length; i++) {
if (i == 0) {
sb.append(URLEncoder.encode(stringArray[i]));
} else {
sb.append(URLEncoder.encode("," + stringArray[i]));
}
}
}
} else {
if (z) {
z = false;
} else {
sb.append("&");
}
sb.append(URLEncoder.encode(str) + "=" + URLEncoder.encode(bundle.getString(str)));
}
}
}
return sb.toString();
}
public static int getErrorCodeFromException(IOException iOException) {
if (iOException instanceof CharConversionException) {
return -20;
}
if (iOException instanceof MalformedInputException) {
return -21;
}
if (iOException instanceof UnmappableCharacterException) {
return -22;
}
if (iOException instanceof HttpResponseException) {
return -23;
}
if (iOException instanceof ClosedChannelException) {
return -24;
}
if (iOException instanceof ConnectionClosedException) {
return -25;
}
if (iOException instanceof EOFException) {
return -26;
}
if (iOException instanceof FileLockInterruptionException) {
return -27;
}
if (iOException instanceof FileNotFoundException) {
return -28;
}
if (iOException instanceof HttpRetryException) {
return -29;
}
if (iOException instanceof ConnectTimeoutException) {
return -7;
}
if (iOException instanceof SocketTimeoutException) {
return -8;
}
if (iOException instanceof InvalidPropertiesFormatException) {
return -30;
}
if (iOException instanceof MalformedChunkCodingException) {
return -31;
}
if (iOException instanceof MalformedURLException) {
return -3;
}
if (iOException instanceof NoHttpResponseException) {
return -32;
}
if (iOException instanceof InvalidClassException) {
return -33;
}
if (iOException instanceof InvalidObjectException) {
return -34;
}
if (iOException instanceof NotActiveException) {
return -35;
}
if (iOException instanceof NotSerializableException) {
return -36;
}
if (iOException instanceof OptionalDataException) {
return -37;
}
if (iOException instanceof StreamCorruptedException) {
return -38;
}
if (iOException instanceof WriteAbortedException) {
return -39;
}
if (iOException instanceof ProtocolException) {
return -40;
}
if (iOException instanceof SSLHandshakeException) {
return -41;
}
if (iOException instanceof SSLKeyException) {
return -42;
}
if (iOException instanceof SSLPeerUnverifiedException) {
return -43;
}
if (iOException instanceof SSLProtocolException) {
return -44;
}
if (iOException instanceof BindException) {
return -45;
}
if (iOException instanceof ConnectException) {
return -46;
}
if (iOException instanceof NoRouteToHostException) {
return -47;
}
if (iOException instanceof PortUnreachableException) {
return -48;
}
if (iOException instanceof SyncFailedException) {
return -49;
}
if (iOException instanceof UTFDataFormatException) {
return -50;
}
if (iOException instanceof UnknownHostException) {
return -51;
}
if (iOException instanceof UnknownServiceException) {
return -52;
}
if (iOException instanceof UnsupportedEncodingException) {
return -53;
}
return iOException instanceof ZipException ? -54 : -2;
}
public static HttpClient getHttpClient(Context context, String str, String str2) {
int i;
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
if (Build.VERSION.SDK_INT < 16) {
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
a aVar = new a(keyStore);
aVar.setHostnameVerifier(SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);
schemeRegistry.register(new Scheme("https", aVar, 443));
} catch (Exception unused) {
schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
}
} else {
schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
}
BasicHttpParams basicHttpParams = new BasicHttpParams();
e a2 = context != null ? e.a(context, str) : null;
int i2 = 0;
if (a2 != null) {
i2 = a2.a("Common_HttpConnectionTimeout");
i = a2.a("Common_SocketConnectionTimeout");
} else {
i = 0;
}
if (i2 == 0) {
i2 = 15000;
}
if (i == 0) {
i = BuglyStrategy.a.MAX_USERDATA_VALUE_LENGTH;
}
HttpConnectionParams.setConnectionTimeout(basicHttpParams, i2);
HttpConnectionParams.setSoTimeout(basicHttpParams, i);
HttpProtocolParams.setVersion(basicHttpParams, HttpVersion.HTTP_1_1);
HttpProtocolParams.setContentCharset(basicHttpParams, "UTF-8");
HttpProtocolParams.setUserAgent(basicHttpParams, "AndroidSDK_" + Build.VERSION.SDK + "_" + Build.DEVICE + "_" + Build.VERSION.RELEASE);
DefaultHttpClient defaultHttpClient = new DefaultHttpClient(new ThreadSafeClientConnManager(basicHttpParams, schemeRegistry), basicHttpParams);
c proxy = getProxy(context);
if (proxy != null) {
defaultHttpClient.getParams().setParameter("http.route.default-proxy", new HttpHost(proxy.a, proxy.b));
}
return defaultHttpClient;
}
public static c getProxy(Context context) {
ConnectivityManager connectivityManager;
NetworkInfo activeNetworkInfo;
if (context != null && (connectivityManager = (ConnectivityManager) context.getSystemService("connectivity")) != null && (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) != null && activeNetworkInfo.getType() == 0) {
String b2 = b(context);
int a2 = a(context);
if (!TextUtils.isEmpty(b2) && a2 >= 0) {
return new c(b2, a2);
}
}
return null;
}
public static i.a openUrl2(Context context, String str, String str2, Bundle bundle) throws MalformedURLException, IOException, NetworkUnavailableException, HttpStatusException {
ConnectivityManager connectivityManager;
NetworkInfo activeNetworkInfo;
if (context != null && (connectivityManager = (ConnectivityManager) context.getSystemService("connectivity")) != null && ((activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null || !activeNetworkInfo.isAvailable())) {
throw new NetworkUnavailableException(NetworkUnavailableException.ERROR_INFO);
}
Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
String string = bundle2.getString("appid_for_getting_config");
bundle2.remove("appid_for_getting_config");
HttpClient httpClient = getHttpClient(context, string, str);
HttpUriRequest httpUriRequest = null;
int i = 0;
int i2 = -1;
if (str2.equals("GET")) {
String encodeUrl = encodeUrl(bundle2);
i = 0 + encodeUrl.length();
com.tencent.open.a.f.a("openSDK_LOG.HttpUtils", "-->openUrl2 before url =" + str);
String str3 = str.indexOf("?") == -1 ? str + "?" : str + "&";
com.tencent.open.a.f.a("openSDK_LOG.HttpUtils", "-->openUrl2 encodedParam =" + encodeUrl + " -- url = " + str3);
StringBuilder sb = new StringBuilder();
sb.append(str3);
sb.append(encodeUrl);
HttpGet httpGet = new HttpGet(sb.toString());
httpGet.addHeader("Accept-Encoding", "gzip");
httpUriRequest = httpGet;
} else if (str2.equals("POST")) {
HttpPost httpPost = new HttpPost(str);
httpPost.addHeader("Accept-Encoding", "gzip");
Bundle bundle3 = new Bundle();
for (String str4 : bundle2.keySet()) {
Object obj = bundle2.get(str4);
if (obj instanceof byte[]) {
bundle3.putByteArray(str4, (byte[]) obj);
}
}
if (!bundle2.containsKey("method")) {
bundle2.putString("method", str2);
}
httpPost.setHeader("Content-Type", "multipart/form-data; boundary=3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f");
httpPost.setHeader("Connection", "Keep-Alive");
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(i.i("--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f\r\n"));
byteArrayOutputStream.write(i.i(encodePostBody(bundle2, "3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f")));
if (!bundle3.isEmpty()) {
int size = bundle3.size();
byteArrayOutputStream.write(i.i("\r\n--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f\r\n"));
for (String str5 : bundle3.keySet()) {
i2++;
byteArrayOutputStream.write(i.i("Content-Disposition: form-data; name=\"" + str5 + "\"; filename=\"" + str5 + "\"\r\n"));
byteArrayOutputStream.write(i.i("Content-Type: content/unknown\r\n\r\n"));
byte[] byteArray = bundle3.getByteArray(str5);
if (byteArray != null) {
byteArrayOutputStream.write(byteArray);
}
if (i2 < size - 1) {
byteArrayOutputStream.write(i.i("\r\n--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f\r\n"));
}
}
}
byteArrayOutputStream.write(i.i("\r\n--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f--\r\n"));
byte[] byteArray2 = byteArrayOutputStream.toByteArray();
i = 0 + byteArray2.length;
byteArrayOutputStream.close();
httpPost.setEntity(new ByteArrayEntity(byteArray2));
httpUriRequest = httpPost;
}
HttpResponse execute = httpClient.execute(httpUriRequest);
int statusCode = execute.getStatusLine().getStatusCode();
if (statusCode == 200) {
return new i.a(a(execute), i);
}
throw new HttpStatusException(HttpStatusException.ERROR_INFO + statusCode);
}
/* JADX WARN: Removed duplicated region for block: B:47:0x0185 A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:49:? A[LOOP:0: B:8:0x00b8->B:49:?, LOOP_END, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static org.json.JSONObject request(com.tencent.connect.auth.QQToken r19, android.content.Context r20, java.lang.String r21, android.os.Bundle r22, java.lang.String r23) throws java.io.IOException, org.json.JSONException, com.tencent.open.utils.HttpUtils.NetworkUnavailableException, com.tencent.open.utils.HttpUtils.HttpStatusException {
/*
Method dump skipped, instructions count: 418
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.utils.HttpUtils.request(com.tencent.connect.auth.QQToken, android.content.Context, java.lang.String, android.os.Bundle, java.lang.String):org.json.JSONObject");
}
public static void requestAsync(final QQToken qQToken, final Context context, final String str, final Bundle bundle, final String str2, final IRequestListener iRequestListener) {
com.tencent.open.a.f.a("openSDK_LOG.HttpUtils", "OpenApi requestAsync");
new Thread() { // from class: com.tencent.open.utils.HttpUtils.1
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
try {
JSONObject request = HttpUtils.request(QQToken.this, context, str, bundle, str2);
if (iRequestListener != null) {
iRequestListener.a(request);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi onComplete");
}
} catch (HttpStatusException e) {
IRequestListener iRequestListener2 = iRequestListener;
if (iRequestListener2 != null) {
iRequestListener2.a(e);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync onHttpStatusException", e);
}
} catch (NetworkUnavailableException e2) {
IRequestListener iRequestListener3 = iRequestListener;
if (iRequestListener3 != null) {
iRequestListener3.a(e2);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync onNetworkUnavailableException", e2);
}
} catch (MalformedURLException e3) {
IRequestListener iRequestListener4 = iRequestListener;
if (iRequestListener4 != null) {
iRequestListener4.a(e3);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync MalformedURLException", e3);
}
} catch (SocketTimeoutException e4) {
IRequestListener iRequestListener5 = iRequestListener;
if (iRequestListener5 != null) {
iRequestListener5.a(e4);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync onSocketTimeoutException", e4);
}
} catch (ConnectTimeoutException e5) {
IRequestListener iRequestListener6 = iRequestListener;
if (iRequestListener6 != null) {
iRequestListener6.a(e5);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync onConnectTimeoutException", e5);
}
} catch (IOException e6) {
IRequestListener iRequestListener7 = iRequestListener;
if (iRequestListener7 != null) {
iRequestListener7.a(e6);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync IOException", e6);
}
} catch (JSONException e7) {
IRequestListener iRequestListener8 = iRequestListener;
if (iRequestListener8 != null) {
iRequestListener8.a(e7);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync JSONException", e7);
}
} catch (Exception e8) {
IRequestListener iRequestListener9 = iRequestListener;
if (iRequestListener9 != null) {
iRequestListener9.a(e8);
com.tencent.open.a.f.b("openSDK_LOG.HttpUtils", "OpenApi requestAsync onUnknowException", e8);
}
}
}
}.start();
}
private static String a(HttpResponse httpResponse) throws IllegalStateException, IOException {
InputStream content = httpResponse.getEntity().getContent();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Header firstHeader = httpResponse.getFirstHeader("Content-Encoding");
InputStream gZIPInputStream = (firstHeader == null || firstHeader.getValue().toLowerCase().indexOf("gzip") <= -1) ? content : new GZIPInputStream(content);
byte[] bArr = new byte[DataDecryptTool.DECRYPT_DB_FILE];
while (true) {
int read = gZIPInputStream.read(bArr);
if (read != -1) {
byteArrayOutputStream.write(bArr, 0, read);
} else {
String str = new String(byteArrayOutputStream.toByteArray(), "UTF-8");
gZIPInputStream.close();
return str;
}
}
}
private static int a(Context context) {
if (Build.VERSION.SDK_INT < 11) {
if (context != null) {
int port = Proxy.getPort(context);
return port < 0 ? Proxy.getDefaultPort() : port;
}
return Proxy.getDefaultPort();
}
String property = System.getProperty("http.proxyPort");
if (!TextUtils.isEmpty(property)) {
try {
return Integer.parseInt(property);
} catch (NumberFormatException unused) {
}
}
return -1;
}
}

View File

@@ -0,0 +1,129 @@
package com.tencent.open.utils;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.ProtocolException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Properties;
import java.util.zip.ZipException;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public final class a {
private static final j a = new j(101010256);
private static final k b = new k(38651);
/* compiled from: ProGuard */
/* renamed from: com.tencent.open.utils.a$a, reason: collision with other inner class name */
private static class C0020a {
Properties a;
byte[] b;
private C0020a() {
this.a = new Properties();
}
void a(byte[] bArr) throws IOException {
if (bArr == null) {
return;
}
ByteBuffer wrap = ByteBuffer.wrap(bArr);
int length = a.b.a().length;
byte[] bArr2 = new byte[length];
wrap.get(bArr2);
if (!a.b.equals(new k(bArr2))) {
throw new ProtocolException("unknow protocl [" + Arrays.toString(bArr) + "]");
}
if (bArr.length - length <= 2) {
return;
}
byte[] bArr3 = new byte[2];
wrap.get(bArr3);
int b = new k(bArr3).b();
if ((bArr.length - length) - 2 < b) {
return;
}
byte[] bArr4 = new byte[b];
wrap.get(bArr4);
this.a.load(new ByteArrayInputStream(bArr4));
int length2 = ((bArr.length - length) - b) - 2;
if (length2 > 0) {
this.b = new byte[length2];
wrap.get(this.b);
}
}
public String toString() {
return "ApkExternalInfo [p=" + this.a + ", otherData=" + Arrays.toString(this.b) + "]";
}
}
public static String a(File file, String str) throws IOException {
RandomAccessFile randomAccessFile;
try {
randomAccessFile = new RandomAccessFile(file, "r");
} catch (Throwable th) {
th = th;
randomAccessFile = null;
}
try {
byte[] a2 = a(randomAccessFile);
if (a2 == null) {
randomAccessFile.close();
return null;
}
C0020a c0020a = new C0020a();
c0020a.a(a2);
String property = c0020a.a.getProperty(str);
randomAccessFile.close();
return property;
} catch (Throwable th2) {
th = th2;
if (randomAccessFile != null) {
randomAccessFile.close();
}
throw th;
}
}
public static String a(File file) throws IOException {
return a(file, "channelNo");
}
private static byte[] a(RandomAccessFile randomAccessFile) throws IOException {
boolean z;
long length = randomAccessFile.length() - 22;
randomAccessFile.seek(length);
byte[] a2 = a.a();
int read = randomAccessFile.read();
while (true) {
z = true;
if (read == -1) {
z = false;
break;
}
if (read == a2[0] && randomAccessFile.read() == a2[1] && randomAccessFile.read() == a2[2] && randomAccessFile.read() == a2[3]) {
break;
}
length--;
randomAccessFile.seek(length);
read = randomAccessFile.read();
}
if (z) {
randomAccessFile.seek(length + 16 + 4);
byte[] bArr = new byte[2];
randomAccessFile.readFully(bArr);
int b2 = new k(bArr).b();
if (b2 == 0) {
return null;
}
byte[] bArr2 = new byte[b2];
randomAccessFile.read(bArr2);
return bArr2;
}
throw new ZipException("archive is not a ZIP archive");
}
}

View File

@@ -0,0 +1,164 @@
package com.tencent.open.utils;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class b {
private static String c;
private String a;
private c b;
private long d;
private Handler e;
private Runnable f = new Runnable() { // from class: com.tencent.open.utils.b.2
@Override // java.lang.Runnable
public void run() {
boolean z;
com.tencent.open.a.f.a("AsynLoadImg", "saveFileRunnable:");
String str = "share_qq_" + i.f(b.this.a) + ".jpg";
String str2 = b.c + str;
File file = new File(str2);
Message obtainMessage = b.this.e.obtainMessage();
if (file.exists()) {
obtainMessage.arg1 = 0;
obtainMessage.obj = str2;
com.tencent.open.a.f.a("AsynLoadImg", "file exists: time:" + (System.currentTimeMillis() - b.this.d));
} else {
Bitmap a = b.a(b.this.a);
if (a != null) {
z = b.this.a(a, str);
} else {
com.tencent.open.a.f.a("AsynLoadImg", "saveFileRunnable:get bmp fail---");
z = false;
}
if (z) {
obtainMessage.arg1 = 0;
obtainMessage.obj = str2;
} else {
obtainMessage.arg1 = 1;
}
com.tencent.open.a.f.a("AsynLoadImg", "file not exists: download time:" + (System.currentTimeMillis() - b.this.d));
}
b.this.e.sendMessage(obtainMessage);
}
};
public b(Activity activity) {
this.e = new Handler(activity.getMainLooper()) { // from class: com.tencent.open.utils.b.1
@Override // android.os.Handler
public void handleMessage(Message message) {
com.tencent.open.a.f.a("AsynLoadImg", "handleMessage:" + message.arg1);
if (message.arg1 == 0) {
b.this.b.a(message.arg1, (String) message.obj);
} else {
b.this.b.a(message.arg1, (String) null);
}
}
};
}
public void a(String str, c cVar) {
com.tencent.open.a.f.a("AsynLoadImg", "--save---");
if (str != null && !str.equals("")) {
if (!i.b()) {
cVar.a(2, (String) null);
return;
}
c = Environment.getExternalStorageDirectory() + "/tmp/";
this.d = System.currentTimeMillis();
this.a = str;
this.b = cVar;
new Thread(this.f).start();
return;
}
cVar.a(1, (String) null);
}
public boolean a(Bitmap bitmap, String str) {
String str2 = c;
BufferedOutputStream bufferedOutputStream = null;
try {
try {
File file = new File(str2);
if (!file.exists()) {
file.mkdir();
}
com.tencent.open.a.f.a("AsynLoadImg", "saveFile:" + str);
BufferedOutputStream bufferedOutputStream2 = new BufferedOutputStream(new FileOutputStream(new File(str2 + str)));
try {
bitmap.compress(Bitmap.CompressFormat.JPEG, 80, bufferedOutputStream2);
bufferedOutputStream2.flush();
try {
bufferedOutputStream2.close();
return true;
} catch (IOException e) {
e.printStackTrace();
return true;
}
} catch (IOException e2) {
e = e2;
bufferedOutputStream = bufferedOutputStream2;
e.printStackTrace();
com.tencent.open.a.f.b("AsynLoadImg", "saveFile bmp fail---", e);
if (bufferedOutputStream != null) {
try {
bufferedOutputStream.close();
} catch (IOException e3) {
e3.printStackTrace();
}
}
return false;
} catch (Throwable th) {
th = th;
bufferedOutputStream = bufferedOutputStream2;
if (bufferedOutputStream != null) {
try {
bufferedOutputStream.close();
} catch (IOException e4) {
e4.printStackTrace();
}
}
throw th;
}
} catch (Throwable th2) {
th = th2;
}
} catch (IOException e5) {
e = e5;
}
}
public static Bitmap a(String str) {
com.tencent.open.a.f.a("AsynLoadImg", "getbitmap:" + str);
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
httpURLConnection.setDoInput(true);
httpURLConnection.connect();
InputStream inputStream = httpURLConnection.getInputStream();
Bitmap decodeStream = BitmapFactory.decodeStream(inputStream);
inputStream.close();
com.tencent.open.a.f.a("AsynLoadImg", "image download finished." + str);
return decodeStream;
} catch (IOException e) {
e.printStackTrace();
com.tencent.open.a.f.a("AsynLoadImg", "getbitmap bmp fail---");
return null;
} catch (OutOfMemoryError e2) {
e2.printStackTrace();
com.tencent.open.a.f.a("AsynLoadImg", "getbitmap bmp fail---");
return null;
}
}
}

View File

@@ -0,0 +1,11 @@
package com.tencent.open.utils;
import java.util.ArrayList;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public interface c {
void a(int i, String str);
void a(int i, ArrayList<String> arrayList);
}

View File

@@ -0,0 +1,33 @@
package com.tencent.open.utils;
import android.content.Context;
import java.io.File;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public final class d {
private static Context a;
public static final Context a() {
Context context = a;
if (context == null) {
return null;
}
return context;
}
public static final String b() {
return a() == null ? "" : a().getPackageName();
}
public static final File c() {
if (a() == null) {
return null;
}
return a().getFilesDir();
}
public static final void a(Context context) {
a = context;
}
}

View File

@@ -0,0 +1,210 @@
package com.tencent.open.utils;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import com.tencent.open.SocialConstants;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class e {
private static Map<String, e> a = Collections.synchronizedMap(new HashMap());
private static String b = null;
private Context c;
private String d;
private JSONObject e = null;
private long f = 0;
private int g = 0;
private boolean h = true;
private e(Context context, String str) {
this.c = null;
this.d = null;
this.c = context.getApplicationContext();
this.d = str;
a();
b();
}
private void b() {
if (this.g != 0) {
d("update thread is running, return");
return;
}
this.g = 1;
final Bundle bundle = new Bundle();
bundle.putString(SocialConstants.PARAM_APP_ID, this.d);
bundle.putString("appid_for_getting_config", this.d);
bundle.putString("status_os", Build.VERSION.RELEASE);
bundle.putString("status_machine", Build.MODEL);
bundle.putString("status_version", Build.VERSION.SDK);
bundle.putString("sdkv", "3.3.0.lite");
bundle.putString("sdkp", "a");
new Thread() { // from class: com.tencent.open.utils.e.1
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
try {
e.this.a(i.d(HttpUtils.openUrl2(e.this.c, "http://cgi.connect.qq.com/qqconnectopen/openapi/policy_conf", "GET", bundle).a));
} catch (Exception e) {
e.printStackTrace();
}
e.this.g = 0;
}
}.start();
}
private String c(String str) {
InputStream open;
String str2;
String str3 = "";
try {
try {
if (this.d != null) {
str2 = str + "." + this.d;
} else {
str2 = str;
}
open = this.c.openFileInput(str2);
} catch (FileNotFoundException unused) {
open = this.c.getAssets().open(str);
}
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(open, Charset.forName("UTF-8")));
StringBuffer stringBuffer = new StringBuffer();
while (true) {
try {
try {
try {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
stringBuffer.append(readLine);
} catch (Throwable th) {
try {
open.close();
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
throw th;
}
} catch (IOException e2) {
e2.printStackTrace();
open.close();
bufferedReader.close();
}
} catch (IOException e3) {
e3.printStackTrace();
}
}
str3 = stringBuffer.toString();
open.close();
bufferedReader.close();
return str3;
} catch (IOException e4) {
e4.printStackTrace();
return "";
}
}
private void d(String str) {
if (this.h) {
com.tencent.open.a.f.a("openSDK_LOG.OpenConfig", str + "; appid: " + this.d);
}
}
public static e a(Context context, String str) {
e eVar;
synchronized (a) {
com.tencent.open.a.f.a("openSDK_LOG.OpenConfig", "getInstance begin");
if (str != null) {
b = str;
}
if (str == null) {
str = b != null ? b : "0";
}
eVar = a.get(str);
if (eVar == null) {
eVar = new e(context, str);
a.put(str, eVar);
}
com.tencent.open.a.f.a("openSDK_LOG.OpenConfig", "getInstance end");
}
return eVar;
}
public boolean b(String str) {
d("get " + str);
c();
Object opt = this.e.opt(str);
if (opt == null) {
return false;
}
if (opt instanceof Integer) {
return !opt.equals(0);
}
if (opt instanceof Boolean) {
return ((Boolean) opt).booleanValue();
}
return false;
}
private void a() {
try {
this.e = new JSONObject(c("com.tencent.open.config.json"));
} catch (JSONException unused) {
this.e = new JSONObject();
}
}
private void a(String str, String str2) {
try {
if (this.d != null) {
str = str + "." + this.d;
}
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(this.c.openFileOutput(str, 0), Charset.forName("UTF-8"));
outputStreamWriter.write(str2);
outputStreamWriter.flush();
outputStreamWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
private void c() {
int optInt = this.e.optInt("Common_frequency");
if (optInt == 0) {
optInt = 1;
}
if (SystemClock.elapsedRealtime() - this.f >= optInt * 3600000) {
b();
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a(JSONObject jSONObject) {
d("cgi back, do update");
this.e = jSONObject;
a("com.tencent.open.config.json", jSONObject.toString());
this.f = SystemClock.elapsedRealtime();
}
public int a(String str) {
d("get " + str);
c();
return this.e.optInt(str);
}
}

View File

@@ -0,0 +1,48 @@
package com.tencent.open.utils;
import android.content.Context;
import android.content.SharedPreferences;
import java.lang.ref.WeakReference;
import java.net.URL;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class f {
private static f a;
private volatile WeakReference<SharedPreferences> b = null;
public static synchronized f a() {
f fVar;
synchronized (f.class) {
if (a == null) {
a = new f();
}
fVar = a;
}
return fVar;
}
public String a(Context context, String str) {
if (this.b == null || this.b.get() == null) {
this.b = new WeakReference<>(context.getSharedPreferences("ServerPrefs", 0));
}
try {
String host = new URL(str).getHost();
if (host == null) {
com.tencent.open.a.f.e("openSDK_LOG.ServerSetting", "Get host error. url=" + str);
return str;
}
String string = this.b.get().getString(host, null);
if (string != null && !host.equals(string)) {
String replace = str.replace(host, string);
com.tencent.open.a.f.a("openSDK_LOG.ServerSetting", "return environment url : " + replace);
return replace;
}
com.tencent.open.a.f.a("openSDK_LOG.ServerSetting", "host=" + host + ", envHost=" + string);
return str;
} catch (Exception e) {
com.tencent.open.a.f.e("openSDK_LOG.ServerSetting", "getEnvUrl url=" + str + "error.: " + e.getMessage());
return str;
}
}
}

View File

@@ -0,0 +1,301 @@
package com.tencent.open.utils;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.MessageDigest;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class g {
public static String a(int i) {
if (i == 10103) {
return "shareToQQ";
}
if (i == 10104) {
return "shareToQzone";
}
if (i == 10105) {
return "addToQQFavorites";
}
if (i == 10106) {
return "sendToMyComputer";
}
if (i == 10107) {
return "shareToTroopBar";
}
if (i == 11101) {
return "action_login";
}
if (i == 10100) {
return "action_request";
}
return null;
}
public static String a(Context context, String str) {
try {
return context.getPackageManager().getPackageInfo(str, 0).versionName;
} catch (PackageManager.NameNotFoundException unused) {
return null;
}
}
public static String b(Context context, String str) {
String str2 = "";
com.tencent.open.a.f.a("openSDK_LOG.SystemUtils", "OpenUi, getSignValidString");
try {
String packageName = context.getPackageName();
Signature[] signatureArr = context.getPackageManager().getPackageInfo(packageName, 64).signatures;
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(signatureArr[0].toByteArray());
String a = i.a(messageDigest.digest());
messageDigest.reset();
com.tencent.open.a.f.a("openSDK_LOG.SystemUtils", "-->sign: " + a);
messageDigest.update(i.i(packageName + "_" + a + "_" + str + ""));
str2 = i.a(messageDigest.digest());
messageDigest.reset();
StringBuilder sb = new StringBuilder();
sb.append("-->signEncryped: ");
sb.append(str2);
com.tencent.open.a.f.a("openSDK_LOG.SystemUtils", sb.toString());
return str2;
} catch (Exception e) {
e.printStackTrace();
com.tencent.open.a.f.b("openSDK_LOG.SystemUtils", "OpenUi, getSignValidString error", e);
return str2;
}
}
public static int c(Context context, String str) {
return a(a(context, "com.tencent.mobileqq"), str);
}
public static int d(Context context, String str) {
return a(a(context, "com.tencent.tim"), str);
}
public static int e(Context context, String str) {
return a(a(context, "com.tencent.qim"), str);
}
public static int a(String str, String str2) {
if (str == null && str2 == null) {
return 0;
}
if (str != null && str2 == null) {
return 1;
}
if (str == null && str2 != null) {
return -1;
}
String[] split = str.split("\\.");
String[] split2 = str2.split("\\.");
int i = 0;
while (i < split.length && i < split2.length) {
try {
int parseInt = Integer.parseInt(split[i]);
int parseInt2 = Integer.parseInt(split2[i]);
if (parseInt < parseInt2) {
return -1;
}
if (parseInt > parseInt2) {
return 1;
}
i++;
} catch (NumberFormatException unused) {
return str.compareTo(str2);
}
}
if (split.length > i) {
return 1;
}
return split2.length > i ? -1 : 0;
}
public static boolean a(Context context, String str, String str2) {
com.tencent.open.a.f.a("openSDK_LOG.SystemUtils", "OpenUi, validateAppSignatureForPackage");
try {
for (Signature signature : context.getPackageManager().getPackageInfo(str, 64).signatures) {
if (i.f(signature.toCharsString()).equals(str2)) {
return true;
}
}
} catch (PackageManager.NameNotFoundException unused) {
}
return false;
}
public static boolean a(Context context, Intent intent) {
return (context == null || intent == null || context.getPackageManager().queryIntentActivities(intent, 0).size() == 0) ? false : true;
}
public static String a(Context context) {
return context.getApplicationInfo().loadLabel(context.getPackageManager()).toString();
}
/* JADX WARN: Removed duplicated region for block: B:55:0x00c5 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:61:? A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:62:0x00be A[EXC_TOP_SPLITTER, SYNTHETIC] */
@android.annotation.SuppressLint({"SdCardPath"})
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static boolean a(java.lang.String r10, java.lang.String r11, int r12) {
/*
java.lang.StringBuilder r0 = new java.lang.StringBuilder
r0.<init>()
java.lang.String r1 = "-->extractSecureLib, libName: "
r0.append(r1)
r0.append(r10)
java.lang.String r0 = r0.toString()
java.lang.String r1 = "openSDK_LOG.SystemUtils"
com.tencent.open.a.f.c(r1, r0)
android.content.Context r0 = com.tencent.open.utils.d.a()
r2 = 0
if (r0 != 0) goto L23
java.lang.String r10 = "-->extractSecureLib, global context is null. "
com.tencent.open.a.f.c(r1, r10)
return r2
L23:
java.lang.String r3 = "secure_lib"
android.content.SharedPreferences r3 = r0.getSharedPreferences(r3, r2)
java.io.File r4 = new java.io.File
java.io.File r5 = r0.getFilesDir()
r4.<init>(r5, r11)
boolean r5 = r4.exists()
r6 = 1
java.lang.String r7 = "version"
if (r5 != 0) goto L50
java.io.File r5 = r4.getParentFile()
if (r5 == 0) goto L73
boolean r5 = r5.mkdirs()
if (r5 == 0) goto L73
r4.createNewFile() // Catch: java.io.IOException -> L4b
goto L73
L4b:
r4 = move-exception
r4.printStackTrace()
goto L73
L50:
int r4 = r3.getInt(r7, r2)
java.lang.StringBuilder r5 = new java.lang.StringBuilder
r5.<init>()
java.lang.String r8 = "-->extractSecureLib, libVersion: "
r5.append(r8)
r5.append(r12)
java.lang.String r8 = " | oldVersion: "
r5.append(r8)
r5.append(r4)
java.lang.String r5 = r5.toString()
com.tencent.open.a.f.c(r1, r5)
if (r12 != r4) goto L73
return r6
L73:
r4 = 0
android.content.res.AssetManager r5 = r0.getAssets() // Catch: java.lang.Throwable -> La1 java.lang.Exception -> La4
java.io.InputStream r10 = r5.open(r10) // Catch: java.lang.Throwable -> La1 java.lang.Exception -> La4
java.io.FileOutputStream r4 = r0.openFileOutput(r11, r2) // Catch: java.lang.Throwable -> L9a java.lang.Exception -> L9c
a(r10, r4) // Catch: java.lang.Throwable -> L9a java.lang.Exception -> L9c
android.content.SharedPreferences$Editor r11 = r3.edit() // Catch: java.lang.Throwable -> L9a java.lang.Exception -> L9c
r11.putInt(r7, r12) // Catch: java.lang.Throwable -> L9a java.lang.Exception -> L9c
r11.commit() // Catch: java.lang.Throwable -> L9a java.lang.Exception -> L9c
if (r10 == 0) goto L94
r10.close() // Catch: java.io.IOException -> L93
goto L94
L93:
L94:
if (r4 == 0) goto L99
r4.close() // Catch: java.io.IOException -> L99
L99:
return r6
L9a:
r11 = move-exception
goto Lbc
L9c:
r11 = move-exception
r9 = r4
r4 = r10
r10 = r9
goto La6
La1:
r11 = move-exception
r10 = r4
goto Lbc
La4:
r11 = move-exception
r10 = r4
La6:
java.lang.String r12 = "-->extractSecureLib, when copy lib execption."
com.tencent.open.a.f.b(r1, r12, r11) // Catch: java.lang.Throwable -> Lb8
if (r4 == 0) goto Lb2
r4.close() // Catch: java.io.IOException -> Lb1
goto Lb2
Lb1:
Lb2:
if (r10 == 0) goto Lb7
r10.close() // Catch: java.io.IOException -> Lb7
Lb7:
return r2
Lb8:
r11 = move-exception
r9 = r4
r4 = r10
r10 = r9
Lbc:
if (r10 == 0) goto Lc3
r10.close() // Catch: java.io.IOException -> Lc2
goto Lc3
Lc2:
Lc3:
if (r4 == 0) goto Lc8
r4.close() // Catch: java.io.IOException -> Lc8
Lc8:
throw r11
*/
throw new UnsupportedOperationException("Method not decompiled: com.tencent.open.utils.g.a(java.lang.String, java.lang.String, int):boolean");
}
private static long a(InputStream inputStream, OutputStream outputStream) throws IOException {
byte[] bArr = new byte[UnityActivity.BLOCKLY_TYPE_NONE];
long j = 0;
while (true) {
int read = inputStream.read(bArr, 0, bArr.length);
if (read != -1) {
outputStream.write(bArr, 0, read);
j += read;
} else {
com.tencent.open.a.f.c("openSDK_LOG.SystemUtils", "-->copy, copyed size is: " + j);
return j;
}
}
}
public static int a(String str) {
if ("shareToQQ".equals(str)) {
return 10103;
}
if ("shareToQzone".equals(str)) {
return 10104;
}
if ("addToQQFavorites".equals(str)) {
return 10105;
}
if ("sendToMyComputer".equals(str)) {
return 10106;
}
if ("shareToTroopBar".equals(str)) {
return 10107;
}
if ("action_login".equals(str)) {
return 11101;
}
return "action_request".equals(str) ? 10100 : -1;
}
}

View File

@@ -0,0 +1,95 @@
package com.tencent.open.utils;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import java.lang.reflect.Field;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public final class h {
private static Handler c;
private static HandlerThread d;
private static Object b = new Object();
public static final Executor a = c();
/* compiled from: ProGuard */
private static class a implements Executor {
final Queue<Runnable> a;
Runnable b;
private a() {
this.a = new LinkedList();
}
protected synchronized void a() {
Runnable poll = this.a.poll();
this.b = poll;
if (poll != null) {
h.a.execute(this.b);
}
}
@Override // java.util.concurrent.Executor
public synchronized void execute(final Runnable runnable) {
this.a.offer(new Runnable() { // from class: com.tencent.open.utils.h.a.1
@Override // java.lang.Runnable
public void run() {
try {
runnable.run();
} finally {
a.this.a();
}
}
});
if (this.b == null) {
a();
}
}
}
public static Handler a() {
if (c == null) {
synchronized (h.class) {
d = new HandlerThread("SDK_SUB");
d.start();
c = new Handler(d.getLooper());
}
}
return c;
}
public static Executor b() {
return new a();
}
private static Executor c() {
Executor threadPoolExecutor;
if (Build.VERSION.SDK_INT >= 11) {
threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingQueue());
} else {
try {
Field declaredField = AsyncTask.class.getDeclaredField("sExecutor");
declaredField.setAccessible(true);
threadPoolExecutor = (Executor) declaredField.get(null);
} catch (Exception unused) {
threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingQueue());
}
}
if (threadPoolExecutor instanceof ThreadPoolExecutor) {
((ThreadPoolExecutor) threadPoolExecutor).setCorePoolSize(3);
}
return threadPoolExecutor;
}
public static void a(Runnable runnable) {
a().post(runnable);
}
}

View File

@@ -0,0 +1,512 @@
package com.tencent.open.utils;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import com.tencent.bugly.Bugly;
import com.tencent.open.SocialConstants;
import com.ubt.jimu.base.entities.Course;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.URL;
import java.net.URLDecoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Enumeration;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class i {
private static String a = "";
private static String b = "";
private static String c = "";
private static String d = "";
private static int e = -1;
private static String f = null;
private static String g = "0123456789ABCDEF";
/* compiled from: ProGuard */
public static class a {
public String a;
public long b;
public long c;
public a(String str, int i) {
this.a = str;
this.b = i;
if (this.a != null) {
this.c = r1.length();
}
}
}
private static char a(int i) {
int i2 = i & 15;
return (char) (i2 < 10 ? i2 + 48 : (i2 - 10) + 97);
}
public static Bundle a(String str) {
Bundle bundle = new Bundle();
if (str == null) {
return bundle;
}
try {
for (String str2 : str.split("&")) {
String[] split = str2.split("=");
if (split.length == 2) {
bundle.putString(URLDecoder.decode(split[0]), URLDecoder.decode(split[1]));
}
}
return bundle;
} catch (Exception unused) {
return null;
}
}
public static Bundle b(String str) {
try {
URL url = new URL(str.replace("auth://", "http://"));
Bundle a2 = a(url.getQuery());
a2.putAll(a(url.getRef()));
return a2;
} catch (MalformedURLException unused) {
return new Bundle();
}
}
public static JSONObject c(String str) {
try {
URL url = new URL(str.replace("auth://", "http://"));
JSONObject a2 = a((JSONObject) null, url.getQuery());
a(a2, url.getRef());
return a2;
} catch (MalformedURLException unused) {
return new JSONObject();
}
}
public static JSONObject d(String str) throws JSONException {
if (str.equals(Bugly.SDK_IS_DEV)) {
str = "{value : false}";
}
if (str.equals("true")) {
str = "{value : true}";
}
if (str.contains("allback(")) {
str = str.replaceFirst("[\\s\\S]*allback\\(([\\s\\S]*)\\);[^\\)]*\\z", "$1").trim();
}
if (str.contains("online[0]=")) {
str = "{online:" + str.charAt(str.length() - 2) + "}";
}
return new JSONObject(str);
}
public static boolean e(String str) {
return str == null || str.length() == 0;
}
private static boolean f(Context context) {
Signature[] signatureArr;
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo("com.tencent.mtt", 64);
String str = packageInfo.versionName;
if (g.a(str, "4.3") >= 0 && !str.startsWith("4.4") && (signatureArr = packageInfo.signatures) != null) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(signatureArr[0].toByteArray());
String a2 = a(messageDigest.digest());
messageDigest.reset();
if (a2.equals("d8391a394d4a179e6fe7bdb8a301258b")) {
return true;
}
} catch (NoSuchAlgorithmException e2) {
com.tencent.open.a.f.e("openSDK_LOG.Util", "isQQBrowerAvailable has exception: " + e2.getMessage());
}
}
} catch (PackageManager.NameNotFoundException unused) {
}
return false;
}
public static final boolean g(String str) {
if (str == null) {
return false;
}
return str.startsWith("http://") || str.startsWith("https://");
}
public static boolean h(String str) {
return str != null && new File(str).exists();
}
public static byte[] i(String str) {
try {
return str.getBytes("UTF-8");
} catch (UnsupportedEncodingException unused) {
return null;
}
}
public static String e(Context context, String str) {
if (context == null) {
return "";
}
c = d(context, str);
return c;
}
public static boolean g(Context context, String str) {
boolean z = !d(context) || g.a(context, "com.tencent.minihd.qq") == null;
if (z && g.a(context, "com.tencent.tim") != null) {
z = false;
}
return z ? g.c(context, str) < 0 : z;
}
public static boolean e(Context context) {
return g.c(context, "5.9.5") >= 0 || g.a(context, "com.tencent.tim") != null;
}
public static boolean b() {
return (Environment.getExternalStorageState().equals("mounted") ? Environment.getExternalStorageDirectory() : null) != null;
}
public static String c(Context context) {
Location lastKnownLocation;
if (context == null) {
return "";
}
try {
LocationManager locationManager = (LocationManager) context.getSystemService("location");
Criteria criteria = new Criteria();
criteria.setCostAllowed(false);
criteria.setAccuracy(2);
String bestProvider = locationManager.getBestProvider(criteria, true);
if (bestProvider == null || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
return "";
}
f = lastKnownLocation.getLatitude() + "*" + lastKnownLocation.getLongitude();
return f;
} catch (Exception e2) {
com.tencent.open.a.f.b("openSDK_LOG.Util", "getLocation>>>", e2);
}
return "";
}
public static JSONObject a(JSONObject jSONObject, String str) {
if (jSONObject == null) {
jSONObject = new JSONObject();
}
if (str != null) {
for (String str2 : str.split("&")) {
String[] split = str2.split("=");
if (split.length == 2) {
try {
split[0] = URLDecoder.decode(split[0]);
split[1] = URLDecoder.decode(split[1]);
} catch (Exception unused) {
}
try {
jSONObject.put(split[0], split[1]);
} catch (JSONException e2) {
com.tencent.open.a.f.e("openSDK_LOG.Util", "decodeUrlToJson has exception: " + e2.getMessage());
}
}
}
}
return jSONObject;
}
public static boolean b(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
if (connectivityManager == null) {
return true;
}
NetworkInfo[] allNetworkInfo = connectivityManager.getAllNetworkInfo();
if (allNetworkInfo != null) {
for (NetworkInfo networkInfo : allNetworkInfo) {
if (networkInfo.isConnectedOrConnecting()) {
return true;
}
}
}
return false;
}
public static String d(Context context, String str) {
if (context == null) {
return "";
}
b(context, str);
return a;
}
public static boolean d(Context context) {
double d2;
try {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
d2 = Math.sqrt(Math.pow(displayMetrics.widthPixels / displayMetrics.xdpi, 2.0d) + Math.pow(displayMetrics.heightPixels / displayMetrics.ydpi, 2.0d));
} catch (Throwable unused) {
d2 = 0.0d;
}
return d2 > 6.5d;
}
public static String f(String str) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(i(str));
byte[] digest = messageDigest.digest();
if (digest == null) {
return str;
}
StringBuilder sb = new StringBuilder();
for (byte b2 : digest) {
sb.append(a(b2 >>> 4));
sb.append(a(b2));
}
return sb.toString();
} catch (NoSuchAlgorithmException e2) {
com.tencent.open.a.f.e("openSDK_LOG.Util", "encrypt has exception: " + e2.getMessage());
return str;
}
}
public static void b(Context context, String str) {
if (context == null) {
return;
}
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(str, 0);
b = packageInfo.versionName;
a = b.substring(0, b.lastIndexOf(46));
d = b.substring(b.lastIndexOf(46) + 1, b.length());
e = packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException e2) {
com.tencent.open.a.f.e("openSDK_LOG.Util", "getPackageInfo has exception: " + e2.getMessage());
} catch (Exception e3) {
com.tencent.open.a.f.e("openSDK_LOG.Util", "getPackageInfo has exception: " + e3.getMessage());
}
}
public static String a() {
try {
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
while (networkInterfaces != null && networkInterfaces.hasMoreElements()) {
Enumeration<InetAddress> inetAddresses = networkInterfaces.nextElement().getInetAddresses();
while (inetAddresses.hasMoreElements()) {
InetAddress nextElement = inetAddresses.nextElement();
if (!nextElement.isLoopbackAddress()) {
return nextElement.getHostAddress().toString();
}
}
}
return "";
} catch (SocketException e2) {
com.tencent.open.a.f.a("openSDK_LOG.Util", "getUserIp SocketException ", e2);
return "";
}
}
public static String c(Context context, String str) {
if (context == null) {
return "";
}
b(context, str);
return b;
}
public static boolean f(Context context, String str) {
boolean z = !d(context) || g.a(context, "com.tencent.minihd.qq") == null;
if (z && g.a(context, "com.tencent.tim") != null) {
z = false;
}
if (z && g.a(context, "com.tencent.qim") != null) {
z = false;
}
return z ? g.c(context, str) < 0 : z;
}
public static boolean a(Context context, String str) {
boolean z;
try {
z = f(context);
try {
if (z) {
a(context, "com.tencent.mtt", "com.tencent.mtt.MainActivity", str);
} else {
a(context, "com.android.browser", "com.android.browser.BrowserActivity", str);
}
return true;
} catch (Exception unused) {
if (z) {
try {
try {
try {
a(context, "com.android.browser", "com.android.browser.BrowserActivity", str);
return true;
} catch (Exception unused2) {
a(context, "com.google.android.browser", "com.android.browser.BrowserActivity", str);
return true;
}
} catch (Exception unused3) {
a(context, "com.android.chrome", "com.google.android.apps.chrome.Main", str);
return true;
}
} catch (Exception unused4) {
return false;
}
}
try {
try {
a(context, "com.google.android.browser", "com.android.browser.BrowserActivity", str);
return true;
} catch (Exception unused5) {
a(context, "com.android.chrome", "com.google.android.apps.chrome.Main", str);
return true;
}
} catch (Exception unused6) {
return false;
}
}
} catch (Exception unused7) {
z = false;
}
}
private static void a(Context context, String str, String str2, String str3) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(str, str2));
intent.setAction("android.intent.action.VIEW");
intent.addFlags(1073741824);
intent.addFlags(268435456);
intent.setData(Uri.parse(str3));
context.startActivity(intent);
}
public static String a(byte[] bArr) {
if (bArr == null) {
return null;
}
StringBuilder sb = new StringBuilder(bArr.length * 2);
for (byte b2 : bArr) {
String num = Integer.toString(b2 & 255, 16);
if (num.length() == 1) {
num = "0" + num;
}
sb.append(num);
}
return sb.toString();
}
public static final String a(Context context) {
CharSequence applicationLabel;
if (context == null || (applicationLabel = context.getPackageManager().getApplicationLabel(context.getApplicationInfo())) == null) {
return null;
}
return applicationLabel.toString();
}
public static final String a(String str, int i, String str2, String str3) {
if (TextUtils.isEmpty(str)) {
return "";
}
if (TextUtils.isEmpty(str2)) {
str2 = "UTF-8";
}
try {
if (str.getBytes(str2).length <= i) {
return str;
}
int i2 = 0;
int i3 = 0;
while (i2 < str.length()) {
int i4 = i2 + 1;
i3 += str.substring(i2, i4).getBytes(str2).length;
if (i3 > i) {
String substring = str.substring(0, i2);
if (TextUtils.isEmpty(str3)) {
return substring;
}
return substring + str3;
}
i2 = i4;
}
return str;
} catch (Exception e2) {
com.tencent.open.a.f.e("openSDK_LOG.Util", "Util.subString has exception: " + e2.getMessage());
return str;
}
}
public static Bundle a(String str, String str2, String str3, String str4, String str5, String str6) {
return a(str, str3, str4, str2, str5, str6, "", "", "", "", "", "");
}
public static Bundle a(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, String str10, String str11, String str12) {
Bundle bundle = new Bundle();
bundle.putString(SocialConstants.PARAM_OPEN_ID, str);
bundle.putString("report_type", str2);
bundle.putString("act_type", str3);
bundle.putString("via", str4);
bundle.putString("app_id", str5);
bundle.putString(UnityActivity.RESULT, str6);
bundle.putString("type", str7);
bundle.putString("login_status", str8);
bundle.putString("need_user_auth", str9);
bundle.putString("to_uin", str10);
bundle.putString("call_source", str11);
bundle.putString("to_type", str12);
return bundle;
}
public static Bundle a(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9) {
Bundle bundle = new Bundle();
bundle.putString("platform", "1");
bundle.putString(UnityActivity.RESULT, str);
bundle.putString(Course.TYPE_BLOCKLY, str2);
bundle.putString("tmcost", str3);
bundle.putString("rate", str4);
bundle.putString("cmd", str5);
bundle.putString("uin", str6);
bundle.putString(SocialConstants.PARAM_APP_ID, str7);
bundle.putString("share_type", str8);
bundle.putString("detail", str9);
bundle.putString("os_ver", Build.VERSION.RELEASE);
bundle.putString("network", com.tencent.open.b.a.a(d.a()));
bundle.putString("apn", com.tencent.open.b.a.b(d.a()));
bundle.putString("model_name", Build.MODEL);
bundle.putString("sdk_ver", "3.3.0.lite");
bundle.putString("packagename", d.b());
bundle.putString("app_ver", d(d.a(), d.b()));
return bundle;
}
public static boolean a(Context context, boolean z) {
if (!d(context) || g.a(context, "com.tencent.minihd.qq") == null) {
return !z ? (g.c(context, "4.1") < 0 && g.a(context, "com.tencent.tim") == null && g.a(context, "com.tencent.qim") == null) ? false : true : g.c(context, "4.1") >= 0 || g.a(context, "com.tencent.tim") != null;
}
return true;
}
}

View File

@@ -0,0 +1,28 @@
package com.tencent.open.utils;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public final class j implements Cloneable {
private long a;
public j(long j) {
this.a = j;
}
public byte[] a() {
long j = this.a;
return new byte[]{(byte) (255 & j), (byte) ((65280 & j) >> 8), (byte) ((16711680 & j) >> 16), (byte) ((j & 4278190080L) >> 24)};
}
public long b() {
return this.a;
}
public boolean equals(Object obj) {
return obj != null && (obj instanceof j) && this.a == ((j) obj).b();
}
public int hashCode() {
return (int) this.a;
}
}

View File

@@ -0,0 +1,37 @@
package com.tencent.open.utils;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public final class k implements Cloneable {
private int a;
public k(byte[] bArr) {
this(bArr, 0);
}
public byte[] a() {
int i = this.a;
return new byte[]{(byte) (i & 255), (byte) ((i & 65280) >> 8)};
}
public int b() {
return this.a;
}
public boolean equals(Object obj) {
return obj != null && (obj instanceof k) && this.a == ((k) obj).b();
}
public int hashCode() {
return this.a;
}
public k(byte[] bArr, int i) {
this.a = (bArr[i + 1] << 8) & 65280;
this.a += bArr[i] & 255;
}
public k(int i) {
this.a = i;
}
}

View File

@@ -0,0 +1,43 @@
package com.tencent.open.web.security;
import android.content.Context;
import com.tencent.connect.auth.AuthAgent;
import com.tencent.open.a.f;
import com.tencent.open.utils.d;
import java.io.File;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class JniInterface {
public static boolean isJniOk = false;
public static native boolean BackSpaceChar(boolean z, int i);
public static native boolean clearAllPWD();
public static native String getPWDKeyToMD5(String str);
public static native boolean insetTextToArray(int i, String str, int i2);
public static void loadSo() {
if (isJniOk) {
return;
}
try {
Context a = d.a();
if (a != null) {
if (new File(a.getFilesDir().toString() + "/" + AuthAgent.g).exists()) {
System.load(a.getFilesDir().toString() + "/" + AuthAgent.g);
isJniOk = true;
f.c("openSDK_LOG.JniInterface", "-->load lib success:" + AuthAgent.g);
} else {
f.c("openSDK_LOG.JniInterface", "-->fail, because so is not exists:" + AuthAgent.g);
}
} else {
f.c("openSDK_LOG.JniInterface", "-->load lib fail, because context is null:" + AuthAgent.g);
}
} catch (Throwable th) {
f.b("openSDK_LOG.JniInterface", "-->load lib error:" + AuthAgent.g, th);
}
}
}

View File

@@ -0,0 +1,84 @@
package com.tencent.open.web.security;
import com.tencent.open.a;
import com.tencent.open.a.f;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class SecureJsInterface extends a.b {
public static boolean isPWDEdit = false;
private String a;
public void clearAllEdit() {
f.c("openSDK_LOG.SecureJsInterface", "-->clear all edit.");
try {
JniInterface.clearAllPWD();
} catch (Exception e) {
f.e("openSDK_LOG.SecureJsInterface", "-->clear all edit exception: " + e.getMessage());
throw new RuntimeException(e);
}
}
public void curPosFromJS(String str) {
int i;
f.b("openSDK_LOG.SecureJsInterface", "-->curPosFromJS: " + str);
try {
i = Integer.parseInt(str);
} catch (NumberFormatException e) {
f.b("openSDK_LOG.SecureJsInterface", "-->curPosFromJS number format exception.", e);
i = -1;
}
if (i < 0) {
throw new RuntimeException("position is illegal.");
}
boolean z = a.c;
boolean z2 = a.b;
if (z2) {
if (Boolean.valueOf(JniInterface.BackSpaceChar(z2, i)).booleanValue()) {
a.b = false;
return;
}
return;
}
this.a = a.a;
String str2 = this.a;
JniInterface.insetTextToArray(i, str2, str2.length());
f.a("openSDK_LOG.SecureJsInterface", "curPosFromJS mKey: " + this.a);
}
@Override // com.tencent.open.a.b
public boolean customCallback() {
return true;
}
public String getMD5FromNative() {
f.c("openSDK_LOG.SecureJsInterface", "-->get md5 form native");
try {
String pWDKeyToMD5 = JniInterface.getPWDKeyToMD5(null);
f.a("openSDK_LOG.SecureJsInterface", "-->getMD5FromNative, MD5= " + pWDKeyToMD5);
return pWDKeyToMD5;
} catch (Exception e) {
f.e("openSDK_LOG.SecureJsInterface", "-->get md5 form native exception: " + e.getMessage());
throw new RuntimeException(e);
}
}
public void isPasswordEdit(String str) {
int i;
f.c("openSDK_LOG.SecureJsInterface", "-->is pswd edit, flag: " + str);
try {
i = Integer.parseInt(str);
} catch (Exception e) {
f.e("openSDK_LOG.SecureJsInterface", "-->is pswd edit exception: " + e.getMessage());
i = -1;
}
if (i != 0 && i != 1) {
throw new RuntimeException("is pswd edit flag is illegal.");
}
if (i == 0) {
isPWDEdit = false;
} else if (i == 1) {
isPWDEdit = true;
}
}
}

View File

@@ -0,0 +1,46 @@
package com.tencent.open.web.security;
import android.view.KeyEvent;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputConnectionWrapper;
import com.tencent.open.a.f;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class a extends InputConnectionWrapper {
public static String a = null;
public static boolean b = false;
public static boolean c = false;
public a(InputConnection inputConnection, boolean z) {
super(inputConnection, z);
}
@Override // android.view.inputmethod.InputConnectionWrapper, android.view.inputmethod.InputConnection
public boolean commitText(CharSequence charSequence, int i) {
c = true;
a = charSequence.toString();
f.a("openSDK_LOG.CaptureInputConnection", "-->commitText: " + charSequence.toString());
return super.commitText(charSequence, i);
}
@Override // android.view.inputmethod.InputConnectionWrapper, android.view.inputmethod.InputConnection
public boolean sendKeyEvent(KeyEvent keyEvent) {
if (keyEvent.getAction() == 0) {
f.c("openSDK_LOG.CaptureInputConnection", "sendKeyEvent");
a = String.valueOf((char) keyEvent.getUnicodeChar());
c = true;
f.b("openSDK_LOG.CaptureInputConnection", "s: " + a);
}
f.b("openSDK_LOG.CaptureInputConnection", "-->sendKeyEvent: " + a);
return super.sendKeyEvent(keyEvent);
}
@Override // android.view.inputmethod.InputConnectionWrapper, android.view.inputmethod.InputConnection
public boolean setComposingText(CharSequence charSequence, int i) {
c = true;
a = charSequence.toString();
f.a("openSDK_LOG.CaptureInputConnection", "-->setComposingText: " + charSequence.toString());
return super.setComposingText(charSequence, i);
}
}

View File

@@ -0,0 +1,64 @@
package com.tencent.open.web.security;
import android.net.Uri;
import android.text.TextUtils;
import android.webkit.WebView;
import com.tencent.open.a;
import com.tencent.open.a.f;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class b extends com.tencent.open.a {
@Override // com.tencent.open.a
public void a(String str, String str2, List<String> list, a.C0016a c0016a) {
f.a("openSDK_LOG.SecureJsBridge", "-->getResult, objectName: " + str + " | methodName: " + str2);
int size = list.size();
for (int i = 0; i < size; i++) {
try {
list.set(i, URLDecoder.decode(list.get(i), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
a.b bVar = this.a.get(str);
if (bVar != null) {
f.b("openSDK_LOG.SecureJsBridge", "-->handler != null");
bVar.call(str2, list, c0016a);
} else {
f.b("openSDK_LOG.SecureJsBridge", "-->handler == null");
if (c0016a != null) {
c0016a.a();
}
}
}
@Override // com.tencent.open.a
public boolean a(WebView webView, String str) {
f.a("openSDK_LOG.SecureJsBridge", "-->canHandleUrl---url = " + str);
if (str == null || !Uri.parse(str).getScheme().equals("jsbridge")) {
return false;
}
ArrayList arrayList = new ArrayList(Arrays.asList((str + "/#").split("/")));
if (arrayList.size() < 7) {
return false;
}
String str2 = (String) arrayList.get(2);
String str3 = (String) arrayList.get(3);
String str4 = (String) arrayList.get(4);
String str5 = (String) arrayList.get(5);
f.a("openSDK_LOG.SecureJsBridge", "-->canHandleUrl, objectName: " + str2 + " | methodName: " + str3 + " | snStr: " + str4);
if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3) && !TextUtils.isEmpty(str4)) {
try {
a(str2, str3, arrayList.subList(6, arrayList.size() - 1), new c(webView, Long.parseLong(str4), str, str5));
return true;
} catch (Exception unused) {
}
}
return false;
}
}

View File

@@ -0,0 +1,60 @@
package com.tencent.open.web.security;
import android.webkit.WebView;
import com.tencent.open.a;
import com.tencent.open.a.f;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class c extends a.C0016a {
private String d;
public c(WebView webView, long j, String str, String str2) {
super(webView, j, str);
this.d = str2;
}
private void b(String str) {
WebView webView = this.a.get();
if (webView != null) {
StringBuffer stringBuffer = new StringBuffer("javascript:");
stringBuffer.append("if(!!");
stringBuffer.append(this.d);
stringBuffer.append("){");
stringBuffer.append(this.d);
stringBuffer.append("(");
stringBuffer.append(str);
stringBuffer.append(")}");
String stringBuffer2 = stringBuffer.toString();
f.a("openSDK_LOG.SecureJsListener", "-->callback, callback: " + stringBuffer2);
webView.loadUrl(stringBuffer2);
}
}
@Override // com.tencent.open.a.C0016a
public void a(Object obj) {
f.a("openSDK_LOG.SecureJsListener", "-->onComplete, result: " + obj);
}
@Override // com.tencent.open.a.C0016a
public void a() {
f.b("openSDK_LOG.SecureJsListener", "-->onNoMatchMethod...");
}
@Override // com.tencent.open.a.C0016a
public void a(String str) {
f.a("openSDK_LOG.SecureJsListener", "-->onCustomCallback, js: " + str);
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(UnityActivity.RESULT, !com.tencent.open.c.c.a ? -4 : 0);
jSONObject.put("sn", this.b);
jSONObject.put("data", str);
} catch (JSONException e) {
e.printStackTrace();
}
b(jSONObject.toString());
}
}