Shandong video conference v3.2.10版本的 MD5 值为:e9e908f971313b4c4bca5737f96781ef
以下内容为反编译后的 WebBusinessActivity.java 源代码,内容仅作参考
package com.ainemo.android.activity.business.actions;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.log.L;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import android.os.RemoteException;
import android.utils.VersionUtil;
import android.utils.imagecache.ImageLoader;
import android.utils.j;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.JavascriptInterface;
import android.webkit.PermissionRequest;
import android.webkit.SslErrorHandler;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebStorage;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import cn.gov.sdongmeeting.video.R;
import com.ainemo.android.activity.BaseMobileActivity;
import com.ainemo.android.activity.MobileApplication;
import com.ainemo.android.activity.business.WebPageActivity;
import com.ainemo.android.activity.business.actions.WebBusinessActivity;
import com.ainemo.android.bean.DurationInfo;
import com.ainemo.android.bean.H5DataInfo;
import com.ainemo.android.business.CallRecord;
import com.ainemo.android.business.DatabaseAccessor;
import com.ainemo.android.business.H5PageManager;
import com.ainemo.android.business.MakeCallManager;
import com.ainemo.android.contact.activity.ContactSelectActivity;
import com.ainemo.android.contact.activity.ContactSelectedActivity;
import com.ainemo.android.data.ShareContent;
import com.ainemo.android.intent.IntentActions;
import com.ainemo.android.net.bean.ShareBean;
import com.ainemo.android.net.bean.UrlBean;
import com.ainemo.android.rest.model.AddMoreDataModel;
import com.ainemo.android.rest.model.CloudMeetingRoom;
import com.ainemo.android.rest.model.LoginResponse;
import com.ainemo.android.rest.model.UserInfoOFWebPage;
import com.ainemo.android.rest.model.WebRecentCallModel;
import com.ainemo.android.utils.AlertUtil;
import com.ainemo.android.utils.DateUtils;
import com.ainemo.android.utils.JsUtils;
import com.ainemo.android.utils.NemoAlertDialog;
import com.ainemo.android.utils.PermissionUtils;
import com.ainemo.android.utils.PinyinUtils;
import com.ainemo.android.view.dialog.ShareWebViewSelectDialog;
import com.ainemo.shared.call.CallConst;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.datepicker.a.a;
import com.datepicker.week.a;
import com.google.gson.Gson;
import com.huawei.updatesdk.sdk.service.storekit.bean.RequestBean;
import com.meeting.call.manager.j;
import com.umeng.analytics.pro.ai;
import com.xylink.common.widget.b.p;
import com.xylink.net.manager.UrlConstants;
import com.xylink.util.file.FileUtils;
import io.xylink.rtc.internal.model.RemoteType;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import okhttp3.Response;
import org.apache.http.HttpHeaders;
import retrofit2.HttpException;
public class WebBusinessActivity extends BaseMobileActivity {
public static final String COPY = "copy";
public static final String MAIL = "mail";
public static final String MESSAGE = "message";
public static final String MOMENTS = "moments";
private static final String PHOTO_FILE_NAME = "web_photo.jpg";
public static final int SELECT_CONTACT_CODE = 100;
public static final int SHARE_TO_CLIPBOARD = 3;
public static final int SHARE_TO_EMAIL = 1;
public static final int SHARE_TO_SMS = 2;
public static final int SHARE_TO_WEXIN = 0;
public static final String URL_TITLE = "ainemo-set://config?title=";
public static final int WEB_ACTION_TYPE_IMAGE_ADD = 2;
public static final int WEB_ACTION_TYPE_IMAGE_DOT_BLUE = 1;
public static final int WEB_ACTION_TYPE_IMAGE_DOT_WHITE = 3;
public static final int WEB_ACTION_TYPE_TEXT = 0;
public static final String WEB_BUSINESS_TITLE = "web_business_title";
public static final String WEB_BUSINESS_URL = "web_business_url";
public static final String WECHAT = "wechat";
private com.google.android.material.bottomsheet.a cameraGalleryDialog;
private CloudMeetingRoom cmr;
private com.datepicker.week.a dateTimeDialog;
private com.xylink.common.widget.b.p dialog;
private boolean displayUpgrade;
private com.datepicker.a.a durationDialog;
private String from;
private ImageView imageShare;
private boolean isAudioMute;
private boolean isNAPIControlSuccess;
private boolean isRedictUrl;
private boolean isVideoMute;
private boolean isWebUrlFail;
private String jsAction;
private String jsGoBack;
private LoginResponse loginResponse;
private Animation mAnimation;
private DatabaseAccessor mDBA;
private Gson mGson;
private d.a mProxy;
private ValueCallback<Uri[]> mUploadCallbackAboveL;
private String mergeId;
private View onErrorFrame;
private String params;
private ShareBean.ParamsBean paramsBean;
private ProgressBar progressBar;
private String selectContactCallback;
private int selectDay;
private int selectHour;
private int selectMinute;
private int selectMonth;
private int selectYear;
private String shareCallback;
private String shareCode;
private ShareBean.ShareDes shareDesBean;
private String shareDesc;
private String shareDescriptString;
private String shareImage;
private String shareThumbnailString;
private String shareTitle;
private String shareTitleString;
private String shareType;
private String shareTypeString;
private String shareUriString;
private String shareUrl;
private File tempFile;
private String title;
private RelativeLayout toobar;
private ImageView toolbarActionImage;
private TextView toolbarActionText;
private ImageView toolbarBack;
private TextView toolbarLeft;
private TextView toolbarShare;
private TextView toolbarTitle;
private UrlBean urlBean;
private long userId;
private String userName;
private View webAction;
private String webUrl;
private WebView webView;
private String TAG = "webBusinessActivity";
private Map<String, String> additionalHttpHeaders = new HashMap();
private UserInfoOFWebPage me = new UserInfoOFWebPage();
private ArrayList<WebRecentCallModel> recentCallJson = new ArrayList<>();
private Set<String> h5Callbacks = new HashSet();
private Handler mHandler = new Handler();
private int durationHour = 0;
private int durationMinute = 0;
private BroadcastReceiver webViewReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (IntentActions.Receiver.CALL_STATE_CHANGE.equals(action)) {
WebBusinessActivity.this.getRecentCallRecord();
} else if (CallConst.SHOW_PROMPT_DIALOG.equals(action)) {
e.h.b.f.m.a(WebBusinessActivity.this, intent.getExtras().getString("reason"));
}
}
};
public class DataModel {
private ArrayList<SelectEmailModel> mailGroup;
private ArrayList<SelectContactModel> userGroup;
public DataModel() {
}
public ArrayList<SelectEmailModel> getMail() {
return this.mailGroup;
}
public ArrayList<SelectContactModel> getUser() {
return this.userGroup;
}
public void setMail(ArrayList<SelectEmailModel> arrayList) {
this.mailGroup = arrayList;
}
public void setUser(ArrayList<SelectContactModel> arrayList) {
this.userGroup = arrayList;
}
}
public class JavaScriptInterface {
private FragmentActivity mActivity;
JavaScriptInterface(FragmentActivity fragmentActivity) {
this.mActivity = fragmentActivity;
}
private void lambda$setShare$4(String str, String str2) throws Throwable {
WebBusinessActivity.this.shareCallback = str;
WebBusinessActivity.this.imageShare.setVisibility(0);
}
public void a(int i2, String str, boolean z, String str2) throws Throwable {
if (i2 != 0 || !com.xylink.net.e.e.a(str)) {
WebBusinessActivity.this.webAction.setVisibility(0);
if (i2 == 0) {
WebBusinessActivity.this.toolbarActionImage.setVisibility(8);
WebBusinessActivity.this.toolbarActionText.setVisibility(0);
WebBusinessActivity.this.toolbarActionText.setText(str);
if (z) {
WebBusinessActivity.this.toolbarActionText.setTextColor(WebBusinessActivity.this.getResources().getColor(R.color.xylink_blue));
return;
} else {
WebBusinessActivity.this.toolbarActionText.setTextColor(WebBusinessActivity.this.getResources().getColor(R.color.text_color_FF393946));
return;
}
}
WebBusinessActivity.this.toolbarActionText.setVisibility(8);
WebBusinessActivity.this.toolbarActionImage.setVisibility(0);
if (i2 == 3) {
WebBusinessActivity.this.toolbarActionImage.setImageResource(R.drawable.action_more_image);
return;
} else if (i2 == 2) {
WebBusinessActivity.this.toolbarActionImage.setImageResource(R.drawable.image_add);
WebBusinessActivity.this.toolbarActionImage.setVisibility(8);
return;
} else {
WebBusinessActivity.this.toolbarActionImage.setImageResource(R.drawable.web_page_action_more_blue);
return;
}
}
WebBusinessActivity.this.toolbarActionText.setVisibility(8);
WebBusinessActivity.this.toolbarActionImage.setVisibility(8);
}
@JavascriptInterface
public void ainemoCall(String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "ainemo call, url: " + str);
String parseValueByKey = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_DEVICEID);
String parseValueByKey2 = WebBusinessActivity.this.parseValueByKey(str, "nemoNumber=");
String parseValueByKey3 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_CONF_NUMBER);
String parseValueByKey4 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_CONF_PASSWORD);
String parseValueByKey5 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_LIVING_NO);
String parseValueByKey6 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_LIVE_ID);
String parseValueByKey7 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_ACTION);
if (!io.xylink.rtc.a.a().isConnected()) {
AlertUtil.alertNoNetwork();
} else if (!parseValueByKey2.isEmpty()) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey2, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4);
} else if (!parseValueByKey.isEmpty()) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute);
} else if (!parseValueByKey3.isEmpty()) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey3, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4);
} else if (parseValueByKey5.isEmpty()) {
} else {
if (parseValueByKey7.equalsIgnoreCase("start")) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey5, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4, parseValueByKey6);
} else {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey5, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4, "");
}
}
}
public void b(String str) throws Throwable {
WebBusinessActivity.this.shareCallback = null;
WebBusinessActivity.this.imageShare.setVisibility(0);
}
public void c(String str) throws Throwable {
WebBusinessActivity.this.imageShare.setVisibility(0);
}
@JavascriptInterface
public void changeTitleColor(final String str, final boolean z) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "changeTitleColor color: " + str);
WebBusinessActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (z) {
WebBusinessActivity.this.toobar.startAnimation(WebBusinessActivity.this.mAnimation);
WebBusinessActivity.this.toobar.setBackgroundColor(Color.parseColor(str));
return;
}
WebBusinessActivity.this.toobar.setBackgroundColor(-1);
}
});
}
@JavascriptInterface
public void clearAction() {
L.i(WebBusinessActivity.this.TAG, "clear action");
io.reactivex.rxjava3.core.g0.o(ai.az).a(io.reactivex.v0.a.e.b.b()).i(new io.reactivex.v0.c.g() {
@Override
public final void accept(Object obj) {
WebBusinessActivity.JavaScriptInterface.this.a((String) obj);
}
});
}
@JavascriptInterface
public void clearShare() {
L.i(WebBusinessActivity.this.TAG, "clear share");
io.reactivex.rxjava3.core.g0.o(ai.az).a(io.reactivex.v0.a.e.b.b()).i(new io.reactivex.v0.c.g() {
@Override
public final void accept(Object obj) {
WebBusinessActivity.JavaScriptInterface.this.b((String) obj);
}
});
}
@JavascriptInterface
public void close() {
L.i(WebBusinessActivity.this.TAG, "close web view called");
WebBusinessActivity.this.finish();
}
@JavascriptInterface
public void createEnterprise(String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "createEnterprise: " + str);
com.ainemo.android.manager.e.a().a(WebBusinessActivity.this);
}
public void d(String str) throws Throwable {
WebBusinessActivity.this.title = str;
WebBusinessActivity.this.toolbarTitle.setText(str);
WebBusinessActivity.this.toolbarTitle.setVisibility(0);
}
@JavascriptInterface
public void downloadFile(String str) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
WebBusinessActivity.this.startActivity(intent);
}
@JavascriptInterface
public void forward(String str, String str2, boolean z) {
L.i(WebBusinessActivity.this.TAG, "forward url is " + str + "isAbsolute: " + z);
if (!z) {
str = H5PageManager.getInstance().getH5PageUrlHeader() + str;
}
Intent intent = new Intent(this.mActivity, WebBusinessActivity.class);
intent.putExtra(WebBusinessActivity.WEB_BUSINESS_URL, str);
intent.putExtra("web_business_title", str2);
WebBusinessActivity.this.startActivity(intent);
WebBusinessActivity.this.finish();
}
@JavascriptInterface
public String getCacheData(String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "getCacheData key: " + str);
return com.ainemo.android.preferences.k.b().a(str);
}
@JavascriptInterface
public String getRecentCall() {
L.i(WebBusinessActivity.this.TAG, "js getRecentCall called");
String recentCallJson = WebBusinessActivity.this.getRecentCallJson();
String str = WebBusinessActivity.this.TAG;
L.i(str, "js getRecentCall end, json= " + recentCallJson);
return recentCallJson;
}
@JavascriptInterface
public String getUserProfile() {
String str = WebBusinessActivity.this.TAG;
L.i(str, "get user profile called, profile: " + e.a.b.b.a(WebBusinessActivity.this.me));
return e.a.b.b.a(WebBusinessActivity.this.me);
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2) {
WebBusinessActivity.this.makeCallWithCheckPermission(str, z, z2, false, null, null, null);
}
@JavascriptInterface
public void openTerminalSelect(String str, String str2, String str3) {
String str4 = WebBusinessActivity.this.TAG;
L.i(str4, "select contact, json data: " + str + " , callback: " + str2 + " title: " + str3);
WebBusinessActivity.this.selectTerminalContact(str, str2, str3);
}
@JavascriptInterface
public void redirect(String str, String str2, boolean z) {
L.i(WebBusinessActivity.this.TAG, "redirect url is " + str);
L.i(WebBusinessActivity.this.TAG, "redirect h5 page, url=" + str + ", title=" + str2 + ", is absolute: " + z);
if (!z) {
str = H5PageManager.getInstance().getH5PageUrlHeader() + str;
}
L.i(WebBusinessActivity.this.TAG, "redirect url:" + str);
if (str.contains("live/v")) {
Intent intent = new Intent(this.mActivity, WebPageActivity.class);
intent.putExtra(WebPageActivity.KEY_URL, str);
intent.putExtra(WebPageActivity.ENABLE_HARDWARE_ACCELERATED, true);
intent.putExtra(WebPageActivity.APPEND_ADDITIONAL, false);
WebBusinessActivity.this.startActivity(intent);
return;
}
Intent intent2 = new Intent(this.mActivity, WebBusinessActivity.class);
intent2.putExtra(WebBusinessActivity.WEB_BUSINESS_URL, str);
intent2.putExtra("web_business_title", str2);
WebBusinessActivity.this.startActivity(intent2);
}
@JavascriptInterface
public void selectContact(String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "select contact, callback=" + str);
WebBusinessActivity.this.selectContact(str);
}
@JavascriptInterface
public void selectTime(final long j2, final String str) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(j2);
WebBusinessActivity.this.selectYear = calendar.get(1);
WebBusinessActivity.this.selectMonth = calendar.get(2) + 1;
WebBusinessActivity.this.selectDay = calendar.get(5);
WebBusinessActivity.this.selectHour = calendar.get(11);
WebBusinessActivity.this.selectMinute = calendar.get(12);
WebBusinessActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebBusinessActivity.JavaScriptInterface.this.a(j2, str);
}
});
}
@JavascriptInterface
public void selectTimeLong(String str, final String str2) {
final DurationInfo durationInfo = (DurationInfo) WebBusinessActivity.this.mGson.fromJson(str, (Class<Object>) DurationInfo.class);
WebBusinessActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebBusinessActivity.JavaScriptInterface.this.a(durationInfo, str2);
}
});
}
@JavascriptInterface
public void setAction(final String str, final boolean z, String str2, final int i2) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "set action called, " + str + UrlConstants.h.a + z + UrlConstants.h.a + str2 + " type=" + i2);
WebBusinessActivity.this.jsAction = str2;
io.reactivex.rxjava3.core.g0.o(str).a(io.reactivex.v0.a.e.b.b()).i(new io.reactivex.v0.c.g() {
@Override
public final void accept(Object obj) {
WebBusinessActivity.JavaScriptInterface.this.a(i2, str, z, (String) obj);
}
});
}
@JavascriptInterface
public void setCacheData(String str, String str2) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "setCacheData key: " + str + ",value: " + str2);
com.ainemo.android.preferences.k.b().a(str, str2);
}
@JavascriptInterface
public void setCloseCallback(String str, final String str2) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "set close call back, function is " + str);
WebBusinessActivity.this.jsGoBack = str;
WebBusinessActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (!com.xylink.net.e.e.c(str2) || str2.equals("undefined")) {
WebBusinessActivity.this.toolbarBack.setVisibility(0);
WebBusinessActivity.this.toolbarLeft.setVisibility(8);
} else if (str2.equals("close")) {
WebBusinessActivity.this.toolbarBack.setVisibility(0);
WebBusinessActivity.this.toolbarLeft.setVisibility(8);
WebBusinessActivity.this.toolbarBack.setImageResource(R.drawable.scan_login_close_image);
} else {
WebBusinessActivity.this.toolbarBack.setVisibility(8);
WebBusinessActivity.this.toolbarLeft.setVisibility(0);
WebBusinessActivity.this.toolbarLeft.setText(str2);
}
}
});
}
@JavascriptInterface
public void setMessageCallback(String[] strArr) {
StringBuffer stringBuffer = new StringBuffer("js setMessageCallback called, callbacks=");
for (int i2 = 0; i2 < strArr.length; i2++) {
stringBuffer.append(strArr[i2] + ",");
WebBusinessActivity.this.h5Callbacks.add(strArr[i2]);
}
L.i(WebBusinessActivity.this.TAG, stringBuffer.toString());
}
@JavascriptInterface
public void setShare(String[] strArr, String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, " shareDesc=" + strArr.length + " ,callback=" + str);
WebBusinessActivity.this.shareCallback = str;
io.reactivex.rxjava3.core.g0.o(str).a(io.reactivex.v0.a.e.b.b()).i(new io.reactivex.v0.c.g() {
@Override
public final void accept(Object obj) {
WebBusinessActivity.JavaScriptInterface.this.c((String) obj);
}
});
}
@JavascriptInterface
public void setTitle(String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "set title, title " + str);
io.reactivex.rxjava3.core.g0.o(str).a(io.reactivex.v0.a.e.b.b()).b(io.reactivex.v0.g.b.b()).i(new io.reactivex.v0.c.g() {
@Override
public final void accept(Object obj) {
WebBusinessActivity.JavaScriptInterface.this.d((String) obj);
}
});
}
@JavascriptInterface
public void share(String str, String str2, String str3, String str4, int i2) {
String str5 = WebBusinessActivity.this.TAG;
L.i(str5, "share called, url=" + str + ", title=" + str2 + ", image=" + str3 + ", desc=" + str4 + ", destination" + i2);
}
@JavascriptInterface
public void shareToClipboard(String str, final String str2) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "share to clipboard, content: " + str);
com.ainemo.android.p.d.a(WebBusinessActivity.this, str);
io.reactivex.rxjava3.core.g0.o(str).a(io.reactivex.v0.a.e.b.b()).i(new io.reactivex.v0.c.g() {
@Override
public final void accept(Object obj) {
WebBusinessActivity.JavaScriptInterface.this.a(str2, (String) obj);
}
});
}
@JavascriptInterface
public void shareToDingding(String str, String str2, String str3, String str4) {
String str5 = WebBusinessActivity.this.TAG;
L.i(str5, "shareToDingding, url: " + str + ", titlej:" + str2 + ", desc:" + str3 + ", " + str4);
ShareContent shareContent = (ShareContent) e.a.b.b.a(str3, (Class<Object>) ShareContent.class);
if (shareContent != null) {
com.ainemo.android.p.d.a(str, str2, WebBusinessActivity.this.getString(R.string.cmr_share_time, new Object[]{shareContent.getStartTime()}) + "\n" + WebBusinessActivity.this.getString(R.string.theme) + ":" + WebBusinessActivity.this.getString(R.string.themevalue, new Object[]{shareContent.getTopic()}), str4);
}
}
@JavascriptInterface
public void shareToEmail(String str, String str2) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "share to email, title: " + str + ", content: " + str2);
com.ainemo.android.p.d.a(WebBusinessActivity.this, "", str, str2);
}
@JavascriptInterface
public void shareToEnterpriseWeixin(String str, String str2, String str3, String str4) {
String str5 = WebBusinessActivity.this.TAG;
L.i(str5, "shareToEnterpriseWeixin, url: " + str + ", titlej:" + str2 + ", desc:" + str3 + ", " + str4);
ShareContent shareContent = (ShareContent) e.a.b.b.a(str3, (Class<Object>) ShareContent.class);
String str6 = WebBusinessActivity.this.TAG;
StringBuilder sb = new StringBuilder();
sb.append("shareToEnterpriseWeixin, shareContent: ");
sb.append(shareContent);
L.i(str6, sb.toString());
if (shareContent != null) {
com.ainemo.android.p.d.b(WebBusinessActivity.this, WebBusinessActivity.this.getString(R.string.cmr_share_time, new Object[]{shareContent.getStartTime()}) + "\n" + WebBusinessActivity.this.getString(R.string.theme) + ":" + WebBusinessActivity.this.getString(R.string.themevalue, new Object[]{shareContent.getTopic()}), str);
}
}
@JavascriptInterface
public void shareToMoments(final String str, final String str2, final String str3, String str4) {
if (android.utils.d.c(str4)) {
String str5 = WebBusinessActivity.this.TAG;
L.i(str5, "no image ,use default, url : " + str);
if (!com.xylink.net.e.e.a(WebBusinessActivity.this.jsAction) && WebBusinessActivity.this.jsAction.equals("nativeHandleMeetingManage")) {
String a = com.ainemo.android.p.d.a(str);
String str6 = WebBusinessActivity.this.TAG;
L.i(str6, "shareToWeixin shareCode=" + a);
ShareContent shareContent = (ShareContent) e.a.b.b.a(str3, (Class<Object>) ShareContent.class);
if (shareContent != null) {
if (!com.ainemo.android.b.f5988k.equals(com.xylink.net.e.c.f()) && !com.xylink.net.e.c.n.equals(com.xylink.net.e.c.f())) {
WebBusinessActivity webBusinessActivity = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity, R.drawable.ic_weixin_share, false, str, webBusinessActivity.getString(R.string.app_name), WebBusinessActivity.this.getString(R.string.click_join_meeting));
return;
}
WebBusinessActivity webBusinessActivity2 = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity2, webBusinessActivity2.getString(R.string.click_join_meeting), str3, R.drawable.min_app_bg, shareContent.getTopic(), shareContent.getStartTime(), shareContent.getEndTime(), shareContent.getConferenceNumber(), a, WebBusinessActivity.this.userName, WebBusinessActivity.this.userId, str);
return;
}
return;
}
com.ainemo.android.p.d.a(WebBusinessActivity.this, R.drawable.ic_weixin_share, true, str, str2, str3);
return;
}
try {
try {
ImageLoader.b().a(str4, new com.bumptech.glide.request.f<Bitmap>() {
@Override
public boolean onLoadFailed(@androidx.annotation.h0 GlideException glideException, Object obj, com.bumptech.glide.request.j.p<Bitmap> pVar, boolean z) {
String str7 = WebBusinessActivity.this.TAG;
L.i(str7, "load image file failure:" + glideException.getMessage());
if (!com.xylink.net.e.e.a(WebBusinessActivity.this.jsAction) && WebBusinessActivity.this.jsAction.equals("nativeHandleMeetingManage")) {
String a2 = com.ainemo.android.p.d.a(str);
String str8 = WebBusinessActivity.this.TAG;
L.i(str8, "shareToWeixin shareCode=" + a2);
ShareContent shareContent2 = (ShareContent) e.a.b.b.a(str3, (Class<Object>) ShareContent.class);
if (shareContent2 != null) {
if (!com.ainemo.android.b.f5988k.equals(com.xylink.net.e.c.f()) && !com.xylink.net.e.c.n.equals(com.xylink.net.e.c.f())) {
WebBusinessActivity webBusinessActivity3 = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity3, R.drawable.ic_weixin_share, false, str, webBusinessActivity3.getString(R.string.app_name), WebBusinessActivity.this.getString(R.string.click_join_meeting));
return false;
}
WebBusinessActivity webBusinessActivity4 = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity4, webBusinessActivity4.getString(R.string.click_join_meeting), str3, R.drawable.min_app_bg, shareContent2.getTopic(), shareContent2.getStartTime(), shareContent2.getEndTime(), shareContent2.getConferenceNumber(), a2, WebBusinessActivity.this.userName, WebBusinessActivity.this.userId, str);
return false;
}
return false;
}
com.ainemo.android.p.d.a(WebBusinessActivity.this, R.drawable.ic_weixin_share, true, str, str2, str3);
return false;
}
@Override
public boolean onResourceReady(Bitmap bitmap, Object obj, com.bumptech.glide.request.j.p<Bitmap> pVar, DataSource dataSource, boolean z) {
L.i(WebBusinessActivity.this.TAG, "load image file success !!!");
if (!com.xylink.net.e.e.a(WebBusinessActivity.this.jsAction) && WebBusinessActivity.this.jsAction.equals("nativeHandleMeetingManage")) {
String a2 = com.ainemo.android.p.d.a(str);
String str7 = WebBusinessActivity.this.TAG;
L.i(str7, "shareToWeixin shareCode=" + a2);
ShareContent shareContent2 = (ShareContent) e.a.b.b.a(str3, (Class<Object>) ShareContent.class);
if (shareContent2 != null) {
if (!com.ainemo.android.b.f5988k.equals(com.xylink.net.e.c.f()) && !com.xylink.net.e.c.n.equals(com.xylink.net.e.c.f())) {
WebBusinessActivity webBusinessActivity3 = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity3, R.drawable.ic_weixin_share, false, str, webBusinessActivity3.getString(R.string.app_name), WebBusinessActivity.this.getString(R.string.click_join_meeting));
return false;
}
WebBusinessActivity webBusinessActivity4 = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity4, webBusinessActivity4.getString(R.string.click_join_meeting), str3, R.drawable.min_app_bg, shareContent2.getTopic(), shareContent2.getStartTime(), shareContent2.getEndTime(), shareContent2.getConferenceNumber(), a2, WebBusinessActivity.this.userName, WebBusinessActivity.this.userId, str);
return false;
}
return false;
}
com.ainemo.android.p.d.a((Context) WebBusinessActivity.this, (int) R.drawable.ic_weixin_share, bitmap, true, str, str2, str3);
return false;
}
});
} catch (Exception e2) {
e = e2;
L.e(WebBusinessActivity.this.TAG, "catch exception, share to wechat by default image");
if (!com.xylink.net.e.e.a(WebBusinessActivity.this.jsAction) && WebBusinessActivity.this.jsAction.equals("nativeHandleMeetingManage")) {
String a2 = com.ainemo.android.p.d.a(str);
String str7 = WebBusinessActivity.this.TAG;
L.i(str7, "shareToWeixin shareCode=" + a2);
ShareContent shareContent2 = (ShareContent) e.a.b.b.a(str3, (Class<Object>) ShareContent.class);
if (shareContent2 != null) {
if (!com.ainemo.android.b.f5988k.equals(com.xylink.net.e.c.f()) && !com.xylink.net.e.c.n.equals(com.xylink.net.e.c.f())) {
WebBusinessActivity webBusinessActivity3 = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity3, R.drawable.ic_weixin_share, false, str, webBusinessActivity3.getString(R.string.app_name), WebBusinessActivity.this.getString(R.string.click_join_meeting));
} else {
com.ainemo.android.p.d.a(WebBusinessActivity.this, str2, str3, R.drawable.min_app_bg, shareContent2.getTopic(), shareContent2.getStartTime(), shareContent2.getEndTime(), shareContent2.getConferenceNumber(), a2, WebBusinessActivity.this.userName, WebBusinessActivity.this.userId, str);
}
}
} else {
com.ainemo.android.p.d.a(WebBusinessActivity.this, R.drawable.ic_weixin_share, true, str, str2, str3);
}
e.printStackTrace();
}
} catch (Exception e3) {
e = e3;
}
}
@JavascriptInterface
public void shareToSMS(String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "share to sms, content: " + str);
com.ainemo.android.p.d.a(WebBusinessActivity.this, "", str);
}
@JavascriptInterface
@androidx.annotation.l0(api = 21)
public void shareToWeChat(String str) {
WebBusinessActivity.this.shareWx(str, false);
}
@JavascriptInterface
public void webLog(String str, String str2) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "web log called, message=" + str2);
L.i(str, str2);
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2, boolean z3) {
WebBusinessActivity.this.makeCallWithCheckPermission(str, z, z2, z3, null, null, null);
}
@JavascriptInterface
public void makeCall(String str, boolean z) {
WebBusinessActivity.this.makeCallWithCheckPermission(str, z, false, false, null, null, null);
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2, boolean z3, String str2) {
WebBusinessActivity.this.makeCallWithCheckPermission(str, z, z2, z3, str2, null, null);
}
@JavascriptInterface
public void setCloseCallback(String str) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "set close call back, function is " + str);
WebBusinessActivity.this.jsGoBack = str;
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2, boolean z3, String str2, String str3, String str4) {
WebBusinessActivity.this.makeCallWithCheckPermission(str, z, z2, z3, str2, str3, str4);
}
@JavascriptInterface
public void setShare(String str) {
L.i(WebBusinessActivity.this.TAG, "custom app, ban share option");
}
public void a(String str) throws Throwable {
WebBusinessActivity.this.jsAction = null;
WebBusinessActivity.this.webAction.setVisibility(8);
WebBusinessActivity.this.toolbarActionImage.setVisibility(8);
WebBusinessActivity.this.toolbarActionText.setVisibility(8);
}
public void a(String str, String str2) throws Throwable {
com.xylink.common.widget.c.b.a(WebBusinessActivity.this, str);
}
public void a(long j2, String str) {
WebBusinessActivity.this.hideDurationPickerDialog();
WebBusinessActivity.this.showDateTimePickerDialog(j2, str);
}
public void a(DurationInfo durationInfo, String str) {
WebBusinessActivity.this.hideDateTimePickerDialog();
WebBusinessActivity.this.showDurationPickerDialog(durationInfo, str);
}
}
public class SelectContactModel {
private int deviceType;
private String id;
private String name;
private int originDeviceType;
private String phone;
private String pictureUrl;
private int type;
public SelectContactModel(AddMoreDataModel addMoreDataModel) {
int deviceType = addMoreDataModel.getDeviceType();
this.deviceType = deviceType;
this.id = ((deviceType == RemoteType.H323.getValue() || this.deviceType == RemoteType.BRUCE.getValue()) && !com.xylink.net.e.e.a(addMoreDataModel.getDialNumber())) ? addMoreDataModel.getDialNumber() : String.valueOf(addMoreDataModel.getDeviceId());
this.name = addMoreDataModel.getDisplayName();
this.originDeviceType = addMoreDataModel.getOriginDeviceType();
this.type = (this.deviceType == RemoteType.SOFT.getValue() || this.deviceType == RemoteType.DESK.getValue()) ? 1 : 2;
this.pictureUrl = addMoreDataModel.getPictureUrl();
this.phone = addMoreDataModel.getDialNumber();
}
public AddMoreDataModel convert2AddMoreDataModel() {
AddMoreDataModel addMoreDataModel = new AddMoreDataModel();
addMoreDataModel.setDeviceType(this.deviceType);
addMoreDataModel.setDeviceId(android.utils.d.a((Object) this.id, -1L));
addMoreDataModel.setDialNumber(this.phone);
addMoreDataModel.setDisplayName(this.name);
addMoreDataModel.setOriginDeviceType(this.originDeviceType);
addMoreDataModel.setPictureUrl(this.pictureUrl);
return addMoreDataModel;
}
public String getId() {
return this.id;
}
public String getPictureUrl() {
return this.pictureUrl;
}
public void setId(String str) {
this.id = str;
}
public void setPictureUrl(String str) {
this.pictureUrl = str;
}
}
public class SelectEmailModel {
String email;
public SelectEmailModel(String str) {
this.email = str;
}
public String getEmail() {
return this.email;
}
}
private void callJsCallback(String str, Object obj) {
String str2 = this.TAG;
L.i(str2, "executeJsCallback=" + str + ", param=" + obj);
if (this.webView == null) {
L.e(this.TAG, "receive event but web view is null ?");
return;
}
HashMap hashMap = new HashMap();
hashMap.put("name", str);
hashMap.put("data", obj);
String a = e.a.b.b.a(hashMap);
String str3 = this.TAG;
L.i(str3, "ready to exceute callJsCallback , message=" + a);
WebView webView = this.webView;
webView.loadUrl("Javascript:messageHandler('" + a + "')");
}
private void cancelFilePathCallback() {
ValueCallback<Uri[]> valueCallback = this.mUploadCallbackAboveL;
if (valueCallback != null) {
valueCallback.onReceiveValue(null);
this.mUploadCallbackAboveL = null;
}
}
public static void clearCookies(Context context) {
CookieSyncManager.createInstance(context);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
cookieManager.removeSessionCookie();
cookieManager.removeAllCookie();
if (Build.VERSION.SDK_INT >= 22) {
cookieManager.removeAllCookies(null);
CookieManager.getInstance().flush();
} else {
cookieManager.removeAllCookie();
CookieSyncManager.getInstance().sync();
}
WebStorage.getInstance().deleteAllData();
}
public void deleteProfilePicture(String str) {
File file = new File(str);
if (file.exists()) {
file.delete();
}
}
public void executeJsCallback(String str, String str2) {
if (str2 != null) {
WebView webView = this.webView;
webView.loadUrl("Javascript:" + str + "('" + str2 + "')");
return;
}
WebView webView2 = this.webView;
webView2.loadUrl("Javascript:" + str + "()");
}
private void fromCamera() {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra("android.intent.extras.CAMERA_FACING", 1);
intent.putExtra("autofocus", true);
intent.putExtra("fullScreen", false);
intent.putExtra("showActionIcons", false);
File file = new File(getExternalFilesDir(j.c.X), PHOTO_FILE_NAME);
this.tempFile = file;
if (file.exists()) {
L.i("delete temp file");
this.tempFile.delete();
}
try {
this.tempFile.createNewFile();
} catch (IOException e2) {
e2.printStackTrace();
}
if (Build.VERSION.SDK_INT >= 24) {
intent.setFlags(1);
intent.putExtra("output", FileUtils.getFileUri(this, this.tempFile));
} else {
intent.putExtra("output", FileUtils.getFileUri(this, this.tempFile));
}
startActivityForResult(intent, 1001);
}
private void fromGallery() {
Intent intent = new Intent("android.intent.action.PICK");
intent.setType(com.xylink.util.file.a.f15522c);
startActivityForResult(intent, 1002);
}
public String getParamterValueFromURL(String str, String str2) {
String[] split;
if (!str.contains("?") || (split = str.substring(str.indexOf("?") + 1).split(WebPageActivity.URL_CONTENT_WEBVIEW_SPLISH)) == null) {
return "";
}
for (int i2 = 0; i2 < split.length; i2++) {
if (split[i2].contains(str2)) {
return android.utils.d.a(split[i2].substring(str2.length() + 1), "");
}
}
return "";
}
public String getRecentCallJson() {
return e.a.b.b.a(this.recentCallJson);
}
public void hideDateTimePickerDialog() {
com.datepicker.week.a aVar = this.dateTimeDialog;
if (aVar == null || !aVar.isVisible()) {
return;
}
this.dateTimeDialog.dismissAllowingStateLoss();
}
public void hideDurationPickerDialog() {
com.datepicker.a.a aVar = this.durationDialog;
if (aVar == null || !aVar.isVisible()) {
return;
}
this.durationDialog.dismissAllowingStateLoss();
}
private void initCameraGalleryDialog() {
com.google.android.material.bottomsheet.a aVar = new com.google.android.material.bottomsheet.a(this, R.style.BottomSheetTransparentDialog);
this.cameraGalleryDialog = aVar;
aVar.setCanceledOnTouchOutside(true);
View inflate = View.inflate(this, R.layout.dialog_select_user_head_item, null);
this.cameraGalleryDialog.setContentView(inflate);
inflate.findViewById(R.id.tv_camera).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebBusinessActivity.this.a(view);
}
});
inflate.findViewById(R.id.tv_gallery).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebBusinessActivity.this.b(view);
}
});
inflate.findViewById(R.id.tv_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebBusinessActivity.this.c(view);
}
});
this.cameraGalleryDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
WebBusinessActivity.this.a(dialogInterface);
}
});
}
private void initView() {
this.webUrl = getIntent().getStringExtra(WEB_BUSINESS_URL);
this.title = getIntent().getStringExtra("web_business_title");
this.toobar = (RelativeLayout) findViewById(R.id.toolbar);
TextView textView = (TextView) findViewById(R.id.web_title);
this.toolbarTitle = textView;
if (this.title != null) {
textView.setVisibility(0);
this.toolbarTitle.setText(this.title);
}
this.toolbarActionImage = (ImageView) findViewById(R.id.web_action_image);
this.toolbarActionText = (TextView) findViewById(R.id.web_action_text);
this.toolbarShare = (TextView) findViewById(R.id.web_share);
this.imageShare = (ImageView) findViewById(R.id.image_share);
this.toolbarBack = (ImageView) findViewById(R.id.web_cancel);
this.toolbarLeft = (TextView) findViewById(R.id.tv_web_left);
UrlBean D = com.ainemo.android.preferences.p.K().D();
this.urlBean = D;
if (D != null) {
this.me.setAppResourcePayUrl(D.getAppResourcePayUrl());
}
this.imageShare.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
WebBusinessActivity webBusinessActivity = WebBusinessActivity.this;
webBusinessActivity.executeJsCallback(webBusinessActivity.shareCallback, null);
}
});
this.onErrorFrame = findViewById(R.id.load_error_page);
findViewById(R.id.reload_web_page).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebBusinessActivity.this.d(view);
}
});
ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar);
this.progressBar = progressBar;
progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.progress_bar_bg));
this.toolbarBack.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebBusinessActivity.this.e(view);
}
});
this.toolbarLeft.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebBusinessActivity.this.f(view);
}
});
View findViewById = findViewById(R.id.web_action_container);
this.webAction = findViewById;
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebBusinessActivity.this.g(view);
}
});
WebView webView = (WebView) findViewById(R.id.web_view);
this.webView = webView;
webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onPermissionRequest(PermissionRequest permissionRequest) {
permissionRequest.grant(permissionRequest.getResources());
}
@Override
public void onProgressChanged(WebView webView2, int i2) {
if (i2 == 100) {
WebBusinessActivity.this.progressBar.setVisibility(8);
} else if (8 == WebBusinessActivity.this.progressBar.getVisibility()) {
WebBusinessActivity.this.progressBar.setVisibility(0);
}
WebBusinessActivity.this.progressBar.setProgress(i2);
super.onProgressChanged(webView2, i2);
}
@Override
public boolean onShowFileChooser(WebView webView2, ValueCallback<Uri[]> valueCallback, WebChromeClient.FileChooserParams fileChooserParams) {
WebBusinessActivity.this.mUploadCallbackAboveL = valueCallback;
if (WebBusinessActivity.this.cameraGalleryDialog != null) {
WebBusinessActivity.this.cameraGalleryDialog.show();
return true;
}
return true;
}
});
if (!this.webUrl.contains("qq.com")) {
this.webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView webView2, String str) {
super.onPageFinished(webView2, str);
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "on load finished : " + str);
if (WebBusinessActivity.this.isWebUrlFail) {
return;
}
WebBusinessActivity.this.onErrorFrame.setVisibility(8);
WebBusinessActivity.this.webView.setVisibility(0);
}
@Override
public void onPageStarted(WebView webView2, String str, Bitmap bitmap) {
super.onPageStarted(webView2, str, bitmap);
WebBusinessActivity.this.isNAPIControlSuccess = false;
WebBusinessActivity.this.isWebUrlFail = false;
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "on load started : " + str);
}
@Override
public void onReceivedError(WebView webView2, int i2, String str, String str2) {
super.onReceivedError(webView2, i2, str, str2);
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "on receive error, error code : " + i2 + ", description: " + str + " failing url: " + str2);
WebBusinessActivity.this.isWebUrlFail = true;
if (str2.equals(WebBusinessActivity.this.webUrl)) {
WebBusinessActivity.this.onErrorFrame.setVisibility(0);
WebBusinessActivity.this.webView.setVisibility(8);
}
}
@Override
public void onReceivedHttpError(WebView webView2, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
super.onReceivedHttpError(webView2, webResourceRequest, webResourceResponse);
if (Build.VERSION.SDK_INT >= 21) {
String str = WebBusinessActivity.this.TAG;
L.i(str, "receive http error, request: " + webResourceRequest.getUrl());
String str2 = WebBusinessActivity.this.TAG;
L.e(str2, "response: " + webResourceResponse.getStatusCode() + " reason: " + webResourceResponse.getReasonPhrase());
}
}
@Override
public void onReceivedSslError(WebView webView2, SslErrorHandler sslErrorHandler, SslError sslError) {
sslErrorHandler.proceed();
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView2, String str) {
L.i(WebBusinessActivity.this.TAG, "shouldOverrideUrlLoading : " + str);
if (str != null && str.toLowerCase().startsWith(WebPageActivity.KEY_EVENT_STRING_CALL)) {
String parseValueByKey = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_DEVICEID);
String parseValueByKey2 = WebBusinessActivity.this.parseValueByKey(str, "nemoNumber=");
String parseValueByKey3 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_CONF_NUMBER);
String parseValueByKey4 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_CONF_PASSWORD);
String parseValueByKey5 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_LIVING_NO);
String parseValueByKey6 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_LIVE_ID);
String parseValueByKey7 = WebBusinessActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_ACTION);
if (!io.xylink.rtc.a.a().isConnected()) {
AlertUtil.alertNoNetwork();
return true;
} else if (!parseValueByKey2.isEmpty()) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey2, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4);
} else if (!parseValueByKey.isEmpty()) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, null);
} else if (!parseValueByKey3.isEmpty()) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey3, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4);
} else if (!parseValueByKey5.isEmpty()) {
if (parseValueByKey7.equalsIgnoreCase("start")) {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey5, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4, parseValueByKey6);
} else {
new MakeCallManager(WebBusinessActivity.this).callWithSettings(parseValueByKey5, WebBusinessActivity.this.isAudioMute, WebBusinessActivity.this.isVideoMute, parseValueByKey4, "");
}
}
} else if (str != null && str.toLowerCase().startsWith(WebPageActivity.KEY_EVENT_STRING_SHARE)) {
final String paramterValueFromURL = WebBusinessActivity.this.getParamterValueFromURL(str, "shareTitle");
final String paramterValueFromURL2 = WebBusinessActivity.this.getParamterValueFromURL(str, "shareDescription");
final String paramterValueFromURL3 = WebBusinessActivity.this.getParamterValueFromURL(str, "shareUrl");
final String paramterValueFromURL4 = WebBusinessActivity.this.getParamterValueFromURL(str, "shareThumbnail");
L.i(WebBusinessActivity.this.TAG, "share url: " + paramterValueFromURL3);
L.i(WebBusinessActivity.this.TAG, "share thumbnail: " + paramterValueFromURL4);
L.i(WebBusinessActivity.this.TAG, "share description: " + paramterValueFromURL2);
L.i(WebBusinessActivity.this.TAG, "share title: " + paramterValueFromURL);
try {
final String str2 = WebPageActivity.SHARE_THUMBNAIL_INPAGE_FILE + ".tmp";
URL url = new URL(paramterValueFromURL4);
com.xylink.net.manager.e.b().a(url.toString(), str2).b(io.reactivex.v0.g.b.b()).a(io.reactivex.v0.a.e.b.b()).subscribe(new com.xylink.net.d.b<Response>(url.toString()) {
@Override
public void onException(Throwable th) {
WebBusinessActivity.this.deleteProfilePicture(str2);
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "on exception, exception is " + th.toString());
th.printStackTrace();
}
@Override
public void onHttpError(HttpException httpException, String str3, boolean z) {
super.onHttpError(httpException, str3, z);
WebBusinessActivity.this.deleteProfilePicture(str2);
String str4 = WebBusinessActivity.this.TAG;
L.i(str4, "on exception, exception is " + httpException.toString());
httpException.printStackTrace();
}
@Override
public void onNext(Response response, boolean z) {
if (response.isSuccessful()) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "succeed to download inpage share picture " + paramterValueFromURL4);
WebBusinessActivity.this.renameProfilePicture(str2, WebPageActivity.SHARE_THUMBNAIL_INPAGE_FILE);
WebBusinessActivity.this.onSelectShareWebview(paramterValueFromURL, paramterValueFromURL2, paramterValueFromURL3, paramterValueFromURL4, WebPageActivity.SHARE_THUMBNAIL_INPAGE_FILE);
return;
}
String str4 = WebBusinessActivity.this.TAG;
L.i(str4, "failed to download share inpage picture " + paramterValueFromURL4);
}
});
} catch (Exception e2) {
e2.printStackTrace();
}
} else if (str != null && (str.indexOf(QrCodeCaptureActivity.LIVE_VOTE_URL) >= 0 || str.indexOf(QrCodeCaptureActivity.LIVE_PRE_VOTE_URL) >= 0 || str.indexOf(QrCodeCaptureActivity.LIVE_EDU_VOTE_URL) >= 0 || str.indexOf(QrCodeCaptureActivity.VOTE_URL) >= 0)) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(str);
stringBuffer.append("&h=" + com.xylink.net.manager.g.H());
StringBuilder sb = new StringBuilder();
sb.append("&uid=");
sb.append(WebBusinessActivity.this.mDBA.getLoginUser() != null ? Long.valueOf(WebBusinessActivity.this.mDBA.getLoginUser().getId()) : "");
stringBuffer.append(sb.toString());
stringBuffer.append("&sk=" + com.xylink.net.manager.f.D());
StringBuilder sb2 = new StringBuilder();
sb2.append("&deviceId=");
sb2.append(WebBusinessActivity.this.mDBA.getLoginDevice() != null ? Long.valueOf(WebBusinessActivity.this.mDBA.getLoginDevice().getId()) : "");
stringBuffer.append(sb2.toString());
stringBuffer.append("&deviceType=" + RemoteType.SOFT.getValue());
stringBuffer.append("&randomUUID=" + UUID.randomUUID().toString());
stringBuffer.append("&locale=" + android.utils.d.b());
stringBuffer.append("&scene=scan");
stringBuffer.append("&direction=vertical");
stringBuffer.append(com.ainemo.android.manager.c.C + VersionUtil.getCodeVersionName());
str = stringBuffer.toString();
WebBusinessActivity.this.toolbarTitle.setVisibility(0);
if (str.contains(j.d.m0) || str.contains("Answer")) {
WebBusinessActivity.this.toolbarTitle.setText(WebBusinessActivity.this.getString(R.string.answer));
} else if (str.contains("sign") || str.contains("Sign")) {
WebBusinessActivity.this.toolbarTitle.setText(WebBusinessActivity.this.getString(R.string.action_sign));
} else if (str.contains(j.d.n0) || str.contains("Evaluation")) {
WebBusinessActivity.this.toolbarTitle.setText(WebBusinessActivity.this.getString(R.string.string_evaluation));
} else if (str.contains("vote/mobileVote")) {
WebBusinessActivity.this.toolbarTitle.setText(WebBusinessActivity.this.getString(R.string.string_vote));
}
} else if (str.contains("xylink.com") && str.contains(".apk")) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse("http://sj.qq.com/myapp/detail.htm?apkName=com.ainemo.dragoon"));
WebBusinessActivity.this.startActivity(intent);
} else if (str.startsWith(com.tencent.smtt.sdk.WebView.SCHEME_TEL)) {
Intent intent2 = new Intent("android.intent.action.DIAL", Uri.parse(str));
if (WebBusinessActivity.this.getPackageManager().resolveActivity(intent2, 0) != null) {
WebBusinessActivity.this.startActivity(intent2);
} else {
WebBusinessActivity webBusinessActivity = WebBusinessActivity.this;
com.xylink.common.widget.c.b.b(webBusinessActivity, webBusinessActivity.getResources().getString(R.string.grant_make_call), 0);
}
}
if (!com.xylink.net.e.e.a(str)) {
String decode = URLDecoder.decode(str.replaceAll("%(?![0-9a-fA-F]{2})", "%25"));
if (decode.contains(UrlConstants.i.a)) {
WebBusinessActivity.this.isRedictUrl = true;
webView2.loadUrl(decode);
} else if (decode.contains(WebBusinessActivity.URL_TITLE)) {
WebBusinessActivity.this.title = decode.substring(decode.indexOf(WebBusinessActivity.URL_TITLE) + 26);
WebBusinessActivity.this.toolbarTitle.setText(WebBusinessActivity.this.title);
}
}
return true;
}
});
}
this.webView.removeJavascriptInterface("accessibility");
this.webView.removeJavascriptInterface("searchBoxJavaBridge");
this.webView.removeJavascriptInterface("accessibilityTraversal");
this.webView.clearCache(true);
this.webView.clearHistory();
WebSettings settings = this.webView.getSettings();
settings.setSavePassword(false);
settings.setJavaScriptEnabled(true);
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
settings.setUseWideViewPort(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setBlockNetworkLoads(false);
settings.setBlockNetworkImage(false);
settings.setDomStorageEnabled(true);
settings.setLoadWithOverviewMode(true);
settings.setLoadsImagesAutomatically(true);
settings.setAllowFileAccess(true);
settings.setAppCacheEnabled(true);
settings.setAppCacheMaxSize(8388608L);
settings.setAppCachePath(getApplicationContext().getCacheDir().getAbsolutePath());
settings.setCacheMode(-1);
this.webView.setScrollBarStyle(33554432);
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
settings.setDatabaseEnabled(true);
settings.setAllowUniversalAccessFromFileURLs(true);
settings.setUserAgentString(settings.getUserAgentString() + "XYLINK");
this.webView.getSettings().setDatabaseEnabled(true);
this.webView.getSettings().setSavePassword(false);
this.webView.getSettings().setDatabasePath(getApplicationContext().getCacheDir().getAbsolutePath());
this.webView.addJavascriptInterface(new JavaScriptInterface(this), "xylink");
this.webView.loadUrl(this.webUrl, this.additionalHttpHeaders);
String str = this.TAG;
L.i(str, "loadUrl : " + this.webUrl);
}
public void makeCallWithCheckPermission(final String str, boolean z, boolean z2, boolean z3, final String str2, final String str3, final String str4) {
runOnUiThread(new Runnable() {
@Override
public final void run() {
WebBusinessActivity.this.a(str, str2, str3, str4);
}
});
}
public void onSelectShareWebview(final String str, final String str2, final String str3, String str4, final String str5) {
ShareWebViewSelectDialog.newInstance(getSupportFragmentManager(), new ShareWebViewSelectDialog.InputCallback() {
@Override
public void onCallback(ShareWebViewSelectDialog.ShareType shareType) {
boolean z = shareType == ShareWebViewSelectDialog.ShareType.WEIXIN_CIRCLE;
if (!com.xylink.net.e.e.a(WebBusinessActivity.this.jsAction) && WebBusinessActivity.this.jsAction.equals("nativeHandleMeetingManage")) {
String a = com.ainemo.android.p.d.a(str3);
String str6 = WebBusinessActivity.this.TAG;
L.i(str6, "shareToWeixin shareCode=" + a);
ShareContent shareContent = (ShareContent) e.a.b.b.a(str3, (Class<Object>) ShareContent.class);
if (shareContent != null) {
if (!com.ainemo.android.b.f5988k.equals(com.xylink.net.e.c.f()) && !com.xylink.net.e.c.n.equals(com.xylink.net.e.c.f())) {
WebBusinessActivity webBusinessActivity = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity, R.drawable.ic_weixin_share, false, webBusinessActivity.shareUrl, WebBusinessActivity.this.getString(R.string.app_name), WebBusinessActivity.this.getString(R.string.click_join_meeting));
} else {
WebBusinessActivity webBusinessActivity2 = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity2, webBusinessActivity2.getString(R.string.click_join_meeting), str3, R.drawable.min_app_bg, shareContent.getTopic(), shareContent.getStartTime(), shareContent.getEndTime(), shareContent.getConferenceNumber(), a, WebBusinessActivity.this.userName, WebBusinessActivity.this.userId, str3);
}
}
} else {
com.ainemo.android.p.d.a(WebBusinessActivity.this, (int) R.drawable.ic_weixin_share, str5, z, str3, str, str2);
}
WebBusinessActivity.this.sendShareEvent();
}
});
}
public String parseValueByKey(String str, String str2) {
if (str != null && str.indexOf(str2) > 0) {
String[] split = str.split(str2);
if (split.length > 1) {
return split[1].split(WebPageActivity.URL_CONTENT_WEBVIEW_SPLISH)[0];
}
}
return "";
}
private void reloadWebPage() {
String str = this.TAG;
L.i(str, "reloadWebPage page : " + this.webUrl);
this.webView.loadUrl(this.webUrl, this.additionalHttpHeaders);
}
public void renameProfilePicture(String str, String str2) {
File file = new File(str);
if (file.exists()) {
file.renameTo(new File(str2));
}
}
private void saveH5Data(UserInfoOFWebPage userInfoOFWebPage) {
H5DataInfo h5DataInfo = new H5DataInfo();
h5DataInfo.setCellPhone(userInfoOFWebPage.getCellPhone());
UrlBean D = com.ainemo.android.preferences.p.K().D();
if (D != null) {
h5DataInfo.setAppResourcePayUrl(D.getAppResourcePayUrl());
}
boolean o = com.ainemo.android.preferences.a.s().o(com.xylink.net.manager.g.L());
h5DataInfo.setCmrId(userInfoOFWebPage.getCmrId());
h5DataInfo.setCmrName(userInfoOFWebPage.getCmrName());
h5DataInfo.setCmrNumber(userInfoOFWebPage.getCmrNumber());
h5DataInfo.setCountryCode(userInfoOFWebPage.getCountryCode());
h5DataInfo.setCustomizedKey(userInfoOFWebPage.getCustomizedKey());
h5DataInfo.setDebug(userInfoOFWebPage.isDebug());
h5DataInfo.setDisplayUpgrade(o);
h5DataInfo.setEmail(userInfoOFWebPage.getEmail());
h5DataInfo.setHost(userInfoOFWebPage.getHost());
h5DataInfo.setName(userInfoOFWebPage.getName());
h5DataInfo.setProfileID(userInfoOFWebPage.getProfileID());
h5DataInfo.setProfilePicture(userInfoOFWebPage.getProfilePicture());
h5DataInfo.setSecurityKey(userInfoOFWebPage.getSecurityKey());
}
public void selectContact(String str) {
this.selectContactCallback = str;
L.i(this.TAG, "open contact");
startActivityForResult(new Intent(this, ContactSelectActivity.class), 100);
}
public void sendShareEvent() {
d.a aIDLService = getAIDLService();
if (aIDLService != null) {
try {
aIDLService.j(this.shareTypeString, this.shareUriString);
} catch (RemoteException e2) {
e2.printStackTrace();
}
}
}
private void setAdditionalHttpHeaders() {
j.a a = android.utils.j.a();
this.additionalHttpHeaders.put("n-ua", "PL=ANDROID&AV=" + VersionUtil.getAppVersionCode(this) + "&DR=" + com.ainemo.android.b.d0 + "&RL=" + a.g() + PinyinUtils.CATEGORY_NEMO + a.f() + "&MF=" + a.c() + "&MO=" + a.d() + "&OS=" + a.e() + "&API=" + a.a() + "&LCLO=&LCLA=");
this.additionalHttpHeaders.put(HttpHeaders.ACCEPT_LANGUAGE, Locale.getDefault().toString().replace(RequestBean.END_FLAG, "-"));
}
@androidx.annotation.l0(api = 21)
public void shareWx(String str, final boolean z) {
ShareBean shareBean;
String str2;
L.i(this.TAG, "content : " + str);
if (com.xylink.net.e.e.a(this.userName) && getAIDLService() != null) {
try {
LoginResponse e0 = getAIDLService().e0();
this.loginResponse = e0;
if (e0 != null && e0.getUserProfile() != null) {
this.userId = this.loginResponse.getUserProfile().getId();
this.userName = this.loginResponse.getUserProfile().getDisplayName();
}
} catch (RemoteException e2) {
e2.printStackTrace();
}
}
if (com.xylink.net.e.e.a(str) || (shareBean = (ShareBean) e.a.b.b.a(str, (Class<Object>) ShareBean.class)) == null) {
return;
}
this.from = shareBean.getFrom();
this.shareType = shareBean.getShareType();
if (shareBean.getContent() != null) {
this.params = shareBean.getContent().getParams();
this.shareUrl = shareBean.getContent().getUrl();
this.shareDesc = shareBean.getContent().getDesc();
this.shareTitle = shareBean.getContent().getTitle();
this.shareImage = shareBean.getContent().getImg();
}
if (!com.xylink.net.e.e.a(this.params)) {
this.paramsBean = (ShareBean.ParamsBean) e.a.b.b.a(this.params, (Class<Object>) ShareBean.ParamsBean.class);
}
if (!com.xylink.net.e.e.a(this.from) && this.from.equals("enterpriseCombine")) {
if (!com.xylink.net.e.e.a(this.shareDesc)) {
this.shareDesBean = (ShareBean.ShareDes) e.a.b.b.a(this.shareDesc, (Class<Object>) ShareBean.ShareDes.class);
}
ShareBean.ParamsBean paramsBean = this.paramsBean;
if (paramsBean != null) {
this.mergeId = paramsBean.getMergeId();
}
ShareBean.ShareDes shareDes = this.shareDesBean;
if (shareDes != null) {
String applyName = shareDes.getApplyName();
this.shareDesBean.getReceiveName();
if (com.xylink.net.e.e.a(this.shareType) || !this.shareType.equals("mp")) {
return;
}
com.ainemo.android.p.d.a(this, getString(R.string.string_accoutn_merge_tip), this.shareDesc, R.drawable.min_app_bg, getString(R.string.string_merge_join_company_tip, new Object[]{applyName}), this.mergeId, this.userName, this.userId);
}
} else if (!com.xylink.net.e.e.a(this.from) && this.from.equals("schedule")) {
if (!com.xylink.net.e.e.a(this.shareDesc)) {
this.shareDesBean = (ShareBean.ShareDes) e.a.b.b.a(this.shareDesc, (Class<Object>) ShareBean.ShareDes.class);
}
ShareBean.ParamsBean paramsBean2 = this.paramsBean;
if (paramsBean2 != null) {
this.shareCode = paramsBean2.getShareCode();
}
if (this.shareDesBean == null || com.xylink.net.e.e.a(this.shareType) || !this.shareType.equals("card")) {
return;
}
long parseLong = Long.parseLong(this.shareDesBean.getStartTime());
long parseLong2 = Long.parseLong(this.shareDesBean.getEndTime());
if (!DateUtils.isSampleYear(parseLong, parseLong2)) {
str2 = DateUtils.stringToDate(parseLong) + "-" + DateUtils.stringToDate(parseLong2);
} else if (DateUtils.isSampleDay(parseLong, parseLong2)) {
str2 = DateUtils.stringToDate(parseLong) + "-" + DateUtils.stampToDate(parseLong2);
} else {
str2 = DateUtils.stringToDate(parseLong) + "-" + DateUtils.longToDate(parseLong2);
}
com.ainemo.android.p.d.a(this, R.drawable.app_share_icon, false, this.shareUrl, this.shareDesBean.getTopic(), getString(R.string.str_meeting_time, new Object[]{str2}) + "\n" + getString(R.string.str_meeting_conf_number, new Object[]{this.shareDesBean.getConferenceNumber()}));
} else if (com.xylink.net.e.e.a(this.from) || !this.from.equals("live")) {
} else {
try {
ImageLoader.b().a(this.shareImage, new com.bumptech.glide.request.f<Bitmap>() {
@Override
public boolean onLoadFailed(@androidx.annotation.h0 GlideException glideException, Object obj, com.bumptech.glide.request.j.p<Bitmap> pVar, boolean z2) {
String str3 = WebBusinessActivity.this.TAG;
L.i(str3, "load image file failure:" + glideException.getMessage());
if (com.xylink.net.e.e.a(WebBusinessActivity.this.shareType) || !WebBusinessActivity.this.shareType.equals("card")) {
return false;
}
WebBusinessActivity webBusinessActivity = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity, R.drawable.ic_weixin_share, z, webBusinessActivity.shareUrl, WebBusinessActivity.this.shareTitle, WebBusinessActivity.this.shareDesc);
return false;
}
@Override
public boolean onResourceReady(Bitmap bitmap, Object obj, com.bumptech.glide.request.j.p<Bitmap> pVar, DataSource dataSource, boolean z2) {
L.i(WebBusinessActivity.this.TAG, "load image file success !!!");
if (com.xylink.net.e.e.a(WebBusinessActivity.this.shareType) || !WebBusinessActivity.this.shareType.equals("card")) {
return false;
}
WebBusinessActivity webBusinessActivity = WebBusinessActivity.this;
com.ainemo.android.p.d.a(webBusinessActivity, (int) R.drawable.ic_weixin_share, bitmap, z, webBusinessActivity.shareUrl, WebBusinessActivity.this.shareTitle, WebBusinessActivity.this.shareDesc);
return false;
}
});
} catch (Exception e3) {
L.e(this.TAG, "catch exception, share to wechat by default image" + e3.getStackTrace());
if (com.xylink.net.e.e.a(this.shareType) || !this.shareType.equals("card")) {
return;
}
com.ainemo.android.p.d.a(this, R.drawable.ic_weixin_share, z, this.shareUrl, this.shareTitle, this.shareDesc);
}
}
}
public void showDateTimePickerDialog(long j2, final String str) {
if (this.dateTimeDialog == null) {
com.datepicker.week.a aVar = new com.datepicker.week.a();
this.dateTimeDialog = aVar;
aVar.a(new a.f() {
@Override
public void onDateTimeChoose(int i2, int i3, int i4, int i5, int i6) {
L.i(WebBusinessActivity.this.TAG, "onDateTimeChoose, year : " + i2 + ", month : " + i3 + ", day : " + i4 + ", hour : " + i5 + ", minute : " + i6);
WebBusinessActivity.this.selectYear = i2;
WebBusinessActivity.this.selectMonth = i3;
WebBusinessActivity.this.selectDay = i4;
WebBusinessActivity.this.selectHour = i5;
WebBusinessActivity.this.selectMinute = i6;
String str2 = i2 + "-" + i3 + "-" + i4 + UrlConstants.h.a + i5 + ":" + i6;
WebBusinessActivity.this.webView.loadUrl("Javascript:" + str + "('" + com.datepicker.b.a.a(str2, true) + "')");
}
@Override
public void onSelectTimeCancel() {
}
});
}
if (this.dateTimeDialog.isVisible()) {
return;
}
androidx.fragment.app.m a = getSupportFragmentManager().a();
if (getSupportFragmentManager().a("TimeDialogFragment") != null) {
a.d(getSupportFragmentManager().a("TimeDialogFragment")).e();
}
try {
this.dateTimeDialog.showNow(getSupportFragmentManager(), "TimeDialogFragment");
this.dateTimeDialog.a(this.selectYear, this.selectMonth, this.selectDay, this.selectHour, this.selectMinute);
} catch (Exception e2) {
e2.printStackTrace();
}
}
public void showDurationPickerDialog(final DurationInfo durationInfo, final String str) {
if (this.durationDialog == null) {
com.datepicker.a.a aVar = new com.datepicker.a.a();
this.durationDialog = aVar;
aVar.b(durationInfo.getMaxHour());
this.durationDialog.a(new a.e() {
@Override
public void onDurationCancel() {
}
@Override
public void onDurationChoose(int i2, int i3) {
String str2 = WebBusinessActivity.this.TAG;
L.i(str2, "onTimeChoose, hour : " + i2 + ", minute : " + i3);
WebBusinessActivity.this.durationHour = i2;
WebBusinessActivity.this.durationMinute = i3;
DurationInfo durationInfo2 = new DurationInfo();
durationInfo2.setHour(i2);
durationInfo2.setMinute(i3);
durationInfo2.setMaxHour(durationInfo.getMaxHour());
String json = WebBusinessActivity.this.mGson.toJson(durationInfo2);
WebView webView = WebBusinessActivity.this.webView;
webView.loadUrl("Javascript:" + str + "('" + json + "')");
}
});
}
if (this.durationDialog.isVisible()) {
return;
}
androidx.fragment.app.m a = getSupportFragmentManager().a();
if (getSupportFragmentManager().a("durationPicker") != null) {
a.d(getSupportFragmentManager().a("durationPicker")).e();
}
this.durationDialog.showNow(getSupportFragmentManager(), "durationPicker");
this.durationDialog.a(durationInfo.getHour(), durationInfo.getMinute());
}
private void showNoPermissionHint() {
NemoAlertDialog.newInstance(getSupportFragmentManager(), getResources().getString(R.string.camera_disabled), R.string.dialog_alert_Known);
}
private void showWaitDialog() {
if (this.dialog == null) {
com.xylink.common.widget.b.p a = new p.a().a();
this.dialog = a;
a.setCancelable(true);
}
if (!this.dialog.isAdded()) {
getSupportFragmentManager().a().a(this.dialog, "WebBusinessActiviy").f();
getSupportFragmentManager().b();
L.i(this.TAG, "show wait dialog");
return;
}
com.xylink.common.widget.b.p pVar = this.dialog;
if (pVar != null) {
pVar.dismissAllowingStateLoss();
}
}
private void uploadDataCallBack(int i2, Intent intent) {
if (-1 != i2) {
this.mUploadCallbackAboveL.onReceiveValue(null);
} else if (intent != null) {
Uri data = intent.getData();
if (data != null) {
this.mUploadCallbackAboveL.onReceiveValue(new Uri[]{data});
} else {
this.mUploadCallbackAboveL.onReceiveValue(null);
}
}
this.mUploadCallbackAboveL = null;
}
public void a(View view) {
if (Build.VERSION.SDK_INT >= 23) {
PermissionUtils.requestCamera(this, new PermissionUtils.PermissionRequestCallback() {
@Override
public final void onResult(boolean z) {
WebBusinessActivity.this.a(z);
}
});
} else {
try {
fromCamera();
} catch (SecurityException e2) {
e2.printStackTrace();
com.xylink.common.widget.c.b.a(this, (int) R.string.permission_camera_and_audio_tips, 1);
}
}
com.google.android.material.bottomsheet.a aVar = this.cameraGalleryDialog;
if (aVar == null || !aVar.isShowing()) {
return;
}
this.cameraGalleryDialog.dismiss();
}
public void b(View view) {
if (Build.VERSION.SDK_INT >= 23) {
PermissionUtils.requestStorage(this, new PermissionUtils.PermissionRequestCallback() {
@Override
public final void onResult(boolean z) {
WebBusinessActivity.this.b(z);
}
});
} else {
try {
fromGallery();
} catch (SecurityException e2) {
e2.printStackTrace();
}
}
com.google.android.material.bottomsheet.a aVar = this.cameraGalleryDialog;
if (aVar == null || !aVar.isShowing()) {
return;
}
this.cameraGalleryDialog.dismiss();
}
public void c(View view) {
com.google.android.material.bottomsheet.a aVar = this.cameraGalleryDialog;
if (aVar != null && aVar.isShowing()) {
this.cameraGalleryDialog.dismiss();
}
cancelFilePathCallback();
}
public void d(View view) {
reloadWebPage();
}
public void dismissWaitDialog() {
L.i(this.TAG, "dismiss wait dialog");
com.xylink.common.widget.b.p pVar = this.dialog;
if (pVar != null) {
pVar.dismissAllowingStateLoss();
getSupportFragmentManager().b();
}
}
public void e(View view) {
String str = this.TAG;
L.i(str, "on toolbar back pressed:" + this.jsGoBack);
if (android.utils.d.d(this.jsGoBack) && !this.jsGoBack.equals("undefined")) {
executeJsCallback(this.jsGoBack, null);
} else {
finish();
}
}
public void f(View view) {
String str = this.TAG;
L.i(str, "on toolbar back pressed:" + this.jsGoBack);
if (android.utils.d.d(this.jsGoBack) && !this.jsGoBack.equals("undefined")) {
executeJsCallback(this.jsGoBack, null);
} else {
finish();
}
}
public void g(View view) {
if (this.jsAction == null) {
return;
}
String str = this.TAG;
L.i(str, "call webaction: " + this.jsAction);
executeJsCallback(this.jsAction, null);
}
public void getRecentCallRecord() {
try {
List<CallRecord> m = this.mProxy.m();
this.recentCallJson.clear();
if (m != null) {
Collections.reverse(m);
for (CallRecord callRecord : m) {
WebRecentCallModel webRecentCallModel = new WebRecentCallModel();
webRecentCallModel.copyFromCallRecord(callRecord);
this.recentCallJson.add(webRecentCallModel);
}
}
} catch (RemoteException e2) {
e2.printStackTrace();
}
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
if (i2 != 100 || i3 != -1) {
if (i2 != 1001) {
if (i2 != 1002 || this.mUploadCallbackAboveL == null) {
return;
}
uploadDataCallBack(i3, intent);
return;
} else if (i3 == -1) {
if (intent == null) {
intent = new Intent();
intent.setData(FileUtils.getFileUri(this, this.tempFile));
}
if (this.mUploadCallbackAboveL != null) {
uploadDataCallBack(i3, intent);
return;
}
return;
} else {
cancelFilePathCallback();
return;
}
}
L.i(this.TAG, "on select contact ok");
ArrayList parcelableArrayListExtra = intent.getParcelableArrayListExtra(com.ainemo.android.g.b.a.a);
ArrayList<String> stringArrayListExtra = intent.getStringArrayListExtra(com.ainemo.android.g.b.a.f6293b);
ArrayList<SelectContactModel> arrayList = new ArrayList<>();
ArrayList<SelectEmailModel> arrayList2 = new ArrayList<>();
if (parcelableArrayListExtra != null && parcelableArrayListExtra.size() > 0) {
Iterator it = parcelableArrayListExtra.iterator();
while (it.hasNext()) {
arrayList.add(new SelectContactModel((AddMoreDataModel) it.next()));
}
}
if (stringArrayListExtra != null && stringArrayListExtra.size() > 0) {
Iterator<String> it2 = stringArrayListExtra.iterator();
while (it2.hasNext()) {
arrayList2.add(new SelectEmailModel(it2.next()));
}
}
DataModel dataModel = new DataModel();
dataModel.setMail(arrayList2);
dataModel.setUser(arrayList);
String str = this.TAG;
L.i(str, "select contact result: " + e.a.b.b.a(dataModel));
String str2 = this.selectContactCallback;
if (str2 != null) {
executeJsCallback(str2, e.a.b.b.a(dataModel));
}
}
@Override
public void onBackPressed() {
if (android.utils.d.d(this.jsGoBack) && !this.jsGoBack.equals("undefined")) {
String str = this.TAG;
L.i(str, "h5 page do this back action, " + this.jsGoBack);
executeJsCallback(this.jsGoBack, null);
return;
}
super.onBackPressed();
}
@Override
@androidx.annotation.l0(api = 21)
public void onCreate(Bundle bundle) {
getWindow().requestFeature(1);
if (Build.VERSION.SDK_INT >= 23) {
getWindow().setStatusBarColor(getResources().getColor(R.color.WHITE));
getWindow().getDecorView().setSystemUiVisibility(8192);
} else {
getWindow().clearFlags(67108864);
getWindow().addFlags(Integer.MIN_VALUE);
getWindow().setStatusBarColor(getResources().getColor(R.color.WHITE));
}
super.onCreate(bundle);
initCameraGalleryDialog();
this.mDBA = new DatabaseAccessor();
this.mAnimation = AnimationUtils.loadAnimation(this, R.anim.toobar_alpha);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(CallConst.SHOW_PROMPT_DIALOG);
registerReceiver(this.webViewReceiver, intentFilter);
setContentView(R.layout.activity_web_business);
this.isAudioMute = com.ainemo.android.preferences.j.n().b();
this.isVideoMute = com.ainemo.android.preferences.j.n().a();
setAdditionalHttpHeaders();
initView();
this.mGson = new Gson();
}
@Override
public void onDestroy() {
this.webView.destroy();
unregisterReceiver(this.webViewReceiver);
String str = this.webUrl;
if (str != null && str.contains("host-meeting")) {
clearCookies(this);
}
L.i(this.TAG, "onDestroy");
super.onDestroy();
}
@Override
public void onMessage(Message message) {
String str = this.TAG;
L.i(str, "onMessage msg.what=" + message.what);
if (message.what != 5017) {
return;
}
updateRecentCall();
}
@Override
public void onPause() {
this.webView.onPause();
L.i(this.TAG, "onPause");
super.onPause();
}
@Override
public void onResume() {
this.webView.onResume();
this.webView.loadUrl("Javascript:onResume()");
super.onResume();
if (com.ainemo.android.preferences.j.n().e(com.xylink.net.manager.g.L())) {
return;
}
e.h.b.f.m.a(this, MobileApplication.l());
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onStop() {
super.onStop();
L.i(this.TAG, "onStop");
if (this.webUrl.contains("qq.com")) {
finish();
}
}
@Override
public void onViewAndServiceReady(d.a aVar) {
super.onViewAndServiceReady(aVar);
this.mProxy = aVar;
try {
String a = e.a.b.b.a(com.ainemo.android.preferences.o.p0().p());
CloudMeetingRoom n = this.mProxy.n();
this.cmr = n;
if (n != null) {
this.me.copyFromLoginResponse(this.mProxy.e0(), this.cmr.getMeetingNumber(), VersionUtil.getCodeVersionName(), a);
this.me.setCmrId(this.cmr.getId());
this.me.setCmrName(this.cmr.getDisplayName());
} else {
this.me.copyFromLoginResponse(this.mProxy.e0(), null, VersionUtil.getCodeVersionName(), a);
}
boolean o = com.ainemo.android.preferences.a.s().o(com.xylink.net.manager.g.L());
this.displayUpgrade = o;
this.me.setDisplayUpgrade(o);
H5PageManager.getInstance().saveH5NeedData(this, this.me);
getRecentCallRecord();
LoginResponse e0 = aVar.e0();
this.loginResponse = e0;
if (e0 == null || e0.getUserProfile() == null) {
return;
}
this.userId = this.loginResponse.getUserProfile().getId();
this.userName = this.loginResponse.getUserProfile().getDisplayName();
} catch (RemoteException e2) {
e2.printStackTrace();
}
}
public void selectTerminalContact(String str, String str2, String str3) {
this.selectContactCallback = str2;
Intent intent = new Intent(this, ContactSelectedActivity.class);
intent.putExtra("title", str3);
intent.putExtra(com.ainemo.android.g.b.a.f6294c, "webBusiness");
if (android.utils.d.d(str)) {
try {
DataModel dataModel = (DataModel) e.a.b.b.a(str, (Class<Object>) DataModel.class);
if (dataModel != null) {
ArrayList<SelectContactModel> user = dataModel.getUser();
ArrayList<? extends Parcelable> arrayList = new ArrayList<>();
ArrayList<String> arrayList2 = new ArrayList<>();
Iterator<SelectContactModel> it = user.iterator();
while (it.hasNext()) {
SelectContactModel next = it.next();
if (next.getPictureUrl() == null && this.loginResponse != null && this.loginResponse.getUserProfile() != null && next.getId().equals(String.valueOf(this.loginResponse.getUserProfile().getId()))) {
next.setPictureUrl(this.mDBA.getUserPicture(Long.parseLong(next.getId())));
}
AddMoreDataModel convert2AddMoreDataModel = next.convert2AddMoreDataModel();
convert2AddMoreDataModel.setSelected(true);
arrayList.add(convert2AddMoreDataModel);
}
Iterator<SelectEmailModel> it2 = dataModel.getMail().iterator();
while (it2.hasNext()) {
arrayList2.add(it2.next().getEmail());
}
intent.putParcelableArrayListExtra(com.ainemo.android.g.b.a.a, arrayList);
intent.putStringArrayListExtra(com.ainemo.android.g.b.a.f6293b, arrayList2);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
startActivityForResult(intent, 100);
}
public void updateRecentCall() {
L.i(this.TAG, "updateRecentCall called");
Set<String> set = this.h5Callbacks;
if (set != null && set.contains(JsUtils.FUNCTION_UPDATE_RECENTCALL)) {
getRecentCallRecord();
callJsCallback(JsUtils.FUNCTION_UPDATE_RECENTCALL, this.recentCallJson);
return;
}
L.i(this.TAG, "do nothing because no recentCallUpdate callback");
}
public void b(boolean z) {
if (z) {
try {
fromGallery();
return;
} catch (SecurityException e2) {
e2.printStackTrace();
return;
}
}
cancelFilePathCallback();
}
public void a(boolean z) {
if (z) {
try {
fromCamera();
return;
} catch (SecurityException e2) {
e2.printStackTrace();
com.xylink.common.widget.c.b.a(this, (int) R.string.permission_camera_and_audio_tips, 1);
return;
}
}
cancelFilePathCallback();
}
public void a(DialogInterface dialogInterface) {
cancelFilePathCallback();
}
public void a(String str, String str2, String str3, String str4) {
new MakeCallManager(this).callWithSettings(str, this.isAudioMute, this.isVideoMute, false, str2, str3, str4, "scheduledPage");
}
}