导航菜单

页面标题

页面副标题

24Six v66.1.24 - ActivityWebView.java 源代码

正在查看: 24Six v66.1.24 应用的 ActivityWebView.java JAVA 源代码文件

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


package app.tfs.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.webkit.CookieManager;
import android.webkit.WebChromeClient;
import android.webkit.WebStorage;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.core.view.MenuProvider;
import androidx.core.view.x;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import app.tfs.R;
import app.tfs.activity.ActivityWebView;
import com.google.android.gms.common.internal.ImagesContract;
import j.C0540f;
import kotlin.jvm.internal.g;
import kotlin.jvm.internal.m;

public final class ActivityWebView extends c {

    public static final a f409t = new a(null);

    private C0540f f410r;

    private String f411s;

    public static final class a {
        public a(g gVar) {
            this();
        }

        private a() {
        }
    }

    public static final class b implements MenuProvider {
        b() {
        }

        public void onCreateMenu(Menu menu, MenuInflater menuInflater) {
            m.e(menu, "menu");
            m.e(menuInflater, "menuInflater");
            menuInflater.inflate(R.h.menu_with_close, menu);
        }

        public void onMenuClosed(Menu menu) {
            x.a(this, menu);
        }

        public boolean onMenuItemSelected(MenuItem menuItem) {
            m.e(menuItem, "menuItem");
            if (menuItem.getItemId() != R.e.menu_close) {
                return false;
            }
            ActivityWebView.this.finish();
            return true;
        }

        public void onPrepareMenu(Menu menu) {
            x.b(this, menu);
        }
    }

    private final void L(WebView webView) {
        WebStorage.getInstance().deleteAllData();
        CookieManager.getInstance().removeAllCookies(null);
        CookieManager.getInstance().flush();
        webView.clearCache(true);
        webView.clearFormData();
        webView.clearHistory();
        webView.clearSslPreferences();
    }

    public static final void M(ActivityWebView activityWebView) {
        C0540f c0540f = activityWebView.f410r;
        C0540f c0540f2 = null;
        if (c0540f == null) {
            m.w("viewBinding");
            c0540f = null;
        }
        c0540f.f1230i.reload();
        C0540f c0540f3 = activityWebView.f410r;
        if (c0540f3 == null) {
            m.w("viewBinding");
        } else {
            c0540f2 = c0540f3;
        }
        c0540f2.e.setRefreshing(false);
    }

    public String m() {
        return "ActivityWebView";
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        C0540f c = C0540f.c(getLayoutInflater());
        this.f410r = c;
        String str = null;
        if (c == null) {
            m.w("viewBinding");
            c = null;
        }
        setContentView(c.getRoot());
        Intent intent = getIntent();
        String stringExtra = intent != null ? intent.getStringExtra(ImagesContract.URL) : null;
        if (stringExtra == null) {
            stringExtra = "";
        }
        this.f411s = stringExtra;
        C0540f c0540f = this.f410r;
        if (c0540f == null) {
            m.w("viewBinding");
            c0540f = null;
        }
        c0540f.f1227f.addMenuProvider(new b());
        C0540f c0540f2 = this.f410r;
        if (c0540f2 == null) {
            m.w("viewBinding");
            c0540f2 = null;
        }
        c0540f2.e.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public final void onRefresh() {
                ActivityWebView.M(ActivityWebView.this);
            }
        });
        C0540f c0540f3 = this.f410r;
        if (c0540f3 == null) {
            m.w("viewBinding");
            c0540f3 = null;
        }
        WebView webView = c0540f3.f1230i;
        m.d(webView, "webView");
        L(webView);
        C0540f c0540f4 = this.f410r;
        if (c0540f4 == null) {
            m.w("viewBinding");
            c0540f4 = null;
        }
        c0540f4.f1230i.getSettings().setJavaScriptEnabled(true);
        C0540f c0540f5 = this.f410r;
        if (c0540f5 == null) {
            m.w("viewBinding");
            c0540f5 = null;
        }
        c0540f5.f1230i.setWebChromeClient(new WebChromeClient());
        C0540f c0540f6 = this.f410r;
        if (c0540f6 == null) {
            m.w("viewBinding");
            c0540f6 = null;
        }
        c0540f6.f1230i.setWebViewClient(new WebViewClient());
        C0540f c0540f7 = this.f410r;
        if (c0540f7 == null) {
            m.w("viewBinding");
            c0540f7 = null;
        }
        WebView webView2 = c0540f7.f1230i;
        String str2 = this.f411s;
        if (str2 == null) {
            m.w("mUrl");
        } else {
            str = str2;
        }
        webView2.loadUrl(str);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        C0540f c0540f = this.f410r;
        if (c0540f == null) {
            m.w("viewBinding");
            c0540f = null;
        }
        WebView webView = c0540f.f1230i;
        m.d(webView, "webView");
        L(webView);
    }
}