APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Pahlavanan cartoon
版本号:40711.0.0
包名称:ir.darchinstudio.pahlavanan

MD5 校验值:63e534d8efee12c91b8e626b68b614ab

反编译源代码说明

a.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package ir.tapsell.sdk.bannerads;

import android.content.Context;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.os.Build;
import android.os.Message;
import android.webkit.ClientCertRequest;
import android.webkit.ConsoleMessage;
import android.webkit.HttpAuthHandler;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import ir.tapsell.sdk.f.d;
import ir.tapsell.sdk.models.SdkPlatformEnum;
import ir.tapsell.sdk.models.requestModels.RequestBannerAdSuggestionJsonParams;
import ir.tapsell.sdk.models.sdkErrorLogModels.SdkErrorTypeEnum;
import ir.tapsell.sdk.utils.GsonHelper;
import java.util.HashMap;
import java.util.Map;

class a {

    static class C0054a extends WebChromeClient {
        final Context a;

        C0054a(Context context) {
            this.a = context;
        }

        @Override
        public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
            if (consoleMessage.messageLevel().equals(ConsoleMessage.MessageLevel.ERROR)) {
                ir.tapsell.sdk.h.e.b.a(this.a, consoleMessage.message(), SdkErrorTypeEnum.TAPSELL_STANDARD);
            }
            return super.onConsoleMessage(consoleMessage);
        }

