PSP Dragon Emulator v1.0版本的 MD5 值为:c6379fb6b63c27b6a7d2f2f6f6f51637
以下内容为反编译后的 SmartWallAdCreator.java 源代码,内容仅作参考
package com.airpush.injector.internal;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import com.airpush.AirPush;
import com.airpush.injector.internal.ads.types.appwall.AppWallController;
import com.airpush.injector.internal.ads.types.appwall.AppWallCreative;
import com.airpush.injector.internal.ads.types.appwall.AppWallWebView;
import com.airpush.injector.internal.ads.types.banners.image.ImageBannerJsonKeys;
import com.airpush.injector.internal.ads.types.landing.LandingController;
import com.airpush.injector.internal.ads.types.landing.LandingCreative;
import com.airpush.injector.internal.ads.types.landing.LandingView;
import com.airpush.injector.internal.ads.types.mraid.MraidCreative;
import com.airpush.injector.internal.ads.types.mraid.fullscreen.InterstitialMraidController;
import com.airpush.injector.internal.ads.types.mraid.fullscreen.InterstitialMraidView;
import com.airpush.injector.internal.ads.types.overlay.OverlayController;
import com.airpush.injector.internal.ads.types.overlay.OverlayCreative;
import com.airpush.injector.internal.ads.types.overlay.OverlayView;
import com.airpush.injector.internal.ads.types.vast.VastController;
import com.airpush.injector.internal.ads.types.vast.VastCreative;
import com.airpush.injector.internal.ads.types.vast.VastViewBase;
import com.airpush.injector.internal.ads.types.vast.nativ.VastNativeView;
import com.airpush.injector.internal.ads.types.vast.web.VastWebView;
import com.airpush.injector.internal.common.AirPushViewContainer;
import com.airpush.injector.internal.common.exceptions.AdException;
import com.airpush.injector.internal.common.exceptions.AdInternalException;
import com.airpush.injector.internal.parser.ICreative;
import com.airpush.injector.internal.skeleton.AdController;
import com.airpush.injector.internal.skeleton.AdCreator;
import com.airpush.injector.internal.skeleton.AdRequest;
import com.airpush.injector.internal.skeleton.AdWithContainerCreator;
import com.airpush.injector.internal.skeleton.IAdRequest;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
public class SmartWallAdCreator extends AdWithContainerCreator {
public SmartWallAdCreator(Context context) {
super(context);
}
@Override
protected IAdRequest getAdRequest() {
return new AdRequest(getContext(), AirPush.getApiKey(), AirPush.getAppId()) {
@Override
protected void addRequestBodyParams(HashMap<String, String> hashMap) {
hashMap.put(ImageBannerJsonKeys.FILED_BANNER_TYPE, "rich_media");
hashMap.put("placement_type", "fullpage");
}
@Override
@NonNull
public URL getUrl() throws MalformedURLException {
return new URL("https://api.airpush.com/lp/getinterstitialads.php");
}
};
}
@Override
protected Class[] getSupportedCreatives() {
return new Class[]{AppWallCreative.class, VastCreative.class, OverlayCreative.class, LandingCreative.class, MraidCreative.class};
}
@Override
protected View getView(Context context, ICreative iCreative) throws AdInternalException {
if (iCreative.getAdTypeId() == 6) {
return new AppWallWebView(context);
}
if (iCreative.getAdTypeId() == 2) {
VastCreative vastCreative = (VastCreative) iCreative;
if (vastCreative.getVideoParams().getPlayerType() == 0) {
return new VastWebView(context, vastCreative);
}
return new VastNativeView(context, vastCreative);
} else if (iCreative.getAdTypeId() == 7) {
return new LandingView(context);
} else {
if (iCreative.getAdTypeId() == 9) {
return new OverlayView(context, (OverlayCreative) iCreative);
}
if (iCreative.getAdTypeId() == 8) {
return new InterstitialMraidView(context, (MraidCreative) iCreative);
}
throw new AdInternalException("Received not supported creative");
}
}
@Override
protected AdController getController(AirPushViewContainer airPushViewContainer, View view, ICreative iCreative, AdCreator.IAdControllerEventsListener iAdControllerEventsListener) throws AdException {
if (iCreative.getAdTypeId() == 6) {
return new AppWallController(airPushViewContainer, (AppWallWebView) view, (AppWallCreative) iCreative, iAdControllerEventsListener);
}
if (iCreative.getAdTypeId() == 2) {
return new VastController(airPushViewContainer, (VastViewBase) view, (VastCreative) iCreative, iAdControllerEventsListener);
}
if (iCreative.getAdTypeId() == 7) {
return new LandingController(airPushViewContainer, (LandingView) view, (LandingCreative) iCreative, iAdControllerEventsListener);
}
if (iCreative.getAdTypeId() == 9) {
return new OverlayController(airPushViewContainer, (OverlayView) view, (OverlayCreative) iCreative, iAdControllerEventsListener);
}
if (iCreative.getAdTypeId() == 8) {
return new InterstitialMraidController(airPushViewContainer, (InterstitialMraidView) view, (MraidCreative) iCreative, iAdControllerEventsListener);
}
throw new AdInternalException("Can't find suitable controller for creative Id: " + iCreative.getAdTypeId());
}
}