导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - BannerActivity.java 源代码

正在查看: Cantique de Louanges v12 应用的 BannerActivity.java JAVA 源代码文件

本页面展示 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.e;
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 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;
    BaseBannerAdapter bn;
    Banner bo;
    BannerAdData selectedAd;
    p userAction;

    private class Banner extends BannerView {
        public Banner(Context context) {
            super(context);
        }

        @Override
        protected BaseBannerAdapter getBannerAdapter() {
            return BannerActivity.this.bn;
        }
    }

    private class a extends e {

        public class C0206a extends WebViewClient {
            public C0206a() {
            }

            @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 b5 = com.appnext.core.g.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", b5).toString() + "); } catch(err){ Appnext.jsError(err.message); }})()");
                                } catch (Throwable unused) {
                                }
                                a.this.loadJS("javascript:(function() { try { Appnext.load(" + a.this.getSelectedAd().getAdJSON() + "," + BannerActivity.this.bm + "," + BannerActivity.this.bi + "); } catch(err){ Appnext.jsError(err.message); }})()");
                            }
                        });
                    }
                });
            }

            @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);
            }
        }

        public class b extends e.a {
            public b() {
                super();
            }

            @JavascriptInterface
            public final void adClicked(String str, int i5) {
                BannerActivity bannerActivity = BannerActivity.this;
                com.appnext.banners.b.J();
                bannerActivity.bh = new BannerAdData((AppnextAd) com.appnext.core.d.parseAd(str));
                BannerActivity bannerActivity2 = BannerActivity.this;
                bannerActivity2.userAction.a(bannerActivity2.bh, 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) {
                        BannerActivity bannerActivity3 = BannerActivity.this;
                        if (bannerActivity3.aA) {
                            bannerActivity3.finish();
                        }
                    }
                });
            }

            @JavascriptInterface
            public final void impression(String str) {
                com.appnext.banners.b.J();
                BannerActivity.this.userAction.d((AppnextAd) com.appnext.core.d.parseAd(str));
            }

            @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);
            }

            @JavascriptInterface
            public final void postView(String str) {
                com.appnext.banners.b.J();
                BannerAdData bannerAdData = new BannerAdData((AppnextAd) com.appnext.core.d.parseAd(str));
                BannerActivity.this.userAction.a(bannerAdData, bannerAdData.getImpressionURL() + "&tem_id=" + a.this.getBannerAd().getTemId(a.this.getSelectedAd()) + "1", null);
            }
        }

        @Override
        protected final BannerAdRequest getAdRequest() {
            return new BannerAdRequest();
        }

        @Override
        protected final BannerAd getBannerAd() {
            return BannerActivity.this.bannerAd;
        }

        @Override
        protected final String getFallbackScript() {
            return new com.appnext.core.result.b().D();
        }

        @Override
        protected final String getJSurl() {
            return "https://cdn.appnext.com/tools/sdk/banner/2.4.3/result.min.js";
        }

        @Override
        protected final int getLayout() {
            return R.layout.apnxt_full_screen;
        }

        @Override
        protected final BannerAdData getSelectedAd() {
            return BannerActivity.this.selectedAd;
        }

        @Override
        protected final e.a getWebInterface() {
            return new b();
        }

        @Override
        protected final WebViewClient getWebViewClient() {
            return new C0206a();
        }

        @Override
        public final void loadAd(BannerAdRequest bannerAdRequest) {
            inflateView(0, null);
        }

        private a() {
        }
    }

    private static com.appnext.banners.BannerSize j(java.lang.String r4) {
        throw new UnsupportedOperationException("Method not decompiled: com.appnext.banners.BannerActivity.j(java.lang.String):com.appnext.banners.BannerSize");
    }

    protected final com.appnext.core.Ad b(java.lang.String r5, java.lang.String r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.appnext.banners.BannerActivity.b(java.lang.String, java.lang.String):com.appnext.core.Ad");
    }

    @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 Ad c() {
                    return BannerActivity.this.bannerAd;
                }

                @Override
                public final AppnextAd d() {
                    return BannerActivity.this.bh;
                }

                @Override
                public final SettingsManager e() {
                    return d.K();
                }

                @Override
                public final void report(String str) {
                }
            });
            try {
                Bundle extras = getIntent().getExtras();
                this.bk = extras.getString("placement");
                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> e5 = b.J().e(this.bannerAd);
                JSONArray jSONArray = new JSONArray();
                if (e5 != null) {
                    Iterator<AppnextAd> it = e5.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);
                finish();
            }
        } catch (Throwable th2) {
            com.appnext.base.a.a("BannerActivity$onCreate", th2);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        try {
            p pVar = this.userAction;
            if (pVar != null) {
                pVar.destroy();
            }
        } catch (Throwable th) {
            com.appnext.base.a.a("BannerActivity$onDestroy", th);
        }
        try {
            BannerAd bannerAd = this.bannerAd;
            if (bannerAd != null) {
                bannerAd.destroy();
            }
        } catch (Throwable th2) {
            com.appnext.base.a.a("BannerActivity$onDestroy", th2);
        }
        try {
            Banner banner = this.bo;
            if (banner != null) {
                banner.destroy();
            }
        } catch (Throwable th3) {
            com.appnext.base.a.a("BannerActivity$onDestroy", th3);
        }
    }
}