        @Override
        public boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
            return super.onJsAlert(webView, str, str2, jsResult);
        }

        @Override
        public boolean onJsBeforeUnload(WebView webView, String str, String str2, JsResult jsResult) {
            return super.onJsBeforeUnload(webView, str, str2, jsResult);
        }

        @Override
        public boolean onJsConfirm(WebView webView, String str, String str2, JsResult jsResult) {
            return super.onJsConfirm(webView, str, str2, jsResult);
        }

        @Override
        public boolean onJsPrompt(WebView webView, String str, String str2, String str3, JsPromptResult jsPromptResult) {
            return super.onJsPrompt(webView, str, str2, str3, jsPromptResult);
        }

        @Override
        public boolean onJsTimeout() {
            ir.tapsell.sdk.h.e.b.a(this.a, "Error js timeout", SdkErrorTypeEnum.TAPSELL_STANDARD);
            return super.onJsTimeout();
        }
    }

    static class b extends WebViewClient {
        final Context a;
        final TapsellBannerWebView b;
        final String c;
        final String d;

        b(Context context, TapsellBannerWebView tapsellBannerWebView, String str, String str2) {
            this.a = context;
            this.b = tapsellBannerWebView;
            this.c = str;
            this.d = str2;
        }

        @Override
        public void onFormResubmission(WebView webView, Message message, Message message2) {
            super.onFormResubmission(webView, message, message2);
        }

        @Override
        public void onLoadResource(WebView webView, String str) {
            super.onLoadResource(webView, str);
        }

        @Override
        public void onPageCommitVisible(WebView webView, String str) {
            super.onPageCommitVisible(webView, str);
        }

        @Override
        public void onPageFinished(WebView webView, String str) {
            if ("https://play.tapsell.ir/standard-banner/index.html?os=android".equalsIgnoreCase(str)) {
                this.b.evaluateJavascript("initialize(" + this.c + ",'" + this.d + "');", null);
            }
            super.onPageFinished(webView, str);
        }

        @Override
        public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
            super.onPageStarted(webView, str, bitmap);
        }

        @Override
        public void onReceivedClientCertRequest(WebView webView, ClientCertRequest clientCertRequest) {
            super.onReceivedClientCertRequest(webView, clientCertRequest);
        }

        @Override
        public void onReceivedError(WebView webView, int i, String str, String str2) {
            super.onReceivedError(webView, i, str, str2);
            if ("https://play.tapsell.ir/standard-banner/index.html?os=android".equalsIgnoreCase(str2)) {
                ir.tapsell.sdk.h.e.b.a(this.a, "ReceivedError: , errorCode: " + i + ", description: " + str + ", failingUrl: " + str2, SdkErrorTypeEnum.TAPSELL_STANDARD);
                this.b.onError(str);
            }
        }

        @Override
        public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
            TapsellBannerWebView tapsellBannerWebView;
            String obj;
            CharSequence description;
            CharSequence description2;
            super.onReceivedError(webView, webResourceRequest, webResourceError);
            if (Build.VERSION.SDK_INT >= 23) {
                if (!"https://play.tapsell.ir/standard-banner/index.html?os=android".equalsIgnoreCase(webResourceRequest.getUrl().toString())) {
                    return;
                }
                Context context = this.a;
                StringBuilder sb = new StringBuilder("Error ReceivedError: url:");
                sb.append(webResourceRequest.getUrl().toString());
                sb.append(", error: ");
                description = webResourceError.getDescription();
                sb.append((Object) description);
                ir.tapsell.sdk.h.e.b.a(context, sb.toString(), SdkErrorTypeEnum.TAPSELL_STANDARD);
                tapsellBannerWebView = this.b;
                description2 = webResourceError.getDescription();
                obj = description2.toString();
            } else {
                if (!"https://play.tapsell.ir/standard-banner/index.html?os=android".equalsIgnoreCase(webResourceRequest.getUrl().toString())) {
                    return;
                }
                ir.tapsell.sdk.h.e.b.a(this.a, "Error ReceivedError: url:" + webResourceRequest.getUrl().toString() + ", error: " + webResourceError.toString(), SdkErrorTypeEnum.TAPSELL_STANDARD);
                tapsellBannerWebView = this.b;
                obj = webResourceError.toString();
            }
            tapsellBannerWebView.onError(obj);
        }

        @Override
        public void onReceivedHttpAuthRequest(WebView webView, HttpAuthHandler httpAuthHandler, String str, String str2) {
            super.onReceivedHttpAuthRequest(webView, httpAuthHandler, str, str2);
        }

        @Override
        public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
            super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
            if ("https://play.tapsell.ir/standard-banner/index.html?os=android".equalsIgnoreCase(webResourceRequest.getUrl().toString())) {
                ir.tapsell.sdk.h.e.b.a(this.a, "Error ReceivedHttpError: url:" + webResourceRequest.getUrl().toString() + ", error: " + webResourceResponse.getReasonPhrase(), SdkErrorTypeEnum.TAPSELL_STANDARD);
                this.b.onError(webResourceResponse.getReasonPhrase());
            }
        }

        @Override
        public void onReceivedLoginRequest(WebView webView, String str, String str2, String str3) {
            super.onReceivedLoginRequest(webView, str, str2, str3);
        }

        @Override
        public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
            super.onReceivedSslError(webView, sslErrorHandler, sslError);
            if ("https://play.tapsell.ir/standard-banner/index.html?os=android".equalsIgnoreCase(webView.getUrl())) {
                ir.tapsell.sdk.h.e.b.a(this.a, "Error ReceivedSSLError: , error: " + sslError.toString(), SdkErrorTypeEnum.TAPSELL_STANDARD);
                this.b.onError("SSL Error");
            }
        }

        @Override
        public void onTooManyRedirects(WebView webView, Message message, Message message2) {
            super.onTooManyRedirects(webView, message, message2);
        }

        @Override
        public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
            return null;
        }

        @Override
        public WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
            return null;
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            return false;
        }
    }

    public static void a(Context context, TapsellBannerWebView tapsellBannerWebView, String str, int i, SdkPlatformEnum sdkPlatformEnum, HashMap<String, String> hashMap) {
        Map<String, String> c = d.c();
        c.put("sdk-platform", sdkPlatformEnum.name());
        String json = GsonHelper.getCustomGson().toJson(c);
        RequestBannerAdSuggestionJsonParams requestBannerAdSuggestionJsonParams = new RequestBannerAdSuggestionJsonParams(str, i);
        requestBannerAdSuggestionJsonParams.setUserExtraInfo(ir.tapsell.sdk.f.b.t().F());
        requestBannerAdSuggestionJsonParams.setExtraParams(hashMap);
        ir.tapsell.sdk.g.b.b(true, "bannerUrl: https://play.tapsell.ir/standard-banner/index.html?os=android");
        ir.tapsell.sdk.g.b.b(true, "headers: " + json);
        String json2 = GsonHelper.getCustomGson().toJson(requestBannerAdSuggestionJsonParams);
        ir.tapsell.sdk.g.b.b(true, "body: " + json2);
        tapsellBannerWebView.loadUrl("https://play.tapsell.ir/standard-banner/index.html?os=android");
        tapsellBannerWebView.getSettings().setJavaScriptEnabled(true);
        tapsellBannerWebView.addJavascriptInterface(new TapsellBannerViewInterface(context, tapsellBannerWebView), "JSInterface");
        tapsellBannerWebView.setWebChromeClient(new C0054a(context));
        tapsellBannerWebView.setWebViewClient(new b(context, tapsellBannerWebView, json, json2));
        tapsellBannerWebView.clearCache(true);
        tapsellBannerWebView.getSettings().setMixedContentMode(0);
    }
}