Shandong video conference v3.2.10版本的 MD5 值为:e9e908f971313b4c4bca5737f96781ef
以下内容为反编译后的 WebPageActivity.java 源代码,内容仅作参考
package com.ainemo.android.activity.business;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.log.L;
import android.log.LogFormData;
import android.log.upload.UploadLogUtil;
import android.log.upload.UploadType;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.RemoteException;
import android.text.Html;
import android.util.Base64;
import android.utils.VersionUtil;
import android.utils.imagecache.ImageLoader;
import android.utils.j;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.DownloadListener;
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.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.gov.sdongmeeting.video.R;
import com.ainemo.android.activity.BaseMobileActivity;
import com.ainemo.android.activity.MainActivity;
import com.ainemo.android.activity.business.WebPageActivity;
import com.ainemo.android.activity.business.actions.QrCodeCaptureActivity;
import com.ainemo.android.activity.business.actions.WebBusinessActivity;
import com.ainemo.android.activity.login.GuideAfterRegisterActivity;
import com.ainemo.android.bean.ContentDesBean;
import com.ainemo.android.bean.DurationInfo;
import com.ainemo.android.bean.H5NoticeNative;
import com.ainemo.android.business.DatabaseAccessor;
import com.ainemo.android.business.H5PageManager;
import com.ainemo.android.business.MakeCallManager;
import com.ainemo.android.business.share.LiveShareResponse;
import com.ainemo.android.model.UIConfigModel;
import com.ainemo.android.net.bean.QrVoucher;
import com.ainemo.android.net.bean.ShareBean;
import com.ainemo.android.net.bean.TicketsTab;
import com.ainemo.android.net.bean.UrlBean;
import com.ainemo.android.net.bean.VoucherBean;
import com.ainemo.android.rest.model.CloudMeetingRoom;
import com.ainemo.android.rest.model.IpcFormListData;
import com.ainemo.android.rest.model.LoginResponse;
import com.ainemo.android.rest.model.UserDevice;
import com.ainemo.android.rest.model.UserInfoOFWebPage;
import com.ainemo.android.utils.AlertUtil;
import com.ainemo.android.utils.DateUtils;
import com.ainemo.android.utils.DeviceUtil;
import com.ainemo.android.utils.NemoAlertDialog;
import com.ainemo.android.utils.PermissionUtils;
import com.ainemo.android.utils.PinyinUtils;
import com.ainemo.android.utils.QRCodeUtil;
import com.ainemo.android.view.dialog.PriceTicketsDialog;
import com.ainemo.android.view.dialog.ShareWebViewSelectDialog;
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.google.gson.reflect.TypeToken;
import com.huawei.updatesdk.sdk.service.storekit.bean.RequestBean;
import com.meeting.call.activity.XylinkMeetingActivity;
import com.meeting.call.manager.j;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;
import com.tencent.wework.api.IWWAPI;
import com.tencent.wework.api.IwwapiFactory;
import com.umeng.analytics.pro.ai;
import com.xylink.common.widget.b.p;
import com.xylink.common.widget.b.q;
import com.xylink.net.manager.UrlConstants;
import com.xylink.util.file.FileUtils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import okhttp3.Response;
import org.apache.http.HttpHeaders;
import retrofit2.HttpException;
public class WebPageActivity extends BaseMobileActivity {
public static final String APPEND_ADDITIONAL = "append_additional";
public static final String ENABLE_HARDWARE_ACCELERATED = "enable_hardware_accelerated";
public static final String FLAG_INTENT_ENTERPRISE_NAME = "flag_intent_enterpriseName";
public static final String FLAG_INTENT_ENTERPRISE_TICKETS = "flag_intent_enterprise_tickets";
public static final String FLAG_INTENT_FROM = "flag_intent_from";
public static final String FLAG_INTENT_TYPEGROUP = "flag_intent_typeGroup";
private static final String JS_CALLBACK_SETWEBVIEWTITLE = "javascript:window.xiaoyu.setWebViewTitle(document.title);";
private static final String JS_CALLBACK_SHARESNS = "javascript:( function () { var shareTitle = document.getElementById(\"shareTitle\").value; var shareDescription = document.getElementById(\"shareDescription\").value; var shareUrl = document.getElementById(\"shareUrl\").value; var shareThumbnail = document.getElementById(\"shareThumbnail\").value; window.xiaoyu.shareSNS(shareTitle,shareDescription,shareUrl,shareThumbnail); } ) ()";
public static final String KEY_DATA = "webpageactivity.key.data";
private static final String KEY_EVENT_CLIPBOARD_COPY = "xylink://clipboard?copied=";
private static final String KEY_EVENT_GOTO_BROWSER = "ainemo-gotobrowser://";
private static final String KEY_EVENT_OPEN_BROWSER = "xylink://open-browser?url=";
public static final String KEY_EVENT_STRING_CALL = "ainemo-call://";
private static final String KEY_EVENT_STRING_OPENNEMOS = "ainemo-close";
private static final String KEY_EVENT_STRING_SEND_LOG = "send_log=yes";
public static final String KEY_EVENT_STRING_SHARE = "ainemo-share://";
private static final String KEY_EVENT_STRING_WATCH = "ainemo-watch://";
private static final String KEY_EVENT_VIDEO_PLAY = "xylink://play?playurl=";
public static final String KEY_FROM = "from";
public static final String KEY_IS_VOUCHER = "isVourcherUrl";
public static final String KEY_TITLE = "webpageactivity.key.title";
public static final String KEY_TITLE_IS_PERMANENT = "webpageactivity.key.title.is.permanent";
public static final String KEY_URL = "webpageactivity.key.url";
private static final String PHOTO_FILE_NAME = "web_photo.jpg";
private static final int REQUESTCODE = 1;
public static final int RESULTCODE = 2;
private static final String TAG = "WBVW";
public static final String URL_CONTENT_WEBVIEW_ACTION = "action=";
public static final String URL_CONTENT_WEBVIEW_ALLOW_CAMERA_CONTROL = "allowControlCamera=";
public static final String URL_CONTENT_WEBVIEW_ALLOW_RING_REMINDER = "allowRingReminder=";
public static final String URL_CONTENT_WEBVIEW_CONF_NUMBER = "conferenceNumber=";
public static final String URL_CONTENT_WEBVIEW_CONF_PASSWORD = "password=";
public static final String URL_CONTENT_WEBVIEW_DEVICEID = "deviceId=";
public static final String URL_CONTENT_WEBVIEW_DEVICETYPE = "deviceid=";
public static final String URL_CONTENT_WEBVIEW_DISTRIBUTORID = "distributorId=";
public static final String URL_CONTENT_WEBVIEW_ISADMIN = "isAdmin=";
public static final String URL_CONTENT_WEBVIEW_LIVE_ID = "liveId=";
public static final String URL_CONTENT_WEBVIEW_LIVING_NO = "livingNo=";
public static final String URL_CONTENT_WEBVIEW_NEMO_NUMBER = "nemoNumber=";
public static final String URL_CONTENT_WEBVIEW_SECURITYKEY = "securityKey=";
public static final String URL_CONTENT_WEBVIEW_SHARETYPE = "shareType=";
public static final String URL_CONTENT_WEBVIEW_SPLISH = "&";
public static final String URL_CONTENT_WEBVIEW_TITLE = "webviewTitle=";
public static final String URL_CONTENT_WEBVIEW_USERID = "userId=";
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;
private boolean back2MainWhenClickClose;
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 enterpriseName;
private String from;
private String getMonitorPageWay;
private String intentFrom;
private boolean isAudioMute;
private boolean isBlackColor;
private boolean isChangeToobarColor;
private boolean isJumpToScan;
private boolean isNAPIControlSuccess;
private boolean isPermanentTitle;
private boolean isRedictUrl;
private boolean isRefresh;
private boolean isSelectMyTicket;
private boolean isSelectPresent;
private boolean isVideoMute;
private boolean isVoucherUrl;
private boolean isWebUrlFail;
private String itemPresentName;
private String itemTicketName;
private IWWAPI iwwapi;
private String jsAction;
private String jsGoBack;
private String jsScanCode;
private LinearLayout layoutRefresh;
private LinearLayout layout_layoutwebview;
private LinearLayout linearCenter;
private LinearLayout linearLeft;
private LoginResponse loginResponse;
private WebChromeClient.CustomViewCallback mCallBack;
private com.ainemo.android.g.e.a mContactApiManager;
private Context mContext;
private Gson mGson;
private ValueCallback<Uri[]> mUploadCallbackAboveL;
private FrameLayout mVideoContainer;
private String meetingId;
private String mergeId;
private Animation mexitAnimation;
private Animation mstartAnimation;
private String myTicketClick;
private String params;
private ShareBean.ParamsBean paramsBean;
private String presentClick;
private PriceTicketsDialog priceTicketsDialog;
private ProgressBar progressBar;
private RelativeLayout relaRight;
private RelativeLayout relaWebImage;
private int selectDay;
private int selectHour;
private int selectMinute;
private int selectMonth;
private int selectYear;
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 com.xylink.common.widget.b.q ticketSuccessDialog;
private TextView toolbarLeft;
private TextView tvGoPresent;
private TextView tvMyTickets;
private TextView tvRight;
private String type;
private int typeGroup;
private String url;
private UrlBean urlBean;
private String urlKeyId;
private long userId;
private String userName;
private String voucherId;
private ImageView webActionImage;
private WebView webview;
private ImageView webviewClose;
private TextView webviewShare;
private String webviewTileString;
private TextView webviewTitle;
private RelativeLayout webviewTitleBar;
private IWXAPI wxapi;
private com.ainemo.android.h.k3 yearsEndSummaryBinding;
public static final String SHARE_THUMBNAIL_OUTPAGE_FILE = Environment.getExternalStorageDirectory().getPath() + "/.nemo/share_thumbnail_file";
public static final String SHARE_THUMBNAIL_INPAGE_FILE = Environment.getExternalStorageDirectory().getPath() + "/.nemo/share_thumbnail_inpage_file";
private Map<String, String> additionalHttpHeaders = new HashMap();
private boolean appendAdditional = true;
private Handler changeTitleHandler = new Handler();
private UserInfoOFWebPage userInfo = new UserInfoOFWebPage();
private Handler mHandler = new Handler();
private int durationHour = 0;
private int durationMinute = 0;
private boolean isFirstLoading = true;
private Runnable changeTitleRunnable = new Runnable() {
@Override
public void run() {
WebPageActivity.this.webviewTitle.setText(WebPageActivity.this.webviewTileString);
}
};
private Runnable dissMissRunnable = new Runnable() {
@Override
public void run() {
if (WebPageActivity.this.isNAPIControlSuccess) {
return;
}
WebPageActivity.this.dismissWaitDialog();
WebPageActivity.this.webview.setVisibility(8);
WebPageActivity.this.layoutRefresh.setVisibility(0);
}
};
public class MyJavaScriptInterface {
private Context ctx;
MyJavaScriptInterface(Context context) {
this.ctx = context;
}
public void a(String str, boolean z) {
if (z) {
try {
WebPageActivity.this.jsScanCode = str;
Intent intent = new Intent(WebPageActivity.this, QrCodeCaptureActivity.class);
if (!com.xylink.net.e.e.a(WebPageActivity.this.intentFrom) && WebPageActivity.this.intentFrom.equals("enterpriseResource")) {
intent.putExtra(GuideAfterRegisterActivity.v, "enterpriseResource");
}
WebPageActivity.this.startActivityForResult(intent, 1);
WebPageActivity.this.isJumpToScan = true;
} catch (SecurityException e2) {
e2.printStackTrace();
com.xylink.common.widget.c.b.a(WebPageActivity.this, (int) R.string.permission_camera_and_audio_tips, 1);
}
}
}
public void b(String str, String str2) {
WebPageActivity.this.changeTicketState(str, str2);
}
public void c(String str, String str2) throws Throwable {
WebPageActivity.this.setWebTitle(str);
}
@JavascriptInterface
public void callPhone(String str) {
try {
Intent intent = new Intent("android.intent.action.DIAL");
intent.setData(Uri.parse(com.tencent.smtt.sdk.WebView.SCHEME_TEL + str));
if (WebPageActivity.this.getPackageManager().resolveActivity(intent, 0) != null) {
WebPageActivity.this.startActivity(intent);
} else {
com.xylink.common.widget.c.b.b(WebPageActivity.this, WebPageActivity.this.getResources().getString(R.string.grant_make_call), 0);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
@JavascriptInterface
public void changeTitleColor(final String str, final boolean z) {
L.i(WebPageActivity.TAG, "changeTitleColor color: " + str);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.a(z, str);
}
});
}
@JavascriptInterface
public void changeToobarState(final boolean z) {
WebPageActivity.this.isChangeToobarColor = true;
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.a(z);
}
});
}
@JavascriptInterface
public void clearAction() {
L.i(WebPageActivity.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) {
WebPageActivity.MyJavaScriptInterface.this.a((String) obj);
}
});
}
@JavascriptInterface
public void close() {
L.i(WebPageActivity.TAG, "close web view called");
WebPageActivity.this.finish();
}
@JavascriptInterface
public void createEnterprise(String str) {
L.i(WebPageActivity.TAG, "createEnterprise: " + str);
com.ainemo.android.manager.e.a().a(WebPageActivity.this.mContext);
WebPageActivity.this.finish();
}
public void d(boolean z) {
if (z) {
WebPageActivity.this.webviewTitleBar.setVisibility(0);
return;
}
WebPageActivity.this.webviewTitleBar.setVisibility(8);
if (Build.VERSION.SDK_INT >= 21) {
Window window = WebPageActivity.this.getWindow();
window.clearFlags(201326592);
window.getDecorView().setSystemUiVisibility(9728);
window.addFlags(Integer.MIN_VALUE);
window.setStatusBarColor(0);
window.setNavigationBarColor(0);
}
}
@JavascriptInterface
public void downloadFile(String str) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
WebPageActivity.this.startActivity(intent);
}
public void e(final String str) {
if (Build.VERSION.SDK_INT < 23) {
try {
WebPageActivity.this.jsScanCode = str;
Intent intent = new Intent(WebPageActivity.this, QrCodeCaptureActivity.class);
if (!com.xylink.net.e.e.a(WebPageActivity.this.intentFrom) && WebPageActivity.this.intentFrom.equals("enterpriseResource")) {
intent.putExtra(GuideAfterRegisterActivity.v, "enterpriseResource");
}
WebPageActivity.this.startActivityForResult(intent, 1);
WebPageActivity.this.isJumpToScan = true;
return;
} catch (SecurityException e2) {
e2.printStackTrace();
com.xylink.common.widget.c.b.a(WebPageActivity.this, (int) R.string.permission_camera_and_audio_tips, 1);
return;
}
}
PermissionUtils.requestCamera(WebPageActivity.this, new PermissionUtils.PermissionRequestCallback() {
@Override
public final void onResult(boolean z) {
WebPageActivity.MyJavaScriptInterface.this.a(str, z);
}
});
}
public void f(String str) {
if (!com.xylink.net.e.e.c(str) || str.equals("undefined")) {
WebPageActivity.this.webviewClose.setVisibility(0);
WebPageActivity.this.toolbarLeft.setVisibility(8);
} else if (str.equals("close")) {
WebPageActivity.this.webviewClose.setVisibility(0);
WebPageActivity.this.webviewClose.setImageResource(R.drawable.scan_login_close_image);
WebPageActivity.this.toolbarLeft.setVisibility(8);
} else {
WebPageActivity.this.webviewClose.setVisibility(8);
WebPageActivity.this.toolbarLeft.setVisibility(0);
WebPageActivity.this.toolbarLeft.setText(str);
}
}
@JavascriptInterface
public void forward(String str, String str2, boolean z) {
L.i(WebPageActivity.TAG, "forward url is " + str + "title: " + str2 + "isAbsolute: " + z);
if (!z) {
str = H5PageManager.getInstance().getH5PageUrlHeader() + str;
}
Intent intent = new Intent(this.ctx, WebPageActivity.class);
intent.putExtra(WebPageActivity.KEY_URL, str);
intent.putExtra(WebPageActivity.KEY_TITLE, str2);
WebPageActivity.this.startActivity(intent);
WebPageActivity.this.finish();
}
public void g(String str) {
WebPageActivity.this.shareWx(str, true);
}
@JavascriptInterface
public String getCacheData(String str) {
L.i(WebPageActivity.TAG, "getCacheData key: " + str);
return com.ainemo.android.preferences.k.b().a(str);
}
@JavascriptInterface
public String getUserProfile() {
L.i(WebPageActivity.TAG, "get user profile called, profile: " + e.a.b.b.a(WebPageActivity.this.userInfo));
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())) {
WebPageActivity.this.userInfo.setDisplayUpgrade(false);
}
return e.a.b.b.a(WebPageActivity.this.userInfo);
}
@JavascriptInterface
public void goCalendar() {
L.i(WebPageActivity.TAG, "web goCalendar");
WebPageActivity.this.goToCalendar();
}
@JavascriptInterface
public void goMain() {
WebPageActivity.this.goMainActivity();
}
@JavascriptInterface
public void goToUseTicket(final String str, final String str2) {
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.a(str, str2);
}
});
}
public void h(String str) {
WebPageActivity.this.shareWx(str, false);
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2) {
WebPageActivity.this.makeCallWithCheckPermission(str, z, z2, false, null, null, null);
}
@JavascriptInterface
public String monitorList() {
String a = android.utils.c.a(e.a.b.b.a(com.meeting.call.manager.l.c().b()));
L.i(WebPageActivity.TAG, "monitorList monitorData: " + a);
return a;
}
@JavascriptInterface
public void navigateToAppPage(final String str) {
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.b(str);
}
});
}
@JavascriptInterface
public void noticeNative(String str) {
L.i(WebPageActivity.TAG, "set close call back, function is " + str);
H5NoticeNative h5NoticeNative = (H5NoticeNative) WebPageActivity.this.mGson.fromJson(str, (Class<Object>) H5NoticeNative.class);
if (h5NoticeNative == null || !H5NoticeNative.CREATEENTP.equals(h5NoticeNative.getType())) {
return;
}
com.ainemo.android.preferences.g.f().c(com.xylink.net.manager.g.L(), h5NoticeNative.getContent().getEnterpriseId());
com.ainemo.android.preferences.g.f().e(com.xylink.net.manager.g.L(), true);
WebPageActivity.this.mContactApiManager.a();
}
@JavascriptInterface
public void optionMonitorItem(String str, String str2) {
String a = android.utils.c.a(str2, "");
L.i(WebPageActivity.TAG, "optionMonitorItem monitorData: " + a);
IpcFormListData ipcFormListData = (IpcFormListData) WebPageActivity.this.mGson.fromJson(a, (Class<Object>) IpcFormListData.class);
if (androidx.core.app.n.e0.equals(str)) {
WebPageActivity.this.ipcToMeeting(ipcFormListData);
} else if ("select".equals(str)) {
com.meeting.call.manager.l.c().a(ipcFormListData);
} else if ("cancel".equals(str)) {
com.meeting.call.manager.l.c().b(ipcFormListData);
}
}
@JavascriptInterface
public void redirect(String str, String str2, boolean z) {
L.i(WebPageActivity.TAG, "redirect url is " + str + "title: " + str2 + "isAbsolute: " + z);
if (!z) {
str = H5PageManager.getInstance().getH5PageUrlHeader() + str;
}
L.i(WebPageActivity.TAG, "redirect url:" + str);
Intent intent = new Intent(this.ctx, WebPageActivity.class);
intent.putExtra(WebPageActivity.KEY_URL, str);
intent.putExtra(WebPageActivity.KEY_TITLE, str2);
WebPageActivity.this.startActivity(intent);
}
@JavascriptInterface
public void saveImageToAlbum(final String str) {
L.i(WebPageActivity.TAG, "save image to local Album: " + str);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.c(str);
}
});
}
@JavascriptInterface
public void saveImageToLocal(final String str) {
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.d(str);
}
});
}
@JavascriptInterface
public void scanQRCode(final String str) {
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.e(str);
}
});
}
@JavascriptInterface
public void selectTime(final long j2, final String str) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(j2);
WebPageActivity.this.selectYear = calendar.get(1);
WebPageActivity.this.selectMonth = calendar.get(2) + 1;
WebPageActivity.this.selectDay = calendar.get(5);
WebPageActivity.this.selectHour = calendar.get(11);
WebPageActivity.this.selectMinute = calendar.get(12);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
WebPageActivity.this.hideDurationPickerDialog();
WebPageActivity.this.showDateTimePickerDialog(j2, str);
}
});
}
@JavascriptInterface
public void selectTimeLong(String str, final String str2) {
final DurationInfo durationInfo = (DurationInfo) WebPageActivity.this.mGson.fromJson(str, (Class<Object>) DurationInfo.class);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.a(durationInfo, str2);
}
});
}
@JavascriptInterface
public void setAction(final String str, final boolean z, String str2, final int i2) {
L.i(WebPageActivity.TAG, "set action called, " + str + UrlConstants.h.a + z + UrlConstants.h.a + str2 + " type=" + i2);
WebPageActivity.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) {
WebPageActivity.MyJavaScriptInterface.this.a(i2, str, z, (String) obj);
}
});
}
@JavascriptInterface
public void setCacheData(String str, String str2) {
L.i(WebPageActivity.TAG, "setCacheData key: " + str + ",value: " + str2);
com.ainemo.android.preferences.k.b().a(str, str2);
}
@JavascriptInterface
public void setCloseCallback(String str, final String str2) {
L.i(WebPageActivity.TAG, "set close call back, function is " + str);
WebPageActivity.this.jsGoBack = str;
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.f(str2);
}
});
}
@JavascriptInterface
public void setStatusBarColor(final boolean z) {
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.b(z);
}
});
}
@JavascriptInterface
public void setTicketAction(final String str, final String str2) {
L.i(WebPageActivity.TAG, "params " + str + "showOrHide :" + str2);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.b(str, str2);
}
});
}
@JavascriptInterface
public void setTitle(final String str) {
L.i(WebPageActivity.TAG, "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) {
WebPageActivity.MyJavaScriptInterface.this.c(str, (String) obj);
}
});
}
@JavascriptInterface
public void setWebViewTitle(String str) {
WebPageActivity.this.setWebTitle(str);
}
@JavascriptInterface
public void shareSNS(String str, String str2, String str3, String str4) {
L.i(WebPageActivity.TAG, "shareSNS called. ");
WebPageActivity.this.shareTitleString = str;
WebPageActivity.this.shareDescriptString = str2;
WebPageActivity.this.shareUriString = str3;
WebPageActivity.this.shareThumbnailString = str4;
if (WebPageActivity.this.shareThumbnailString != null) {
WebPageActivity webPageActivity = WebPageActivity.this;
webPageActivity.downloadShareThumbnail(webPageActivity.shareThumbnailString, WebPageActivity.SHARE_THUMBNAIL_OUTPAGE_FILE);
}
}
@JavascriptInterface
public void shareToEnterpriseWeixin(String str) {
L.i(WebPageActivity.TAG, "shareToEnterpriseWeixin: " + str);
WebPageActivity.this.shareQyWeixin(str);
}
@JavascriptInterface
@androidx.annotation.l0(api = 21)
public void shareToMoments(final String str) {
L.i(WebPageActivity.TAG, "share to we chat moments: " + str);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.g(str);
}
});
}
@JavascriptInterface
@androidx.annotation.l0(api = 21)
public void shareToWeChat(final String str) {
L.i(WebPageActivity.TAG, "share to we chat: " + str);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.h(str);
}
});
}
@JavascriptInterface
public void showOrHideTitleBar(final boolean z) {
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.c(z);
}
});
}
@JavascriptInterface
public void showOrHideToobar(final boolean z) {
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.d(z);
}
});
}
@JavascriptInterface
public void usingVoucher(String str) {
L.i(WebPageActivity.TAG, "usingVoucher url: " + str);
if (WebPageActivity.this.getAIDLService() != null) {
try {
WebPageActivity.this.loginResponse = WebPageActivity.this.getAIDLService().e0();
} catch (RemoteException e2) {
e2.printStackTrace();
}
}
UIConfigModel.EntranceListBean.EntranceBean f2 = com.ainemo.android.preferences.o.p0().f(com.xylink.net.manager.g.L());
L.i(WebPageActivity.TAG, "usingVoucher mode: " + f2 + " ,loginResponse: " + WebPageActivity.this.loginResponse);
if (f2 == null || WebPageActivity.this.loginResponse == null || WebPageActivity.this.loginResponse.getUserProfile() == null) {
return;
}
String str2 = str + "?securityKey=" + WebPageActivity.this.loginResponse.getSecurityKey() + "&userId=" + WebPageActivity.this.loginResponse.getUserProfile().getId() + "&userName=" + WebPageActivity.this.loginResponse.getUserProfile().getDisplayName() + "&walletLevel=0&present=" + f2.getVoucherGiftPermission();
Intent intent = new Intent(this.ctx, WebPageActivity.class);
intent.putExtra(WebPageActivity.KEY_URL, str2);
WebPageActivity.this.startActivity(intent);
}
@JavascriptInterface
public void webLog(String str, String str2) {
L.i(WebPageActivity.TAG, "web log called, message=" + str2);
L.i(str, str2);
}
@JavascriptInterface
public void webViewGoBack() {
L.i(WebPageActivity.TAG, "webview go back, function is ");
com.ainemo.android.preferences.p.K().k(true);
WebPageActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.MyJavaScriptInterface.this.a();
}
});
}
public void b(String str, boolean z) {
if (z) {
try {
WebPageActivity.this.saveImageToGallery(str);
} catch (SecurityException e2) {
e2.printStackTrace();
com.xylink.common.widget.c.b.a(WebPageActivity.this, (int) R.string.permission_sdcard_tips, 1);
}
}
}
public void c(final String str) {
if (Build.VERSION.SDK_INT < 23) {
WebPageActivity.this.saveImageToGallery(str);
} else {
PermissionUtils.requestStorage(WebPageActivity.this, new PermissionUtils.PermissionRequestCallback() {
@Override
public final void onResult(boolean z) {
WebPageActivity.MyJavaScriptInterface.this.b(str, z);
}
});
}
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2, boolean z3) {
WebPageActivity.this.makeCallWithCheckPermission(str, z, z2, z3, null, null, null);
}
@JavascriptInterface
public void makeCall(String str, boolean z) {
WebPageActivity.this.makeCallWithCheckPermission(str, z, false, false, null, null, null);
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2, boolean z3, String str2) {
WebPageActivity.this.makeCallWithCheckPermission(str, z, z2, z3, str2, null, null);
}
@JavascriptInterface
public void setCloseCallback(String str) {
L.i(WebPageActivity.TAG, "set close call back, function is " + str);
WebPageActivity.this.jsGoBack = str;
}
public void b(boolean z) {
if (z) {
if (Build.VERSION.SDK_INT >= 23) {
WebPageActivity.this.getWindow().clearFlags(201326592);
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.WHITE));
WebPageActivity.this.getWindow().getDecorView().setSystemUiVisibility(9728);
}
} else if (Build.VERSION.SDK_INT >= 23) {
WebPageActivity.this.getWindow().clearFlags(201326592);
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.color_dark_actionbar_background));
WebPageActivity.this.getWindow().getDecorView().setSystemUiVisibility(1792);
}
}
public void c(boolean z) {
if (z) {
WebPageActivity.this.webviewTitleBar.setVisibility(0);
WebPageActivity.this.progressBar.setVisibility(0);
if (Build.VERSION.SDK_INT >= 23) {
WebPageActivity.this.getWindow().clearFlags(1024);
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.WHITE));
WebPageActivity.this.getWindow().getDecorView().setSystemUiVisibility(8192);
return;
}
return;
}
WebPageActivity.this.webviewTitleBar.setVisibility(8);
WebPageActivity.this.progressBar.setVisibility(8);
if (Build.VERSION.SDK_INT >= 23) {
WebPageActivity.this.getWindow().clearFlags(1024);
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.black));
WebPageActivity.this.getWindow().getDecorView().setSystemUiVisibility(256);
}
}
@JavascriptInterface
public void makeCall(String str, boolean z, boolean z2, boolean z3, String str2, String str3, String str4) {
WebPageActivity.this.makeCallWithCheckPermission(str, z, z2, z3, str2, str3, str4);
}
public void a(int i2, String str, boolean z, String str2) throws Throwable {
if (i2 != 0 || !com.xylink.net.e.e.a(str)) {
WebPageActivity.this.tvRight.setVisibility(0);
if (i2 == 0) {
WebPageActivity.this.tvRight.setVisibility(0);
WebPageActivity.this.tvRight.setText(str);
WebPageActivity.this.relaWebImage.setVisibility(8);
if (z) {
WebPageActivity.this.tvRight.setTextColor(WebPageActivity.this.getResources().getColor(R.color.xylink_blue));
return;
} else {
WebPageActivity.this.tvRight.setTextColor(WebPageActivity.this.getResources().getColor(R.color.ainemo_white));
return;
}
}
WebPageActivity.this.tvRight.setVisibility(8);
WebPageActivity.this.relaWebImage.setVisibility(0);
if (i2 == 3) {
if (WebPageActivity.this.isChangeToobarColor) {
if (WebPageActivity.this.isBlackColor) {
WebPageActivity.this.webActionImage.setImageResource(R.drawable.web_page_action_more_white);
return;
} else {
WebPageActivity.this.webActionImage.setImageResource(R.drawable.action_more_image);
return;
}
}
WebPageActivity.this.webActionImage.setImageResource(R.drawable.action_more_image);
return;
} else if (i2 == 2) {
if (WebPageActivity.this.isChangeToobarColor) {
if (WebPageActivity.this.isBlackColor) {
WebPageActivity.this.webActionImage.setImageResource(R.drawable.action_item_add);
return;
} else {
WebPageActivity.this.webActionImage.setImageResource(R.drawable.image_add);
return;
}
}
WebPageActivity.this.webActionImage.setImageResource(R.drawable.image_add);
return;
} else {
WebPageActivity.this.webActionImage.setImageResource(R.drawable.web_page_action_more_blue);
return;
}
}
WebPageActivity.this.tvRight.setVisibility(8);
WebPageActivity.this.relaWebImage.setVisibility(8);
}
public void d(final String str) {
if (Build.VERSION.SDK_INT < 23) {
WebPageActivity.this.savePictureToGallery(str);
} else {
PermissionUtils.requestStorage(WebPageActivity.this, new PermissionUtils.PermissionRequestCallback() {
@Override
public final void onResult(boolean z) {
WebPageActivity.MyJavaScriptInterface.this.c(str, z);
}
});
}
}
public void b(String str) {
if ("about".equals(str)) {
WebPageActivity.this.startActivity(new Intent(WebPageActivity.this, SettingActivity.class));
}
}
public void c(String str, boolean z) {
if (z) {
try {
WebPageActivity.this.savePictureToGallery(str);
} catch (SecurityException e2) {
e2.printStackTrace();
com.xylink.common.widget.c.b.a(WebPageActivity.this, (int) R.string.permission_sdcard_tips, 1);
}
}
}
public void a(String str) throws Throwable {
WebPageActivity.this.jsAction = null;
WebPageActivity.this.relaWebImage.setVisibility(8);
WebPageActivity.this.tvRight.setVisibility(8);
}
public void a() {
WebPageActivity.this.finish();
}
public void a(String str, String str2) {
boolean o = com.ainemo.android.preferences.g.f().o(com.xylink.net.manager.g.L());
String c2 = com.ainemo.android.preferences.g.f().c(com.xylink.net.manager.g.L());
if (!o || com.xylink.net.e.e.a(c2)) {
VoucherBean voucherBean = (VoucherBean) WebPageActivity.this.mGson.fromJson(str2, (Class<Object>) VoucherBean.class);
if (WebPageActivity.this.priceTicketsDialog != null) {
WebPageActivity.this.priceTicketsDialog = null;
}
WebPageActivity.this.showPriceTicketDialog(voucherBean);
return;
}
WebView webView = WebPageActivity.this.webview;
webView.loadUrl("Javascript:" + str + "()");
}
public void a(boolean z, String str) {
if (z) {
WebPageActivity.this.webviewTitleBar.startAnimation(WebPageActivity.this.mstartAnimation);
WebPageActivity.this.webviewTitleBar.setBackgroundColor(Color.parseColor(str));
WebPageActivity.this.tvGoPresent.setEnabled(false);
WebPageActivity.this.tvMyTickets.setEnabled(false);
WebPageActivity.this.tvRight.setEnabled(false);
} else if (WebPageActivity.this.isChangeToobarColor) {
if (WebPageActivity.this.isBlackColor) {
WebPageActivity.this.webviewTitleBar.setBackgroundColor(WebPageActivity.this.getResources().getColor(R.color.color_dark_actionbar_background));
return;
}
WebPageActivity.this.webviewTitleBar.setBackgroundColor(-1);
WebPageActivity.this.tvGoPresent.setEnabled(true);
WebPageActivity.this.tvMyTickets.setEnabled(true);
WebPageActivity.this.tvRight.setEnabled(true);
} else {
WebPageActivity.this.webviewTitleBar.setBackgroundColor(-1);
WebPageActivity.this.tvGoPresent.setEnabled(true);
WebPageActivity.this.tvMyTickets.setEnabled(true);
WebPageActivity.this.tvRight.setEnabled(true);
}
}
public void a(DurationInfo durationInfo, String str) {
WebPageActivity.this.hideDateTimePickerDialog();
WebPageActivity.this.showDurationPickerDialog(durationInfo, str);
}
public void a(boolean z) {
if (z) {
WebPageActivity.this.isBlackColor = true;
WebPageActivity.this.webviewTitleBar.setBackgroundColor(WebPageActivity.this.getResources().getColor(R.color.color_dark_actionbar_background));
WebPageActivity.this.webviewClose.setImageResource(R.drawable.image_white_back);
WebPageActivity.this.webviewTitle.setTextColor(-1);
if (Build.VERSION.SDK_INT >= 23) {
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.color_dark_actionbar_background));
WebPageActivity.this.getWindow().getDecorView().setSystemUiVisibility(256);
return;
}
WebPageActivity.this.getWindow().clearFlags(67108864);
WebPageActivity.this.getWindow().addFlags(Integer.MIN_VALUE);
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.color_dark_actionbar_background));
return;
}
WebPageActivity.this.isBlackColor = false;
WebPageActivity.this.webviewTitleBar.setBackgroundColor(WebPageActivity.this.getResources().getColor(R.color.WHITE));
WebPageActivity.this.webviewClose.setImageResource(R.drawable.image_back_new);
WebPageActivity.this.webviewTitle.setTextColor(WebPageActivity.this.getResources().getColor(R.color.text_color_90393946));
if (Build.VERSION.SDK_INT >= 23) {
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.WHITE));
WebPageActivity.this.getWindow().getDecorView().setSystemUiVisibility(8192);
return;
}
WebPageActivity.this.getWindow().clearFlags(67108864);
WebPageActivity.this.getWindow().addFlags(Integer.MIN_VALUE);
WebPageActivity.this.getWindow().setStatusBarColor(WebPageActivity.this.getResources().getColor(R.color.WHITE));
}
}
private void appendAinemoParamters() {
String str;
if (this.url.contains(PinyinUtils.DEFAULT_CHAR)) {
String[] split = this.url.split(PinyinUtils.DEFAULT_CHAR);
if (split.length >= 2) {
this.url = split[0];
str = split[1];
String format = String.format("securityKey=%s", com.xylink.net.manager.f.D());
if (!this.url.contains(URL_CONTENT_WEBVIEW_SECURITYKEY)) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format;
} else {
this.url += "?" + format;
}
}
String format2 = String.format("appVersion=%s", VersionUtil.getCodeVersionName());
if (!this.url.contains("appVersion=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format2;
} else {
this.url += "?" + format2;
}
}
if (!this.url.contains("platform=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + "platform=android";
} else {
this.url += "?platform=android";
}
}
String format3 = String.format("customizedkey=%s", com.ainemo.android.b.I);
if (!this.url.contains("customizedkey=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format3;
} else {
this.url += "?" + format3;
}
}
String format4 = String.format("r=%d", Integer.valueOf(new Random().nextInt(9999)));
if (!this.url.contains("r=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format4;
} else {
this.url += "?" + format4;
}
}
String format5 = String.format("host=%s", com.xylink.net.manager.g.E().v());
if (!this.url.contains("host=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format5;
} else {
this.url += "?" + format5;
}
}
String format6 = String.format("locale=%s", Locale.getDefault().getLanguage() + RequestBean.END_FLAG + Locale.getDefault().getCountry());
if (!this.url.contains("locale=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format6;
} else {
this.url += "?" + format6;
}
}
String format7 = String.format("statusBarHeight=%s", Integer.valueOf(getStatusBarHeight(this)));
if (!this.url.contains("statusBarHeight=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format7;
} else {
this.url += "?" + format7;
}
}
String format8 = String.format("navigateBarHeight=%s", Integer.valueOf(com.xylink.common.e.e.a(60.0f)));
if (!this.url.contains("navigateBarHeight=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format8;
} else {
this.url += "?" + format8;
}
}
String format9 = String.format("bottomNavigateBarHeight=%s", Integer.valueOf(getNavigationBarHeight(this)));
if (!this.url.contains("bottomNavigateBarHeight=")) {
if (this.url.contains("?")) {
this.url += URL_CONTENT_WEBVIEW_SPLISH + format9;
} else {
this.url += "?" + format9;
}
}
if (str != null) {
this.url += PinyinUtils.DEFAULT_CHAR + str;
}
if (this.isVoucherUrl) {
return;
}
this.url += "#/main";
return;
}
}
str = null;
String format10 = String.format("securityKey=%s", com.xylink.net.manager.f.D());
if (!this.url.contains(URL_CONTENT_WEBVIEW_SECURITYKEY)) {
}
String format22 = String.format("appVersion=%s", VersionUtil.getCodeVersionName());
if (!this.url.contains("appVersion=")) {
}
if (!this.url.contains("platform=")) {
}
String format32 = String.format("customizedkey=%s", com.ainemo.android.b.I);
if (!this.url.contains("customizedkey=")) {
}
String format42 = String.format("r=%d", Integer.valueOf(new Random().nextInt(9999)));
if (!this.url.contains("r=")) {
}
String format52 = String.format("host=%s", com.xylink.net.manager.g.E().v());
if (!this.url.contains("host=")) {
}
String format62 = String.format("locale=%s", Locale.getDefault().getLanguage() + RequestBean.END_FLAG + Locale.getDefault().getCountry());
if (!this.url.contains("locale=")) {
}
String format72 = String.format("statusBarHeight=%s", Integer.valueOf(getStatusBarHeight(this)));
if (!this.url.contains("statusBarHeight=")) {
}
String format82 = String.format("navigateBarHeight=%s", Integer.valueOf(com.xylink.common.e.e.a(60.0f)));
if (!this.url.contains("navigateBarHeight=")) {
}
String format92 = String.format("bottomNavigateBarHeight=%s", Integer.valueOf(getNavigationBarHeight(this)));
if (!this.url.contains("bottomNavigateBarHeight=")) {
}
if (str != null) {
}
if (this.isVoucherUrl) {
}
}
private void autoDismiss() {
this.mHandler.removeCallbacks(this.dissMissRunnable);
this.mHandler.postDelayed(this.dissMissRunnable, 30000L);
}
private void cancelFilePathCallback() {
ValueCallback<Uri[]> valueCallback = this.mUploadCallbackAboveL;
if (valueCallback != null) {
valueCallback.onReceiveValue(null);
this.mUploadCallbackAboveL = null;
}
}
public void changeTicketState(String str, String str2) {
List<TicketsTab> list = (List) this.mGson.fromJson(str, new TypeToken<List<TicketsTab>>() {
}.getType());
if (!com.xylink.net.e.e.a(str2) && str2.equals("1")) {
this.linearCenter.setVisibility(0);
} else if (!com.xylink.net.e.e.a(str2) && str2.equals("0")) {
this.linearCenter.setVisibility(8);
}
if (list == null || list.size() <= 0) {
return;
}
for (TicketsTab ticketsTab : list) {
if (ticketsTab.getKey().equals("present")) {
boolean isSelected = ticketsTab.isSelected();
this.isSelectPresent = isSelected;
if (isSelected) {
this.tvGoPresent.setBackground(this.mContext.getResources().getDrawable(R.drawable.boder_give_code_style));
} else {
this.tvGoPresent.setBackground(null);
}
this.tvGoPresent.setTextColor(this.mContext.getResources().getColor(R.color.black));
this.presentClick = ticketsTab.getClick();
String item = ticketsTab.getItem();
this.itemPresentName = item;
this.tvGoPresent.setText(item);
} else if (ticketsTab.getKey().equals("voucher")) {
boolean isSelected2 = ticketsTab.isSelected();
this.isSelectMyTicket = isSelected2;
if (isSelected2) {
this.tvMyTickets.setBackground(this.mContext.getResources().getDrawable(R.drawable.boder_give_code_style));
} else {
this.tvMyTickets.setBackground(null);
}
this.tvMyTickets.setTextColor(this.mContext.getResources().getColor(R.color.black));
this.myTicketClick = ticketsTab.getClick();
String item2 = ticketsTab.getItem();
this.itemTicketName = item2;
this.tvMyTickets.setText(item2);
}
}
}
public void deleteProfilePicture(String str) {
File file = new File(str);
if (file.exists()) {
file.delete();
}
}
public void downloadShareThumbnail(final String str, final String str2) {
try {
final String str3 = str2 + ".tmp";
URL url = new URL(str);
com.xylink.net.manager.e.b().a(url.toString(), str3).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) {
WebPageActivity.this.deleteProfilePicture(str3);
th.printStackTrace();
}
@Override
public void onHttpError(HttpException httpException, String str4, boolean z) {
super.onHttpError(httpException, str4, z);
WebPageActivity.this.deleteProfilePicture(str3);
}
@Override
public void onNext(Response response, boolean z) {
if (response.isSuccessful()) {
L.i(WebPageActivity.TAG, "succeed to download share picture " + str);
WebPageActivity.this.renameProfilePicture(str3, str2);
return;
}
L.i(WebPageActivity.TAG, "failed to download share picture " + str);
}
});
} catch (Exception e2) {
e2.printStackTrace();
}
}
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 void fullScreen() {
if (getResources().getConfiguration().orientation == 1) {
setRequestedOrientation(0);
} else {
setRequestedOrientation(1);
}
}
private int getNavigationBarHeight(Context context) {
Resources resources = context.getResources();
return resources.getDimensionPixelSize(resources.getIdentifier("navigation_bar_height", android.utils.n.m, UrlConstants.f.a));
}
public String getParamterValueFromURL(String str, String str2) {
String[] split;
if (!str.contains("?") || (split = str.substring(str.indexOf("?") + 1).split(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 void goToCalendar() {
StringBuilder sb = new StringBuilder();
sb.append(H5PageManager.getInstance().getH5PageHost());
sb.append("my-schedule.html?v=");
sb.append((int) (Math.random() * 10000.0d));
sb.append("&h5versionCode=");
sb.append(0);
sb.append("&hideInviteAttendee=");
sb.append(!com.ainemo.android.preferences.o.p0().d0().booleanValue());
sb.append("&hideNewLive=");
sb.append(true);
String sb2 = sb.toString();
String string = getString(R.string.my_calendar);
Intent intent = new Intent(this, WebBusinessActivity.class);
intent.putExtra(WebBusinessActivity.WEB_BUSINESS_URL, sb2);
intent.putExtra("web_business_title", string);
startActivity(intent);
finish();
}
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) {
WebPageActivity.this.c(view);
}
});
inflate.findViewById(R.id.tv_gallery).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebPageActivity.this.a(view);
}
});
inflate.findViewById(R.id.tv_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebPageActivity.this.b(view);
}
});
this.cameraGalleryDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
WebPageActivity.this.a(dialogInterface);
}
});
}
public void ipcToMeeting(final IpcFormListData ipcFormListData) {
runOnUiThread(new Runnable() {
@Override
public final void run() {
WebPageActivity.this.a(ipcFormListData);
}
});
}
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() {
WebPageActivity.this.a(str, str2, str3, str4);
}
});
}
public void onSelectShareWebview(final String str, final String str2, final String str3, final String str4, final String str5) {
ShareWebViewSelectDialog.newInstance(getSupportFragmentManager(), new ShareWebViewSelectDialog.InputCallback() {
@Override
public void onCallback(ShareWebViewSelectDialog.ShareType shareType) {
final boolean z = shareType == ShareWebViewSelectDialog.ShareType.WEIXIN_CIRCLE;
L.i(WebPageActivity.TAG, "share url: " + str3);
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 z2) {
L.i(WebPageActivity.TAG, "load image file failure:" + glideException.getMessage());
AnonymousClass12 anonymousClass12 = AnonymousClass12.this;
com.ainemo.android.p.d.a(WebPageActivity.this, (int) R.drawable.ic_weixin_share, str5, z, str3, str, str2);
return false;
}
@Override
public boolean onResourceReady(Bitmap bitmap, Object obj, com.bumptech.glide.request.j.p<Bitmap> pVar, DataSource dataSource, boolean z2) {
L.i(WebPageActivity.TAG, "load image file success !!!");
AnonymousClass12 anonymousClass12 = AnonymousClass12.this;
com.ainemo.android.p.d.a(WebPageActivity.this, (int) R.drawable.ic_weixin_share, bitmap, z, str3, str, str2);
return false;
}
});
WebPageActivity.this.sendShareEvent();
}
});
}
public void parseCommonUrl(String str) {
}
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(URL_CONTENT_WEBVIEW_SPLISH)[0];
}
}
return "";
}
private void reloadWebPage() {
L.i(TAG, "reloadWebPage page : " + this.url);
this.webview.loadUrl(this.url, this.additionalHttpHeaders);
}
public void renameProfilePicture(String str, String str2) {
File file = new File(str);
if (file.exists()) {
file.renameTo(new File(str2));
}
}
public void saveImageToGallery(String str) {
Throwable th;
FileOutputStream fileOutputStream;
if (com.xylink.net.e.e.c(str)) {
QrVoucher qrVoucher = (QrVoucher) this.mGson.fromJson(str, (Class<Object>) QrVoucher.class);
String url = qrVoucher.getUrl();
int moneyAmount = qrVoucher.getMoneyAmount();
long endTime = qrVoucher.getEndTime();
String expiredTimeStr = qrVoucher.getExpiredTimeStr();
Bitmap createQRImage = QRCodeUtil.createQRImage(url, 300, 350, BitmapFactory.decodeResource(getResources(), R.drawable.logo_image));
FileOutputStream fileOutputStream2 = null;
View inflate = LayoutInflater.from(this).inflate(R.layout.layout_qr_tickets, (ViewGroup) null, false);
inflate.setBackground(getResources().getDrawable(R.drawable.bg_image_tickets_style));
TextView textView = (TextView) inflate.findViewById(R.id.tv_title);
textView.setText(this.mContext.getString(R.string.string_receive_voucher_tip, String.valueOf(moneyAmount)));
((TextView) inflate.findViewById(R.id.tv_describe)).setText(getString(R.string.string_free_experience_video_tip));
textView.getPaint().setShader(new LinearGradient(0.0f, 0.0f, 0.0f, textView.getPaint().getTextSize(), new int[]{getResources().getColor(R.color.start_text_color), getResources().getColor(R.color.center_text_color), getResources().getColor(R.color.end_text_color)}, new float[]{0.0f, 0.6f, 1.0f}, Shader.TileMode.CLAMP));
TextView textView2 = (TextView) inflate.findViewById(R.id.tv_date);
try {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(endTime);
int i2 = calendar.get(1);
Calendar calendar2 = Calendar.getInstance();
calendar2.setTimeInMillis(System.currentTimeMillis());
if (i2 - calendar2.get(1) >= 3) {
textView2.setText(expiredTimeStr);
} else {
textView2.setText(this.mContext.getString(R.string.string_validity_period_tip, DateUtils.stringToDate(endTime)));
}
} catch (Exception e2) {
e2.printStackTrace();
}
((ImageView) inflate.findViewById(R.id.image_qr)).setImageBitmap(createQRImage);
android.utils.e.a(inflate, com.xylink.common.e.e.a(325.0f), com.xylink.common.e.e.a(436.0f));
Bitmap b2 = android.utils.e.b(inflate);
String str2 = "xylink_voucher_qrcode_" + System.currentTimeMillis() + ".png";
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "voucher_qrcode");
if (!file.exists()) {
file.mkdir();
}
File file2 = new File(file, str2);
try {
try {
try {
fileOutputStream = new FileOutputStream(file2);
} catch (Throwable th2) {
th = th2;
}
} catch (IOException e3) {
e = e3;
}
} catch (IOException e4) {
e4.printStackTrace();
}
try {
b2.compress(Bitmap.CompressFormat.JPEG, 90, fileOutputStream);
fileOutputStream.flush();
fileOutputStream.close();
} catch (IOException e5) {
e = e5;
fileOutputStream2 = fileOutputStream;
e.printStackTrace();
if (fileOutputStream2 != null) {
fileOutputStream2.flush();
fileOutputStream2.close();
}
this.mContext.sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(file2)));
com.xylink.common.widget.c.b.a(this, (int) R.string.save_success, 0);
} catch (Throwable th3) {
th = th3;
fileOutputStream2 = fileOutputStream;
if (fileOutputStream2 != null) {
try {
fileOutputStream2.flush();
fileOutputStream2.close();
} catch (IOException e6) {
e6.printStackTrace();
}
}
throw th;
}
this.mContext.sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(file2)));
com.xylink.common.widget.c.b.a(this, (int) R.string.save_success, 0);
}
}
public void savePictureToGallery(String str) {
Bitmap bitmap;
String str2;
String str3;
FileOutputStream fileOutputStream;
String str4;
Object obj;
if (com.xylink.net.e.e.a(str)) {
return;
}
ContentDesBean contentDesBean = (ContentDesBean) e.a.b.b.a(str, (Class<Object>) ContentDesBean.class);
FileOutputStream fileOutputStream2 = 0;
FileOutputStream fileOutputStream3 = null;
if ("2020YearEndSummary".equals(contentDesBean.getType())) {
this.yearsEndSummaryBinding = (com.ainemo.android.h.k3) androidx.databinding.m.a(LayoutInflater.from(this), (int) R.layout.layout_years_end_summary, (ViewGroup) null, false);
this.yearsEndSummaryBinding.v2.setImageBitmap(QRCodeUtil.createQRImage(contentDesBean.getContent().getLink(), 300, 350, BitmapFactory.decodeResource(getResources(), R.drawable.logo_image)));
this.yearsEndSummaryBinding.E2.setText(contentDesBean.getContent().getTitle());
if (com.xylink.net.e.e.c(contentDesBean.getContent().getLatestTime())) {
String[] split = contentDesBean.getContent().getLatestTime().split(PinyinUtils.DEFAULT_CHAR);
obj = split[0];
str4 = split[1];
} else {
str4 = null;
obj = null;
}
this.yearsEndSummaryBinding.E2.setText(this.shareTitle);
String string = getString(R.string.str_year_summary, new Object[]{contentDesBean.getContent().getTotalCallDuration(), contentDesBean.getContent().getTotalNightUseCount(), obj, str4});
String[] strArr = new String[4];
StringBuilder sb = new StringBuilder();
if (com.xylink.net.e.e.c(string)) {
strArr = string.split("\n");
}
sb.append(strArr[0] + "\n");
sb.append(strArr[1] + "\n");
if (com.xylink.net.e.e.c(contentDesBean.getContent().getTotalNightUseCount())) {
sb.append(strArr[2] + "\n");
}
if (com.xylink.net.e.e.c(contentDesBean.getContent().getLatestTime())) {
sb.append(strArr[3] + "\n");
}
this.yearsEndSummaryBinding.C2.setText(Html.fromHtml(sb.toString().replace("\n", "<br>")));
this.yearsEndSummaryBinding.D2.setText(contentDesBean.getContent().getSlogan());
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.yearsEndSummaryBinding.D2.getLayoutParams();
if (this.yearsEndSummaryBinding.D2.getLineHeight() >= 75) {
layoutParams.topMargin = com.xylink.common.e.e.a(18.0f);
} else if (DeviceUtil.isTabletDevice(this) && this.yearsEndSummaryBinding.D2.getLineHeight() >= 63) {
layoutParams.topMargin = com.xylink.common.e.e.a(18.0f);
} else {
layoutParams.topMargin = com.xylink.common.e.e.a(40.0f);
}
this.yearsEndSummaryBinding.D2.setLayoutParams(layoutParams);
android.utils.e.a(this.yearsEndSummaryBinding.B2, com.xylink.common.e.e.a(320.0f), com.xylink.common.e.e.a(520.0f));
bitmap = android.utils.e.b(this.yearsEndSummaryBinding.B2);
str2 = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "years_end_summary";
str3 = "xylink_years_end_summary_" + System.currentTimeMillis() + ".png";
} else {
bitmap = null;
str2 = null;
str3 = null;
}
File file = new File(str2);
if (!file.exists()) {
file.mkdir();
}
File file2 = new File(file, str3);
try {
try {
try {
fileOutputStream = new FileOutputStream(file2);
} catch (IOException e2) {
e2.printStackTrace();
}
} catch (IOException e3) {
e = e3;
}
} catch (Throwable th) {
th = th;
}
try {
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fileOutputStream);
fileOutputStream.flush();
fileOutputStream.close();
} catch (IOException e4) {
e = e4;
fileOutputStream3 = fileOutputStream;
e.printStackTrace();
if (fileOutputStream3 != null) {
fileOutputStream3.flush();
fileOutputStream3.close();
}
Uri fromFile = Uri.fromFile(file2);
?? r0 = this.mContext;
fileOutputStream2 = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", fromFile);
r0.sendBroadcast(fileOutputStream2);
com.xylink.common.widget.c.b.a(this, (int) R.string.save_success, 0);
} catch (Throwable th2) {
th = th2;
fileOutputStream2 = fileOutputStream;
if (fileOutputStream2 != 0) {
try {
fileOutputStream2.flush();
fileOutputStream2.close();
} catch (IOException e5) {
e5.printStackTrace();
}
}
throw th;
}
Uri fromFile2 = Uri.fromFile(file2);
?? r02 = this.mContext;
fileOutputStream2 = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", fromFile2);
r02.sendBroadcast(fileOutputStream2);
com.xylink.common.widget.c.b.a(this, (int) R.string.save_success, 0);
}
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();
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("PL=ANDROID");
stringBuffer.append("&AV=" + VersionUtil.getAppVersionCode(this));
stringBuffer.append("&DR=14097");
stringBuffer.append("&RL=" + a.g() + PinyinUtils.CATEGORY_NEMO + a.f());
StringBuilder sb = new StringBuilder();
sb.append("&MF=");
sb.append(a.c());
stringBuffer.append(sb.toString());
stringBuffer.append("&MO=" + a.d());
stringBuffer.append("&OS=" + a.e());
stringBuffer.append("&API=" + a.a());
stringBuffer.append("&LCLO=");
stringBuffer.append("&LCLA=");
this.additionalHttpHeaders.put("n-ua", stringBuffer.toString());
this.additionalHttpHeaders.put(HttpHeaders.ACCEPT_LANGUAGE, Locale.getDefault().toString().replace(RequestBean.END_FLAG, "-"));
}
public void setWebTitle(String str) {
if (this.isPermanentTitle) {
return;
}
if (str != null && !str.isEmpty()) {
this.webviewTileString = str;
} else {
this.webviewTileString = "";
}
this.changeTitleHandler.post(this.changeTitleRunnable);
}
public void shareQyWeixin(String str) {
ShareBean shareBean;
ShareBean.ParamsBean paramsBean;
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("voucher") || (paramsBean = this.paramsBean) == null) {
return;
}
String type = paramsBean.getType();
this.type = type;
if (com.xylink.net.e.e.a(type) || !this.type.equals("voucher")) {
return;
}
this.paramsBean.getDispenseRecordId();
this.paramsBean.getMd5();
this.paramsBean.getVoucherId();
String moneyAmount = this.paramsBean.getMoneyAmount();
this.paramsBean.getDispenseUserId();
this.paramsBean.getTypeName();
this.paramsBean.getDispenseEnterpriseId();
this.paramsBean.getDispenseNum();
this.paramsBean.getEndTime();
System.currentTimeMillis();
getString(R.string.string_mp_ticket_tip, new Object[]{moneyAmount});
getString(R.string.string_free_use_cloud_meeting);
if (com.xylink.net.e.e.a(this.shareType) || !this.shareType.equals("card")) {
return;
}
com.ainemo.android.p.d.c(this, this.shareTitle + "\n" + this.shareDesc + "\n" + getString(R.string.cmr_share_url, new Object[]{this.shareUrl}));
}
@androidx.annotation.l0(api = 21)
public void shareWx(String str, final boolean z) {
ShareBean shareBean;
Object obj;
char c2;
String time;
String meetingNumber;
Object obj2;
if (!this.wxapi.isWXAppInstalled()) {
com.xylink.common.widget.c.b.b(this, getResources().getString(R.string.vod_share_no_weixin), 0);
return;
}
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.userName = this.loginResponse.getUserProfile().getDisplayName();
this.userId = this.loginResponse.getUserProfile().getId();
}
} 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) {
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.shareDesc)) {
this.shareDesBean = (ShareBean.ShareDes) e.a.b.b.a(this.shareDesc, (Class<Object>) ShareBean.ShareDes.class);
}
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) {
Object applyName = shareDes.getApplyName();
this.shareDesBean.getReceiveName();
if (!com.xylink.net.e.e.a(this.shareType) && this.shareType.equals("mp")) {
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")) {
long parseLong = Long.parseLong(this.shareDesBean.getStartTime());
long parseLong2 = Long.parseLong(this.shareDesBean.getEndTime());
if (!DateUtils.isSampleYear(parseLong, parseLong2)) {
obj2 = DateUtils.stringToDate(parseLong) + "-" + DateUtils.stringToDate(parseLong2);
} else if (DateUtils.isSampleDay(parseLong, parseLong2)) {
obj2 = DateUtils.stringToDate(parseLong) + "-" + DateUtils.stampToDate(parseLong2);
} else {
obj2 = 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[]{obj2}) + "\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")) {
try {
ImageLoader.b().a(this.shareImage, new com.bumptech.glide.request.f<Bitmap>() {
@Override
public boolean onLoadFailed(@androidx.annotation.h0 GlideException glideException, Object obj3, com.bumptech.glide.request.j.p<Bitmap> pVar, boolean z2) {
L.i(WebPageActivity.TAG, "load image file failure:" + glideException.getMessage());
if (com.xylink.net.e.e.a(WebPageActivity.this.shareType) || !WebPageActivity.this.shareType.equals("card")) {
return false;
}
WebPageActivity webPageActivity = WebPageActivity.this;
com.ainemo.android.p.d.a(webPageActivity, R.drawable.ic_weixin_share, z, webPageActivity.shareUrl, WebPageActivity.this.shareTitle, WebPageActivity.this.shareDesc);
return false;
}
@Override
public boolean onResourceReady(Bitmap bitmap, Object obj3, com.bumptech.glide.request.j.p<Bitmap> pVar, DataSource dataSource, boolean z2) {
L.i(WebPageActivity.TAG, "load image file success !!!");
if (com.xylink.net.e.e.a(WebPageActivity.this.shareType) || !WebPageActivity.this.shareType.equals("card")) {
return false;
}
WebPageActivity webPageActivity = WebPageActivity.this;
com.ainemo.android.p.d.a(webPageActivity, (int) R.drawable.ic_weixin_share, bitmap, z, webPageActivity.shareUrl, WebPageActivity.this.shareTitle, WebPageActivity.this.shareDesc);
return false;
}
});
} catch (Exception e3) {
L.e(TAG, "catch exception, share to wechat by default image" + e3.getStackTrace());
if (!com.xylink.net.e.e.a(this.shareType) && this.shareType.equals("card")) {
com.ainemo.android.p.d.a(this, R.drawable.ic_weixin_share, z, this.shareUrl, this.shareTitle, this.shareDesc);
}
}
} else {
Object obj3 = null;
if (!com.xylink.net.e.e.a(this.from) && this.from.equals("voucher")) {
ShareBean.ParamsBean paramsBean3 = this.paramsBean;
if (paramsBean3 != null) {
String type = paramsBean3.getType();
this.type = type;
if (!com.xylink.net.e.e.a(type) && this.type.equals("voucher")) {
String dispenseRecordId = this.paramsBean.getDispenseRecordId();
String md5 = this.paramsBean.getMd5();
String voucherId = this.paramsBean.getVoucherId();
String moneyAmount = this.paramsBean.getMoneyAmount();
String dispenseUserId = this.paramsBean.getDispenseUserId();
String typeName = this.paramsBean.getTypeName();
String dispenseEnterpriseId = this.paramsBean.getDispenseEnterpriseId();
String dispenseNum = this.paramsBean.getDispenseNum();
String endTime = this.paramsBean.getEndTime();
int typeGroup = this.paramsBean.getTypeGroup();
long currentTimeMillis = System.currentTimeMillis();
String string = getString(R.string.string_free_use_cloud_meeting);
if (!com.xylink.net.e.e.a(this.shareType) && this.shareType.equals("mp")) {
if (typeGroup == 1) {
com.ainemo.android.p.d.a(this, getString(R.string.string_mp_ticket_tip, new Object[]{moneyAmount}), this.shareDesc, R.drawable.ticket_mp_bg_image, string, voucherId, dispenseUserId, moneyAmount, dispenseRecordId, md5, currentTimeMillis, typeName, dispenseEnterpriseId, dispenseNum, endTime, typeGroup);
} else if (typeGroup == 2) {
com.ainemo.android.p.d.a(this, getString(R.string.string_mp_train_voucher_tip, new Object[]{moneyAmount}), this.shareDesc, R.drawable.training_tickets_bg, string, voucherId, dispenseUserId, moneyAmount, dispenseRecordId, md5, currentTimeMillis, typeName, dispenseEnterpriseId, dispenseNum, endTime, typeGroup);
}
} else if (com.xylink.net.e.e.a(this.shareType) || !this.shareType.equals("card")) {
} else {
if (z) {
com.ainemo.android.p.d.a(this, R.drawable.wx_circle_image_card, z, this.shareUrl, this.shareTitle + "\n" + this.shareDesc, this.shareDesc);
return;
}
com.ainemo.android.p.d.a(this, R.drawable.wx_circle_image_card, z, this.shareUrl, this.shareTitle, this.shareDesc);
}
} else if (!com.xylink.net.e.e.a(this.type) && this.type.equals("meeting")) {
com.ainemo.android.p.d.a(this, getString(R.string.click_join_meeting), getString(R.string.cmr_share_time, new Object[]{time}) + "\n" + getString(R.string.cmr_share_content, new Object[]{meetingNumber}), R.drawable.min_app_bg, this.paramsBean.getTopic(), this.paramsBean.getTime(), this.paramsBean.getEndTime(), this.paramsBean.getMeetingNumber(), this.paramsBean.getShareCode(), this.userName, this.userId, this.shareUrl);
} else if (!com.xylink.net.e.e.a(this.type) && this.type.equals(j.d.g0)) {
String c3 = com.ainemo.android.preferences.g.f().c(this.loginResponse.getUserProfile().getId());
String d2 = com.ainemo.android.preferences.g.f().d(this.loginResponse.getUserProfile().getId());
String displayName = this.loginResponse.getUserProfile().getDisplayName();
long id = this.loginResponse.getUserProfile().getId();
if (displayName.length() > 5) {
StringBuilder sb = new StringBuilder();
c2 = 0;
sb.append(displayName.substring(0, 4));
sb.append("…");
displayName = sb.toString();
} else {
c2 = 0;
}
String str2 = displayName;
Object[] objArr = new Object[1];
objArr[c2] = str2;
com.ainemo.android.p.d.a(this, getString(R.string.string_invate_click_use, objArr), "", R.drawable.min_app_bg, c3, d2, str2, System.currentTimeMillis(), str2, id);
} else if ("qrImage".equals(this.type)) {
String url = this.paramsBean.getUrl();
String moneyAmount2 = this.paramsBean.getMoneyAmount();
String endTime2 = this.paramsBean.getEndTime();
String expiredTimeStr = this.paramsBean.getExpiredTimeStr();
Bitmap createQRImage = QRCodeUtil.createQRImage(url, 300, 350, BitmapFactory.decodeResource(getResources(), R.drawable.logo_image));
View inflate = LayoutInflater.from(this).inflate(R.layout.layout_qr_tickets, (ViewGroup) null, false);
inflate.setBackground(getResources().getDrawable(R.drawable.bg_image_tickets_style));
TextView textView = (TextView) inflate.findViewById(R.id.tv_title);
textView.setText(this.mContext.getString(R.string.string_receive_voucher_tip, moneyAmount2));
textView.getPaint().setShader(new LinearGradient(0.0f, 0.0f, 0.0f, textView.getPaint().getTextSize(), new int[]{getResources().getColor(R.color.start_text_color), getResources().getColor(R.color.center_text_color), getResources().getColor(R.color.end_text_color)}, new float[]{0.0f, 0.6f, 1.0f}, Shader.TileMode.CLAMP));
TextView textView2 = (TextView) inflate.findViewById(R.id.tv_date);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(Long.parseLong(endTime2));
int i2 = calendar.get(1);
Calendar calendar2 = Calendar.getInstance();
calendar2.setTimeInMillis(System.currentTimeMillis());
if (i2 - calendar2.get(1) >= 3) {
textView2.setText(expiredTimeStr);
} else {
try {
textView2.setText(this.mContext.getString(R.string.string_validity_period_tip, DateUtils.stringToDate(Long.parseLong(endTime2))));
} catch (Exception e4) {
e4.printStackTrace();
}
}
((ImageView) inflate.findViewById(R.id.image_qr)).setImageBitmap(createQRImage);
android.utils.e.a(inflate, com.xylink.common.e.e.a(325.0f), com.xylink.common.e.e.a(436.0f));
com.ainemo.android.p.d.a(this.mContext, android.utils.e.b(inflate), false);
}
}
} else if ("2020YearEndSummary".equals(this.from) && j.c.X.equals(this.shareType)) {
this.yearsEndSummaryBinding = (com.ainemo.android.h.k3) androidx.databinding.m.a(LayoutInflater.from(this), (int) R.layout.layout_years_end_summary, (ViewGroup) null, false);
if (com.xylink.net.e.e.c(this.shareDesBean.getLatestTime())) {
Object[] split = this.shareDesBean.getLatestTime().split(PinyinUtils.DEFAULT_CHAR);
obj3 = split[0];
obj = split[1];
} else {
obj = null;
}
this.yearsEndSummaryBinding.E2.setText(this.shareTitle);
String string2 = getString(R.string.str_year_summary, new Object[]{this.shareDesBean.getTotalCallDuration(), this.shareDesBean.getTotalNightUseCount(), obj3, obj});
String[] strArr = new String[4];
StringBuilder sb2 = new StringBuilder();
if (com.xylink.net.e.e.c(string2)) {
strArr = string2.split("\n");
}
sb2.append(strArr[0] + "\n");
sb2.append(strArr[1] + "\n");
if (com.xylink.net.e.e.c(this.shareDesBean.getTotalNightUseCount())) {
sb2.append(strArr[2] + "\n");
}
if (com.xylink.net.e.e.c(this.shareDesBean.getLatestTime())) {
sb2.append(strArr[3] + "\n");
}
this.yearsEndSummaryBinding.C2.setText(Html.fromHtml(sb2.toString().replace("\n", "<br>")));
this.yearsEndSummaryBinding.D2.setText(this.shareDesBean.getSlogan());
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.yearsEndSummaryBinding.D2.getLayoutParams();
if (this.yearsEndSummaryBinding.D2.getLineHeight() >= 75) {
layoutParams.topMargin = com.xylink.common.e.e.a(18.0f);
} else if (DeviceUtil.isTabletDevice(this) && this.yearsEndSummaryBinding.D2.getLineHeight() >= 63) {
layoutParams.topMargin = com.xylink.common.e.e.a(18.0f);
} else {
layoutParams.topMargin = com.xylink.common.e.e.a(40.0f);
}
this.yearsEndSummaryBinding.D2.setLayoutParams(layoutParams);
this.yearsEndSummaryBinding.v2.setImageBitmap(QRCodeUtil.createQRImage(this.shareDesBean.getLink(), 300, 350, BitmapFactory.decodeResource(getResources(), R.drawable.logo_image)));
android.utils.e.a(this.yearsEndSummaryBinding.B2, com.xylink.common.e.e.a(320.0f), com.xylink.common.e.e.a(520.0f));
com.ainemo.android.p.d.a(this.mContext, android.utils.e.b(this.yearsEndSummaryBinding.B2), z);
}
}
}
}
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(WebPageActivity.TAG, "onDateTimeChoose, year : " + i2 + ", month : " + i3 + ", day : " + i4 + ", hour : " + i5 + ", minute : " + i6);
WebPageActivity.this.selectYear = i2;
WebPageActivity.this.selectMonth = i3;
WebPageActivity.this.selectDay = i4;
WebPageActivity.this.selectHour = i5;
WebPageActivity.this.selectMinute = i6;
String str2 = i2 + "-" + i3 + "-" + i4 + UrlConstants.h.a + i5 + ":" + i6;
WebPageActivity.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();
}
this.dateTimeDialog.showNow(getSupportFragmentManager(), "TimeDialogFragment");
this.dateTimeDialog.a(this.selectYear, this.selectMonth, this.selectDay, this.selectHour, this.selectMinute);
}
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) {
L.i(WebPageActivity.TAG, "onTimeChoose, hour : " + i2 + ", minute : " + i3);
WebPageActivity.this.durationHour = i2;
WebPageActivity.this.durationMinute = i3;
DurationInfo durationInfo2 = new DurationInfo();
durationInfo2.setHour(i2);
durationInfo2.setMinute(i3);
durationInfo2.setMaxHour(durationInfo.getMaxHour());
String json = WebPageActivity.this.mGson.toJson(durationInfo2);
WebView webView = WebPageActivity.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);
}
public void showPriceTicketDialog(VoucherBean voucherBean) {
if (voucherBean != null) {
voucherBean.getMoneyAmount();
String scope = voucherBean.getScope();
if (this.priceTicketsDialog == null) {
PriceTicketsDialog build = new PriceTicketsDialog.Builder().build();
this.priceTicketsDialog = build;
PriceTicketsDialog.Builder builder = build.getBuilder();
builder.setTitle(getString(R.string.string_use_for_company));
builder.setButtonText(getString(R.string.string_now_create_company));
builder.setMoneyUrl(voucherBean.getMoneyImgUrl());
builder.setIsShowList(false);
if ("fix_cloud_meeting_room".equals(scope)) {
builder.setContent(voucherBean.getDetail());
} else if ("training_course".equals(scope)) {
builder.setContent(getString(R.string.string_describe_course));
}
this.priceTicketsDialog.setCancelable(false);
this.priceTicketsDialog.setOnDialogCallback(new PriceTicketsDialog.OnDialogCallback() {
@Override
public void onButtonClicked(Button button) {
if (WebPageActivity.this.priceTicketsDialog != null && WebPageActivity.this.priceTicketsDialog.isVisible()) {
WebPageActivity.this.priceTicketsDialog.dismissAllowingStateLoss();
}
com.ainemo.android.manager.e.a().a(WebPageActivity.this.mContext);
WebPageActivity.this.finish();
}
@Override
public void onCloseClicked(ImageView imageView) {
if (WebPageActivity.this.priceTicketsDialog == null || !WebPageActivity.this.priceTicketsDialog.isVisible()) {
return;
}
WebPageActivity.this.priceTicketsDialog.dismissAllowingStateLoss();
}
});
}
if (this.priceTicketsDialog.isVisible() || this.priceTicketsDialog.isAdded()) {
return;
}
androidx.fragment.app.m a = getSupportFragmentManager().a();
a.a(this.priceTicketsDialog, "priceTicketDialog");
a.f();
this.priceTicketsDialog.setCancelable(false);
}
}
public 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, "WebPageActiviy").f();
getSupportFragmentManager().b();
L.i(TAG, "show wait dialog");
return;
}
com.xylink.common.widget.b.p pVar = this.dialog;
if (pVar != null) {
pVar.dismissAllowingStateLoss();
}
}
public void startWatch(long j2, Boolean bool, Boolean bool2) {
UserDevice userDevice = new UserDevice();
userDevice.setId(j2);
userDevice.setType(2);
userDevice.setDisplayName(getResources().getString(R.string.featurenemo));
userDevice.setPublicNemo(true);
Intent intent = new Intent(this, XylinkMeetingActivity.class);
intent.putExtra("key_ring_reminder", bool);
intent.putExtra("key_control_camera", bool2);
startActivity(intent);
}
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(String str, String str2, String str3, String str4) {
new MakeCallManager(this).callWithSettings(str, this.isAudioMute, this.isVideoMute, false, str2, str3, str4, "scheduledPage");
}
public void b(boolean z) {
if (z) {
try {
fromGallery();
return;
} catch (SecurityException e2) {
e2.printStackTrace();
return;
}
}
cancelFilePathCallback();
}
public void c(View view) {
if (Build.VERSION.SDK_INT >= 23) {
PermissionUtils.requestCamera(this, new PermissionUtils.PermissionRequestCallback() {
@Override
public final void onResult(boolean z) {
WebPageActivity.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 closeWebViewPage() {
if (this.back2MainWhenClickClose) {
goMainActivity();
}
finish();
}
public void d(View view) {
reloadWebPage();
}
public void dismissWaitDialog() {
L.i(TAG, "dismiss wait dialog: " + this.dialog);
com.xylink.common.widget.b.p pVar = this.dialog;
if (pVar == null || !pVar.isVisible()) {
return;
}
this.dialog.dismissAllowingStateLoss();
getSupportFragmentManager().b();
}
public void e(View view) {
if (this.jsAction == null) {
return;
}
L.i(TAG, "call webaction: " + this.jsAction);
executeJsCallback(this.jsAction, null);
}
public void f(View view) {
L.i(TAG, "on toolbar back pressed:" + this.jsGoBack);
if (android.utils.d.d(this.jsGoBack) && !this.jsGoBack.equals("undefined")) {
executeJsCallback(this.jsGoBack, null);
} else {
finish();
}
}
public int getStatusBarHeight(Context context) {
Resources resources = context.getResources();
return resources.getDimensionPixelSize(resources.getIdentifier("status_bar_height", android.utils.n.m, UrlConstants.f.a));
}
public void m() {
String str = this.url;
if (str != null) {
if (str.contains("enterprise/pay")) {
L.i(TAG, "no reload");
} else if (!com.xylink.net.e.e.a(this.from) && this.from.equals("cloudMeeting") && this.isRefresh) {
this.webview.reload();
com.ainemo.android.preferences.p.K().k(false);
}
}
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
super.onActivityResult(i2, i3, intent);
if (i3 == 2) {
if (i2 == 1) {
String stringExtra = intent.getStringExtra("scanResult");
if (this.isJumpToScan) {
this.isJumpToScan = false;
if (!android.utils.d.d(this.jsScanCode) || this.jsScanCode.equals("undefined")) {
return;
}
L.i(TAG, "h5 page do this back action, " + this.jsScanCode);
executeJsCallback(this.jsScanCode, stringExtra);
}
}
} else if (i2 != 1001) {
if (i2 != 1002 || this.mUploadCallbackAboveL == null) {
return;
}
uploadDataCallBack(i3, intent);
} else if (i3 == -1) {
if (intent == null) {
intent = new Intent();
intent.setData(FileUtils.getFileUri(this, this.tempFile));
}
if (this.mUploadCallbackAboveL != null) {
uploadDataCallBack(i3, intent);
}
} else {
cancelFilePathCallback();
}
}
@Override
public void onBackPressed() {
L.i(TAG, "onBackPressed:" + this.jsGoBack);
if (com.ainemo.android.preferences.p.K().y()) {
com.ainemo.android.preferences.p.K().i(false);
goMainActivity();
} else if (android.utils.d.d(this.jsGoBack) && !this.jsGoBack.equals("undefined")) {
executeJsCallback(this.jsGoBack, null);
} else if (this.webview.canGoBack()) {
this.webview.goBack();
} else {
finish();
}
}
@Override
@SuppressLint({"SetJavaScriptEnabled"})
@androidx.annotation.l0(api = 21)
public void onCreate(Bundle bundle) {
int i2;
int i3;
requestWindowFeature(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);
setContentView(R.layout.activity_webview);
this.mstartAnimation = AnimationUtils.loadAnimation(this, R.anim.toobar_alpha);
this.mexitAnimation = AnimationUtils.loadAnimation(this, R.anim.toobar_alpha_exit);
this.mContext = this;
this.mContactApiManager = new com.ainemo.android.g.e.a(this);
this.isAudioMute = com.ainemo.android.preferences.j.n().b();
this.isVideoMute = com.ainemo.android.preferences.j.n().a();
this.isVoucherUrl = getIntent().getBooleanExtra(KEY_IS_VOUCHER, false);
this.typeGroup = getIntent().getIntExtra("flag_intent_typeGroup", 1);
this.intentFrom = getIntent().getStringExtra("flag_intent_from");
this.enterpriseName = getIntent().getStringExtra("flag_intent_enterpriseName");
this.from = getIntent().getStringExtra(KEY_FROM);
UrlBean D = com.ainemo.android.preferences.p.K().D();
this.urlBean = D;
if (D != null) {
this.userInfo.setAppResourcePayUrl(D.getAppResourcePayUrl());
}
boolean o = com.ainemo.android.preferences.a.s().o(com.xylink.net.manager.g.L());
this.displayUpgrade = o;
this.userInfo.setDisplayUpgrade(o);
this.userInfo.setEnterpriseId(com.ainemo.android.preferences.g.f().c(com.xylink.net.manager.g.L()));
String r = com.ainemo.android.preferences.p.K().r();
this.getMonitorPageWay = r;
this.userInfo.setGetMonitorPageWay(r);
setAdditionalHttpHeaders();
this.wxapi = WXAPIFactory.createWXAPI(this, com.ainemo.android.b.x);
this.iwwapi = IwwapiFactory.getInstance().getIwwapi();
this.layoutRefresh = (LinearLayout) findViewById(R.id.layout_refresh);
this.webview = (WebView) findViewById(R.id.webview);
this.webviewTitle = (TextView) findViewById(R.id.web_title);
this.webviewClose = (ImageView) findViewById(R.id.web_close);
this.toolbarLeft = (TextView) findViewById(R.id.tv_web_left);
this.linearLeft = (LinearLayout) findViewById(R.id.linear_left);
this.webviewShare = (TextView) findViewById(R.id.web_share_image);
this.progressBar = (ProgressBar) findViewById(R.id.progressBar);
this.webviewTitleBar = (RelativeLayout) findViewById(R.id.webviewTitleBar);
this.progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.progress_bar_bg));
this.tvRight = (TextView) findViewById(R.id.tv_right);
this.relaRight = (RelativeLayout) findViewById(R.id.rela_right);
this.linearCenter = (LinearLayout) findViewById(R.id.linear_center);
this.tvGoPresent = (TextView) findViewById(R.id.tv_go_give);
this.tvMyTickets = (TextView) findViewById(R.id.tv_my_ticket);
this.mVideoContainer = (FrameLayout) findViewById(R.id.videoContainer);
this.webActionImage = (ImageView) findViewById(R.id.web_action_image);
this.relaWebImage = (RelativeLayout) findViewById(R.id.rela_web_image);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
int i4 = (int) getResources().getDisplayMetrics().density;
double d2 = i4;
float f2 = (float) (((i2 / 40) * 3.0d) / d2);
float f3 = (float) (((i3 / 40) * 3.0d) / d2);
L.i(TAG, "layoutParams: density:" + i4 + " xdpi:" + ((int) getResources().getDisplayMetrics().xdpi) + " ydpi:" + ((int) getResources().getDisplayMetrics().ydpi) + " densityDpi:" + getResources().getDisplayMetrics().densityDpi + " paddingleft:" + f2 + " paddingright:" + f3);
layoutParams.setMargins(-com.xylink.common.e.e.a(this, f2), 0, 0, -com.xylink.common.e.e.a(this, f3));
this.mVideoContainer.setLayoutParams(layoutParams);
this.layout_layoutwebview = (LinearLayout) findViewById(R.id.layout_layoutwebview);
if (getIntent().getBooleanExtra(ENABLE_HARDWARE_ACCELERATED, false)) {
getWindow().setFlags(16777216, 16777216);
}
this.mGson = new Gson();
this.url = getIntent().getStringExtra(KEY_URL);
L.i(TAG, "url: " + android.utils.d.a((Object) this.url, ""));
if (com.xylink.net.e.e.c(this.url) && this.url.contains("annualSummary")) {
this.interceptRequestOrientation = true;
setRequestedOrientation(1);
}
byte[] byteArrayExtra = getIntent().getByteArrayExtra(KEY_DATA);
this.isPermanentTitle = getIntent().getBooleanExtra(KEY_TITLE_IS_PERMANENT, false);
this.appendAdditional = getIntent().getBooleanExtra(APPEND_ADDITIONAL, true);
String stringExtra = getIntent().getStringExtra(KEY_TITLE);
if (this.isPermanentTitle && stringExtra != null) {
this.webviewTitle.setText(stringExtra);
}
if (this.url != null) {
if (this.appendAdditional) {
appendAinemoParamters();
}
L.i(TAG, "my_cloud_url:" + this.url);
parseCommonUrl(this.url);
}
this.toolbarLeft.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
L.i(WebPageActivity.TAG, "on toolbar back pressed:" + WebPageActivity.this.jsGoBack);
if (!android.utils.d.d(WebPageActivity.this.jsGoBack) || WebPageActivity.this.jsGoBack.equals("undefined")) {
if (WebPageActivity.this.webview.canGoBack()) {
WebPageActivity.this.webview.goBack();
return;
} else {
WebPageActivity.this.finish();
return;
}
}
WebPageActivity webPageActivity = WebPageActivity.this;
webPageActivity.executeJsCallback(webPageActivity.jsGoBack, null);
}
});
this.webviewClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if ("ConfirmPhoneActivity".equals(WebPageActivity.this.intentFrom)) {
WebPageActivity.this.finish();
return;
}
L.i(WebPageActivity.TAG, "on toolbar back pressed:" + WebPageActivity.this.jsGoBack);
if (!com.ainemo.android.preferences.p.K().y()) {
if (!android.utils.d.d(WebPageActivity.this.jsGoBack) || WebPageActivity.this.jsGoBack.equals("undefined")) {
if (WebPageActivity.this.webview.canGoBack()) {
WebPageActivity.this.webview.goBack();
} else {
WebPageActivity.this.finish();
}
} else {
WebPageActivity webPageActivity = WebPageActivity.this;
webPageActivity.executeJsCallback(webPageActivity.jsGoBack, null);
}
} else {
com.ainemo.android.preferences.p.K().i(false);
WebPageActivity.this.goMainActivity();
}
WebPageActivity.this.hideInputMethod();
}
});
this.webviewShare.setOnClickListener(new View.OnClickListener() {
@Override
@androidx.annotation.l0(api = 19)
public void onClick(View view) {
WebPageActivity.this.webview.evaluateJavascript("Javascript:onShareInfo()", new ValueCallback<String>() {
@Override
public void onReceiveValue(String str) {
L.i("Javascript:onShareInfo() onReceiveValue=" + str);
if (!com.xylink.net.e.e.a(str) && !str.toLowerCase().equals("null")) {
LiveShareResponse liveShareResponse = (LiveShareResponse) e.a.b.b.a(str.replaceAll("\\\\", "").replace("\"{", "{").replace("}\"", "}"), (Class<Object>) LiveShareResponse.class);
if (liveShareResponse != null) {
WebPageActivity.this.onSelectShareWebview(liveShareResponse.getShareTitle(), liveShareResponse.getShareDescription(), liveShareResponse.getShareUrl(), liveShareResponse.getShareThumbnail(), WebPageActivity.SHARE_THUMBNAIL_OUTPAGE_FILE);
return;
} else {
L.e(WebPageActivity.TAG, "live share info is empty!");
return;
}
}
L.e(WebPageActivity.TAG, "live share info is empty!");
}
});
}
});
findViewById(R.id.reload_web_page).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebPageActivity.this.d(view);
}
});
this.webviewShare.setVisibility(8);
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.setCacheMode(2);
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
this.webview.addJavascriptInterface(new MyJavaScriptInterface(this), "xylink");
this.webview.setScrollBarStyle(33554432);
settings.setAllowUniversalAccessFromFileURLs(true);
settings.setUserAgentString(settings.getUserAgentString() + "XYLINK");
this.webview.setLayerType(2, null);
this.webview.getSettings().setDomStorageEnabled(true);
settings.setAllowFileAccess(true);
settings.setAppCacheEnabled(true);
settings.setAppCacheMaxSize(8388608L);
settings.setAppCachePath(getApplicationContext().getCacheDir().getAbsolutePath());
this.webview.getSettings().setDatabaseEnabled(true);
this.webview.getSettings().setDatabasePath(getApplicationContext().getCacheDir().getAbsolutePath());
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setBlockNetworkLoads(false);
settings.setBlockNetworkImage(false);
settings.setLoadsImagesAutomatically(true);
if (Build.VERSION.SDK_INT >= 16) {
settings.setAllowUniversalAccessFromFileURLs(true);
} else {
try {
Method method = settings.getClass().getMethod("setAllowUniversalAccessFromFileURLs", Boolean.TYPE);
if (method != null) {
method.invoke(settings, true);
}
} catch (IllegalAccessException e2) {
e2.printStackTrace();
} catch (NoSuchMethodException e3) {
e3.printStackTrace();
} catch (InvocationTargetException e4) {
e4.printStackTrace();
}
}
this.webview.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String str, String str2, String str3, String str4, long j2) {
try {
WebPageActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
} catch (Exception unused) {
}
}
});
this.webview.setWebViewClient(new WebViewClient() {
@Override
public void onLoadResource(WebView webView, String str) {
super.onLoadResource(webView, str);
}
@Override
public void onPageFinished(WebView webView, String str) {
WebPageActivity.this.dismissWaitDialog();
if (str != null && str.indexOf(WebPageActivity.URL_CONTENT_WEBVIEW_SHARETYPE) > 0) {
WebPageActivity.this.webview.loadUrl(WebPageActivity.JS_CALLBACK_SHARESNS);
WebPageActivity.this.webviewShare.setVisibility(0);
}
if (str != null) {
WebPageActivity.this.webviewShare.setVisibility(4);
}
WebPageActivity.this.parseCommonUrl(str);
if (str.contains("liveVideo") && str.contains("notify=yes")) {
WebPageActivity.this.back2MainWhenClickClose = true;
try {
WebPageActivity.this.getAIDLService().o0();
} catch (RemoteException e5) {
e5.printStackTrace();
}
}
if (!com.xylink.net.e.e.a(WebPageActivity.this.intentFrom) && WebPageActivity.this.intentFrom.equals(WebPageActivity.FLAG_INTENT_ENTERPRISE_TICKETS)) {
if (WebPageActivity.this.ticketSuccessDialog != null) {
WebPageActivity.this.ticketSuccessDialog = null;
}
WebPageActivity webPageActivity = WebPageActivity.this;
webPageActivity.showTicketSuccessDialog(webPageActivity.typeGroup);
WebPageActivity.this.intentFrom = "";
}
if (WebPageActivity.this.isWebUrlFail) {
return;
}
WebPageActivity.this.layoutRefresh.setVisibility(8);
WebPageActivity.this.webview.setVisibility(0);
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
super.onPageStarted(webView, str, bitmap);
WebPageActivity.this.isNAPIControlSuccess = false;
WebPageActivity.this.isWebUrlFail = false;
if (str.contains("minecmr.html") || str.contains("www.xylink.com")) {
return;
}
if (WebPageActivity.this.isFirstLoading) {
WebPageActivity.this.isFirstLoading = false;
} else {
WebPageActivity.this.showWaitDialog();
}
}
@Override
public void onReceivedError(WebView webView, int i5, String str, String str2) {
L.i(WebPageActivity.TAG, "on load error, error code is" + i5);
WebPageActivity.this.isWebUrlFail = true;
WebPageActivity.this.dismissWaitDialog();
if (str2.equals(WebPageActivity.this.url)) {
WebPageActivity.this.layoutRefresh.setVisibility(0);
WebPageActivity.this.webview.setVisibility(8);
}
}
@Override
public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
WebPageActivity.this.dismissWaitDialog();
}
@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
String str2;
String str3;
String[] split;
L.i(WebPageActivity.TAG, "override url:" + android.utils.d.a((Object) str, ""));
WebPageActivity.this.parseCommonUrl(str);
if (str.contains("xylink-agreement.html")) {
WebPageActivity.this.webview.getSettings().setTextZoom(100);
} else {
WebPageActivity.this.webview.getSettings().setTextZoom(100);
}
if (str.contains(WebPageActivity.KEY_EVENT_CLIPBOARD_COPY)) {
try {
((ClipboardManager) WebPageActivity.this.getSystemService("clipboard")).setText(new String(Base64.decode(str.substring(str.indexOf(WebPageActivity.KEY_EVENT_CLIPBOARD_COPY) + 26).getBytes(), 0)));
} catch (Exception e5) {
L.i(WebPageActivity.TAG, "exception: " + e5.getMessage());
}
return true;
} else if (str.contains(WebPageActivity.KEY_EVENT_OPEN_BROWSER)) {
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(new String(Base64.decode(str.substring(str.indexOf(WebPageActivity.KEY_EVENT_OPEN_BROWSER) + 26).getBytes(), 0))));
intent.addFlags(268435456);
WebPageActivity.this.startActivity(intent);
} catch (Exception e6) {
L.i(WebPageActivity.TAG, "exception: " + e6.getMessage());
}
return true;
} else if (str.contains(WebPageActivity.KEY_EVENT_VIDEO_PLAY)) {
L.i(WebPageActivity.TAG, "start play video and set orientation to portrait");
try {
String str4 = new String(Base64.decode(str.substring(str.indexOf(WebPageActivity.KEY_EVENT_VIDEO_PLAY) + 22).getBytes(), 0));
Intent intent2 = new Intent(WebPageActivity.this, WebPageVideoPlayActivity.class);
intent2.putExtra("videoUrl", str4);
WebPageActivity.this.startActivity(intent2);
} catch (Exception e7) {
L.i(WebPageActivity.TAG, "exception: " + e7.getMessage());
}
return true;
} else {
if (str.indexOf(WebPageActivity.KEY_EVENT_STRING_SEND_LOG) > 0) {
UploadLogUtil uploadLogUtil = new UploadLogUtil(com.xylink.net.manager.g.E().f(), UploadType.UploadTypeLog, null);
LoginResponse loginResponse = new DatabaseAccessor().getLoginResponse();
if (loginResponse != null && loginResponse.getUserProfile() != null && loginResponse.getUserDevice() != null && loginResponse.getUserProfile().getDisplayName() != null && loginResponse.getUserDevice().getDisplayName() != null) {
String deviceSN = loginResponse.getUserDevice().getDeviceSN();
StringBuilder sb = new StringBuilder();
str2 = "exception: ";
sb.append(loginResponse.getUserProfile().getId());
sb.append("");
String sb2 = sb.toString();
StringBuilder sb3 = new StringBuilder();
str3 = "android.intent.action.VIEW";
sb3.append(loginResponse.getUserDevice().getId());
sb3.append("");
LogFormData logFormData = new LogFormData(null, deviceSN, sb2, sb3.toString(), loginResponse.getUserProfile().getDisplayName().replace(UrlConstants.h.a, ""), loginResponse.getUserDevice().getDisplayName().replace(UrlConstants.h.a, ""), LogFormData.LogDataType.LOG_DATA_TYPE_CRASH, loginResponse.getUserProfile().getCellPhone(), loginResponse.getUserProfile().getCellPhone(), com.ainemo.android.b.f5983f, Build.VERSION.SDK_INT + "", System.currentTimeMillis());
logFormData.setDeviceType(LogFormData.LogDeviceType.LOG_DEVICE_TYPE_APP);
uploadLogUtil.startZipLast2Logs(logFormData);
if (str == null && str.toLowerCase().startsWith(WebPageActivity.KEY_EVENT_STRING_OPENNEMOS)) {
Intent intent3 = new Intent(WebPageActivity.this, MainActivity.class);
intent3.setFlags(268468224);
WebPageActivity.this.startActivity(intent3);
return true;
} else if (str == null && str.toLowerCase().startsWith(WebPageActivity.KEY_EVENT_STRING_SHARE)) {
final String paramterValueFromURL = WebPageActivity.this.getParamterValueFromURL(str, "shareTitle");
final String paramterValueFromURL2 = WebPageActivity.this.getParamterValueFromURL(str, "shareDescription");
final String paramterValueFromURL3 = WebPageActivity.this.getParamterValueFromURL(str, "shareUrl");
final String paramterValueFromURL4 = WebPageActivity.this.getParamterValueFromURL(str, "shareThumbnail");
try {
final String str5 = WebPageActivity.SHARE_THUMBNAIL_INPAGE_FILE + ".tmp";
URL url = new URL(paramterValueFromURL4);
com.xylink.net.manager.e.b().a(url.toString(), str5).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) {
WebPageActivity.this.deleteProfilePicture(str5);
L.i(WebPageActivity.TAG, "on exception, exception is " + th.toString());
th.printStackTrace();
}
@Override
public void onHttpError(HttpException httpException, String str6, boolean z) {
super.onHttpError(httpException, str6, z);
WebPageActivity.this.deleteProfilePicture(str5);
}
@Override
public void onNext(Response response, boolean z) {
if (response.isSuccessful()) {
L.i(WebPageActivity.TAG, "succeed to download inpage share picture " + paramterValueFromURL4);
WebPageActivity.this.renameProfilePicture(str5, WebPageActivity.SHARE_THUMBNAIL_INPAGE_FILE);
WebPageActivity.this.onSelectShareWebview(paramterValueFromURL, paramterValueFromURL2, paramterValueFromURL3, paramterValueFromURL4, WebPageActivity.SHARE_THUMBNAIL_INPAGE_FILE);
return;
}
L.i(WebPageActivity.TAG, "failed to download share inpage picture " + paramterValueFromURL4);
}
});
return true;
} catch (Exception e8) {
e8.printStackTrace();
return true;
}
} else if (str == null && str.toLowerCase().startsWith(WebPageActivity.KEY_EVENT_GOTO_BROWSER)) {
String a = android.utils.d.a((Object) str.substring(21, str.length()), "");
if (a.isEmpty()) {
return true;
}
WebPageActivity.this.startActivity(new Intent(str3, Uri.parse(a)));
return true;
} else {
String str6 = str3;
if (str == null && str.toLowerCase().startsWith(WebPageActivity.KEY_EVENT_STRING_WATCH)) {
long longValue = Long.valueOf(WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_DEVICETYPE)).longValue();
if (longValue <= 0) {
return true;
}
Boolean valueOf = Boolean.valueOf(Boolean.parseBoolean(WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_ALLOW_RING_REMINDER)));
Boolean valueOf2 = Boolean.valueOf(Boolean.parseBoolean(WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_ALLOW_CAMERA_CONTROL)));
if (io.xylink.rtc.a.a().isConnected()) {
WebPageActivity.this.startWatch(longValue, valueOf, valueOf2);
return true;
}
AlertUtil.alertNoNetwork();
return true;
} else if (str == null && str.toLowerCase().startsWith(WebPageActivity.KEY_EVENT_STRING_CALL)) {
String parseValueByKey = WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_DEVICEID);
String parseValueByKey2 = WebPageActivity.this.parseValueByKey(str, "nemoNumber=");
String parseValueByKey3 = WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_CONF_NUMBER);
String parseValueByKey4 = WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_CONF_PASSWORD);
String parseValueByKey5 = WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_LIVING_NO);
String parseValueByKey6 = WebPageActivity.this.parseValueByKey(str, WebPageActivity.URL_CONTENT_WEBVIEW_LIVE_ID);
String parseValueByKey7 = WebPageActivity.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(WebPageActivity.this).callWithSettings(parseValueByKey2, WebPageActivity.this.isAudioMute, WebPageActivity.this.isVideoMute, parseValueByKey4);
return true;
} else if (!parseValueByKey.isEmpty()) {
new MakeCallManager(WebPageActivity.this).callWithSettings(parseValueByKey, WebPageActivity.this.isAudioMute, WebPageActivity.this.isVideoMute);
return true;
} else if (!parseValueByKey3.isEmpty()) {
new MakeCallManager(WebPageActivity.this).callWithSettings(parseValueByKey3, WebPageActivity.this.isAudioMute, WebPageActivity.this.isVideoMute, parseValueByKey4);
return true;
} else if (parseValueByKey5.isEmpty()) {
return true;
} else {
if (parseValueByKey7.equalsIgnoreCase("start")) {
new MakeCallManager(WebPageActivity.this).callWithSettings(parseValueByKey5, WebPageActivity.this.isAudioMute, WebPageActivity.this.isVideoMute, parseValueByKey4, parseValueByKey6);
return true;
}
new MakeCallManager(WebPageActivity.this).callWithSettings(parseValueByKey5, WebPageActivity.this.isAudioMute, WebPageActivity.this.isVideoMute, parseValueByKey4, "");
return true;
}
} else if (!str.contains("alipay")) {
final WebPageActivity webPageActivity = WebPageActivity.this;
if (!str.startsWith("alipays:") && !str.startsWith("alipay")) {
if (str.startsWith(UrlConstants.i.a) || str.startsWith(UrlConstants.i.f15430b)) {
webView.loadUrl(str);
return true;
}
return true;
}
try {
webPageActivity.startActivity(new Intent(str6, Uri.parse(str)));
return true;
} catch (Exception unused) {
new AlertDialog.Builder(webPageActivity).setMessage(webPageActivity.getString(R.string.string_alipay_tip)).setPositiveButton(webPageActivity.getString(R.string.string_now_install_tip), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i5) {
webPageActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://d.alipay.com")));
}
}).setNegativeButton(webPageActivity.getString(R.string.cancel), (DialogInterface.OnClickListener) null).show();
return true;
}
} else if (str.startsWith("weixin://")) {
WebPageActivity webPageActivity2 = WebPageActivity.this;
try {
webPageActivity2.startActivity(new Intent(str6, Uri.parse(str)));
return true;
} catch (Exception unused2) {
new AlertDialog.Builder(webPageActivity2).setMessage(webPageActivity2.getString(R.string.string_weixin_tip)).setPositiveButton(webPageActivity2.getString(R.string.sure), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i5) {
dialogInterface.dismiss();
}
}).create().show();
return true;
}
} else if (str.startsWith("https://wx.tenpay.com")) {
HashMap hashMap = new HashMap();
hashMap.put(HttpHeaders.REFERER, "http://www.xylink.com");
webView.loadUrl(str, hashMap);
return true;
} else if (str.startsWith(com.tencent.smtt.sdk.WebView.SCHEME_TEL)) {
Intent intent4 = new Intent("android.intent.action.DIAL", Uri.parse(str));
if (WebPageActivity.this.getPackageManager().resolveActivity(intent4, 0) != null) {
WebPageActivity.this.startActivity(intent4);
return true;
}
WebPageActivity webPageActivity3 = WebPageActivity.this;
com.xylink.common.widget.c.b.b(webPageActivity3, webPageActivity3.getResources().getString(R.string.grant_make_call), 0);
return true;
} else if (com.xylink.net.e.e.a(str)) {
return true;
} else {
try {
String decode = URLDecoder.decode(str);
if (decode.contains(UrlConstants.i.a)) {
WebPageActivity.this.isRedictUrl = true;
webView.loadUrl(decode);
} else if (decode.contains(WebBusinessActivity.URL_TITLE)) {
for (String str7 : decode.split(WebPageActivity.URL_CONTENT_WEBVIEW_SPLISH)) {
if (str7.contains(WebBusinessActivity.URL_TITLE)) {
str7.replace(WebBusinessActivity.URL_TITLE, "");
break;
}
}
}
return true;
} catch (Exception e9) {
L.i(WebPageActivity.TAG, str2 + e9.getMessage());
return true;
}
}
}
}
}
str2 = "exception: ";
str3 = "android.intent.action.VIEW";
if (str == null) {
}
if (str == null) {
}
if (str == null) {
}
String str62 = str3;
if (str == null) {
}
if (str == null) {
}
if (!str.contains("alipay")) {
}
}
}
});
this.webview.setWebChromeClient(new WebChromeClient() {
@Override
public void onHideCustomView() {
WebPageActivity.this.fullScreen();
if (WebPageActivity.this.mCallBack != null) {
WebPageActivity.this.mCallBack.onCustomViewHidden();
}
WebPageActivity.this.layout_layoutwebview.setVisibility(0);
WebPageActivity.this.mVideoContainer.removeAllViews();
WebPageActivity.this.mVideoContainer.setVisibility(8);
super.onHideCustomView();
}
@Override
public void onPermissionRequest(PermissionRequest permissionRequest) {
permissionRequest.grant(permissionRequest.getResources());
}
@Override
public void onProgressChanged(WebView webView, int i5) {
if (i5 == 100) {
WebPageActivity.this.progressBar.setVisibility(8);
} else {
if (8 == WebPageActivity.this.progressBar.getVisibility()) {
WebPageActivity.this.progressBar.setVisibility(0);
}
WebPageActivity.this.progressBar.setProgress(i5);
}
super.onProgressChanged(webView, i5);
}
@Override
public void onReceivedTitle(WebView webView, String str) {
super.onReceivedTitle(webView, str);
if (str == null || str.startsWith(UrlConstants.i.a) || str.startsWith(UrlConstants.i.f15430b) || str.startsWith("minecmr.html") || str.startsWith("edit.html")) {
return;
}
WebPageActivity.this.setWebTitle(str);
}
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback customViewCallback) {
WebPageActivity.this.fullScreen();
L.i(WebPageActivity.TAG, "layoutParams view:" + view.getPaddingLeft() + " " + view.getPaddingTop());
WebPageActivity.this.layout_layoutwebview.setVisibility(8);
WebPageActivity.this.mVideoContainer.setVisibility(0);
WebPageActivity.this.mVideoContainer.addView(view);
WebPageActivity.this.mCallBack = customViewCallback;
super.onShowCustomView(view, customViewCallback);
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> valueCallback, WebChromeClient.FileChooserParams fileChooserParams) {
WebPageActivity.this.mUploadCallbackAboveL = valueCallback;
if (WebPageActivity.this.cameraGalleryDialog != null) {
WebPageActivity.this.cameraGalleryDialog.show();
return true;
}
return true;
}
});
if (byteArrayExtra == null) {
if (this.url != null) {
L.i(TAG, "url : " + this.url + " additional: " + this.additionalHttpHeaders.toString());
this.webview.loadUrl(this.url, this.additionalHttpHeaders);
}
} else {
String str = this.url;
if (str != null) {
this.webview.postUrl(str, byteArrayExtra);
}
}
this.tvRight.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebPageActivity.this.e(view);
}
});
this.tvGoPresent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!WebPageActivity.this.isSelectPresent) {
WebPageActivity.this.isSelectMyTicket = false;
WebPageActivity.this.isSelectPresent = true;
WebView webView = WebPageActivity.this.webview;
webView.loadUrl("Javascript:" + WebPageActivity.this.presentClick + "()");
}
WebPageActivity.this.tvGoPresent.setBackground(WebPageActivity.this.mContext.getResources().getDrawable(R.drawable.boder_give_code_style));
WebPageActivity.this.tvGoPresent.setTextColor(WebPageActivity.this.mContext.getResources().getColor(R.color.black));
WebPageActivity.this.tvMyTickets.setBackground(null);
WebPageActivity.this.tvMyTickets.setTextColor(WebPageActivity.this.mContext.getResources().getColor(R.color.black));
}
});
this.tvMyTickets.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!WebPageActivity.this.isSelectMyTicket) {
WebPageActivity.this.isSelectPresent = false;
WebPageActivity.this.isSelectMyTicket = true;
WebView webView = WebPageActivity.this.webview;
webView.loadUrl("javascript:" + WebPageActivity.this.myTicketClick + "()");
}
WebPageActivity.this.tvMyTickets.setBackground(WebPageActivity.this.mContext.getResources().getDrawable(R.drawable.boder_give_code_style));
WebPageActivity.this.tvMyTickets.setTextColor(WebPageActivity.this.mContext.getResources().getColor(R.color.black));
WebPageActivity.this.tvGoPresent.setBackground(null);
WebPageActivity.this.tvGoPresent.setTextColor(WebPageActivity.this.mContext.getResources().getColor(R.color.black));
}
});
this.relaWebImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
L.i(WebPageActivity.TAG, "call webaction: " + WebPageActivity.this.jsAction);
WebPageActivity webPageActivity = WebPageActivity.this;
webPageActivity.executeJsCallback(webPageActivity.jsAction, null);
}
});
this.toolbarLeft.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
WebPageActivity.this.f(view);
}
});
initCameraGalleryDialog();
showWaitDialog();
if (this.url.contains("privacy-agreement")) {
com.ainemo.android.preferences.a.s().n(com.xylink.net.manager.g.L(), false);
}
}
@Override
public void onDestroy() {
WebView webView = this.webview;
if (webView != null) {
webView.destroy();
}
super.onDestroy();
}
@Override
public boolean onKeyDown(int i2, KeyEvent keyEvent) {
if (i2 == 4) {
if (com.ainemo.android.preferences.p.K().y()) {
com.ainemo.android.preferences.p.K().i(false);
goMainActivity();
} else if (this.back2MainWhenClickClose) {
goMainActivity();
return super.onKeyDown(i2, keyEvent);
} else {
L.i(TAG, "onKeyDown:" + this.jsGoBack);
if (android.utils.d.d(this.jsGoBack) && !this.jsGoBack.equals("undefined")) {
executeJsCallback(this.jsGoBack, null);
} else if (this.webview.canGoBack()) {
this.webview.goBack();
} else {
finish();
}
}
return false;
}
return super.onKeyDown(i2, keyEvent);
}
@Override
public void onMessage(Message message) {
}
@Override
public void onPause() {
WebView webView = this.webview;
if (webView != null) {
webView.onPause();
}
super.onPause();
}
@Override
public void onRestart() {
super.onRestart();
}
@Override
public void onResume() {
super.onResume();
this.webview.loadUrl("Javascript:onResume()");
WebView webView = this.webview;
if (webView != null) {
webView.onResume();
}
this.isRefresh = com.ainemo.android.preferences.p.K().F();
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
WebPageActivity.this.m();
}
}, 500L);
cancelFilePathCallback();
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onViewAndServiceReady(d.a aVar) {
if (getAIDLService() == null || "ConfirmPhoneActivity".equals(this.intentFrom)) {
return;
}
this.mContactApiManager.a(aVar);
try {
String a = e.a.b.b.a(com.ainemo.android.preferences.o.p0().p());
getAIDLService().I(this.urlKeyId);
this.cmr = getAIDLService().n();
LoginResponse e0 = getAIDLService().e0();
this.loginResponse = e0;
if (e0 != null && e0.getUserProfile() != null) {
this.userName = this.loginResponse.getUserProfile().getDisplayName();
this.userId = this.loginResponse.getUserProfile().getId();
this.userInfo.copyFromLoginResponse(this.loginResponse, this.cmr == null ? null : this.cmr.getMeetingNumber(), VersionUtil.getCodeVersionName(), a);
}
if (this.cmr != null) {
this.userInfo.setCmrId(this.cmr.getId());
this.userInfo.setCmrName(this.cmr.getDisplayName());
}
boolean o = com.ainemo.android.preferences.a.s().o(com.xylink.net.manager.g.L());
this.displayUpgrade = o;
this.userInfo.setDisplayUpgrade(o);
H5PageManager.getInstance().saveH5NeedData(this, this.userInfo);
} catch (RemoteException e2) {
L.e("service getPushfullUrl error", e2);
}
}
public void showTicketSuccessDialog(int i2) {
int c2 = com.ainemo.android.preferences.n.g().c();
if (this.ticketSuccessDialog == null) {
q.c cVar = new q.c();
cVar.c(this.mContext.getString(R.string.string_receive_success));
cVar.e(false);
cVar.b(false);
cVar.c(true);
if (i2 == 1) {
cVar.b(getString(R.string.string_ticket_dialog_tip, new Object[]{this.enterpriseName, String.valueOf(c2)}));
} else if (i2 == 2) {
cVar.b(getString(R.string.string_train_ticket_dialog_tip, new Object[]{this.enterpriseName, String.valueOf(c2)}));
}
cVar.a(getString(R.string.bind_nemo_succeed_dialog));
cVar.a();
this.ticketSuccessDialog = cVar.a();
}
this.ticketSuccessDialog.setCancelable(false);
this.ticketSuccessDialog.a(new q.d() {
@Override
public void onButtonClicked(Button button) {
WebPageActivity.this.getSupportFragmentManager().a().d(WebPageActivity.this.ticketSuccessDialog).e();
}
@Override
public void onCloseClicked(ImageView imageView) {
WebPageActivity.this.getSupportFragmentManager().a().d(WebPageActivity.this.ticketSuccessDialog).e();
}
});
getSupportFragmentManager().a().a(this.ticketSuccessDialog, "showReceiveTicketSuccessDialog").e();
}
public void a(final IpcFormListData ipcFormListData) {
new com.xylink.common.d.b(this).d("android.permission.CAMERA", "android.permission.RECORD_AUDIO").b(io.reactivex.v0.a.e.b.b()).a(io.reactivex.v0.a.e.b.b()).i(new io.reactivex.v0.c.g() {
@Override
public final void accept(Object obj) {
WebPageActivity.this.a(ipcFormListData, (Boolean) obj);
}
});
}
public void b(View view) {
com.google.android.material.bottomsheet.a aVar = this.cameraGalleryDialog;
if (aVar != null && aVar.isShowing()) {
this.cameraGalleryDialog.dismiss();
}
cancelFilePathCallback();
}
public void a(IpcFormListData ipcFormListData, Boolean bool) throws Throwable {
if (bool.booleanValue()) {
if (this.cmr != null) {
new MakeCallManager(this).callIPCToMeeting(this.cmr.getMeetingNumber(), this.isAudioMute, this.isVideoMute, ipcFormListData);
return;
}
return;
}
showNoPermissionHint();
}
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(View view) {
if (Build.VERSION.SDK_INT >= 23) {
PermissionUtils.requestStorage(this, new PermissionUtils.PermissionRequestCallback() {
@Override
public final void onResult(boolean z) {
WebPageActivity.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 a(DialogInterface dialogInterface) {
cancelFilePathCallback();
}
}