Weather Tracker v1.0.0版本的 MD5 值为:3edef27647e42a8ea0e7c0d2dbf56f97

以下内容为反编译后的 BaseWebView.java 源代码,内容仅作参考


package com.tp.adx.sdk.ui;

import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
import android.view.WindowManager;
import android.webkit.WebView;
import com.google.android.material.badge.BadgeDrawable;
import com.tradplus.ads.base.util.WebViews;
import com.tradplus.ads.common.util.Views;
public class BaseWebView extends WebView {
    private static boolean VJ = false;
    InnerHtmlLoadListener EAU;
    private final Handler O2WW392N;
    protected boolean mIsDestroyed;

    public interface InnerHtmlLoadListener {
        void onClicked();

        void onDestory();

        void onJump(String str);

        void onLoaded();

        void onVisibilityChanged(boolean z);
    }

    public BaseWebView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.O2WW392N = new Handler(Looper.getMainLooper());
        jB();
        WebViews.setDisableJSChromeClient(this);
        if (VJ) {
            return;
        }
        gt65QHUX(getContext());
        VJ = true;
    }

    private void gt65QHUX(Context context) {
        if (Build.VERSION.SDK_INT == 19) {
            WebView webView = new WebView(context.getApplicationContext());
            webView.setBackgroundColor(0);
            webView.loadDataWithBaseURL(null, "", "text/html", "UTF-8", null);
            WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
            layoutParams.width = 1;
            layoutParams.height = 1;
            layoutParams.type = 2005;
            layoutParams.flags = 16777240;
            layoutParams.format = -2;
            layoutParams.gravity = BadgeDrawable.TOP_START;
            ((WindowManager) context.getSystemService("window")).addView(webView, layoutParams);
        }
    }

    private void jB() {
        getSettings().setAllowFileAccess(false);
        getSettings().setAllowContentAccess(false);
        getSettings().setAllowFileAccessFromFileURLs(false);
        getSettings().setAllowUniversalAccessFromFileURLs(false);
        getSettings().setSavePassword(false);
        removeJavascriptInterface("searchBoxJavaBridge_");
        removeJavascriptInterface("accessibility");
        removeJavascriptInterface("accessibilityTraversal");
    }

    @Override
    public void destroy() {
        if (this.mIsDestroyed) {
            return;
        }
        this.mIsDestroyed = true;
        Views.removeFromParent(this);
        removeAllViews();
        super.destroy();
    }

    public void loadHtmlResponse(String str) {
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        WebViews.manageThirdPartyCookies(this);
    }

    @Deprecated
    void setIsDestroyed(boolean z) {
        this.mIsDestroyed = z;
    }

    public void setLoadListener(InnerHtmlLoadListener innerHtmlLoadListener) {
        this.EAU = innerHtmlLoadListener;
    }

    public void setWebViewScaleJS() {
        loadUrl("javascript:var meta = document.querySelector('meta[name=viewport]');if (!meta){meta = document.createElement('meta');meta.name = 'viewport'; meta.content = 'width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1';document.getElementsByTagName('head')[0].appendChild(meta);}");
    }

    public BaseWebView(Context context) {
        super(context.getApplicationContext());
        this.O2WW392N = new Handler(Looper.getMainLooper());
        jB();
        WebViews.setDisableJSChromeClient(this);
        if (VJ) {
            return;
        }
        gt65QHUX(getContext());
        VJ = true;
    }
}