导航菜单

页面标题

页面副标题

BetterTogether v3.0.0 - MoPubBrowser.java 源代码

正在查看: BetterTogether v3.0.0 应用的 MoPubBrowser.java JAVA 源代码文件

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


package com.mopub.common;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.ViewGroup;
import android.webkit.CookieSyncManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.mopub.common.util.Drawables;
import com.mopub.common.util.Utils;
import com.mopub.mobileads.BaseWebView;
import com.mopub.mobileads.util.WebViews;
import ho.o;
import ho.p;
import ho.q;

public class MoPubBrowser extends Activity {
    public static final String DESTINATION_URL_KEY = "URL";
    public static final String DSP_CREATIVE_ID = "mopub-dsp-creative-id";
    public static final int MOPUB_BROWSER_REQUEST_CODE = 1;
    public BaseWebView d;
    public ImageButton e;
    public ImageButton i;
    public ImageButton v;
    public ImageButton w;
    public boolean x;

    public final ImageButton a(Drawable drawable) {
        ImageButton imageButton = new ImageButton(this);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2, 1.0f);
        layoutParams.gravity = 16;
        imageButton.setLayoutParams(layoutParams);
        imageButton.setImageDrawable(drawable);
        return imageButton;
    }

    @Override
    public void finish() {
        ((ViewGroup) getWindow().getDecorView()).removeAllViews();
        super.finish();
    }

    public ImageButton getBackButton() {
        return this.e;
    }

    public ImageButton getCloseButton() {
        return this.w;
    }

    public ImageButton getForwardButton() {
        return this.i;
    }

    public ImageButton getRefreshButton() {
        return this.v;
    }

    public WebView getWebView() {
        return this.d;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setResult(-1);
        boolean requestFeature = getWindow().requestFeature(2);
        this.x = requestFeature;
        if (requestFeature) {
            getWindow().setFeatureInt(2, -1);
        }
        LinearLayout linearLayout = new LinearLayout(this);
        linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
        linearLayout.setOrientation(1);
        RelativeLayout relativeLayout = new RelativeLayout(this);
        relativeLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
        linearLayout.addView(relativeLayout);
        LinearLayout linearLayout2 = new LinearLayout(this);
        linearLayout2.setId(1);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -2);
        layoutParams.addRule(12);
        linearLayout2.setLayoutParams(layoutParams);
        linearLayout2.setBackgroundDrawable(Drawables.BACKGROUND.createDrawable(this));
        relativeLayout.addView(linearLayout2);
        this.e = a(Drawables.UNLEFT_ARROW.createDrawable(this));
        this.i = a(Drawables.UNRIGHT_ARROW.createDrawable(this));
        this.v = a(Drawables.REFRESH.createDrawable(this));
        this.w = a(Drawables.CLOSE.createDrawable(this));
        linearLayout2.addView(this.e);
        linearLayout2.addView(this.i);
        linearLayout2.addView(this.v);
        linearLayout2.addView(this.w);
        this.d = new BaseWebView(this);
        RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, -1);
        layoutParams2.addRule(2, 1);
        this.d.setLayoutParams(layoutParams2);
        relativeLayout.addView(this.d);
        setContentView(linearLayout);
        WebSettings settings = this.d.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setSupportZoom(true);
        settings.setBuiltInZoomControls(true);
        settings.setUseWideViewPort(true);
        this.d.loadUrl(getIntent().getStringExtra(DESTINATION_URL_KEY));
        this.d.setWebViewClient(new b(this));
        this.e.setBackgroundColor(0);
        this.e.setOnClickListener(new ho.m(this));
        this.i.setBackgroundColor(0);
        this.i.setOnClickListener(new ho.n(this));
        this.v.setBackgroundColor(0);
        this.v.setOnClickListener(new o(this));
        this.w.setBackgroundColor(0);
        this.w.setOnClickListener(new p(this));
        CookieSyncManager.createInstance(this);
        CookieSyncManager.getInstance().startSync();
    }

    @Override
    public final void onDestroy() {
        super.onDestroy();
        this.d.destroy();
        this.d = null;
    }

    @Override
    public final void onPause() {
        super.onPause();
        CookieSyncManager.getInstance().stopSync();
        this.d.setWebChromeClient(null);
        WebViews.onPause(this.d, isFinishing());
    }

    @Override
    public final void onResume() {
        super.onResume();
        CookieSyncManager.getInstance().startSync();
        this.d.setWebChromeClient(new q(this));
        this.d.onResume();
    }

    @Override
    public final void onStart() {
        super.onStart();
        Utils.hideNavigationBar(this);
    }
}