导航菜单

页面标题

页面副标题

bbinstant v6.24.0 - DeleteAccountActivity.java 源代码

正在查看: bbinstant v6.24.0 应用的 DeleteAccountActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bigbasket.bbinstant.ui.help;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import com.adjetter.kapchatsdk.R;
import com.amazon.identity.auth.device.authorization.AuthorizationResponseParser;
import com.amazonaws.services.s3.internal.Constants;
import com.bigbasket.bbinstant.ui.BaseActivity;
import com.bigbasket.bbinstant.ui.help.DeleteAccountActivity;
import com.facebook.shimmer.ShimmerFrameLayout;
import kotlin.jvm.internal.v;
import kotlin.text.p;

public final class DeleteAccountActivity extends BaseActivity {
    private boolean isRedirected;
    public ShimmerFrameLayout shimmer;
    private final String url_goBack = "https://selfserveapp.kapturecrm.com/go-back";
    public WebView webView;

    public static final class a extends WebViewClient {
        a() {
        }

        public static final void onReceivedSslError$lambda$0(SslErrorHandler sslErrorHandler, DialogInterface dialogInterface, int i) {
            v.checkNotNullParameter(sslErrorHandler, "$handler");
            sslErrorHandler.proceed();
        }

        public static final void onReceivedSslError$lambda$1(SslErrorHandler sslErrorHandler, DialogInterface dialogInterface, int i) {
            v.checkNotNullParameter(sslErrorHandler, "$handler");
            sslErrorHandler.cancel();
        }

        @Override
        public void onPageFinished(WebView webView, String str) {
            super.onPageFinished(webView, str);
            if (DeleteAccountActivity.this.isRedirected) {
                return;
            }
            DeleteAccountActivity.this.getShimmer().setVisibility(8);
        }

        @Override
        public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
            super.onPageStarted(webView, str, bitmap);
            DeleteAccountActivity.this.isRedirected = false;
        }

        @Override
        public void onReceivedError(WebView webView, int i, String str, String str2) {
            v.checkNotNullParameter(webView, "view");
            v.checkNotNullParameter(str, "description");
            v.checkNotNullParameter(str2, "failingUrl");
        }

        @Override
        public void onReceivedSslError(WebView webView, final SslErrorHandler sslErrorHandler, SslError sslError) {
            v.checkNotNullParameter(sslErrorHandler, "handler");
            v.checkNotNullParameter(sslError, AuthorizationResponseParser.ERROR);
            StringBuilder sb = new StringBuilder();
            sb.append(sslErrorHandler.toString());
            sb.append("error:");
            sb.append(sslError);
            AlertDialog.Builder builder = new AlertDialog.Builder(DeleteAccountActivity.this);
            builder.setMessage(DeleteAccountActivity.this.getString(2131886468));
            builder.setPositiveButton(DeleteAccountActivity.this.getString(2131886191), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    DeleteAccountActivity.a.onReceivedSslError$lambda$0(sslErrorHandler, dialogInterface, i);
                }
            });
            builder.setNegativeButton(DeleteAccountActivity.this.getString(2131886158), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    DeleteAccountActivity.a.onReceivedSslError$lambda$1(sslErrorHandler, dialogInterface, i);
                }
            });
            AlertDialog create = builder.create();
            v.checkNotNullExpressionValue(create, "builder.create()");
            create.show();
        }

        @Override
        public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
            Uri url;
            String uri;
            if (webResourceRequest != null && (url = webResourceRequest.getUrl()) != null && (uri = url.toString()) != null && p.equals(uri, DeleteAccountActivity.this.getUrl_goBack(), true)) {
                DeleteAccountActivity.this.setResult(FAQsActivity.Companion.getDELETE_REQ_CODE());
                DeleteAccountActivity.this.finish();
            }
            return super.shouldInterceptRequest(webView, webResourceRequest);
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            v.checkNotNullParameter(webView, "view");
            v.checkNotNullParameter(str, Constants.URL_ENCODING);
            webView.loadUrl(str);
            return true;
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
            DeleteAccountActivity.this.isRedirected = true;
            return super.shouldOverrideUrlLoading(webView, webResourceRequest);
        }
    }

    public final ShimmerFrameLayout getShimmer() {
        ShimmerFrameLayout shimmerFrameLayout = this.shimmer;
        if (shimmerFrameLayout != null) {
            return shimmerFrameLayout;
        }
        v.throwUninitializedPropertyAccessException("shimmer");
        return null;
    }

    public final String getUrl_goBack() {
        return this.url_goBack;
    }

    public final WebView getWebView() {
        WebView webView = this.webView;
        if (webView != null) {
            return webView;
        }
        v.throwUninitializedPropertyAccessException("webView");
        return null;
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(2131558433);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        View findViewById = findViewById(2131362527);
        v.checkNotNullExpressionValue(findViewById, "findViewById(R.id.shimmer_delete_account)");
        setShimmer((ShimmerFrameLayout) findViewById);
        setSupportActionBar(toolbar);
        ActionBar supportActionBar = getSupportActionBar();
        v.checkNotNull(supportActionBar);
        supportActionBar.setDisplayHomeAsUpEnabled(true);
        setTitle(getString(2131886476));
        View findViewById2 = findViewById(2131362819);
        v.checkNotNullExpressionValue(findViewById2, "findViewById(R.id.webview_delete_account)");
        setWebView((WebView) findViewById2);
        getWebView().setWebViewClient(new a());
        WebSettings settings = getWebView().getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setUseWideViewPort(true);
        settings.setDomStorageEnabled(true);
        settings.setLoadWithOverviewMode(true);
        getWebView().loadUrl("https://selfserveapp.kapturecrm.com/support-portals/deactivation/bb-instant");
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        v.checkNotNullParameter(menuItem, "item");
        if (menuItem.getItemId() != 16908332) {
            return super.onOptionsItemSelected(menuItem);
        }
        onBackPressed();
        return true;
    }

    public final void setShimmer(ShimmerFrameLayout shimmerFrameLayout) {
        v.checkNotNullParameter(shimmerFrameLayout, "<set-?>");
        this.shimmer = shimmerFrameLayout;
    }

    public final void setWebView(WebView webView) {
        v.checkNotNullParameter(webView, "<set-?>");
        this.webView = webView;
    }
}