导航菜单

页面标题

页面副标题

klikUMKM v2.0.1 - WebViewActivity.java 源代码

正在查看: klikUMKM v2.0.1 应用的 WebViewActivity.java JAVA 源代码文件

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


package com.yx.credit.base.web;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;
import ba.a;
import ba.b;
import ba.c;
import com.google.firebase.encoders.json.BuildConfig;
import com.yx.credit.base.R$id;
import com.yx.credit.base.R$layout;
import com.yx.credit.base.YxApplication;
import com.yx.credit.base.activity.BaseFragmentActivity;
import j4.m;

public class WebViewActivity extends BaseFragmentActivity {
    public static final int Q = 0;
    public WebView K;
    public String L;
    public String M;
    public String N;
    public ImageView O;
    public TextView P;

    @Override
    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R$layout.activity_web_view);
        G();
        J();
        K();
        ((ViewGroup) findViewById(R$id.ll_back)).setPadding(0, m.o(YxApplication.f7325c), 0, 0);
        this.K = (WebView) findViewById(R$id.wv_webview);
        this.O = (ImageView) findViewById(R$id.iv_back_base_title);
        this.P = (TextView) findViewById(R$id.tv_title_base_title);
        WebSettings settings = this.K.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setMixedContentMode(0);
        Intent intent = getIntent();
        if (intent != null) {
            this.L = getIntent().getStringExtra("url");
            this.N = getIntent().getStringExtra("local_data");
            this.M = intent.getStringExtra("title");
        }
        if (!TextUtils.isEmpty(this.M)) {
            this.P.setText(this.M);
        }
        if (TextUtils.isEmpty(this.L)) {
            this.K.loadData(this.N, "text/html", "UTF-8");
        } else {
            this.K.loadUrl(this.L);
        }
        this.K.setWebViewClient(new b(0));
        this.K.setWebChromeClient(new c());
        this.O.setOnClickListener(new a(0, this));
    }

    @Override
    public final void onDestroy() {
        WebView webView = this.K;
        if (webView != null) {
            webView.loadDataWithBaseURL(null, BuildConfig.FLAVOR, "text/html", "utf-8", null);
            this.K.clearHistory();
            ((ViewGroup) this.K.getParent()).removeView(this.K);
            this.K.destroy();
            this.K = null;
        }
        super.onDestroy();
    }

    @Override
    public final boolean onKeyDown(int i10, KeyEvent keyEvent) {
        if (i10 != 4 || !this.K.canGoBack()) {
            return super.onKeyDown(i10, keyEvent);
        }
        this.K.goBack();
        return true;
    }
}