13Poker by gametower unlimited gems v0.4版本的 MD5 值为:51324fc0f195c34821074948ab266846

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


package com.adsdk.sdk.mraid;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.location.Location;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.webkit.WebViewDatabase;
import android.widget.FrameLayout;
import com.adsdk.sdk.AdListener;
import java.util.HashMap;
public class MoPubView extends FrameLayout {
    public static final int DEFAULT_LOCATION_PRECISION = 6;
    private AdListener mAdListener;
    protected AdView mAdView;
    protected BaseAdapter mAdapter;
    private Context mContext;
    private boolean mIsInForeground;
    private LocationAwareness mLocationAwareness;
    private int mLocationPrecision;
    private boolean mPreviousAutorefreshSetting;
    private BroadcastReceiver mScreenStateReceiver;

    public enum LocationAwareness {
        LOCATION_AWARENESS_NORMAL,
        LOCATION_AWARENESS_TRUNCATED,
        LOCATION_AWARENESS_DISABLED;

        public static LocationAwareness[] valuesCustom() {
            LocationAwareness[] valuesCustom = values();
            int length = valuesCustom.length;
            LocationAwareness[] locationAwarenessArr = new LocationAwareness[length];
            System.arraycopy(valuesCustom, 0, locationAwarenessArr, 0, length);
            return locationAwarenessArr;
        }
    }

    public MoPubView(Context context) {
        this(context, null);
    }

