xiaodi8 v1.0.0版本的 MD5 值为:6b857c57f508176c5ba1afb422bbb5a9
以下内容为反编译后的 Bridge.java 源代码,内容仅作参考
package com.bslyun.app.browser;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Color;
import android.media.AudioManager;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.PowerManager;
import android.provider.Settings;
import android.text.TextUtils;
import android.text.format.Formatter;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.widget.Toast;
import androidx.appcompat.app.b;
import com.bslyun.app.activity.MainActivity;
import com.bslyun.app.browser.listeners.ChangeBottomMenuListener;
import com.bslyun.app.browser.listeners.NetChangeListeners;
import com.bslyun.app.browser.listeners.PermissionListener;
import com.bslyun.app.browser.listeners.WebViewJavaScripteCallback;
import com.bslyun.app.browser.local.LocalBrowser;
import com.bslyun.app.browser.x5.X5Browser;
import com.bslyun.app.component.PushComponent;
import com.bslyun.app.component.SportStepCommponent;
import com.bslyun.app.component.ai.BaiduAIComponent;
import com.bslyun.app.component.ai.FaceComponent;
import com.bslyun.app.component.ai.SpeechRecogComponent;
import com.bslyun.app.component.ai.TTSyyhcComponent;
import com.bslyun.app.component.alibc.AliBCComponent;
import com.bslyun.app.component.alilogin.AliLoginComponent;
import com.bslyun.app.component.csj.CsjAdCommponent;
import com.bslyun.app.component.hx.HXadComponent;
import com.bslyun.app.component.lebo.LeboComponent;
import com.bslyun.app.component.linkpage.LinkpageComponent;
import com.bslyun.app.component.live.ZBCommponent;
import com.bslyun.app.component.meiqia.MQCommponent;
import com.bslyun.app.component.oaid.OAIDComponent;
import com.bslyun.app.component.qrcode.QRCodeComponent;
import com.bslyun.app.component.quicklogin.QuickLoginComponent;
import com.bslyun.app.component.rongyun.RongYunComponent;
import com.bslyun.app.component.uppay.UPPayComponent;
import com.bslyun.app.component.wx.WechatComponent;
import com.bslyun.app.component.ylh.TxAdCommponent;
import com.bslyun.app.d.a;
import com.bslyun.app.f.h;
import com.bslyun.app.g.d;
import com.bslyun.app.g.e;
import com.bslyun.app.modes.BottomMenuItemModel;
import com.bslyun.app.modes.CheckMapResult;
import com.bslyun.app.modes.EventBusMessage;
import com.bslyun.app.modes.LoginItem;
import com.bslyun.app.modes.PayModel;
import com.bslyun.app.modes.PhoneInfoModel;
import com.bslyun.app.modes.SHARE_MEDIA;
import com.bslyun.app.modes.ShareItem;
import com.bslyun.app.modes.TagPushModel;
import com.bslyun.app.utils.NetBroadcastReceiver;
import com.bslyun.app.utils.c0;
import com.bslyun.app.utils.f;
import com.bslyun.app.utils.i0;
import com.bslyun.app.utils.m0;
import com.bslyun.app.utils.p;
import com.bslyun.app.utils.s;
import com.bslyun.app.utils.t;
import com.bslyun.app.utils.u;
import com.bslyun.app.utils.y;
import com.google.gson.Gson;
import com.kseuay.kziwmts.R;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.permissions.PermissionConfig;
import com.tencent.smtt.sdk.TbsConfig;
import com.tencent.smtt.sdk.TbsVideoCacheTask;
import io.github.inflationx.calligraphy3.BuildConfig;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;
import org.greenrobot.eventbus.c;
import org.json.JSONException;
import org.json.JSONObject;
public class Bridge {
private ChangeBottomMenuListener bottomMenuListener;
public Activity context;
private Gson gson = new Gson();
private WebViewJavaScripteCallback jsCallback;
private int oaidCode;
private NetBroadcastReceiver receiver;
public ViewGroup webview;
public Bridge(Activity activity, ViewGroup viewGroup, WebViewJavaScripteCallback webViewJavaScripteCallback) {
this.context = activity;
this.webview = viewGroup;
this.jsCallback = webViewJavaScripteCallback;
this.bottomMenuListener = (ChangeBottomMenuListener) activity;
}
private boolean isIgnoringBatteryOptimizations() {
PowerManager powerManager = (PowerManager) this.context.getSystemService("power");
if (powerManager != null) {
return powerManager.isIgnoringBatteryOptimizations(this.context.getPackageName());
}
return false;
}
private void requestIgnoreOptimizations() {
if (Build.VERSION.SDK_INT < 23 || isIgnoringBatteryOptimizations()) {
return;
}
requestIgnoreBatteryOptimizations();
}
private void setPermission(String[] strArr, int i, String str, String str2) {
s sVar = new s();
Activity activity = this.context;
sVar.c(activity, strArr, (PermissionListener) activity, i, null, null, str, str2);
}
private void setSystemBrightness(final String str) {
i0.a().post(new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT >= 23) {
if (!Settings.System.canWrite(Bridge.this.context)) {
Intent intent = new Intent("android.settings.action.MANAGE_WRITE_SETTINGS");
intent.setData(Uri.parse("package:" + Bridge.this.context.getPackageName()));
intent.addFlags(268435456);
Bridge.this.context.startActivityForResult(intent, 0);
return;
}
m0.t0(Bridge.this.context, str);
return;
}
m0.t0(Bridge.this.context, str);
}
});
}
@JavascriptInterface
public void ControlOpenApp(String str) {
if (a.f(this.context).r1 == 0) {
return;
}
if (str.equals("1")) {
a.f(this.context).O0 = true;
} else if (str.equals("0")) {
a.f(this.context).O0 = false;
}
}
@JavascriptInterface
public void FaceAccountVerify(String str, String str2) {
if (a.f(this.context).j2) {
if (androidx.core.content.a.a(this.context, "android.permission.CAMERA") != 0) {
s sVar = new s();
Activity activity = this.context;
sVar.c(activity, new String[]{"android.permission.CAMERA"}, (PermissionListener) activity, 10136, "permission_camera_key", activity.getString(R.string.permission_CAMERA), this.context.getString(R.string.permission_hint_camera_title), this.context.getString(R.string.permission_hint_camera_detailed));
return;
}
FaceComponent.openRegister(this.context, str, "1", str2);
return;
}
Activity activity2 = this.context;
m0.u0(activity2, activity2.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void FaceDetectLogin(String str) {
if (a.f(this.context).j2) {
if (androidx.core.content.a.a(this.context, "android.permission.CAMERA") != 0) {
s sVar = new s();
Activity activity = this.context;
sVar.c(activity, new String[]{"android.permission.CAMERA"}, (PermissionListener) activity, 10136, "permission_camera_key", activity.getString(R.string.permission_CAMERA), this.context.getString(R.string.permission_hint_camera_title), this.context.getString(R.string.permission_hint_camera_detailed));
return;
}
FaceComponent.detectLogin(this.context, str);
return;
}
Activity activity2 = this.context;
m0.u0(activity2, activity2.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void FaceLiveness(String str) {
if (a.f(this.context).j2) {
if (androidx.core.content.a.a(this.context, "android.permission.CAMERA") != 0) {
s sVar = new s();
Activity activity = this.context;
sVar.c(activity, new String[]{"android.permission.CAMERA"}, (PermissionListener) activity, 10136, "permission_camera_key", activity.getString(R.string.permission_CAMERA), this.context.getString(R.string.permission_hint_camera_title), this.context.getString(R.string.permission_hint_camera_detailed));
return;
}
FaceComponent.faceLiveness(this.context, str);
return;
}
Activity activity2 = this.context;
m0.u0(activity2, activity2.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void FaceRegister(String str, String str2) {
if (a.f(this.context).j2) {
if (androidx.core.content.a.a(this.context, "android.permission.CAMERA") != 0) {
s sVar = new s();
Activity activity = this.context;
sVar.c(activity, new String[]{"android.permission.CAMERA"}, (PermissionListener) activity, 10136, "permission_camera_key", activity.getString(R.string.permission_CAMERA), this.context.getString(R.string.permission_hint_camera_title), this.context.getString(R.string.permission_hint_camera_detailed));
return;
}
FaceComponent.openRegister(this.context, str, "0", str2);
return;
}
Activity activity2 = this.context;
m0.u0(activity2, activity2.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void GenerateShortUrl(String str, String str2) {
if (a.f(this.context).k2) {
LinkpageComponent.generateShortUrl(this.context, str, this.webview, str2);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void GetBuildCode(String str) {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.context.getString(R.string.inside_version_code)));
}
@JavascriptInterface
public void LoadInsertAD(final String str) {
if (Build.VERSION.SDK_INT < 19) {
return;
}
if (a.f(this.context).s2) {
i0.a().post(new Runnable() {
@Override
public void run() {
HXadComponent.loadInsertAD(Bridge.this.context, str);
}
});
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void LoadRewardVideo(final String str, final String str2) {
if (Build.VERSION.SDK_INT < 19) {
return;
}
if (a.f(this.context).s2) {
i0.a().post(new Runnable() {
@Override
public void run() {
HXadComponent.loadRewardVideo(Bridge.this.context, str, str2);
}
});
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void OXlogin(String str) {
if (a.f(this.context).t3 != 2) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
int i = Build.VERSION.SDK_INT;
if (i < 21) {
b.a aVar = new b.a(this.context);
aVar.f("手机系统版本不能低于5.0");
aVar.g("确认", null);
aVar.a().show();
return;
}
if (!t.c(this.context)) {
m0.u0(this.context, "请插入SIM卡");
return;
}
if (!t.b(this.context)) {
m0.u0(this.context, "请打开移动数据链接");
return;
}
if (i == 23 && t.a(this.context) == 1) {
b.a aVar2 = new b.a(this.context);
aVar2.f("6.0系统需要关闭wifi的情况下才可以使用一键登录功能");
aVar2.g("确认", null);
aVar2.a().show();
return;
}
MainActivity.jsCallbackMethod = str;
QuickLoginComponent.login(R.mipmap.ic_launcher);
EventBusMessage factory = EventBusMessage.Factory.factory();
factory.flag1 = "dialog";
c.c().l(factory);
}
@JavascriptInterface
public void OpenProjection(String str) {
if (a.f(this.context).l2) {
if (!TextUtils.isEmpty(str)) {
LeboComponent.openTP(this.context, str);
return;
} else {
m0.u0(this.context, "视频链接有误");
return;
}
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void SpeechSynthesis(int i, String str, String str2) {
if (a.f(this.context).q2) {
TTSyyhcComponent.startSynthesis(this.context, i, str, str2);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void StartAccelerate(String str) {
EventBusMessage factory = EventBusMessage.Factory.factory("startAccelerate");
factory.setObject(str);
c.c().l(factory);
}
@JavascriptInterface
public void StartGyro(String str) {
EventBusMessage factory = EventBusMessage.Factory.factory("startGyro");
factory.setObject(str);
c.c().l(factory);
}
@JavascriptInterface
public void StopAccelerate() {
c.c().l(EventBusMessage.Factory.factory("stopAccelerate"));
}
@JavascriptInterface
public void StopGyro() {
c.c().l(EventBusMessage.Factory.factory("stopAccelerate"));
}
@JavascriptInterface
public void TXLoadInsertScreenAD(String str) {
if (a.f(this.context).m2 && !TextUtils.isEmpty(str)) {
TxAdCommponent.loadInsertScreenAD(this.context, str);
} else {
m0.u0(this.context, "启用广告失败");
}
}
@JavascriptInterface
public void TXLoadRewardVideoAD(String str, String str2) {
if (a.f(this.context).m2 && !TextUtils.isEmpty(str)) {
TxAdCommponent.loadRewardVideoAD(this.context, str, str2);
} else {
m0.u0(this.context, "启用广告失败");
}
}
@JavascriptInterface
public void TXShowInsertScreenAD() {
if (a.f(this.context).m2) {
i0.a().post(new Runnable() {
@Override
public void run() {
TxAdCommponent.showInsertScreenAD();
}
});
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void TXShowRewardVideoAD() {
if (a.f(this.context).m2) {
i0.a().post(new Runnable() {
@Override
public void run() {
TxAdCommponent.showRewardVideoAD();
}
});
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void ZbAnchor(String str) {
if (a.f(this.context).g2) {
Activity activity = this.context;
ZBCommponent.openAnchor(activity, a.f(activity).t, a.f(this.context).v, str);
} else {
Activity activity2 = this.context;
m0.u0(activity2, activity2.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void ZbLiveList() {
if (a.f(this.context).g2) {
ZBCommponent.openLiveList(this.context);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void ZbLogin(String str, String str2, String str3) {
if (a.f(this.context).g2) {
ZBCommponent.zbLogin(this.context, str, str2, str3);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void ZbLogout() {
if (a.f(this.context).g2) {
ZBCommponent.zbLogout();
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void ZbRegister(String str, String str2, String str3) {
if (a.f(this.context).g2) {
ZBCommponent.zbRegister(this.context, str, str2, str3);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void ZbUpdataUser(String str, String str2, String str3, String str4) {
if (a.f(this.context).g2) {
int i = -1;
if (!TextUtils.isEmpty(str3)) {
try {
i = Integer.parseInt(str3);
} catch (NumberFormatException e2) {
e2.printStackTrace();
}
}
ZBCommponent.updataUser(this.context, str, str2, i, str4);
return;
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void addContact(String str, String str2) {
if (!a.f(this.context).Z0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
return;
}
com.bslyun.app.e.a.i = str;
com.bslyun.app.e.a.j = str2;
s sVar = new s();
Activity activity2 = this.context;
sVar.c(activity2, new String[]{"android.permission.WRITE_CONTACTS"}, (PermissionListener) activity2, 10125, "permisson_contact", activity2.getString(R.string.permission_READ_CONTACTS), null, null);
}
}
@JavascriptInterface
public void addToBlacklist(String str) {
if (a.f(this.context).i3) {
RongYunComponent.addToBlacklist(str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void aliLoginAuth(String str) {
AliLoginComponent.getLoginToken(this.context, str, 3000);
}
@JavascriptInterface
public void alibcLogin(String str) {
if (a.f(this.context).b2) {
AliBCComponent.alibcLogin(this.context, this.webview, str);
}
}
@JavascriptInterface
public void alibcLogout(String str) {
if (a.f(this.context).b2) {
AliBCComponent.alibcLogout(this.context, this.webview, str);
}
}
@JavascriptInterface
public void audioBackstage(String str) {
if (a.f(this.context).g1) {
if (TextUtils.isEmpty(str)) {
return;
}
a.f(this.context).B1 = str.equals("1");
return;
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void awakeOtherWebview(String str) {
if (!a.f(this.context).y0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
WebViewJavaScripteCallback webViewJavaScripteCallback = this.jsCallback;
if (webViewJavaScripteCallback != null) {
webViewJavaScripteCallback.onAwakeOtherBrowser(str);
}
}
}
@JavascriptInterface
public void bottomMenuChangeStatus(String str) {
if (a.f(this.context).l) {
c.c().l(EventBusMessage.Factory.factory("tab_status_change", Integer.valueOf(Integer.parseInt(str))));
}
}
@JavascriptInterface
public void checkAppInstalled(String str, String str2) {
String str3;
if (TextUtils.isEmpty(str2)) {
return;
}
if (m0.d0(this.context, str2)) {
str3 = "{code:1,app:" + str2 + "}";
} else {
str3 = "{code:0,app:" + str2 + "}";
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, str3));
}
@JavascriptInterface
public void checkBDMap(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(m0.d0(this.context, "com.baidu.BaiduMap") ? "1" : "0", "BDMap"))));
}
@JavascriptInterface
public void checkFingerprint(String str) {
if (a.f(this.context).U0) {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, new com.jsyh.fingerpirnt.a(this.context).c() ? "1" : "0"));
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void checkGDMap(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(m0.d0(this.context, "com.autonavi.minimap") ? "1" : "0", "GDMap"))));
}
@JavascriptInterface
public void checkGGMap(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(m0.d0(this.context, "com.google.android.apps.maps") ? "1" : "0", "GGMap"))));
}
@JavascriptInterface
public void checkMap(String str, String str2) {
if (TextUtils.isEmpty(str2)) {
m0.u0(this.context, "请输入地图类型");
return;
}
str2.hashCode();
char c2 = 65535;
switch (str2.hashCode()) {
case 63055290:
if (str2.equals("BDMap")) {
c2 = 0;
break;
}
break;
case 67672895:
if (str2.equals("GDMap")) {
c2 = 1;
break;
}
break;
case 67762268:
if (str2.equals("GGMap")) {
c2 = 2;
break;
}
break;
case 80274488:
if (str2.equals("TXMap")) {
c2 = 3;
break;
}
break;
}
switch (c2) {
case 0:
checkBDMap(str);
return;
case 1:
checkGDMap(str);
return;
case 2:
checkGGMap(str);
return;
case 3:
checkTXMap(str);
return;
default:
return;
}
}
@JavascriptInterface
public void checkTXMap(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(m0.d0(this.context, "com.tencent.map") ? "1" : "0", "TXMap"))));
}
@JavascriptInterface
public void checkWX(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
String str2 = "javascript:" + str + "(" + (m0.d0(this.context, TbsConfig.APP_WX) ? 1 : 0) + ");";
if (m0.Z(this.context)) {
((LocalBrowser) this.webview).postJs(str2);
} else {
((X5Browser) this.webview).postJs(str2);
}
}
@JavascriptInterface
public void checkZFB(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
String str2 = "javascript:" + str + "(" + (m0.d0(this.context, "com.eg.android.AlipayGphone") ? 1 : 0) + ");";
if (m0.Z(this.context)) {
((LocalBrowser) this.webview).postJs(str2);
} else {
((X5Browser) this.webview).postJs(str2);
}
}
@JavascriptInterface
public void cleanCache() {
y.d(this.context, this.webview, 0);
}
@JavascriptInterface
public void cleanData() {
b.a aVar = new b.a(this.context);
aVar.f(this.context.getResources().getString(R.string.clear_dialog_hint));
aVar.g(this.context.getResources().getString(R.string.clear_dialog_cancel), null);
aVar.j(this.context.getResources().getString(R.string.clear_dialog_sure), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
m0.c(Bridge.this.context);
}
});
aVar.a().show();
}
@JavascriptInterface
public void closeNetListen() {
if (a.f(this.context).c1) {
i0.a().post(new Runnable() {
@Override
public void run() {
if (Bridge.this.receiver != null) {
com.bslyun.app.e.a.n = BuildConfig.FLAVOR;
Bridge bridge = Bridge.this;
bridge.context.unregisterReceiver(bridge.receiver);
Bridge.this.receiver = null;
}
}
});
}
}
@JavascriptInterface
public void closeStep() {
if (a.f(this.context).l1) {
SportStepCommponent.getStepInstance().stopStep(this.context);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void closeTopWindow() {
if (!a.f(this.context).Q1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
i0.a().post(new Runnable() {
@Override
public void run() {
WebViewUtils.closeTopWindow((MainActivity) Bridge.this.context);
}
});
}
}
@JavascriptInterface
public void closeTopWindowRefresh() {
if (!a.f(this.context).Q1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
i0.a().post(new Runnable() {
@Override
public void run() {
WebViewUtils.closeTopWindowRefresh((MainActivity) Bridge.this.context);
}
});
}
}
@JavascriptInterface
public void connectRYIMServer(String str, String str2) {
if (a.f(this.context).i3) {
RongYunComponent.connectRongYunIMServer(this.context, str, this.webview, str2);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void controlBottomTabLayout(String str, String str2) {
if (a.f(this.context).l && a.f(this.context).D0) {
WebViewJavaScripteCallback webViewJavaScripteCallback = this.jsCallback;
if (webViewJavaScripteCallback != null) {
webViewJavaScripteCallback.controlBottomTabLayout(true, str, str2);
return;
}
return;
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void controlLeftMenuLayout(String str) {
if (a.f(this.context).i && a.f(this.context).E0) {
WebViewJavaScripteCallback webViewJavaScripteCallback = this.jsCallback;
if (webViewJavaScripteCallback != null) {
webViewJavaScripteCallback.controlLeftMenuLayout(str);
return;
}
return;
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void controlNavBarHide(String str) {
if (a.f(this.context).r && a.f(this.context).C0) {
if (str.equals("1")) {
a.f(this.context).l0 = true;
} else if (str.equals("0")) {
a.f(this.context).l0 = false;
}
}
}
@JavascriptInterface
public void controlScreenshot(final String str) {
if (a.f(this.context).j1) {
i0.a().post(new Runnable() {
@Override
public void run() {
if (str.equals("1")) {
Bridge.this.context.getWindow().addFlags(8192);
} else if (str.equals("0")) {
Bridge.this.context.getWindow().clearFlags(8192);
}
}
});
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void controlSlide(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
a.f(this.context).S0 = str;
this.jsCallback.onSetDrawerLayout(str);
}
@JavascriptInterface
public void controlTabBarHide(String str) {
if (a.f(this.context).l && a.f(this.context).D0) {
if (str.equals("1")) {
a.f(this.context).m0 = true;
} else if (str.equals("0")) {
a.f(this.context).m0 = false;
}
}
}
@JavascriptInterface
public void controllNavigateLayout(String str, String str2) {
if (a.f(this.context).r && a.f(this.context).C0) {
WebViewJavaScripteCallback webViewJavaScripteCallback = this.jsCallback;
if (webViewJavaScripteCallback != null) {
webViewJavaScripteCallback.controlNavigatorLayout(str, str2);
return;
}
return;
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void copyText(String str) {
m0.e(this.context, str);
}
@JavascriptInterface
public void copyUrlToClipboard() {
if (m0.Z(this.context)) {
this.webview.post(new Runnable() {
@Override
public void run() {
Bridge bridge = Bridge.this;
m0.e(bridge.context, ((LocalBrowser) bridge.webview).getUrl());
}
});
} else {
this.webview.post(new Runnable() {
@Override
public void run() {
Bridge bridge = Bridge.this;
m0.e(bridge.context, ((X5Browser) bridge.webview).getUrl());
}
});
}
m0.u0(this.context, "复制成功!");
}
@JavascriptInterface
public void createWindows(String str) {
if (!a.f(this.context).Q1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
EventBusMessage factory = EventBusMessage.Factory.factory("new_fragment");
factory.setObject(str);
c.c().l(factory);
}
}
@JavascriptInterface
public void ctrlNavLeftBtnFun(String str, String str2, String str3) {
if (a.f(this.context).r) {
this.jsCallback.controlNavLeftMenu(str, str2, str3);
}
}
@JavascriptInterface
public void ctrlNavRightBtnFun(String str, String str2, String str3) {
if (a.f(this.context).r) {
this.jsCallback.controlNavRightMenu(str, str2, str3);
}
}
@JavascriptInterface
public void deletePushTags(String str, String str2) {
if (a.f(this.context).p0 && a.f(this.context).o0) {
if (TextUtils.isEmpty(str) && TextUtils.isEmpty(str2)) {
return;
}
String[] split = str.split(",");
if (split.length < 0) {
return;
}
try {
ArrayList arrayList = new ArrayList();
for (String str3 : split) {
arrayList.add(str3);
}
TagPushModel tagPushModel = new TagPushModel(arrayList, str2);
if (tagPushModel.getTag() != null && tagPushModel.getTag().size() != 0) {
if (TextUtils.isEmpty(tagPushModel.getCallbackMethod())) {
m0.u0(this.context, "请添加回调方法");
return;
}
HashSet hashSet = new HashSet();
Iterator<String> it = tagPushModel.getTag().iterator();
while (it.hasNext()) {
hashSet.add(it.next());
}
a f2 = a.f(this.context);
if (f2.o0 && f2.p0) {
if ("1".equals(f2.q0)) {
PushComponent.deleteJpushTags(this.context, hashSet, str2);
return;
} else if ("2".equals(f2.q0)) {
PushComponent.miUnsubscribeTag(this.context, tagPushModel.getTag().get(0));
return;
} else {
if ("4".equals(f2.q0)) {
return;
}
"3".equals(f2.q0);
return;
}
}
return;
}
m0.u0(this.context, "至少添加一个Tag");
return;
} catch (Exception unused) {
m0.u0(this.context, "数据格式错误");
return;
}
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void downRefresh(String str, String str2) {
if (a.f(this.context).h1) {
if (TextUtils.isEmpty(str)) {
return;
}
this.jsCallback.onJsRefreshEnable(str, str2);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void downloadFile(String str, String str2, String str3) {
if (!a.f(this.context).e1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || !m0.X(str3)) {
return;
}
EventBusMessage factory = EventBusMessage.Factory.factory("download_file");
HashMap hashMap = new HashMap();
hashMap.put("data", str);
hashMap.put("callback", str2);
hashMap.put("type", "1");
hashMap.put("selectOpen", str3);
factory.setMapData(hashMap);
c.c().l(factory);
}
@JavascriptInterface
public void fingerprint(String str) {
if (a.f(this.context).U0) {
this.jsCallback.onFingerprint(str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void getAllContact(String str) {
if (!a.f(this.context).Z0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (TextUtils.isEmpty(str)) {
return;
}
com.bslyun.app.e.a.f4271h = str;
s sVar = new s();
Activity activity2 = this.context;
sVar.c(activity2, new String[]{"android.permission.READ_CONTACTS"}, (PermissionListener) activity2, 10122, "permisson_contact", activity2.getString(R.string.permission_READ_CONTACTS), null, null);
}
}
@JavascriptInterface
public void getBase64FromBlobData(String str) {
EventBusMessage factory = EventBusMessage.Factory.factory("download_file");
HashMap hashMap = new HashMap();
hashMap.put("data", "[\"" + str + "\"]");
hashMap.put("callback", BuildConfig.FLAVOR);
hashMap.put("type", "3");
hashMap.put("selectOpen", "0");
factory.setMapData(hashMap);
c.c().l(factory);
}
@JavascriptInterface
public void getBrightness(String str) {
if (!a.f(this.context).n0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, m0.u(this.context) + BuildConfig.FLAVOR));
}
@JavascriptInterface
public String getBuild() {
return this.context.getResources().getString(R.string.inside_version_code);
}
@JavascriptInterface
public void getCacheSize(String str) {
File externalCacheDir;
if (!"mounted".equals(Environment.getExternalStorageState()) && Environment.isExternalStorageRemovable()) {
externalCacheDir = this.context.getCacheDir();
} else {
externalCacheDir = this.context.getExternalCacheDir();
}
String str2 = "javascript:" + str + "('" + Formatter.formatFileSize(this.context, m0.w(externalCacheDir)) + "')";
if (m0.Z(this.context)) {
((LocalBrowser) this.webview).postJs(str2);
} else {
((X5Browser) this.webview).postJs(str2);
}
}
@JavascriptInterface
public void getCharset(String str) {
if (!TextUtils.isEmpty(str)) {
if (str.contains("charset=")) {
str.substring(str.indexOf("charset=") + 8);
}
a.f(this.context).q(str);
}
str = "utf-8";
a.f(this.context).q(str);
}
@JavascriptInterface
public void getClipboardText(String str) {
ClipData primaryClip;
ClipboardManager clipboardManager = (ClipboardManager) this.context.getSystemService("clipboard");
StringBuilder sb = new StringBuilder();
if (clipboardManager == null || (primaryClip = clipboardManager.getPrimaryClip()) == null) {
return;
}
for (int i = 0; i < primaryClip.getItemCount(); i++) {
ClipData.Item itemAt = primaryClip.getItemAt(i);
sb.append("'");
sb.append(itemAt.getText().toString());
sb.append("'");
if (i < primaryClip.getItemCount() - 1) {
sb.append(",");
}
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, "javascript:" + str + "(" + sb.toString().replaceAll("(\\r\\n|\\n|\\n\\r)", BuildConfig.FLAVOR) + ");");
}
@JavascriptInterface
public void getDescription(String str) {
a.f(this.context).r(str);
}
@JavascriptInterface
public void getDeviceIdentifier(String str) {
if (!a.f(this.context).z0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
a.f(this.context).p(str);
if (androidx.core.content.a.a(this.context, "android.permission.READ_PHONE_STATE") != 0) {
s sVar = new s();
Activity activity2 = this.context;
sVar.c(activity2, new String[]{"android.permission.READ_PHONE_STATE"}, (PermissionListener) activity2, 140, "permisson_phone_state", activity2.getString(R.string.permission_READ_PHONE_STATE), this.context.getString(R.string.permission_hint_phone_state_title), this.context.getString(R.string.permission_hint_phone_state_detailed));
return;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, m0.z(this.context)));
}
@JavascriptInterface
public void getLocation(String str, String str2) {
if (a.f(this.context).G0) {
int parseInt = m0.X(str) ? Integer.parseInt(str) : 0;
EventBusMessage eventBusMessage = null;
if (parseInt >= 0) {
eventBusMessage = EventBusMessage.Factory.factory("get_location", Integer.valueOf(parseInt));
} else if (parseInt < 0) {
eventBusMessage = EventBusMessage.Factory.factory("get_location_cancel");
}
if (eventBusMessage != null) {
eventBusMessage.setObject(str2);
c.c().l(eventBusMessage);
}
}
}
@JavascriptInterface
public void getMusicVolume(String str) {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, m0.C(this.context) + BuildConfig.FLAVOR));
}
@JavascriptInterface
public void getNetType(final String str) {
if (a.f(this.context).c1) {
i0.a().post(new Runnable() {
@Override
public void run() {
int a2 = t.a(Bridge.this.context);
String geneciCallbackFunction = JavaScriptUtils.geneciCallbackFunction(str, a2 != 0 ? a2 != 1 ? a2 != 2 ? a2 != 3 ? a2 != 4 ? a2 != 5 ? BuildConfig.FLAVOR : "未知网络" : "4G" : "3G" : "2G" : "wifi" : "未连接");
Bridge bridge = Bridge.this;
JavaScriptUtils.postJsInWebView(bridge.context, bridge.webview, geneciCallbackFunction);
}
});
}
}
@JavascriptInterface
public void getOAID(final String str) {
if (!a.f(this.context).z0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
i0.a().post(new Runnable() {
@Override
public void run() {
OAIDComponent.getOAID(Bridge.this.context, str);
}
});
}
}
@JavascriptInterface
public void getRYUserInfo(final String str, final String str2) {
if (a.f(this.context).i3) {
i0.a().post(new Runnable() {
@Override
public void run() {
Bridge bridge = Bridge.this;
RongYunComponent.getRYUserInfo(bridge.context, str, bridge.webview, str2);
}
});
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void getRegistrationID(String str) {
if (a.f(this.context).o0) {
PushComponent.getRegistrationID(this.context, str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void getSingleContacts(String str) {
if (!a.f(this.context).Z0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (TextUtils.isEmpty(str)) {
return;
}
com.bslyun.app.e.a.f4270g = str;
s sVar = new s();
Activity activity2 = this.context;
sVar.c(activity2, new String[]{"android.permission.READ_CONTACTS"}, (PermissionListener) activity2, 10121, "permisson_contact", activity2.getString(R.string.permission_READ_CONTACTS), null, null);
}
}
@JavascriptInterface
public void getStatusBarHeight(String str) {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, String.valueOf(m0.H(this.context))));
}
@JavascriptInterface
public void getStepNum(String str) {
if (a.f(this.context).l1 && SportStepCommponent.getStepInstance().isOpenStport()) {
this.jsCallback.onStepNum(str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void getToken(String str) {
if (a.f(this.context).o0 && "3".equals(a.f(this.context).q0) && !TextUtils.isEmpty(str)) {
com.bslyun.app.e.a.f4268e = str;
PushComponent.hwGetToken(this.context);
}
}
@JavascriptInterface
public void getVersionCode(String str) {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, m0.e0(this.context) + BuildConfig.FLAVOR));
}
@JavascriptInterface
public void getVersionName(String str) {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, m0.f0(this.context)));
}
@JavascriptInterface
public void getVolume(String str) {
String str2 = "javascript:" + str + "('" + m0.I(this.context) + "')";
if (m0.Z(this.context)) {
((LocalBrowser) this.webview).postJs(str2);
} else {
((X5Browser) this.webview).postJs(str2);
}
}
@JavascriptInterface
public void getWifiSSID(String str) {
if (!a.f(this.context).V0) {
m0.u0(this.context, "请开启获取wifi名称权限");
return;
}
if (Build.VERSION.SDK_INT >= 26) {
String[] strArr = {"android.permission.ACCESS_FINE_LOCATION"};
if (androidx.core.content.a.a(this.context, strArr[0]) != 0) {
s sVar = new s();
Activity activity = this.context;
sVar.c(activity, strArr, (PermissionListener) activity, -1, "permission_location_ley", activity.getString(R.string.permission_ACCESS_FINE_LOCATION), this.context.getString(R.string.permission_hint_location_title), this.context.getString(R.string.permission_hint_location_detailed));
return;
}
}
String M = m0.M(this.context);
TextUtils.isEmpty(M);
String str2 = "javascript:" + str + "(" + M + ");";
if (m0.Z(this.context)) {
((LocalBrowser) this.webview).postJs(str2);
} else {
((X5Browser) this.webview).postJs(str2);
}
}
@JavascriptInterface
public void hideStateBar(String str, String str2) {
if (str2.equals("1")) {
com.bslyun.app.e.a.l = str;
}
this.jsCallback.onHideState(str);
}
@JavascriptInterface
public void injectOk() {
JavaScriptUtils.postJsInWebView(this.context, this.webview, "javascript:appFinishiLoad();");
}
@JavascriptInterface
public void isFirstInstall(String str) {
String str2 = "1";
if (!TextUtils.isEmpty((String) c0.a(this.context, "FirstInstall", BuildConfig.FLAVOR)) && !"1".equals((String) c0.a(this.context, "FirstInstall", BuildConfig.FLAVOR))) {
str2 = "0";
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, str2));
}
@JavascriptInterface
public void isOpenNotice(String str) {
if (!a.f(this.context).o0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, u.a(this.context) ? "1" : "0"));
}
}
@JavascriptInterface
public void jpushSetAlias(String str, String str2) {
if (a.f(this.context).o0) {
PushComponent.jpushSetAlias(this.context, str, str2);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void jsAIRecognition(String str, String str2) {
if (a.f(this.context).P1) {
BaiduAIComponent.setAIdata(this.context, str, str2);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void jsAISpeechRecog(final String str) {
if (!a.f(this.context).S1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (androidx.core.content.a.a(this.context, "android.permission.RECORD_AUDIO") != 0) {
s sVar = new s();
Activity activity2 = this.context;
sVar.c(activity2, new String[]{"android.permission.RECORD_AUDIO"}, (PermissionListener) activity2, 10132, "permission_audio_ley", activity2.getString(R.string.permission_RECORD_AUDIO), null, null);
return;
}
i0.a().post(new Runnable() {
@Override
public void run() {
new SpeechRecogComponent().startSpeechRecog(Bridge.this.context, str);
}
});
}
}
@JavascriptInterface
public void keepBright(final String str) {
if (!a.f(this.context).n0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
i0.a().post(new Runnable() {
@Override
public void run() {
if (str.equals("1")) {
Bridge.this.context.getWindow().addFlags(128);
} else if (str.equals("0")) {
Bridge.this.context.getWindow().clearFlags(128);
}
}
});
}
}
@JavascriptInterface
public void loadFullScreenVideoAd(String str) {
if (a.f(this.context).e2 && !TextUtils.isEmpty(str)) {
CsjAdCommponent.loadFullScreenVideoAd(this.context, str);
} else {
m0.u0(this.context, "初始化全屏视频广告失败");
}
}
@JavascriptInterface
public void loadRewardVideoAd(String str, String str2, String str3, String str4) {
if (a.f(this.context).e2 && !TextUtils.isEmpty(str)) {
CsjAdCommponent.loadRewardVideoAd(this.context, str, str2, str3, this.webview, str4);
} else {
m0.u0(this.context, "初始化激励视频广告失败");
}
}
@JavascriptInterface
public void login(String str) {
try {
final LoginItem loginItem = (LoginItem) this.gson.fromJson(str, LoginItem.class);
if (TextUtils.isEmpty(loginItem.platform)) {
m0.u0(this.context, "登录平台不能为空!");
} else if (TextUtils.isEmpty(loginItem.forwardurl) && TextUtils.isEmpty(loginItem.callbackMethod)) {
m0.u0(this.context, "登录成功后跳转地址与登录成功后回调的js函数不能同时为空!");
} else {
i0.a().post(new Runnable() {
@Override
public void run() {
Bridge bridge = Bridge.this;
y.e(bridge.context, bridge.webview, loginItem);
}
});
}
} catch (Exception e2) {
e2.printStackTrace();
m0.u0(this.context, "登录数据格式错误!");
}
}
@JavascriptInterface
public void logoutRY() {
if (a.f(this.context).i3) {
RongYunComponent.logoutRY();
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void msgRing() {
RingtoneManager.getRingtone(this.context.getApplicationContext(), RingtoneManager.getDefaultUri(2)).play();
}
@JavascriptInterface
public void navBDMap(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
int i;
if (!a.f(this.context).W0 && !a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4) || TextUtils.isEmpty(str5) || TextUtils.isEmpty(str6)) {
return;
}
if (m0.d0(this.context, "com.baidu.BaiduMap")) {
String str8 = "javascript:location.href='" + ("baidumap://map/direction?origin=latlng:" + str3 + "," + str4 + "|name:" + str + "&destination=latlng:" + str5 + "," + str6 + "|name:" + str2 + "&mode=driving&coord_type=gcj02") + "'";
if (m0.Z(this.context)) {
((LocalBrowser) this.webview).postJs(str8);
} else {
((X5Browser) this.webview).postJs(str8);
}
i = 1;
} else {
i = 0;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str7, this.gson.toJson(new CheckMapResult(i + BuildConfig.FLAVOR, "BDMap"))));
}
@JavascriptInterface
public void navGDMap(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
int i;
if (!a.f(this.context).W0 && !a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4) || TextUtils.isEmpty(str5) || TextUtils.isEmpty(str6)) {
return;
}
if (m0.d0(this.context, "com.autonavi.minimap")) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.setPackage("com.autonavi.minimap");
intent.setData(Uri.parse("amapuri://route/plan/?sid=BGVIS1&slat=" + str3 + "&slon=" + str4 + "&sname=" + str + "&did=BGVIS2&dlat=" + str5 + "&dlon=" + str6 + "&dname=" + str2 + "&dev=0&t=0"));
this.context.startActivity(intent);
i = 1;
} else {
i = 0;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str7, this.gson.toJson(new CheckMapResult(i + BuildConfig.FLAVOR, "GDMap"))));
}
@JavascriptInterface
public void navGGMap(String str, String str2, String str3, String str4, String str5) {
int i;
if (!a.f(this.context).W0 && !a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4)) {
return;
}
if (m0.d0(this.context, "com.google.android.apps.maps")) {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(String.format(Locale.ENGLISH, "http://maps.google.com/maps?saddr=" + str + "," + str2 + "&daddr=" + str3 + "," + str4 + "&mode=walking&sensor=false", new Object[0])));
intent.setPackage("com.google.android.apps.maps");
this.context.startActivity(intent);
i = 1;
} else {
i = 0;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str5, this.gson.toJson(new CheckMapResult(i + BuildConfig.FLAVOR, "GGMap"))));
}
@JavascriptInterface
public void navMap(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8) {
if (TextUtils.isEmpty(str8)) {
m0.u0(this.context, "请输入地图类型");
return;
}
str8.hashCode();
char c2 = 65535;
switch (str8.hashCode()) {
case 63055290:
if (str8.equals("BDMap")) {
c2 = 0;
break;
}
break;
case 67672895:
if (str8.equals("GDMap")) {
c2 = 1;
break;
}
break;
case 67762268:
if (str8.equals("GGMap")) {
c2 = 2;
break;
}
break;
case 80274488:
if (str8.equals("TXMap")) {
c2 = 3;
break;
}
break;
}
switch (c2) {
case 0:
navBDMap(str5, str6, str, str2, str3, str4, str7);
return;
case 1:
navGDMap(str5, str6, str, str2, str3, str4, str7);
return;
case 2:
navGGMap(str, str2, str3, str4, str7);
return;
case 3:
navTXMap(str5, str6, str, str2, str3, str4, str7);
return;
default:
return;
}
}
@JavascriptInterface
public void navTXMap(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
int i;
if (!a.f(this.context).W0 && !a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4) || TextUtils.isEmpty(str5) || TextUtils.isEmpty(str6)) {
return;
}
if (m0.d0(this.context, "com.tencent.map")) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("qqmap://map/routeplan?type=drive&from=" + str + "&fromcoord=" + str3 + "," + str4 + "&to=" + str2 + "&tocoord=" + str5 + "," + str6 + "&policy=0&referer=myapp"));
this.context.startActivity(intent);
i = 1;
} else {
i = 0;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str7, this.gson.toJson(new CheckMapResult(i + BuildConfig.FLAVOR, "TXMap"))));
}
@JavascriptInterface
public void navbarColor(String str, String str2) {
if (TextUtils.isEmpty(str) || !str.startsWith("#") || str.length() > 7) {
return;
}
this.jsCallback.onSetStateBarColor(str, str2, true);
}
@JavascriptInterface
public void netWorkState(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
String str2 = "javascript:" + str + "(" + m0.b0(this.context) + ")";
if (m0.Z(this.context)) {
((LocalBrowser) this.webview).postJs(str2);
} else {
((X5Browser) this.webview).postJs(str2);
}
}
@JavascriptInterface
public void openApp(String str, String str2) {
String str3;
if (a.f(this.context).d1 && !TextUtils.isEmpty(str) && m0.d0(this.context, str) && !this.context.getPackageName().equals(str)) {
if (m0.d0(this.context, str)) {
m0.b(this.context, str);
str3 = "1";
} else {
str3 = "0";
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str2, "{code:" + str3 + ",app:" + str + "}"));
}
}
@JavascriptInterface
public void openBDMap(String str) {
String str2;
if (!a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
try {
Intent intent = new Intent();
intent.setData(Uri.parse("baidumap://map/"));
this.context.startActivity(intent);
str2 = "1";
} catch (Exception e2) {
e2.printStackTrace();
str2 = "0";
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(str2, "BDMap"))));
}
@JavascriptInterface
public void openBrowser(String str, String str2, String str3) {
str2.hashCode();
char c2 = 65535;
switch (str2.hashCode()) {
case 2592:
if (str2.equals("QQ")) {
c2 = 0;
break;
}
break;
case 2702:
if (str2.equals("UC")) {
c2 = 1;
break;
}
break;
case 82605:
if (str2.equals("SYS")) {
c2 = 2;
break;
}
break;
case 2138589785:
if (str2.equals("Google")) {
c2 = 3;
break;
}
break;
}
switch (c2) {
case 0:
openBrowser2(TbsConfig.APP_QB, str3, str);
return;
case 1:
openBrowser2("com.UCMobile", str3, str);
return;
case 2:
try {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str3));
this.context.startActivity(intent);
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, "0"));
return;
} catch (Exception e2) {
e2.printStackTrace();
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, "2"));
return;
}
case 3:
openBrowser2("com.android.chrome", str3, str);
return;
default:
return;
}
}
@JavascriptInterface
public void openBrowser2(String str, String str2, String str3) {
String str4;
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
return;
}
try {
if (m0.d0(this.context, str)) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str2));
PackageManager packageManager = this.context.getPackageManager();
String className = packageManager.getLaunchIntentForPackage(str).resolveActivity(packageManager).getClassName();
p.a(className);
intent.setClassName(str, className);
this.context.startActivity(intent);
str4 = "0";
} else {
str4 = "1";
m0.u0(this.context, "未安装指定浏览器");
}
} catch (Exception e2) {
e2.printStackTrace();
str4 = "2";
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str3, str4));
}
@JavascriptInterface
public void openGDMap(String str) {
int i;
if (!a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (m0.d0(this.context, "com.autonavi.minimap")) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("androidamap://showTraffic?sourceApplication=softname&poiid=BGVIS1&lat=36.2&lon=116.1&level=10&dev=0"));
intent.setPackage("com.autonavi.minimap");
this.context.startActivity(intent);
i = 1;
} else {
i = 0;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(i + BuildConfig.FLAVOR, "GDMap"))));
}
@JavascriptInterface
public void openGGMap(String str) {
int i;
if (!a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (m0.d0(this.context, "com.google.android.apps.maps")) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setPackage("com.google.android.apps.maps");
this.context.startActivity(intent);
i = 1;
} else {
i = 0;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(i + BuildConfig.FLAVOR, "GGMap"))));
}
@JavascriptInterface
public void openImage(String str) {
i0.a().post(new Runnable() {
@Override
public void run() {
String extra;
if (m0.Z(Bridge.this.context)) {
if (((LocalBrowser) Bridge.this.webview).getHitTestResult().getType() == 5) {
extra = ((LocalBrowser) Bridge.this.webview).getHitTestResult().getExtra();
}
extra = null;
} else {
if (((X5Browser) Bridge.this.webview).getHitTestResult().getType() == 5) {
extra = ((X5Browser) Bridge.this.webview).getHitTestResult().getExtra();
}
extra = null;
}
if (TextUtils.isEmpty(extra)) {
return;
}
Bridge.this.jsCallback.onImageClick(extra);
}
});
}
@JavascriptInterface
public void openInterstitial(final String str) {
if (a.f(this.context).e2 && !TextUtils.isEmpty(str)) {
i0.a().post(new Runnable() {
@Override
public void run() {
CsjAdCommponent.loadInteractionExpressAd(Bridge.this.context, str);
}
});
} else {
m0.u0(this.context, "启用插屏广告失败");
}
}
@JavascriptInterface
public void openMQChat(String str) {
if (a.f(this.context).d3) {
MQCommponent.openChat(this.context, str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void openMap(String str, String str2) {
if (TextUtils.isEmpty(str2)) {
m0.u0(this.context, "请输入地图类型");
return;
}
str2.hashCode();
char c2 = 65535;
switch (str2.hashCode()) {
case 63055290:
if (str2.equals("BDMap")) {
c2 = 0;
break;
}
break;
case 67672895:
if (str2.equals("GDMap")) {
c2 = 1;
break;
}
break;
case 67762268:
if (str2.equals("GGMap")) {
c2 = 2;
break;
}
break;
case 80274488:
if (str2.equals("TXMap")) {
c2 = 3;
break;
}
break;
}
switch (c2) {
case 0:
openBDMap(str);
return;
case 1:
openGDMap(str);
return;
case 2:
openGGMap(str);
return;
case 3:
openTXMap(str);
return;
default:
return;
}
}
@JavascriptInterface
public void openNetListen(final String str) {
if (a.f(this.context).c1) {
i0.a().post(new Runnable() {
@Override
public void run() {
com.bslyun.app.e.a.n = str;
Bridge.this.receiver = new NetBroadcastReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
Bridge bridge = Bridge.this;
bridge.context.registerReceiver(bridge.receiver, intentFilter);
Bridge.this.receiver.a((NetChangeListeners) Bridge.this.context);
}
});
}
}
@JavascriptInterface
public void openPrivacyStatement() {
if (a.f(this.context).W1) {
new h(this.context, new View.OnClickListener() {
@Override
public void onClick(View view) {
c0.c(Bridge.this.context, "isAllow", "0");
Bridge.this.setJsClose();
}
}, null).show();
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void openRYConversation(String str) {
if (a.f(this.context).i3) {
RongYunComponent.openRYConversation(this.context, str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void openRYConversationList(String str) {
if (a.f(this.context).i3) {
RongYunComponent.openRYConversationList(this.context, str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void openStep(String str) {
if (a.f(this.context).l1) {
SportStepCommponent.stepCallback = str;
if (Build.VERSION.SDK_INT > 28 && androidx.core.content.a.a(this.context, "android.permission.ACTIVITY_RECOGNITION") != 0) {
s sVar = new s();
Activity activity = this.context;
sVar.c(activity, new String[]{"android.permission.ACTIVITY_RECOGNITION"}, (PermissionListener) activity, 158, "permission_step_ley", activity.getString(R.string.permission_ACTIVITY_RECOGNITION), null, null);
return;
} else if (!SportStepCommponent.getStepInstance().isOpenStport()) {
SportStepCommponent.getStepInstance().openStep(this.context, this.webview);
return;
} else {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, "1"));
return;
}
}
Activity activity2 = this.context;
m0.u0(activity2, activity2.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void openTXMap(String str) {
int i;
if (!a.f(this.context).G0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (m0.d0(this.context, "com.tencent.map")) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("qqmap://map/"));
this.context.startActivity(intent);
i = 1;
} else {
i = 0;
}
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(new CheckMapResult(i + BuildConfig.FLAVOR, "TXMap"))));
}
@JavascriptInterface
public void openVideo(final String str, final String str2) {
if (a.f(this.context).X0) {
try {
if (TextUtils.isEmpty(com.bslyun.app.e.a.f4267d)) {
i0.a().post(new Runnable() {
@Override
public void run() {
Intent intent = new Intent();
intent.setClassName(Bridge.this.context, "com.jsyh.video.VideoActivity");
Bundle bundle = new Bundle();
bundle.putString(TbsVideoCacheTask.KEY_VIDEO_CACHE_PARAM_URL, str);
bundle.putString("title", str2);
if (TextUtils.isEmpty(str2)) {
bundle.putString("title", a.f(Bridge.this.context).d());
}
intent.putExtras(bundle);
com.bslyun.app.e.a.f4267d = str;
Bridge.this.context.startActivityForResult(intent, 2000);
}
});
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
@JavascriptInterface
public void openWXKF(String str, String str2) {
if (a.f(this.context).m3) {
if (!str.startsWith("https://work.weixin.qq.com/kfid/")) {
m0.u0(this.context, "客服链接格式错误");
return;
} else {
if (TextUtils.isEmpty(str2)) {
m0.u0(this.context, "请传入企业id");
return;
}
new WechatComponent(this.context, this.context.getResources().getString(R.string.WX_APP_ID), this.context.getResources().getString(R.string.WX_AppSecret)).wxCustomerService(str, str2);
return;
}
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void openXCX(final String str, final String str2, final String str3, final String str4) {
if (!a.f(this.context).m1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
i0.a().post(new Runnable() {
@Override
public void run() {
try {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4) || !Pattern.matches("^\\d+$", str3)) {
return;
}
int parseInt = Integer.parseInt(str3);
if (parseInt >= 0 || parseInt <= 3) {
if (a.f(Bridge.this.context).m1) {
new WechatComponent(Bridge.this.context, Bridge.this.context.getResources().getString(R.string.WX_APP_ID), Bridge.this.context.getResources().getString(R.string.WX_AppSecret)).openXCX(str, str2, parseInt, str4);
} else {
Toast.makeText(Bridge.this.context, "您未开启小程序功能", 0).show();
}
}
} catch (Resources.NotFoundException e2) {
e2.printStackTrace();
} catch (NumberFormatException e3) {
e3.printStackTrace();
}
}
});
}
}
@JavascriptInterface
public void pay(String str, String str2, String str3) {
try {
if (TextUtils.isEmpty(str)) {
m0.u0(this.context, "订单数据不能为空!");
return;
}
if (TextUtils.isEmpty(str2)) {
m0.u0(this.context, "请输入支付类型!");
return;
}
if (!"WEIXIN".equals(str2) && !"ALIPAY".equals(str2)) {
m0.u0(this.context, "未识别的支付类型!");
return;
}
PayModel payModel = new PayModel(str2, str, str3);
if (!payModel.getPaytype().equals(BuildConfig.FLAVOR) && payModel.getPaytype() != null) {
if (!payModel.getCallbackMethod().equals(BuildConfig.FLAVOR) && payModel.getCallbackMethod() != null) {
y.f(this.context, this.webview, payModel);
return;
}
m0.u0(this.context, "支付完成之后回调方法不能为空!");
return;
}
m0.u0(this.context, "支付类型不能为空!");
} catch (Exception e2) {
e2.printStackTrace();
m0.u0(this.context, "支付数据格式错误!");
}
}
@JavascriptInterface
public void qrPhoto(String str, String str2) {
if (!a.f(this.context).R) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
com.bslyun.app.e.a.f4265b = 0;
if (!TextUtils.isEmpty(str)) {
com.bslyun.app.e.a.f4266c = str;
}
a.f(this.context).T = str2;
if (Build.VERSION.SDK_INT >= 33) {
s sVar = new s();
Activity activity2 = this.context;
sVar.c(activity2, new String[]{PermissionConfig.READ_MEDIA_IMAGES, PermissionConfig.READ_MEDIA_VIDEO, PermissionConfig.READ_MEDIA_AUDIO}, (PermissionListener) activity2, 10127, "permission_storage_key", activity2.getString(R.string.permission_WRITE_EXTERNAL_STORAGE), this.context.getString(R.string.permission_hint_storage_write_read_title), this.context.getString(R.string.permission_hint_storage_write_read_detailed));
} else {
s sVar2 = new s();
Activity activity3 = this.context;
sVar2.c(activity3, new String[]{PermissionConfig.WRITE_EXTERNAL_STORAGE, PermissionConfig.READ_EXTERNAL_STORAGE}, (PermissionListener) activity3, 10127, "permission_storage_key", activity3.getString(R.string.permission_WRITE_EXTERNAL_STORAGE), this.context.getString(R.string.permission_hint_storage_write_read_title), this.context.getString(R.string.permission_hint_storage_write_read_detailed));
}
}
@JavascriptInterface
public void qrUrl(String str, String str2, String str3) {
if (!a.f(this.context).R) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
com.bslyun.app.e.a.f4265b = 0;
if (!TextUtils.isEmpty(str)) {
com.bslyun.app.e.a.f4266c = str;
}
a.f(this.context).T = str3;
QRCodeComponent.image(this.context, str2, str3);
}
@JavascriptInterface
public void qrcoder(String str, String str2) {
if (!a.f(this.context).R) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
com.bslyun.app.e.a.f4265b = 0;
if (!TextUtils.isEmpty(str)) {
com.bslyun.app.e.a.f4266c = str;
}
a.f(this.context).T = str2;
y.g(this.context, str2);
}
@JavascriptInterface
public void qrcoderWithCallback(String str) {
com.bslyun.app.e.a.f4265b = 0;
if (!TextUtils.isEmpty(str)) {
com.bslyun.app.e.a.f4266c = str;
}
y.g(this.context, null);
}
@JavascriptInterface
public void readImageUrl(String str) {
a.f(this.context).g().add(str);
}
@JavascriptInterface
public void registerPushTag(String str, String str2) {
if (a.f(this.context).p0 && a.f(this.context).o0) {
if (TextUtils.isEmpty(str) && TextUtils.isEmpty(str2)) {
return;
}
String[] split = str.split(",");
if (split.length < 0) {
return;
}
try {
ArrayList arrayList = new ArrayList();
for (String str3 : split) {
arrayList.add(str3);
}
TagPushModel tagPushModel = new TagPushModel(arrayList, str2);
if (tagPushModel.getTag() != null && tagPushModel.getTag().size() != 0) {
if (TextUtils.isEmpty(tagPushModel.getCallbackMethod())) {
m0.u0(this.context, "请添加回调方法");
return;
} else {
y.h(this.context, this.webview, tagPushModel);
return;
}
}
m0.u0(this.context, "至少添加一个Tag");
return;
} catch (Exception unused) {
m0.u0(this.context, "数据格式错误");
return;
}
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void removeAllCookies() {
if (a.f(this.context).X.equals("1")) {
WebViewUtils.removeAllX5Cookies(null);
} else {
WebViewUtils.removeAllCookies(null);
}
}
@JavascriptInterface
public void removeExpiredCookies() {
if (a.f(this.context).X.equals("1")) {
WebViewUtils.removeExpiredX5Cookies();
} else {
WebViewUtils.removeExpiredCookies();
}
}
@JavascriptInterface
public void removeFromBlacklist(String str) {
if (a.f(this.context).i3) {
RongYunComponent.removeFromBlacklist(str);
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
public void requestIgnoreBatteryOptimizations() {
try {
Intent intent = new Intent("android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS");
intent.setData(Uri.parse("package:" + this.context.getPackageName()));
this.context.startActivity(intent);
} catch (Exception e2) {
e2.printStackTrace();
}
}
@JavascriptInterface
public void revokePrivacyAgreement() {
c0.c(this.context, "isAllow", "0");
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Bridge.this.setJsClose();
}
}, 200L);
}
@JavascriptInterface
public void screenshortLinstener(boolean z, String str) {
if (a.f(this.context).j1) {
EventBusMessage eventBusMessage = new EventBusMessage();
eventBusMessage.flag1 = "screenshort";
eventBusMessage.setObject(str);
if (z) {
eventBusMessage.flage2 = 1;
} else {
eventBusMessage.flage2 = 0;
}
c.c().l(eventBusMessage);
return;
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void setBottomMenu(String str) {
if (!a.f(this.context).l) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (TextUtils.isEmpty(str)) {
return;
}
BottomMenuItemModel bottomMenuItemModel = (BottomMenuItemModel) this.gson.fromJson(str, BottomMenuItemModel.class);
if (bottomMenuItemModel.getItemId() < 0) {
return;
}
this.bottomMenuListener.changeBottomMenu(bottomMenuItemModel);
}
}
@JavascriptInterface
public void setBrightness(final String str, String str2) {
if (!a.f(this.context).n0) {
m0.u0(this.context, "请开启亮度调节配置");
return;
}
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
return;
}
if (str2.equals("1")) {
setSystemBrightness(str);
} else {
i0.a().post(new Runnable() {
@Override
public void run() {
m0.q0(Bridge.this.context, str);
}
});
}
}
@JavascriptInterface
public void setJsClose() {
c0.e(this.context, "js_orientation");
d.f().d();
System.exit(0);
}
@JavascriptInterface
public void setJsPermission(String str) {
str.hashCode();
char c2 = 65535;
switch (str.hashCode()) {
case -1611296843:
if (str.equals("LOCATION")) {
c2 = 0;
break;
}
break;
case 76105038:
if (str.equals("PHONE")) {
c2 = 1;
break;
}
break;
case 303398256:
if (str.equals("READ_EXTERNAL_STORAGE")) {
c2 = 2;
break;
}
break;
case 521038035:
if (str.equals("WRITE_CONTACTS")) {
c2 = 3;
break;
}
break;
case 1017485532:
if (str.equals("READ_CONTACTS")) {
c2 = 4;
break;
}
break;
case 1107437128:
if (str.equals("RECORD_AUDIO")) {
c2 = 5;
break;
}
break;
case 1883661927:
if (str.equals("WRITE_EXTERNAL_STORAGE")) {
c2 = 6;
break;
}
break;
case 1919977223:
if (str.equals("IGNORE_BATTERY_OPTIMIZATIONS")) {
c2 = 7;
break;
}
break;
case 1980544805:
if (str.equals("CAMERA")) {
c2 = '\b';
break;
}
break;
}
switch (c2) {
case 0:
setPermission(new String[]{"android.permission.ACCESS_FINE_LOCATION"}, 10203, this.context.getString(R.string.permission_hint_location_title), this.context.getString(R.string.permission_hint_location_detailed));
return;
case 1:
setPermission(new String[]{"android.permission.READ_PHONE_STATE"}, 10208, this.context.getString(R.string.permission_hint_phone_state_title), this.context.getString(R.string.permission_hint_phone_state_detailed));
return;
case 2:
setPermission(new String[]{PermissionConfig.READ_EXTERNAL_STORAGE}, 10204, this.context.getString(R.string.permission_hint_storage_write_read_title), this.context.getString(R.string.permission_hint_storage_write_read_detailed));
return;
case 3:
setPermission(new String[]{"android.permission.WRITE_CONTACTS"}, 10206, null, null);
return;
case 4:
setPermission(new String[]{"android.permission.READ_CONTACTS"}, 10206, null, null);
return;
case 5:
setPermission(new String[]{"android.permission.RECORD_AUDIO"}, 10201, null, null);
return;
case 6:
setPermission(new String[]{PermissionConfig.WRITE_EXTERNAL_STORAGE}, 10204, this.context.getString(R.string.permission_hint_storage_write_read_title), this.context.getString(R.string.permission_hint_storage_write_read_detailed));
return;
case 7:
requestIgnoreOptimizations();
return;
case '\b':
setPermission(new String[]{"android.permission.CAMERA"}, 10202, this.context.getString(R.string.permission_hint_camera_title), this.context.getString(R.string.permission_hint_camera_detailed));
return;
default:
return;
}
}
@JavascriptInterface
public void setJsPhoneInfo(String str) {
if (!a.f(this.context).a1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else if (androidx.core.content.a.a(this.context, "android.permission.READ_PHONE_STATE") != 0) {
s sVar = new s();
Activity activity2 = this.context;
sVar.c(activity2, new String[]{"android.permission.READ_PHONE_STATE"}, (PermissionListener) activity2, 10131, "permisson_phone_state", activity2.getString(R.string.permission_READ_PHONE_STATE), this.context.getString(R.string.permission_hint_phone_state_title), this.context.getString(R.string.permission_hint_phone_state_detailed));
} else {
PhoneInfoModel E = m0.E(this.context);
if (E != null) {
JavaScriptUtils.postJsInWebView(this.context, this.webview, JavaScriptUtils.geneciCallbackFunction(str, this.gson.toJson(E)));
}
}
}
@JavascriptInterface
public void setMusicVolume(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
try {
float parseFloat = Float.parseFloat(str);
if (parseFloat < 0.0f) {
return;
}
((AudioManager) this.context.getSystemService(PictureMimeType.MIME_TYPE_PREFIX_AUDIO)).setStreamVolume(3, (int) (r0.getStreamMaxVolume(3) * parseFloat), 1);
} catch (NumberFormatException e2) {
e2.printStackTrace();
}
}
@JavascriptInterface
public void setNavBarAlpha(String str, String str2) {
if (!a.f(this.context).n.equals("1") && m0.c0(str) && m0.T(m0.O(str))) {
this.jsCallback.onJsNavBarAlpha(m0.O(str), str2);
}
}
@JavascriptInterface
public void setNavigationBarButtonColor(final String str) {
if (Build.VERSION.SDK_INT >= 21) {
i0.a().post(new Runnable() {
@Override
public void run() {
int systemUiVisibility = Bridge.this.context.getWindow().getDecorView().getSystemUiVisibility();
if (str.equals("0")) {
Bridge.this.context.getWindow().getDecorView().setSystemUiVisibility(systemUiVisibility | 16);
} else if (str.equals("1")) {
Bridge.this.context.getWindow().getDecorView().setSystemUiVisibility(systemUiVisibility & (-17));
}
}
});
}
}
@JavascriptInterface
public void setNavigationBarColor(String str) {
if (!m0.V(str) || Build.VERSION.SDK_INT < 21) {
return;
}
this.context.getWindow().setNavigationBarColor(Color.parseColor(str));
}
@JavascriptInterface
public void setRYUserInfo(final String str, final String str2) {
if (a.f(this.context).i3) {
i0.a().post(new Runnable() {
@Override
public void run() {
RongYunComponent.setRYUserInfo(str, str2);
}
});
} else {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
}
@JavascriptInterface
public void setScreenOrientation(String str) {
WebViewJavaScripteCallback webViewJavaScripteCallback;
if (a.f(this.context).F0) {
if (TextUtils.isEmpty(str) || (webViewJavaScripteCallback = this.jsCallback) == null) {
return;
}
webViewJavaScripteCallback.onCreenOrientation(str);
return;
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void setTabbarAlpha(String str, String str2) {
if (!a.f(this.context).p.equals("1") && m0.c0(str) && m0.T(m0.O(str))) {
this.jsCallback.onJsTabbarAlpha(m0.O(str), str2, true);
}
}
@JavascriptInterface
public void setTitleName(String str, String str2) {
if (a.f(this.context).r) {
this.jsCallback.onJsTitleName(str, str2);
}
}
@JavascriptInterface
public void setVolume(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
try {
float parseFloat = Float.parseFloat(str);
if (parseFloat < 0.0f) {
return;
}
((AudioManager) this.context.getSystemService(PictureMimeType.MIME_TYPE_PREFIX_AUDIO)).setStreamVolume(1, (int) (r0.getStreamMaxVolume(1) * parseFloat), 1);
} catch (NumberFormatException e2) {
e2.printStackTrace();
}
}
@JavascriptInterface
public void share(String str) {
if (!a.f(this.context).P && !a.f(this.context).Q) {
Activity activity = this.context;
Toast.makeText(activity, activity.getString(R.string.not_turned_on), 0).show();
return;
}
try {
final ShareItem shareItem = (ShareItem) this.gson.fromJson(str, ShareItem.class);
if (!shareItem.content.equals(BuildConfig.FLAVOR) && shareItem.content != null) {
if (!shareItem.title.equals(BuildConfig.FLAVOR) && shareItem.title != null) {
i0.a().post(new Runnable() {
@Override
public void run() {
if (TextUtils.isEmpty(shareItem.platform)) {
y.i(Bridge.this.context, shareItem, 0);
return;
}
for (SHARE_MEDIA share_media : SHARE_MEDIA.values()) {
if (share_media.toString().equalsIgnoreCase(shareItem.platform)) {
e g2 = e.g(Bridge.this.context);
ShareItem shareItem2 = shareItem;
g2.j(share_media, shareItem2.title, shareItem2.content, shareItem2.targetUrl, shareItem2.imageurl, 0, shareItem2.callbackMethod);
return;
}
}
}
});
return;
}
m0.u0(this.context, "分享标题不能为空!");
return;
}
m0.u0(this.context, "分享内容不能为空!");
} catch (Exception unused) {
m0.u0(this.context, "分享数据格式错误!");
}
}
@JavascriptInterface
public void shareApplet(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
if (!a.f(this.context).P) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str4) && !TextUtils.isEmpty(str5) && !TextUtils.isEmpty(str6) && !TextUtils.isEmpty(str7)) {
com.bslyun.app.e.a.f4268e = str7;
y.f4732c = str7;
Activity activity2 = this.context;
WechatComponent.factory(activity2, activity2.getResources().getString(R.string.WX_APP_ID), this.context.getResources().getString(R.string.WX_AppSecret)).shareApplet(str, str2, str3, str4, str5, str6);
return;
}
Toast.makeText(this.context, "分享缺少参数!", 0).show();
}
@JavascriptInterface
public void shareCutImage(String str) {
if (!a.f(this.context).P && !a.f(this.context).Q) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
EventBusMessage eventBusMessage = new EventBusMessage();
HashMap hashMap = new HashMap();
eventBusMessage.flag1 = "shareCutImage";
hashMap.put("data", str);
eventBusMessage.setMapData(hashMap);
c.c().l(eventBusMessage);
}
@JavascriptInterface
public void shareImage(String str) {
if (!a.f(this.context).P && !a.f(this.context).Q) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
try {
ShareItem shareItem = (ShareItem) this.gson.fromJson(str, ShareItem.class);
if (!shareItem.imageurl.equals(BuildConfig.FLAVOR) && shareItem.imageurl != null) {
EventBusMessage eventBusMessage = new EventBusMessage();
eventBusMessage.flag1 = "shareImage";
eventBusMessage.setObject(shareItem);
c.c().l(eventBusMessage);
return;
}
m0.u0(this.context, "分享图片不能为空!");
} catch (Exception unused) {
m0.u0(this.context, "分享数据格式错误!");
}
}
@JavascriptInterface
public void shareImageByPlatform(final String str, String str2, final String str3) {
if (!a.f(this.context).P && !a.f(this.context).Q) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || TextUtils.isEmpty(str3)) {
return;
}
f.b(this.context, true, str2, com.bslyun.app.e.a.f4264a, "shareImae.png", new f.d() {
@Override
public void getDownPath(final String str4) {
i0.a().post(new Runnable() {
@Override
public void run() {
if (TextUtils.isEmpty(str4)) {
m0.u0(Bridge.this.context, "图片地址有误,请重新尝试!");
return;
}
for (SHARE_MEDIA share_media : SHARE_MEDIA.values()) {
if (share_media.toString().equalsIgnoreCase(str)) {
e.g(Bridge.this.context).j(share_media, " ", BuildConfig.FLAVOR, null, str4, 1, str3);
return;
}
}
}
});
}
@Override
public void onDownPath(List<String> list) {
}
});
}
}
@JavascriptInterface
public void shareMultiImage(String[] strArr, final String str) {
if (!a.f(this.context).P) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (strArr == null || strArr.length < 1) {
return;
}
f.f(strArr, com.bslyun.app.e.a.f4264a, new f.d() {
@Override
public void getDownPath(String str2) {
p.b(str2);
}
@Override
public void onDownPath(final List<String> list) {
Bridge.this.webview.post(new Runnable() {
@Override
public void run() {
if (list.isEmpty()) {
m0.u0(Bridge.this.context, "图片下载失败");
} else if (list.size() < 1) {
m0.u0(Bridge.this.context, "可支持分享图片必须大于1");
} else {
AnonymousClass2 anonymousClass2 = AnonymousClass2.this;
e.n(Bridge.this.context, str, list);
}
}
});
}
});
}
}
@JavascriptInterface
public void shareMultiImageToSome(String[] strArr) {
if (!a.f(this.context).P) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (strArr == null || strArr.length < 1) {
return;
}
f.f(strArr, com.bslyun.app.e.a.f4264a, new f.d() {
@Override
public void getDownPath(String str) {
p.b(str);
}
@Override
public void onDownPath(final List<String> list) {
Bridge.this.webview.post(new Runnable() {
@Override
public void run() {
if (list.isEmpty()) {
m0.u0(Bridge.this.context, "图片下载失败");
} else {
e.r(Bridge.this.context, list);
}
}
});
}
});
}
}
@JavascriptInterface
public void shareMusic(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
String str8;
if (TextUtils.isEmpty(str)) {
return;
}
if (!a.f(this.context).P) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
com.bslyun.app.e.a.f4268e = str7;
y.f4732c = str7;
if (str.contains("WEIXIN")) {
Activity activity2 = this.context;
WechatComponent.factory(activity2, activity2.getResources().getString(R.string.WX_APP_ID), this.context.getResources().getString(R.string.WX_AppSecret)).shareMusic(str, str2, str3, str4, str5, str6);
}
int hashCode = str.hashCode();
if (hashCode == 2592) {
str8 = "QQ";
} else if (hashCode == 2545289) {
str8 = "SINA";
} else if (hashCode != 77564797) {
return;
} else {
str8 = "QZONE";
}
str.equals(str8);
}
@JavascriptInterface
public void shareVideo(String str, String str2, String str3, String str4, String str5, String str6) {
String str7;
if (TextUtils.isEmpty(str)) {
return;
}
if (!a.f(this.context).P) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
com.bslyun.app.e.a.f4268e = str6;
y.f4732c = str6;
if (str.contains("WEIXIN")) {
Activity activity2 = this.context;
WechatComponent.factory(activity2, activity2.getResources().getString(R.string.WX_APP_ID), this.context.getResources().getString(R.string.WX_AppSecret)).shareVideo(str, str2, str3, str4, str5);
}
int hashCode = str.hashCode();
if (hashCode == 2592) {
str7 = "QQ";
} else if (hashCode == 2545289) {
str7 = "SINA";
} else if (hashCode != 77564797) {
return;
} else {
str7 = "QZONE";
}
str.equals(str7);
}
@JavascriptInterface
public void showFullScreenVideoAd() {
if (a.f(this.context).e2) {
i0.a().post(new Runnable() {
@Override
public void run() {
CsjAdCommponent.showFullScreenVideoAd(Bridge.this.context);
}
});
} else {
m0.u0(this.context, "启用插屏广告失败");
}
}
@JavascriptInterface
public void showFullVoideoAd() {
if (a.f(this.context).e2) {
i0.a().post(new Runnable() {
@Override
public void run() {
CsjAdCommponent.showFullVoideoAd(Bridge.this.context);
}
});
} else {
m0.u0(this.context, "启用全屏视频广告失败");
}
}
@JavascriptInterface
public void showImages(String[] strArr, String[] strArr2, String str) {
int i;
if (strArr == null || strArr2 == null || strArr.length == 0 || strArr2.length == 0) {
return;
}
int i2 = 1;
if (!TextUtils.isEmpty(str)) {
try {
i = Integer.parseInt(str);
} catch (NumberFormatException e2) {
e2.printStackTrace();
i = 1;
}
if (i >= 0 && i <= 4) {
i2 = i;
}
}
EventBusMessage factory = EventBusMessage.Factory.factory("showImages");
factory.flage2 = Integer.valueOf(i2);
factory.setArgs(new ArrayList(Arrays.asList(strArr)));
factory.setObject(new ArrayList(Arrays.asList(strArr2)));
c.c().l(factory);
}
@JavascriptInterface
public void showRewardVideoAd() {
if (a.f(this.context).e2) {
i0.a().post(new Runnable() {
@Override
public void run() {
CsjAdCommponent.showRewardVideoAd(Bridge.this.context);
}
});
} else {
m0.u0(this.context, "启用激励视频广告失败");
}
}
@JavascriptInterface
public void startUnionPayPlugin(String str, String str2) {
if (a.f(this.context).e3) {
if (TextUtils.isEmpty(str)) {
m0.u0(this.context, "订单号不能为空");
return;
} else {
com.bslyun.app.e.a.f4268e = str2;
UPPayComponent.startUnionPayPlugin(this.context, str);
return;
}
}
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
}
@JavascriptInterface
public void stateBarTextColor(final String str) {
i0.a().post(new Runnable() {
@Override
public void run() {
if (!str.equals("0")) {
m0.r0(Bridge.this.context.getWindow(), true);
} else {
m0.r0(Bridge.this.context.getWindow(), false);
}
}
});
}
@JavascriptInterface
public void systemShareImg(String str) {
if (!TextUtils.isEmpty(str)) {
f.b(this.context, true, str, com.bslyun.app.e.a.f4264a, "shareImae.png", new f.d() {
@Override
public void getDownPath(final String str2) {
i0.a().post(new Runnable() {
@Override
public void run() {
if (TextUtils.isEmpty(str2)) {
m0.u0(Bridge.this.context, "图片地址有误,请重新尝试!");
} else {
e.u(Bridge.this.context, str2);
}
}
});
}
@Override
public void onDownPath(List<String> list) {
}
});
} else {
m0.u0(this.context, "分享的内容不能为空!");
}
}
@JavascriptInterface
public void systemShareImgs(String[] strArr) {
if (strArr != null && strArr.length >= 1) {
f.f(strArr, com.bslyun.app.e.a.f4264a, new f.d() {
@Override
public void getDownPath(String str) {
p.b(str);
}
@Override
public void onDownPath(final List<String> list) {
Bridge.this.webview.post(new Runnable() {
@Override
public void run() {
if (list.isEmpty()) {
m0.u0(Bridge.this.context, "图片下载失败");
} else {
e.v(Bridge.this.context, list);
}
}
});
}
});
} else {
m0.u0(this.context, "分享的内容不能为空!");
}
}
@JavascriptInterface
public void systemShareTxt(String str) {
if (!TextUtils.isEmpty(str)) {
e.w(this.context, str);
} else {
m0.u0(this.context, "分享的内容不能为空!");
}
}
@JavascriptInterface
public void tabbarColor(String str, String str2) {
if (TextUtils.isEmpty(str) || !str.startsWith("#") || str.length() > 7) {
return;
}
this.jsCallback.onTabBarColor(str, str2, true);
}
@JavascriptInterface
public void test() {
}
@JavascriptInterface
public void uniLogin(String str, String str2) {
if (str.equals("weixin")) {
str = "WEIXIN";
} else if (str.equals("qq")) {
str = "QQ";
}
final LoginItem loginItem = new LoginItem();
loginItem.platform = str;
loginItem.callbackMethod = str2;
loginItem.type = "uni";
i0.a().post(new Runnable() {
@Override
public void run() {
Bridge bridge = Bridge.this;
y.e(bridge.context, bridge.webview, loginItem);
}
});
}
@JavascriptInterface
public void uniPay(String str, String str2, String str3) {
if (str.equals("wxpay")) {
str = "WEIXIN";
}
y.f(this.context, this.webview, new PayModel(str, str2, "success"));
}
@JavascriptInterface
public void uniShare(String str, String str2) {
try {
JSONObject jSONObject = new JSONObject(str);
SHARE_MEDIA share_media = SHARE_MEDIA.WEIXIN;
String string = jSONObject.getString("provider");
if (string.equals("weixin")) {
String string2 = jSONObject.getString("scene");
if (!string2.equals("WXSceneSession")) {
if (string2.equals("WXSceneTimeline")) {
share_media = SHARE_MEDIA.WEIXIN_TIMELINE;
} else if (string2.equals("WXSceneFavorite")) {
m0.u0(this.context, "暂不支持分享到收藏");
}
}
} else if (string.equals("qq")) {
share_media = SHARE_MEDIA.QQ;
} else if (string.equals("sinaweibo")) {
string = "SINA";
share_media = SHARE_MEDIA.SINA;
}
String str3 = string;
SHARE_MEDIA share_media2 = share_media;
String string3 = jSONObject.getString("type");
if (string3.equals("0")) {
e.g(this.context).j(share_media2, jSONObject.getString("title"), jSONObject.getString("summary"), jSONObject.getString("href"), jSONObject.getString("imageUrl"), 0, str2);
return;
}
if (string3.equals("1")) {
e.g(this.context).j(share_media2, BuildConfig.FLAVOR, jSONObject.getString("summary"), BuildConfig.FLAVOR, null, 3, str2);
} else if (string3.equals("2")) {
shareImageByPlatform(str3, jSONObject.getString("imageUrl"), str2);
}
} catch (JSONException e2) {
e2.printStackTrace();
}
}
@JavascriptInterface
public void vibrator() {
EventBusMessage eventBusMessage = new EventBusMessage();
eventBusMessage.flag1 = "vibrator";
c.c().l(eventBusMessage);
}
@JavascriptInterface
public void wxPay(String str, String str2, String str3, String str4, String str5, String str6) {
if (!a.f(this.context).v0) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
} else {
if (!TextUtils.isEmpty(a.f(this.context).t1) && !TextUtils.isEmpty(a.f(this.context).u1) && !TextUtils.isEmpty(a.f(this.context).v1)) {
Activity activity2 = this.context;
WechatComponent wechatComponent = new WechatComponent(activity2, activity2.getResources().getString(R.string.WX_APP_ID), this.context.getResources().getString(R.string.WX_AppSecret));
MainActivity.jsCallbackMethod = str6;
wechatComponent.pay(a.f(this.context).t1, str, str2, str4, str3, a.f(this.context).u1, a.f(this.context).v1, str5);
return;
}
Toast.makeText(this.context, "您的微信支付配置不完整!", 0).show();
}
}
@JavascriptInterface
public void downloadFile(String str, String str2, String str3, String str4) {
if (!a.f(this.context).e1) {
Activity activity = this.context;
m0.u0(activity, activity.getString(R.string.not_turned_on));
return;
}
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str3) || !m0.X(str4)) {
return;
}
EventBusMessage factory = EventBusMessage.Factory.factory("download_file_path");
HashMap hashMap = new HashMap();
hashMap.put("data", str);
hashMap.put("path", str2);
hashMap.put("type", "2");
hashMap.put("callback", str3);
hashMap.put("selectOpen", str4);
factory.setMapData(hashMap);
c.c().l(factory);
}
}