atsameip v0.1版本的 MD5 值为:28547cf98b0a2d02acb37969dcfb83e9
以下内容为反编译后的 BannerActivity.java 源代码,内容仅作参考
package com.appnext.banners;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import com.appnext.banners.f;
import com.appnext.core.Ad;
import com.appnext.core.AppnextAd;
import com.appnext.core.SettingsManager;
import com.appnext.core.f;
import com.appnext.core.n;
import com.appnext.core.p;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import java.util.ArrayList;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONObject;
public class BannerActivity extends Activity {
boolean aA;
BannerAd bannerAd;
BannerAdData bh;
String bi;
String bj;
String bk;
String bl;
String bm;
e bn;
Banner bo;
BannerAdData selectedAd;
p userAction;
@Override
protected void onCreate(Bundle bundle) {
try {
requestWindowFeature(1);
getWindow().setFlags(1024, 1024);
super.onCreate(bundle);
this.bn = new a();
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
setContentView(linearLayout);
this.userAction = new p(this, new p.a() {
@Override
public final void report(String str) {
}
@Override
public final Ad c() {
return BannerActivity.this.bannerAd;
}
@Override
public final AppnextAd d() {
return BannerActivity.this.bh;
}
@Override
public final SettingsManager e() {
return d.K();
}
});
Bundle extras = getIntent().getExtras();
this.bk = extras.getString(IronSourceConstants.EVENTS_PLACEMENT_NAME);
String string = extras.getString("size");
this.bl = string;
BannerAd bannerAd = (BannerAd) b(this.bk, string);
this.bannerAd = bannerAd;
bannerAd.setPostback(extras.getString("postback"));
this.bannerAd.setCategories(extras.getString("category"));
this.bj = extras.getString("clicked");
this.aA = extras.getBoolean("shouldClose", false);
this.selectedAd = (BannerAdData) extras.getSerializable("selected");
this.bi = b.J().k(this.bannerAd);
ArrayList<AppnextAd> e = b.J().e(this.bannerAd);
JSONArray jSONArray = new JSONArray();
if (e != null) {
Iterator<AppnextAd> it = e.iterator();
while (it.hasNext()) {
jSONArray.put(new JSONObject(new BannerAdData(it.next()).getAdJSON()));
}
}
this.bm = new JSONObject().put("apps", jSONArray).toString();
Banner banner = new Banner(this);
this.bo = banner;
linearLayout.addView(banner);
this.bo.getLayoutParams().height = -1;
this.bo.getLayoutParams().width = -1;
this.bo.setPlacementId(this.bk);
this.bo.setBannerSize(j(this.bl));
this.bo.loadAd(null);
} catch (Throwable th) {
com.appnext.base.a.a("BannerActivity$onCreate", th);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
try {
if (this.userAction != null) {
this.userAction.destroy();
}
} catch (Throwable th) {
com.appnext.base.a.a("BannerActivity$onDestroy", th);
}
try {
if (this.bannerAd != null) {
this.bannerAd.destroy();
}
} catch (Throwable th2) {
com.appnext.base.a.a("BannerActivity$onDestroy", th2);
}
try {
if (this.bo != null) {
this.bo.destroy();
}
} catch (Throwable th3) {
com.appnext.base.a.a("BannerActivity$onDestroy", th3);
}
}
private static BannerSize j(String str) {
char c = 65535;
try {
int hashCode = str.hashCode();
if (hashCode != -1966536496) {
if (hashCode != -96588539) {
if (hashCode == 1951953708 && str.equals("BANNER")) {
c = 0;
}
} else if (str.equals("MEDIUM_RECTANGLE")) {
c = 2;
}
} else if (str.equals("LARGE_BANNER")) {
c = 1;
}
return BannerSize.BANNER;
} catch (Throwable th) {
com.appnext.base.a.a("BannerActivity$getSize", th);
return BannerSize.BANNER;
}
}
protected final Ad b(String str, String str2) {
char c = 65535;
try {
int hashCode = str2.hashCode();
if (hashCode != -1966536496) {
if (hashCode != -96588539) {
if (hashCode == 1951953708 && str2.equals("BANNER")) {
c = 0;
}
} else if (str2.equals("MEDIUM_RECTANGLE")) {
c = 2;
}
} else if (str2.equals("LARGE_BANNER")) {
c = 1;
}
return new SmallBannerAd(this, str);
} catch (Throwable th) {
com.appnext.base.a.a("BannerActivity$createAd", th);
return new SmallBannerAd(this, str);
}
}
private class a extends f {
@Override
protected final String getJSurl() {
return "https://cdn.appnext.com/tools/sdk/banner/2.4.3/result.min.js";
}
private a() {
}
@Override
protected final String getFallbackScript() {
return new com.appnext.core.result.b().D();
}
@Override
protected final int getLayout() {
return R.layout.apnxt_full_screen;
}
@Override
protected final BannerAd getBannerAd() {
return BannerActivity.this.bannerAd;
}
@Override
protected final BannerAdData getSelectedAd() {
return BannerActivity.this.selectedAd;
}
@Override
public final void loadAd(BannerAdRequest bannerAdRequest) {
inflateView(0, null);
}
@Override
protected final BannerAdRequest getAdRequest() {
return new BannerAdRequest();
}
@Override
protected final f.a getWebInterface() {
return new b();
}
@Override
protected final WebViewClient getWebViewClient() {
return new C0045a();
}
public class b extends f.a {
public b() {
super();
}
@JavascriptInterface
public final void adClicked(String str, int i) {
BannerActivity bannerActivity = BannerActivity.this;
com.appnext.banners.b.J();
bannerActivity.bh = new BannerAdData((AppnextAd) com.appnext.banners.b.parseAd(str));
p pVar = BannerActivity.this.userAction;
BannerAdData bannerAdData = BannerActivity.this.bh;
pVar.a(bannerAdData, BannerActivity.this.bh.getAppURL() + "&tem_id=" + a.this.getBannerAd().getTemId(a.this.getSelectedAd()) + "1", a.this.getPlacementId(), new f.a() {
@Override
public final void error(String str2) {
}
@Override
public final void onMarket(String str2) {
if (BannerActivity.this.aA) {
BannerActivity.this.finish();
}
}
});
}
@JavascriptInterface
public final void impression(String str) {
com.appnext.banners.b.J();
BannerActivity.this.userAction.d((AppnextAd) com.appnext.banners.b.parseAd(str));
}
@JavascriptInterface
public final void postView(String str) {
com.appnext.banners.b.J();
BannerAdData bannerAdData = new BannerAdData((AppnextAd) com.appnext.banners.b.parseAd(str));
p pVar = BannerActivity.this.userAction;
pVar.a(bannerAdData, bannerAdData.getImpressionURL() + "&tem_id=" + a.this.getBannerAd().getTemId(a.this.getSelectedAd()) + "1", null);
}
@Override
@JavascriptInterface
public final void openLink(String str) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
intent.addFlags(268435456);
BannerActivity.this.startActivity(intent);
}
}
public class C0045a extends WebViewClient {
public C0045a() {
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (str == null) {
return false;
}
try {
if (str.startsWith("http")) {
webView.loadUrl(str);
return true;
}
} catch (Throwable th) {
com.appnext.base.a.a("BWebViewClient$shouldOverrideUrlLoading", th);
}
return super.shouldOverrideUrlLoading(webView, str);
}
@Override
public final void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
n.aa().a(new Runnable() {
@Override
public final void run() {
final String b = com.appnext.core.g.b(a.this.context, false);
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
try {
a aVar = a.this;
aVar.loadJS("javascript:(function() { try { Appnext.setParams(" + a.this.getConfigParams().put("did", b).toString() + "); } catch(err){ Appnext.jsError(err.message); }})()");
} catch (Throwable unused) {
}
a aVar2 = a.this;
aVar2.loadJS("javascript:(function() { try { Appnext.load(" + a.this.getSelectedAd().getAdJSON() + "," + BannerActivity.this.bm + "," + BannerActivity.this.bi + "); } catch(err){ Appnext.jsError(err.message); }})()");
}
});
}
});
}
}
}
private class Banner extends BannerView {
public Banner(Context context) {
super(context);
}
@Override
protected e getBannerAdapter() {
return BannerActivity.this.bn;
}
}
}