    public MoPubView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.mPreviousAutorefreshSetting = false;
        this.mContext = context;
        this.mIsInForeground = getVisibility() == 0;
        this.mLocationAwareness = LocationAwareness.LOCATION_AWARENESS_NORMAL;
        this.mLocationPrecision = 6;
        setHorizontalScrollBarEnabled(false);
        setVerticalScrollBarEnabled(false);
        if (WebViewDatabase.getInstance(context) == null) {
            Log.e("MoPub", "Disabling MoPub. Local cache file is inaccessible so MoPub will fail if we try to create a WebView. Details of this Android bug found at:http://code.google.com/p/android/issues/detail?id=10789");
        }
    }

    public void loadAd() {
        if (this.mAdView != null) {
            this.mAdView.loadAd();
        }
    }

    public void destroy() {
        if (this.mAdView != null) {
            this.mAdView.cleanup();
            this.mAdView = null;
        }
        if (this.mAdapter != null) {
            this.mAdapter.invalidate();
            this.mAdapter = null;
        }
    }

    public void loadFailUrl() {
        if (this.mAdView != null) {
            this.mAdView.loadFailUrl();
        }
    }

    public void loadNativeSDK(HashMap<String, String> paramsHash) {
        if (this.mAdapter != null) {
            this.mAdapter.invalidate();
        }
        String type = paramsHash.get("X-Adtype");
        this.mAdapter = BaseAdapter.getAdapterForType(type);
        if (this.mAdapter != null) {
            Log.i("MoPub", "Loading native adapter for type: " + type);
            String jsonParams = paramsHash.get("X-Nativeparams");
            this.mAdapter.init(this, jsonParams);
            this.mAdapter.loadAd();
            return;
        }
        Log.i("MoPub", "Couldn't load native adapter. Trying next ad...");
        loadFailUrl();
    }

    public void registerClick() {
        if (this.mAdView != null) {
            this.mAdView.registerClick();
            adClicked();
        }
    }

    @Override
    protected void onWindowVisibilityChanged(int visibility) {
        if (this.mAdView != null) {
            if (visibility == 0) {
                Log.d("MoPub", "Ad Unit (" + this.mAdView.getAdUnitId() + ") going visible: enabling refresh");
                this.mIsInForeground = true;
                this.mAdView.setAutorefreshEnabled(true);
                return;
            }
            Log.d("MoPub", "Ad Unit (" + this.mAdView.getAdUnitId() + ") going invisible: disabling refresh");
            this.mIsInForeground = false;
            this.mAdView.setAutorefreshEnabled(false);
        }
    }

    protected void adWillLoad(String url) {
        Log.d("MoPub", "adWillLoad: " + url);
    }

    public void adLoaded() {
        Log.d("MoPub", "adLoaded");
        if (this.mAdListener != null) {
            this.mAdListener.adLoadSucceeded(null);
        }
    }

    public void adFailed() {
        if (this.mAdListener != null) {
            this.mAdListener.noAdFound();
        }
    }

    public void adPresentedOverlay() {
        if (this.mAdListener != null) {
            this.mAdListener.adShown(null, true);
        }
    }

    public void adClosed() {
        if (this.mAdListener != null) {
            this.mAdListener.adClosed(null, true);
        }
    }

    public void adClicked() {
        if (this.mAdListener != null) {
            this.mAdListener.adClicked();
        }
    }

    public void nativeAdLoaded() {
        if (this.mAdView != null) {
            this.mAdView.scheduleRefreshTimerIfEnabled();
        }
        adLoaded();
    }

    protected void adAppeared() {
        if (this.mAdView != null) {
            this.mAdView.adAppeared();
        }
    }

    public void customEventDidLoadAd() {
        if (this.mAdView != null) {
            this.mAdView.customEventDidLoadAd();
        }
    }

    public void customEventDidFailToLoadAd() {
        if (this.mAdView != null) {
            this.mAdView.customEventDidFailToLoadAd();
        }
    }

    public void customEventActionWillBegin() {
        if (this.mAdView != null) {
            this.mAdView.customEventActionWillBegin();
        }
    }

    public void setAdUnitId(String adUnitId) {
        if (this.mAdView != null) {
            this.mAdView.setAdUnitId(adUnitId);
        }
    }

    public void setKeywords(String keywords) {
        if (this.mAdView != null) {
            this.mAdView.setKeywords(keywords);
        }
    }

    public String getKeywords() {
        if (this.mAdView != null) {
            return this.mAdView.getKeywords();
        }
        return null;
    }

    public void setLocation(Location location) {
        if (this.mAdView != null) {
            this.mAdView.setLocation(location);
        }
    }

    public Location getLocation() {
        if (this.mAdView != null) {
            return this.mAdView.getLocation();
        }
        return null;
    }

    public int getAdWidth() {
        if (this.mAdView != null) {
            return this.mAdView.getAdWidth();
        }
        return 0;
    }

    public int getAdHeight() {
        if (this.mAdView != null) {
            return this.mAdView.getAdHeight();
        }
        return 0;
    }

    public String getResponseString() {
        if (this.mAdView != null) {
            return this.mAdView.getResponseString();
        }
        return null;
    }

    public void setClickthroughUrl(String url) {
        if (this.mAdView != null) {
            this.mAdView.setClickthroughUrl(url);
        }
    }

    public String getClickthroughUrl() {
        if (this.mAdView != null) {
            return this.mAdView.getClickthroughUrl();
        }
        return null;
    }

    public Activity getActivity() {
        return (Activity) this.mContext;
    }

    public void setLocationAwareness(LocationAwareness awareness) {
        this.mLocationAwareness = awareness;
    }

    public LocationAwareness getLocationAwareness() {
        return this.mLocationAwareness;
    }

    public void setLocationPrecision(int precision) {
        if (precision < 0) {
            precision = 0;
        }
        this.mLocationPrecision = precision;
    }

    public int getLocationPrecision() {
        return this.mLocationPrecision;
    }

    public void setAutorefreshEnabled(boolean enabled) {
        if (this.mAdView != null) {
            this.mAdView.setAutorefreshEnabled(enabled);
        }
    }

    public boolean getAutorefreshEnabled() {
        if (this.mAdView != null) {
            return this.mAdView.getAutorefreshEnabled();
        }
        Log.d("MoPub", "Can't get autorefresh status for destroyed MoPubView. Returning false.");
        return false;
    }

    public void setAdContentView(View view) {
        if (this.mAdView != null) {
            this.mAdView.setAdContentView(view);
        }
    }

    public void setAdListener(AdListener adListener) {
        this.mAdListener = adListener;
    }

    public void forceRefresh() {
        if (this.mAdapter != null) {
            this.mAdapter.invalidate();
            this.mAdapter = null;
        }
        if (this.mAdView != null) {
            this.mAdView.forceRefresh();
        }
    }
}