GoooBet v1.0版本的 MD5 值为:ff9748f16167bfd7735b669c0a9931c5
以下内容为反编译后的 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.g;
import com.appnext.core.Ad;
import com.appnext.core.AppnextAd;
import com.appnext.core.e;
import com.appnext.core.p;
import com.appnext.core.q;
import com.google.android.exoplayer2.metadata.icy.IcyHeaders;
import com.mopub.common.Constants;
import com.startapp.android.mediation.admob.StartAppNative;
import com.startapp.android.publish.common.model.AdPreferences;
import java.util.ArrayList;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONObject;
public class BannerActivity extends Activity {
String ap;
BannerAd bannerAd;
BannerAdData cF;
String cG;
String cH;
String cI;
String cJ;
e cK;
Banner cL;
boolean cd;
BannerAdData selectedAd;
q userAction;
@Override
protected void onCreate(Bundle bundle) {
char c;
BannerAd smallBannerAd;
BannerSize bannerSize;
requestWindowFeature(1);
getWindow().setFlags(1024, 1024);
super.onCreate(bundle);
this.cK = new a();
LinearLayout linearLayout = new LinearLayout(this);
char c2 = 65535;
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
setContentView(linearLayout);
this.userAction = new q(this, new q.a() {
@Override
public final void report(String str) {
}
@Override
public final Ad e() {
return BannerActivity.this.bannerAd;
}
@Override
public final AppnextAd f() {
return BannerActivity.this.cF;
}
@Override
public final p g() {
return d.S();
}
});
try {
Bundle extras = getIntent().getExtras();
this.ap = extras.getString("placement");
String string = extras.getString("size");
this.cI = string;
String str = this.ap;
int hashCode = string.hashCode();
if (hashCode == -1966536496) {
if (string.equals("LARGE_BANNER")) {
c = 1;
}
c = 65535;
} else if (hashCode != -96588539) {
if (hashCode == 1951953708 && string.equals(AdPreferences.TYPE_BANNER)) {
c = 0;
}
c = 65535;
} else {
if (string.equals("MEDIUM_RECTANGLE")) {
c = 2;
}
c = 65535;
}
if (c == 0) {
smallBannerAd = new SmallBannerAd(this, str);
} else if (c == 1) {
smallBannerAd = new LargeBannerAd(this, str);
} else if (c == 2) {
smallBannerAd = new MediumRectangleAd(this, str);
} else {
throw new IllegalArgumentException("Wrong banner size " + string);
}
BannerAd bannerAd = smallBannerAd;
this.bannerAd = bannerAd;
bannerAd.setPostback(extras.getString("postback"));
this.bannerAd.setCategories(extras.getString(StartAppNative.EXTRAS_CATEGORY));
this.cH = extras.getString("clicked");
this.cd = extras.getBoolean("shouldClose", false);
this.selectedAd = (BannerAdData) extras.getSerializable("selected");
this.cG = b.R().l(this.bannerAd);
ArrayList<AppnextAd> f = b.R().f(this.bannerAd);
JSONArray jSONArray = new JSONArray();
if (f != null) {
Iterator<AppnextAd> it = f.iterator();
while (it.hasNext()) {
jSONArray.put(new JSONObject(new BannerAdData(it.next()).getAdJSON()));
}
}
this.cJ = new JSONObject().put("apps", jSONArray).toString();
Banner banner = new Banner(this);
this.cL = banner;
linearLayout.addView(banner);
this.cL.getLayoutParams().height = -1;
this.cL.getLayoutParams().width = -1;
this.cL.setPlacementId(this.ap);
Banner banner2 = this.cL;
String str2 = this.cI;
int hashCode2 = str2.hashCode();
if (hashCode2 != -1966536496) {
if (hashCode2 != -96588539) {
if (hashCode2 == 1951953708 && str2.equals(AdPreferences.TYPE_BANNER)) {
c2 = 0;
}
} else if (str2.equals("MEDIUM_RECTANGLE")) {
c2 = 2;
}
} else if (str2.equals("LARGE_BANNER")) {
c2 = 1;
}
if (c2 == 0) {
bannerSize = BannerSize.BANNER;
} else if (c2 == 1) {
bannerSize = BannerSize.LARGE_BANNER;
} else if (c2 == 2) {
bannerSize = BannerSize.MEDIUM_RECTANGLE;
} else {
throw new IllegalArgumentException("Wrong banner size " + str2);
}
banner2.setBannerSize(bannerSize);
this.cL.loadAd(null);
} catch (Throwable unused) {
finish();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
try {
this.userAction.destroy();
} catch (Throwable unused) {
}
try {
this.bannerAd.destroy();
} catch (Throwable unused2) {
}
try {
this.cL.destroy();
} catch (Throwable unused3) {
}
}
private static BannerSize n(String str) {
char c;
int hashCode = str.hashCode();
if (hashCode == -1966536496) {
if (str.equals("LARGE_BANNER")) {
c = 1;
}
c = 65535;
} else if (hashCode != -96588539) {
if (hashCode == 1951953708 && str.equals(AdPreferences.TYPE_BANNER)) {
c = 0;
}
c = 65535;
} else {
if (str.equals("MEDIUM_RECTANGLE")) {
c = 2;
}
c = 65535;
}
if (c == 0) {
return BannerSize.BANNER;
}
if (c == 1) {
return BannerSize.LARGE_BANNER;
}
if (c == 2) {
return BannerSize.MEDIUM_RECTANGLE;
}
throw new IllegalArgumentException("Wrong banner size " + str);
}
protected final Ad c(String str, String str2) {
char c;
int hashCode = str2.hashCode();
if (hashCode == -1966536496) {
if (str2.equals("LARGE_BANNER")) {
c = 1;
}
c = 65535;
} else if (hashCode != -96588539) {
if (hashCode == 1951953708 && str2.equals(AdPreferences.TYPE_BANNER)) {
c = 0;
}
c = 65535;
} else {
if (str2.equals("MEDIUM_RECTANGLE")) {
c = 2;
}
c = 65535;
}
if (c == 0) {
return new SmallBannerAd(this, str);
}
if (c == 1) {
return new LargeBannerAd(this, str);
}
if (c == 2) {
return new MediumRectangleAd(this, str);
}
throw new IllegalArgumentException("Wrong banner size " + str2);
}
private class a extends g {
@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().J();
}
@Override
protected final int getLayout() {
return R.layout.apnxt_full_screen;
}
@Override
public 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
public final BannerAdRequest getAdRequest() {
return new BannerAdRequest();
}
@Override
protected final g.a getWebInterface() {
return new b();
}
@Override
protected final WebViewClient getWebViewClient() {
return new C0042a();
}
public class b extends g.a {
public b() {
super();
}
@JavascriptInterface
public final void adClicked(String str, int i) {
BannerActivity bannerActivity = BannerActivity.this;
com.appnext.banners.b.R();
bannerActivity.cF = new BannerAdData((AppnextAd) com.appnext.banners.b.parseAd(str));
BannerActivity.this.userAction.a(BannerActivity.this.cF, BannerActivity.this.cF.getAppURL() + "&tem_id=" + a.this.getBannerAd().getTemId(a.this.getSelectedAd()) + IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE, a.this.getPlacementId(), new e.a() {
@Override
public final void error(String str2) {
}
@Override
public final void onMarket(String str2) {
if (BannerActivity.this.cd) {
BannerActivity.this.finish();
}
}
});
}
@JavascriptInterface
public final void impression(String str) {
com.appnext.banners.b.R();
BannerActivity.this.userAction.e((AppnextAd) com.appnext.banners.b.parseAd(str));
}
@JavascriptInterface
public final void postView(String str) {
com.appnext.banners.b.R();
BannerAdData bannerAdData = new BannerAdData((AppnextAd) com.appnext.banners.b.parseAd(str));
BannerActivity.this.userAction.a(bannerAdData, bannerAdData.getImpressionURL() + "&tem_id=" + a.this.getBannerAd().getTemId(a.this.getSelectedAd()) + IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE, 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 C0042a extends WebViewClient {
public C0042a() {
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (str == null) {
return false;
}
if (str.startsWith(Constants.HTTP)) {
webView.loadUrl(str);
return true;
}
return super.shouldOverrideUrlLoading(webView, str);
}
@Override
public final void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
new Thread(new Runnable() {
@Override
public final void run() {
final String b = com.appnext.core.f.b(a.this.context, false);
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
try {
a.this.loadJS("javascript:(function() { try { Appnext.setParams(" + a.this.getConfigParams().put("did", b).toString() + "); } catch(err){ Appnext.jsError(err.message); }})()");
} catch (Throwable unused) {
}
a.this.loadJS("javascript:(function() { try { Appnext.load(" + a.this.getSelectedAd().getAdJSON() + "," + BannerActivity.this.cJ + "," + BannerActivity.this.cG + "); } catch(err){ Appnext.jsError(err.message); }})()");
}
});
}
}).start();
}
}
}
private class Banner extends BannerView {
public Banner(Context context) {
super(context);
}
@Override
protected e getBannerAdapter() {
return BannerActivity.this.cK;
}
}
}