正在查看: pg 娱乐 v1.0.7.202506242308 应用的 ContainerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: pg 娱乐 v1.0.7.202506242308 应用的 ContainerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.yueyi.container.ui;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Environment;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.DownloadListener;
import android.webkit.URLUtil;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.FileProvider;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import com.blankj.utilcode.util.CacheDiskUtils;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.NetworkUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.drake.net.scope.AndroidScope;
import com.drake.net.utils.ScopeKt;
import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.interfaces.OnConfirmListener;
import com.yueyi.container.API;
import com.yueyi.container.R;
import com.yueyi.container.bean.CheckUpdateBean;
import com.yueyi.container.bean.RegisterFailed;
import com.yueyi.container.ui.dialog.versions.VersionsUpdateDialogFragmentKt;
import com.yueyi.container.ui.web.CommonJavaScriptInterfaceKt;
import com.yueyi.container.ui.web.WebViewActivity;
import com.yxing.ScanCodeConfig;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CancellationException;
import kotlin.Deprecated;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.ResultKt;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.collections.MapsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.Reflection;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Dispatchers;
import okhttp3.Response;
import okhttp3.ResponseBody;
@Metadata(d1 = {"\u0000\u0098\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0011\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0010$\n\u0002\b\u0006\u0018\u0000 R2\u00020\u0001:\u0001RB\u0005¢\u0006\u0002\u0010\u0002J\n\u0010,\u001a\u0004\u0018\u00010-H\u0002J\u0010\u0010.\u001a\u00020/2\u0006\u00100\u001a\u00020\u0007H\u0002J\u0018\u00101\u001a\u00020/2\u0006\u00102\u001a\u0002032\u0006\u00104\u001a\u00020\u0007H\u0003J\b\u00105\u001a\u00020/H\u0002J\u000e\u00106\u001a\u00020/2\u0006\u00107\u001a\u00020\u0007J\"\u00108\u001a\u00020/2\u0006\u00109\u001a\u00020\u000b2\u0006\u0010:\u001a\u00020\u000b2\b\u0010;\u001a\u0004\u0018\u00010<H\u0015J\b\u0010=\u001a\u00020/H\u0017J\u0012\u0010>\u001a\u00020/2\b\u0010?\u001a\u0004\u0018\u00010@H\u0015J\b\u0010A\u001a\u00020/H\u0014J\b\u0010B\u001a\u00020/H\u0014J\b\u0010C\u001a\u00020/H\u0014J\b\u0010D\u001a\u00020/H\u0002J\b\u0010E\u001a\u00020/H\u0002J\u000e\u0010F\u001a\u00020/2\u0006\u00107\u001a\u00020\u0007J\u0006\u0010G\u001a\u00020/J\b\u0010H\u001a\u00020/H\u0002J\u0006\u0010I\u001a\u00020/J\b\u0010J\u001a\u00020/H\u0002J\b\u0010K\u001a\u00020/H\u0002J\u001c\u0010L\u001a\u00020/2\u0012\u0010;\u001a\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u00070MH\u0002J\u0011\u0010N\u001a\u00020/H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010OJ\u0010\u0010P\u001a\u00020/2\b\u0010Q\u001a\u0004\u0018\u00010\u0007R\u0016\u0010\u0003\u001a\n \u0005*\u0004\u0018\u00010\u00040\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\b\u001a\u0004\u0018\u00010\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u0011\u001a\u00020\u00078BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0014\u0010\u0015\u001a\u0004\b\u0012\u0010\u0013R\u0010\u0010\u0016\u001a\u0004\u0018\u00010\u0017X\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010\u0018\u001a\u0012\u0012\f\u0012\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010\u001a\u0018\u00010\u0019X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001c\u001a\u00020\u001dX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001e\u001a\u00020\u001fX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010 \u001a\u00020!X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\"\u001a\u00020#X\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010$\u001a\u0004\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010%\u001a\u00020&8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b)\u0010\u0015\u001a\u0004\b'\u0010(R\u000e\u0010*\u001a\u00020+X\u0082.¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006S"}, d2 = {"Lcom/yueyi/container/ui/ContainerActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "cacheDiskUtils", "Lcom/blankj/utilcode/util/CacheDiskUtils;", "kotlin.jvm.PlatformType", "cookieReg", "", "countdownTimer", "Landroid/os/CountDownTimer;", "counterSetDomain", "", "currentUrl", "isConnected", "", "isShowVersionsUpdateDialog", "isShownPopupMessage", "localPath", "getLocalPath", "()Ljava/lang/String;", "localPath$delegate", "Lkotlin/Lazy;", "mCapturedImageURI", "Landroid/net/Uri;", "mUploadMessages", "Landroid/webkit/ValueCallback;", "", "networkReceiverRegistered", "networkStateReceiver", "Landroid/content/BroadcastReceiver;", "remainSecond", "Landroid/widget/TextView;", "splashImage", "Landroid/widget/ImageView;", "splashScope", "Lcom/drake/net/scope/AndroidScope;", "statusBarColor", "viewModel", "Lcom/yueyi/container/ui/ContainerViewModel;", "getViewModel", "()Lcom/yueyi/container/ui/ContainerViewModel;", "viewModel$delegate", "webView", "Landroid/webkit/WebView;", "createImageFile", "Ljava/io/File;", "downloadAndSave", "", "picUrl", "downloadQRCodeImage", "context", "Landroid/content/Context;", "url", "hideSplashImage", "loginAccount", "requestBody", "onActivityResult", "requestCode", "resultCode", "data", "Landroid/content/Intent;", "onBackPressed", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onPause", "onResume", "openCamera", "openGallery", "registerAccount", "reload", "requestNotificationPermission", "requestShowImageCaptcha", "sendEventPopupMessage", "setupApiDomain", "updateBaseApiUrl", "", "updateDeviceTokenJpush", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "updateStatusBarColor", "color", "Companion", "app_kaiyuanRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class ContainerActivity extends AppCompatActivity {
private static final int CAMERA_REQUEST_CODE = 1235;
private static final int GALLERY_REQUEST_CODE = 1234;
private CountDownTimer countdownTimer;
private int counterSetDomain;
private boolean isShowVersionsUpdateDialog;
private boolean isShownPopupMessage;
private Uri mCapturedImageURI;
private ValueCallback<Uri[]> mUploadMessages;
private boolean networkReceiverRegistered;
private BroadcastReceiver networkStateReceiver;
private TextView remainSecond;
private ImageView splashImage;
private AndroidScope splashScope;
private String statusBarColor;
private final Lazy viewModel;
private WebView webView;
private final CacheDiskUtils cacheDiskUtils = CacheDiskUtils.getInstance("cache");
private String cookieReg = "";
private final Lazy localPath = LazyKt.lazy(new Function0<String>() {
{
super(0);
}
@Override
public final String invoke() {
return ContainerActivity.this.getFilesDir().getAbsolutePath() + API.FOLDER_PATH;
}
});
private String currentUrl = API.INDEX_HTML;
private boolean isConnected = true;
public static final void downloadAndSave$lambda$10(DialogInterface dialogInterface, int i) {
}
public static final boolean onCreate$lambda$0(View view, MotionEvent motionEvent) {
return true;
}
public ContainerActivity() {
final ComponentActivity componentActivity = (ComponentActivity) this;
final Function0 function0 = null;
this.viewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(ContainerViewModel.class), new Function0<ViewModelStore>() {
{
super(0);
}
@Override
public final ViewModelStore invoke() {
ViewModelStore viewModelStore = componentActivity.getViewModelStore();
Intrinsics.checkNotNullExpressionValue(viewModelStore, "viewModelStore");
return viewModelStore;
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
@Override
public final ViewModelProvider.Factory invoke() {
ViewModelProvider.Factory defaultViewModelProviderFactory = componentActivity.getDefaultViewModelProviderFactory();
Intrinsics.checkNotNullExpressionValue(defaultViewModelProviderFactory, "defaultViewModelProviderFactory");
return defaultViewModelProviderFactory;
}
}, new Function0<CreationExtras>() {
{
super(0);
}
@Override
public final CreationExtras invoke() {
CreationExtras creationExtras;
Function0 function02 = Function0.this;
if (function02 != null && (creationExtras = (CreationExtras) function02.invoke()) != null) {
return creationExtras;
}
CreationExtras defaultViewModelCreationExtras = componentActivity.getDefaultViewModelCreationExtras();
Intrinsics.checkNotNullExpressionValue(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
return defaultViewModelCreationExtras;
}
});
}
public final ContainerViewModel getViewModel() {
return (ContainerViewModel) this.viewModel.getValue();
}
private final String getLocalPath() {
return (String) this.localPath.getValue();
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_container);
this.networkStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
boolean z;
boolean z2;
ContainerViewModel viewModel;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
z = ContainerActivity.this.isConnected;
if (!z && NetworkUtils.isConnected()) {
viewModel = ContainerActivity.this.getViewModel();
viewModel.checkVersion(false);
LogUtils.d(new Object[]{"networkStateReceiver", "Reconnected"});
}
ContainerActivity.this.isConnected = NetworkUtils.isConnected();
z2 = ContainerActivity.this.isConnected;
if (z2) {
return;
}
final ContainerActivity containerActivity = ContainerActivity.this;
new XPopup.Builder((Context) containerActivity).isDestroyOnDismiss(true).dismissOnTouchOutside(false).dismissOnBackPressed(false).asConfirm("错误", "请您检查网络链接是否正常", "取消", "前往设置", new OnConfirmListener() {
@Override
public final void onConfirm() {
ContainerActivity.this.startActivity(new Intent("android.settings.SETTINGS"));
}
}, null, false).show();
}
};
getWindow().setStatusBarColor(Color.parseColor(API.STATUS_BAR_COLOR));
ScreenUtils.toggleFullScreen((Activity) this);
LifecycleOwner lifecycleOwner = (LifecycleOwner) this;
getViewModel().getCheckVersion().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<CheckUpdateBean, Unit>() {
{
super(1);
}
@Override
public Unit invoke(CheckUpdateBean checkUpdateBean) {
invoke2(checkUpdateBean);
return Unit.INSTANCE;
}
public final void invoke2(CheckUpdateBean checkUpdateBean) {
CacheDiskUtils cacheDiskUtils;
boolean z;
if ((checkUpdateBean != null ? Integer.valueOf(checkUpdateBean.getVersion_num()) : null) == null) {
return;
}
cacheDiskUtils = ContainerActivity.this.cacheDiskUtils;
String string = cacheDiskUtils.getString("version", "120");
Intrinsics.checkNotNullExpressionValue(string, "cacheDiskUtils.getString….VERSION_CODE.toString())");
int parseInt = Integer.parseInt(string);
int version_num = checkUpdateBean.getVersion_num();
LogUtils.d(new Object[]{"checkVersionResult " + parseInt + ' ' + version_num});
if (parseInt >= version_num) {
return;
}
z = ContainerActivity.this.isShowVersionsUpdateDialog;
if (z) {
return;
}
ContainerActivity.this.isShowVersionsUpdateDialog = true;
ContainerActivity containerActivity = ContainerActivity.this;
final ContainerActivity containerActivity2 = ContainerActivity.this;
VersionsUpdateDialogFragmentKt.showVersionsUpdateDialog(containerActivity, checkUpdateBean, new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
ContainerActivity.this.sendEventPopupMessage();
}
});
}
}));
getViewModel().getConnectException().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<Boolean, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Boolean bool) {
invoke2(bool);
return Unit.INSTANCE;
}
public final void invoke2(Boolean it) {
Intrinsics.checkNotNullExpressionValue(it, "it");
if (it.booleanValue()) {
final ContainerActivity containerActivity = ContainerActivity.this;
new XPopup.Builder((Context) containerActivity).isDestroyOnDismiss(true).dismissOnTouchOutside(false).dismissOnBackPressed(false).asConfirm("错误", "请您检查对该应用访问的网络权限", "取消", "前往设置", new OnConfirmListener() {
@Override
public final void onConfirm() {
Intent intent = new Intent();
intent.addFlags(268435456);
intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
intent.setData(Uri.parse("package:" + ContainerActivity.this.getPackageName()));
try {
ContainerActivity.this.startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
}, null, false).show();
}
}
}));
getViewModel().getSocketTimeoutException().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<Boolean, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Boolean bool) {
invoke2(bool);
return Unit.INSTANCE;
}
public final void invoke2(Boolean it) {
Intrinsics.checkNotNullExpressionValue(it, "it");
if (it.booleanValue()) {
final ContainerActivity containerActivity = ContainerActivity.this;
new XPopup.Builder((Context) containerActivity).isDestroyOnDismiss(true).dismissOnTouchOutside(false).dismissOnBackPressed(false).asConfirm("错误", "连接超时", "取消", "重试", new OnConfirmListener() {
@Override
public final void onConfirm() {
ContainerViewModel viewModel;
viewModel = ContainerActivity.this.getViewModel();
viewModel.checkVersion(true);
}
}, null, false).show();
}
}
}));
getViewModel().getHealthCheck().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<Boolean, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Boolean bool) {
invoke2(bool);
return Unit.INSTANCE;
}
public final void invoke2(Boolean bool) {
CacheDiskUtils cacheDiskUtils;
ContainerViewModel viewModel;
if (Intrinsics.areEqual((Object) bool, (Object) true)) {
cacheDiskUtils = ContainerActivity.this.cacheDiskUtils;
String string = cacheDiskUtils.getString("baseUrl");
LogUtils.d(new Object[]{"healthCheck>>> " + string});
ContainerActivity.this.setupApiDomain();
if (string != null) {
viewModel = ContainerActivity.this.getViewModel();
viewModel.registerPushNotification((Context) ContainerActivity.this, string);
}
}
}
}));
getViewModel().isDomainAliveNull().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<Boolean, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Boolean bool) {
invoke2(bool);
return Unit.INSTANCE;
}
public final void invoke2(Boolean bool) {
if (Intrinsics.areEqual((Object) bool, (Object) true)) {
final ContainerActivity containerActivity = ContainerActivity.this;
new XPopup.Builder((Context) containerActivity).isDestroyOnDismiss(true).dismissOnTouchOutside(false).dismissOnBackPressed(false).asConfirm(null, "网络异常\n建议切换网络后再次尝试", "取消", "确定", new OnConfirmListener() {
@Override
public final void onConfirm() {
ContainerViewModel viewModel;
viewModel = ContainerActivity.this.getViewModel();
viewModel.checkVersion(true);
}
}, null, false).show();
}
}
}));
getViewModel().getLoginResponse().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<Response, Unit>() {
{
super(1);
}
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u008a@"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {1, 8, 0}, xi = 48)
@DebugMetadata(c = "com.yueyi.container.ui.ContainerActivity$onCreate$7$1", f = "ContainerActivity.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
final Response $response;
int label;
final ContainerActivity this$0;
AnonymousClass1(Response response, ContainerActivity containerActivity, Continuation<? super AnonymousClass1> continuation) {
super(2, continuation);
this.$response = response;
this.this$0 = containerActivity;
}
@Override
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
return new AnonymousClass1(this.$response, this.this$0, continuation);
}
@Override
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override
public final Object invokeSuspend(Object obj) {
String str;
IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
Response response = this.$response;
if (response != null) {
try {
ResponseBody body = response.body();
String str2 = "";
if (body == null || (str = body.string()) == null) {
str = "";
}
if (!this.$response.isSuccessful()) {
if (str.length() > 0) {
LogUtils.d(new Object[]{"userLoginResult " + this.$response});
str2 = ((RegisterFailed) GsonUtils.fromJson(str, RegisterFailed.class)).getMessage();
}
}
Object fromJson = GsonUtils.fromJson(str, Map.class);
Intrinsics.checkNotNull(fromJson, "null cannot be cast to non-null type kotlin.collections.Map<*, *>");
Map map = (Map) fromJson;
Pair[] pairArr = new Pair[2];
pairArr[0] = TuplesKt.to("event", "user-login-result");
Pair[] pairArr2 = new Pair[3];
pairArr2[0] = TuplesKt.to("status", this.$response.code() == 200 ? "success" : "failed");
pairArr2[1] = TuplesKt.to("message", str2);
pairArr2[2] = TuplesKt.to("response", map);
pairArr[1] = TuplesKt.to("data", MapsKt.mapOf(pairArr2));
final String str3 = "transferData('" + GsonUtils.toJson(MapsKt.mapOf(pairArr)) + "');";
LogUtils.d(new Object[]{"jsCode " + str3});
final ContainerActivity containerActivity = this.this$0;
containerActivity.runOnUiThread(
throw new UnsupportedOperationException("Method not decompiled: com.yueyi.container.ui.ContainerActivity$onCreate$7.AnonymousClass1.invokeSuspend(java.lang.Object):java.lang.Object");
}
public static final void invokeSuspend$lambda$1(ContainerActivity containerActivity, String str) {
WebView webView;
webView = containerActivity.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.evaluateJavascript(str,
throw new UnsupportedOperationException("Method not decompiled: com.yueyi.container.ui.ContainerActivity$onCreate$7.AnonymousClass1.invokeSuspend$lambda$1(com.yueyi.container.ui.ContainerActivity, java.lang.String):void");
}
public static final void invokeSuspend$lambda$1$lambda$0(String str) {
LogUtils.d(new Object[]{"loginAccount>>> " + str});
}
}
@Override
public Unit invoke(Response response) {
invoke2(response);
return Unit.INSTANCE;
}
public final void invoke2(Response response) {
ScopeKt.scopeNetLife$default(ContainerActivity.this, (Lifecycle.Event) null, Dispatchers.getIO(), new AnonymousClass1(response, ContainerActivity.this, null), 1, (Object) null);
}
}));
getViewModel().getRegisterResponse().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<Response, Unit>() {
{
super(1);
}
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u008a@"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {1, 8, 0}, xi = 48)
@DebugMetadata(c = "com.yueyi.container.ui.ContainerActivity$onCreate$8$1", f = "ContainerActivity.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
final Response $response;
int label;
final ContainerActivity this$0;
AnonymousClass1(Response response, ContainerActivity containerActivity, Continuation<? super AnonymousClass1> continuation) {
super(2, continuation);
this.$response = response;
this.this$0 = containerActivity;
}
@Override
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
return new AnonymousClass1(this.$response, this.this$0, continuation);
}
@Override
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override
public final java.lang.Object invokeSuspend(java.lang.Object r15) {
throw new UnsupportedOperationException("Method not decompiled: com.yueyi.container.ui.ContainerActivity$onCreate$8.AnonymousClass1.invokeSuspend(java.lang.Object):java.lang.Object");
}
public static final void invokeSuspend$lambda$1(ContainerActivity containerActivity, String str) {
WebView webView;
webView = containerActivity.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.evaluateJavascript(str,
throw new UnsupportedOperationException("Method not decompiled: com.yueyi.container.ui.ContainerActivity$onCreate$8.AnonymousClass1.invokeSuspend$lambda$1(com.yueyi.container.ui.ContainerActivity, java.lang.String):void");
}
public static final void invokeSuspend$lambda$1$lambda$0(String str) {
LogUtils.d(new Object[]{"registerAccount>>> " + str});
}
}
@Override
public Unit invoke(Response response) {
invoke2(response);
return Unit.INSTANCE;
}
public final void invoke2(Response response) {
ScopeKt.scopeNetLife$default(ContainerActivity.this, (Lifecycle.Event) null, Dispatchers.getIO(), new AnonymousClass1(response, ContainerActivity.this, null), 1, (Object) null);
}
}));
getViewModel().getRefreshWebview().observe(lifecycleOwner, new ContainerActivity$sam$androidx_lifecycle_Observer$0(new Function1<Unit, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Unit unit) {
invoke2(unit);
return Unit.INSTANCE;
}
public final void invoke2(Unit unit) {
WebView webView;
webView = ContainerActivity.this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.reload();
}
}));
requestNotificationPermission();
getViewModel().checkVersion(false);
View findViewById = findViewById(R.id.splash);
Intrinsics.checkNotNullExpressionValue(findViewById, "findViewById(R.id.splash)");
ImageView imageView = (ImageView) findViewById;
this.splashImage = imageView;
WebView webView = null;
if (imageView == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashImage");
imageView = null;
}
imageView.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
boolean onCreate$lambda$0;
onCreate$lambda$0 = ContainerActivity.onCreate$lambda$0(view, motionEvent);
return onCreate$lambda$0;
}
});
RequestBuilder load = Glide.with((FragmentActivity) this).load(Integer.valueOf(R.drawable.splash));
ImageView imageView2 = this.splashImage;
if (imageView2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashImage");
imageView2 = null;
}
load.into(imageView2);
View findViewById2 = findViewById(R.id.web_view);
Intrinsics.checkNotNullExpressionValue(findViewById2, "findViewById(R.id.web_view)");
this.webView = (WebView) findViewById2;
View findViewById3 = findViewById(R.id.remainSecond);
Intrinsics.checkNotNullExpressionValue(findViewById3, "findViewById(R.id.remainSecond)");
TextView textView = (TextView) findViewById3;
this.remainSecond = textView;
if (textView == null) {
Intrinsics.throwUninitializedPropertyAccessException("remainSecond");
textView = null;
}
final Ref.LongRef longRef = new Ref.LongRef();
textView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AndroidScope androidScope;
if (System.currentTimeMillis() - Ref.LongRef.this.element < 500) {
return;
}
Ref.LongRef.this.element = System.currentTimeMillis();
if (view != null) {
this.hideSplashImage();
androidScope = this.splashScope;
if (androidScope == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashScope");
androidScope = null;
}
AndroidScope.cancel$default(androidScope, (CancellationException) null, 1, (Object) null);
return;
}
throw new NullPointerException("null cannot be cast to non-null type android.widget.TextView");
}
});
if (new File(getLocalPath()).exists()) {
this.currentUrl = getLocalPath();
}
WebView webView2 = this.webView;
if (webView2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView2 = null;
}
webView2.evaluateJavascript("document.cookie;", new ValueCallback() {
@Override
public final void onReceiveValue(Object obj) {
ContainerActivity.onCreate$lambda$2((String) obj);
}
});
BuildersKt__Builders_commonKt.launch$default(LifecycleOwnerKt.getLifecycleScope(lifecycleOwner), null, null, new ContainerActivity$onCreate$13(this, null), 3, null);
ContainerActivity containerActivity = this;
WebView webView3 = this.webView;
if (webView3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
} else {
webView = webView3;
}
final WebView initWebView = CommonJavaScriptInterfaceKt.initWebView(containerActivity, webView);
CookieManager.getInstance().setAcceptCookie(true);
initWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onReceivedTitle(WebView webView4, String title) {
super.onReceivedTitle(webView4, title);
}
@Override
public boolean onShowFileChooser(WebView mWebView, final ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
Intrinsics.checkNotNullParameter(filePathCallback, "filePathCallback");
boolean z = false;
LogUtils.d(new Object[]{"onShowFileChooser", "onShowFileChooser"});
ContainerActivity.this.mUploadMessages = filePathCallback;
if (fileChooserParams != null && fileChooserParams.isCaptureEnabled()) {
z = true;
}
if (!z) {
ContainerActivity.this.openGallery();
} else {
XXPermissions permission = XXPermissions.with((Context) ContainerActivity.this).permission(Permission.CAMERA);
final ContainerActivity containerActivity2 = ContainerActivity.this;
permission.request(new OnPermissionCallback() {
@Override
public void onGranted(List<String> permissions, boolean allGranted) {
Intrinsics.checkNotNullParameter(permissions, "permissions");
if (allGranted) {
containerActivity2.openCamera();
} else {
ToastUtils.showShort("获取相机权限失败", new Object[0]);
filePathCallback.onReceiveValue(null);
}
}
@Override
public void onDenied(List<String> permissions, boolean doNotAskAgain) {
Intrinsics.checkNotNullParameter(permissions, "permissions");
filePathCallback.onReceiveValue(null);
if (doNotAskAgain) {
ToastUtils.showShort("被永久拒绝授权,请手动授予相机权限", new Object[0]);
} else {
ToastUtils.showShort("获取相机权限失败", new Object[0]);
}
}
});
}
return true;
}
});
initWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
String valueOf = String.valueOf(request != null ? request.getUrl() : null);
if (StringsKt.startsWith$default(valueOf, "http://", false, 2, (Object) null) || StringsKt.startsWith$default(valueOf, "https://", false, 2, (Object) null)) {
initWebView.getContext().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(valueOf)));
return true;
}
return super.shouldOverrideUrlLoading(view, request);
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
Intrinsics.checkNotNull(request);
String uri = request.getUrl().toString();
Intrinsics.checkNotNullExpressionValue(uri, "request!!.url.toString()");
if (StringsKt.contains$default((CharSequence) uri, (CharSequence) "v/user/reg", false, 2, (Object) null)) {
LogUtils.d(new Object[]{"shouldInterceptRequest " + uri});
}
return super.shouldInterceptRequest(view, request);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
LogUtils.d(new Object[]{"onPageStarted " + url});
}
@Override
public void onPageFinished(WebView web, String url) {
int i;
Intrinsics.checkNotNullParameter(web, "web");
LogUtils.d(new Object[]{"onPageFinished " + url});
i = this.counterSetDomain;
if (i < 5) {
Intrinsics.checkNotNull(url);
if (StringsKt.contains$default((CharSequence) url, (CharSequence) "/index.html", false, 2, (Object) null)) {
this.setupApiDomain();
}
}
}
});
initWebView.loadUrl(this.currentUrl);
initWebView.setDownloadListener(new DownloadListener() {
@Override
public final void onDownloadStart(String str, String str2, String str3, String str4, long j) {
ContainerActivity.onCreate$lambda$5$lambda$3(ContainerActivity.this, initWebView, str, str2, str3, str4, j);
}
});
initWebView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public final boolean onLongClick(View view) {
boolean onCreate$lambda$5$lambda$4;
onCreate$lambda$5$lambda$4 = ContainerActivity.onCreate$lambda$5$lambda$4(ContainerActivity.this, view);
return onCreate$lambda$5$lambda$4;
}
});
WebView.setWebContentsDebuggingEnabled(true);
}
public static final void onCreate$lambda$2(String str) {
LogUtils.d(new Object[]{"WEB_COOKIE " + str});
}
public static final void onCreate$lambda$5$lambda$3(ContainerActivity this$0, WebView this_apply, String url, String str, String str2, String str3, long j) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
Intrinsics.checkNotNullExpressionValue(url, "url");
if (StringsKt.startsWith$default(url, "data:image/", false, 2, (Object) null)) {
Context context = this_apply.getContext();
Intrinsics.checkNotNullExpressionValue(context, "context");
this$0.downloadQRCodeImage(context, url);
} else {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(url));
this$0.startActivity(intent);
}
}
public static final boolean onCreate$lambda$5$lambda$4(com.yueyi.container.ui.ContainerActivity r3, android.view.View r4) {
throw new UnsupportedOperationException("Method not decompiled: com.yueyi.container.ui.ContainerActivity.onCreate$lambda$5$lambda$4(com.yueyi.container.ui.ContainerActivity, android.view.View):boolean");
}
private final void requestNotificationPermission() {
XXPermissions.with((Context) this).permission(Permission.POST_NOTIFICATIONS).request(new OnPermissionCallback() {
@Override
public void onDenied(List<String> permissions, boolean doNotAskAgain) {
Intrinsics.checkNotNullParameter(permissions, "permissions");
}
@Override
public void onGranted(List<String> permissions, boolean allGranted) {
Intrinsics.checkNotNullParameter(permissions, "permissions");
LogUtils.d(new Object[]{"POST_NOTIFICATIONS", Boolean.valueOf(allGranted)});
}
});
}
private final void downloadAndSave(final String picUrl) {
if (TextUtils.isEmpty(picUrl) || !StringsKt.startsWith$default(picUrl, API.HTTP_PREFIX, false, 2, (Object) null)) {
return;
}
new AlertDialog.Builder((Context) this).setMessage("是否保存当前图片?").setPositiveButton("保存", new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ContainerActivity.downloadAndSave$lambda$9(picUrl, this, dialogInterface, i);
}
}).setNeutralButton("取消", new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ContainerActivity.downloadAndSave$lambda$10(dialogInterface, i);
}
}).show();
}
public static final void downloadAndSave$lambda$9(final String picUrl, final ContainerActivity this$0, DialogInterface dialogInterface, int i) {
Intrinsics.checkNotNullParameter(picUrl, "$picUrl");
Intrinsics.checkNotNullParameter(this$0, "this$0");
new Thread(new Runnable() {
@Override
public final void run() {
ContainerActivity.downloadAndSave$lambda$9$lambda$8(picUrl, this$0);
}
}).start();
}
public static final void downloadAndSave$lambda$9$lambda$8(java.lang.String r10, final com.yueyi.container.ui.ContainerActivity r11) {
throw new UnsupportedOperationException("Method not decompiled: com.yueyi.container.ui.ContainerActivity.downloadAndSave$lambda$9$lambda$8(java.lang.String, com.yueyi.container.ui.ContainerActivity):void");
}
public static final void downloadAndSave$lambda$9$lambda$8$lambda$6(ContainerActivity this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Toast.makeText((Context) this$0, "图片保存成功", 0).show();
}
public static final void downloadAndSave$lambda$9$lambda$8$lambda$7(ContainerActivity this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Toast.makeText((Context) this$0, "保存失败", 0).show();
}
public final void openGallery() {
try {
Intent intent = new Intent("android.intent.action.PICK", MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/* video/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);
} catch (Exception e) {
e.printStackTrace();
}
}
public final void openCamera() {
File createImageFile;
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
if (intent.resolveActivity(getPackageManager()) == null || (createImageFile = createImageFile()) == null) {
return;
}
Uri uriForFile = FileProvider.getUriForFile((Context) this, getPackageName() + ".fileprovider", createImageFile);
this.mCapturedImageURI = uriForFile;
intent.putExtra("output", uriForFile);
intent.addFlags(2);
startActivityForResult(intent, CAMERA_REQUEST_CODE);
}
private final File createImageFile() {
try {
File createTempFile = File.createTempFile("IMG_" + new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date()) + '_', ".jpg", getExternalCacheDir());
Intrinsics.checkNotNullExpressionValue(createTempFile, "createTempFile(\n …irectory */\n )");
return createTempFile;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
private final void downloadQRCodeImage(final Context context, final String url) {
XXPermissions.with(context).permission(Permission.READ_MEDIA_IMAGES, Permission.WRITE_EXTERNAL_STORAGE).request(new OnPermissionCallback() {
@Override
public void onGranted(List<String> permissions, boolean allGranted) {
Intrinsics.checkNotNullParameter(permissions, "permissions");
if (allGranted) {
try {
byte[] decode = Base64.getDecoder().decode((String) CollectionsKt.lastOrNull(StringsKt.split$default((CharSequence) url, new String[]{","}, false, 0, 6, (Object) null)));
File externalStoragePublicDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
if (!externalStoragePublicDirectory.exists()) {
externalStoragePublicDirectory.mkdirs();
}
File file = new File(externalStoragePublicDirectory, "qrcode_" + System.currentTimeMillis() + ".png");
FileOutputStream fileOutputStream = new FileOutputStream(file);
fileOutputStream.write(decode);
fileOutputStream.close();
ToastUtils mode = ToastUtils.make().setTopIcon(R.drawable.icon_tick_success).setGravity(16, 0, 0).setMode("dark");
Intrinsics.checkNotNullExpressionValue(mode, "make().setTopIcon(R.draw… 0, 0).setMode(MODE.DARK)");
mode.show("保存成功", new Object[0]);
MediaScannerConnection.scanFile(context, new String[]{file.toString()}, null, null);
return;
} catch (Exception e) {
e.printStackTrace();
return;
}
}
ToastUtils.showShort("授权永久被拒绝,请手动授予照片访问权限", new Object[0]);
}
@Override
public void onDenied(List<String> permissions, boolean doNotAskAgain) {
Intrinsics.checkNotNullParameter(permissions, "permissions");
ToastUtils.showShort("授权永久被拒绝,请手动授予照片访问权限", new Object[0]);
}
});
}
public final void registerAccount(String requestBody) {
Intrinsics.checkNotNullParameter(requestBody, "requestBody");
getViewModel().userRegister(this.cookieReg, requestBody);
}
public final void loginAccount(String requestBody) {
Intrinsics.checkNotNullParameter(requestBody, "requestBody");
getViewModel().userLogin(this.cookieReg, requestBody);
}
public final void setupApiDomain() {
ScopeKt.scopeLife$default((LifecycleOwner) this, (Lifecycle.Event) null, (CoroutineDispatcher) null, new ContainerActivity$setupApiDomain$1(this, null), 3, (Object) null);
}
public final void sendEventPopupMessage() {
if (this.isShownPopupMessage) {
return;
}
this.isShownPopupMessage = true;
String str = "transferData('" + GsonUtils.toJson(MapsKt.mapOf(TuplesKt.to("event", "show-message-popup"))) + "');";
LogUtils.d(new Object[]{"jsCode " + str});
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.evaluateJavascript(str, new ValueCallback() {
@Override
public final void onReceiveValue(Object obj) {
ContainerActivity.sendEventPopupMessage$lambda$12((String) obj);
}
});
}
public static final void sendEventPopupMessage$lambda$12(String str) {
LogUtils.d(new Object[]{"evaluateJavascript>>> " + str});
}
public final void updateBaseApiUrl(Map<String, String> data) {
String str = "transferData('" + GsonUtils.toJson(MapsKt.mapOf(TuplesKt.to("event", "set-base-domain"), TuplesKt.to("data", data))) + "');";
LogUtils.d(new Object[]{"jsCode " + str});
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.evaluateJavascript(str, new ValueCallback() {
@Override
public final void onReceiveValue(Object obj) {
ContainerActivity.updateBaseApiUrl$lambda$13((String) obj);
}
});
}
public static final void updateBaseApiUrl$lambda$13(String str) {
LogUtils.d(new Object[]{"evaluateJavascript>>> " + str});
}
public final java.lang.Object updateDeviceTokenJpush(kotlin.coroutines.Continuation<? super kotlin.Unit> r9) {
throw new UnsupportedOperationException("Method not decompiled: com.yueyi.container.ui.ContainerActivity.updateDeviceTokenJpush(kotlin.coroutines.Continuation):java.lang.Object");
}
public static final void updateDeviceTokenJpush$lambda$14(String str) {
LogUtils.d(new Object[]{"evaluateJavascript>>> " + str});
}
public final void requestShowImageCaptcha() {
ScopeKt.scopeNetLife$default((LifecycleOwner) this, (Lifecycle.Event) null, Dispatchers.getIO(), new ContainerActivity$requestShowImageCaptcha$1(this.cacheDiskUtils.getString("baseUrl") + "/app-api/v/vCode?m=reg&_t=" + System.currentTimeMillis(), this, null), 1, (Object) null);
}
public final void hideSplashImage() {
getWindow().setStatusBarColor(Color.parseColor(API.STATUS_BAR_COLOR));
getWindow().setNavigationBarColor(Color.parseColor(API.NAVIGATION_BAR_HIDE_SPLASH_COLOR));
ImageView imageView = this.splashImage;
BroadcastReceiver broadcastReceiver = null;
if (imageView == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashImage");
imageView = null;
}
imageView.post(new Runnable() {
@Override
public final void run() {
ContainerActivity.hideSplashImage$lambda$15(ContainerActivity.this);
}
});
runOnUiThread(new Runnable() {
@Override
public final void run() {
ContainerActivity.hideSplashImage$lambda$17(ContainerActivity.this);
}
});
if (this.networkReceiverRegistered) {
return;
}
IntentFilter intentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
BroadcastReceiver broadcastReceiver2 = this.networkStateReceiver;
if (broadcastReceiver2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("networkStateReceiver");
} else {
broadcastReceiver = broadcastReceiver2;
}
registerReceiver(broadcastReceiver, intentFilter);
this.networkReceiverRegistered = true;
}
public static final void hideSplashImage$lambda$15(ContainerActivity this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
ImageView imageView = this$0.splashImage;
TextView textView = null;
if (imageView == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashImage");
imageView = null;
}
imageView.setVisibility(8);
TextView textView2 = this$0.remainSecond;
if (textView2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("remainSecond");
} else {
textView = textView2;
}
textView.setVisibility(8);
}
public static final void hideSplashImage$lambda$17(ContainerActivity this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
if (this$0.statusBarColor != null) {
this$0.getWindow().setStatusBarColor(Color.parseColor(this$0.statusBarColor));
}
ScreenUtils.setNonFullScreen((Activity) this$0);
}
public final void updateStatusBarColor(String color) {
String str = color;
if (str == null || str.length() == 0) {
return;
}
ImageView imageView = this.splashImage;
if (imageView == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashImage");
imageView = null;
}
if (imageView.getVisibility() == 0) {
return;
}
try {
getWindow().setStatusBarColor(Color.parseColor(color));
this.statusBarColor = color;
} catch (Exception e) {
e.printStackTrace();
}
}
public final void reload() {
this.currentUrl = getLocalPath();
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.loadUrl(this.currentUrl);
LogUtils.d(new Object[]{"reload_currentUrl: " + this.currentUrl});
}
protected void onResume() {
super.onResume();
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.onResume();
LogUtils.d(new Object[]{"onResume>>>"});
ImageView imageView = this.splashImage;
if (imageView == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashImage");
imageView = null;
}
if (imageView.getVisibility() == 0) {
this.splashScope = ScopeKt.scopeLife$default((LifecycleOwner) this, (Lifecycle.Event) null, (CoroutineDispatcher) null, new ContainerActivity$onResume$1(this, null), 3, (Object) null);
}
}
protected void onPause() {
super.onPause();
ImageView imageView = this.splashImage;
WebView webView = null;
if (imageView == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashImage");
imageView = null;
}
if (imageView.getVisibility() == 0) {
AndroidScope androidScope = this.splashScope;
if (androidScope == null) {
Intrinsics.throwUninitializedPropertyAccessException("splashScope");
androidScope = null;
}
AndroidScope.cancel$default(androidScope, (CancellationException) null, 1, (Object) null);
}
WebView webView2 = this.webView;
if (webView2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
} else {
webView = webView2;
}
webView.onPause();
}
@Deprecated(message = "Deprecated in Java")
public void onBackPressed() {
WebView webView = this.webView;
WebView webView2 = null;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
if (webView.canGoBack()) {
WebView webView3 = this.webView;
if (webView3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
} else {
webView2 = webView3;
}
webView2.goBack();
return;
}
super.onBackPressed();
}
@Deprecated(message = "Deprecated in Java")
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
ValueCallback<Uri[]> valueCallback;
Uri uri;
Bundle extras;
ValueCallback<Uri[]> valueCallback2;
Uri[] clipDataToArray;
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && (valueCallback2 = this.mUploadMessages) != null) {
if (resultCode == -1) {
if (data != null) {
if (data.getData() != null) {
Uri data2 = data.getData();
Intrinsics.checkNotNull(data2);
clipDataToArray = new Uri[]{data2};
} else {
clipDataToArray = ClipDataWrapper.INSTANCE.clipDataToArray(data.getClipData());
}
ValueCallback<Uri[]> valueCallback3 = this.mUploadMessages;
if (valueCallback3 != null) {
valueCallback3.onReceiveValue(clipDataToArray);
}
}
} else if (valueCallback2 != null) {
valueCallback2.onReceiveValue(null);
}
this.mUploadMessages = null;
} else if (requestCode == CAMERA_REQUEST_CODE && resultCode == -1 && (valueCallback = this.mUploadMessages) != null && (uri = this.mCapturedImageURI) != null) {
if (valueCallback != null) {
Intrinsics.checkNotNull(uri);
valueCallback.onReceiveValue(new Uri[]{uri});
}
this.mUploadMessages = null;
}
if (resultCode == -1 && data != null && requestCode == 16 && (extras = data.getExtras()) != null) {
String string = extras.getString(ScanCodeConfig.CODE_KEY);
LogUtils.d(new Object[]{"code >>> " + string});
try {
if (URLUtil.isNetworkUrl(string)) {
Intent intent = new Intent((Context) this, (Class<?>) WebViewActivity.class);
intent.putExtra("url", string);
startActivity(intent);
} else {
ToastUtils.showShort("无效URL,无法打开", new Object[0]);
}
} catch (Exception unused) {
ToastUtils.showShort("无效的二维码", new Object[0]);
}
}
ValueCallback<Uri[]> valueCallback4 = this.mUploadMessages;
if (valueCallback4 != null) {
valueCallback4.onReceiveValue(null);
}
}
protected void onDestroy() {
CountDownTimer countDownTimer = this.countdownTimer;
if (countDownTimer != null) {
countDownTimer.cancel();
}
if (this.networkReceiverRegistered) {
BroadcastReceiver broadcastReceiver = this.networkStateReceiver;
if (broadcastReceiver == null) {
Intrinsics.throwUninitializedPropertyAccessException("networkStateReceiver");
broadcastReceiver = null;
}
unregisterReceiver(broadcastReceiver);
}
super.onDestroy();
}
}