Proxy Master v3.4.9版本的 MD5 值为:14d0aa2468d13530c8f6e96bcc114bf5

以下内容为反编译后的 q5.java 源代码,内容仅作参考


package com.my.target;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.graphics.Rect;
import android.net.Uri;
import android.text.TextUtils;
import android.webkit.ConsoleMessage;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.google.android.exoplayer2.text.ttml.TtmlNode;
import com.google.android.gms.common.internal.ImagesContract;
import com.my.target.v5;
import com.my.tracker.ads.AdFormat;
import io.appmetrica.analytics.coreutils.internal.StringUtils;
import java.net.URI;
import java.util.ArrayList;
import org.json.JSONObject;
public class q5 {
    public final String f10242a;
    public final WebViewClient f10243b = new b();
    public a f10244c;
    public v5 f10245d;
    public boolean f10246e;
    public boolean f10247f;

    public interface a {
        void a(Uri uri);

        void a(q5 q5Var, WebView webView);

        void a(boolean z6);

        boolean a(float f10, float f11);

        boolean a(int i10, int i11, int i12, int i13, boolean z6, int i14);

        boolean a(ConsoleMessage consoleMessage, q5 q5Var);

        boolean a(String str);

        boolean a(String str, JsResult jsResult);

        boolean a(boolean z6, s5 s5Var);

        void b();

        boolean b(Uri uri);

        void c();

        void d();

        boolean e();
    }

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

        @Override
        public void onPageFinished(WebView webView, String str) {
            q5.this.b();
        }

        @Override
        public void onReceivedError(WebView webView, int i10, String str, String str2) {
            ba.a("MraidBridge: Error - " + str);
            super.onReceivedError(webView, i10, str, str2);
        }

        @Override
        @TargetApi(24)
        public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
            q5.this.a(webResourceRequest.getUrl());
            return true;
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            q5.this.a(Uri.parse(str));
            return true;
        }
    }

    @SuppressLint({"RtlHardcoded"})
    public static class c {
        public static int a(String str) {
            char c10;
            if (str == null) {
                return 53;
            }
            switch (str.hashCode()) {
                case -1364013995:
                    if (str.equals(TtmlNode.CENTER)) {
                        c10 = 1;
                        break;
                    }
                    c10 = 65535;
                    break;
                case -1314880604:
                    if (str.equals("top-right")) {
                        c10 = 6;
                        break;
                    }
                    c10 = 65535;
                    break;
                case -1012429441:
                    if (str.equals("top-left")) {
                        c10 = 0;
                        break;
                    }
                    c10 = 65535;
                    break;
                case -655373719:
                    if (str.equals("bottom-left")) {
                        c10 = 2;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1163912186:
                    if (str.equals("bottom-right")) {
                        c10 = 3;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1288627767:
                    if (str.equals("bottom-center")) {
                        c10 = 5;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1755462605:
                    if (str.equals("top-center")) {
                        c10 = 4;
                        break;
                    }
                    c10 = 65535;
                    break;
                default:
                    c10 = 65535;
                    break;
            }
            if (c10 != 0) {
                if (c10 != 1) {
                    if (c10 != 2) {
                        if (c10 != 3) {
                            if (c10 != 4) {
                                return c10 != 5 ? 53 : 81;
                            }
                            return 49;
                        }
                        return 85;
                    }
                    return 83;
                }
                return 17;
            }
            return 51;
        }
    }

    public class d extends WebChromeClient {
        public d() {
        }

        @Override
        public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
            String message = consoleMessage.message();
            int lineNumber = consoleMessage.lineNumber();
            ba.a("MraidBridge: JS console message - " + message + " - at line " + lineNumber);
            q5 q5Var = q5.this;
            a aVar = q5Var.f10244c;
            return aVar != null ? aVar.a(consoleMessage, q5Var) : super.onConsoleMessage(consoleMessage);
        }

        @Override
        public boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
            a aVar = q5.this.f10244c;
            return aVar != null ? aVar.a(str2, jsResult) : super.onJsAlert(webView, str, str2, jsResult);
        }
    }

    public class e implements v5.a {
        public e() {
        }

        @Override
        public void a(boolean z6) {
            a aVar = q5.this.f10244c;
            if (aVar != null) {
                aVar.a(z6);
            }
        }

        @Override
        public void b() {
            a aVar = q5.this.f10244c;
            if (aVar != null) {
                aVar.b();
            }
        }
    }

    public q5(String str) {
        this.f10242a = str;
    }

    public static q5 b(String str) {
        return new q5(str);
    }

    public final String a(Rect rect) {
        return rect.left + StringUtils.COMMA + rect.top + StringUtils.COMMA + rect.width() + StringUtils.COMMA + rect.height();
    }

    public void a() {
        this.f10245d = null;
    }

    public void a(Uri uri) {
        a aVar;
        JSONObject jSONObject;
        String scheme = uri.getScheme();
        String host = uri.getHost();
        if ("mytarget".equals(scheme)) {
            if ("onloadmraidjs".equals(host)) {
                ba.a("MraidBridge: JS call onLoad");
            }
            ba.a("MraidBridge: Got mytarget scheme - " + uri);
        } else if (!"mraid".equals(scheme)) {
            try {
                new URI(uri.toString());
                v5 v5Var = this.f10245d;
                if (v5Var == null || !v5Var.g() || (aVar = this.f10244c) == null) {
                    return;
                }
                aVar.a(uri);
            } catch (Throwable unused) {
                ba.a("MraidBridge: Invalid MRAID URL - " + uri);
                a("", "Mraid command sent an invalid URL");
            }
        } else {
            if (host.contains(StringUtils.COMMA)) {
                host = host.substring(0, host.indexOf(StringUtils.COMMA)).trim();
            }
            ba.a("MraidBridge: Got mraid command - " + uri);
            String uri2 = uri.toString();
            r5 r5Var = new r5(host, this.f10242a);
            c(r5Var.toString());
            int indexOf = uri2.indexOf("{");
            int lastIndexOf = uri2.lastIndexOf("}") + 1;
            if (indexOf >= 0 && lastIndexOf > 0 && indexOf < lastIndexOf) {
                try {
                    if (lastIndexOf <= uri2.length()) {
                        jSONObject = new JSONObject(uri2.substring(indexOf, lastIndexOf));
                        a(r5Var, jSONObject);
                    }
                } catch (Throwable th) {
                    a(r5Var.toString(), th.getMessage());
                    return;
                }
            }
            jSONObject = null;
            a(r5Var, jSONObject);
        }
    }

    public void a(a aVar) {
        this.f10244c = aVar;
    }

    public void a(u5 u5Var) {
        a("mraidbridge.setScreenSize(" + b(u5Var.d()) + ");window.mraidbridge.setMaxSize(" + b(u5Var.c()) + ");window.mraidbridge.setCurrentPosition(" + a(u5Var.a()) + ");window.mraidbridge.setDefaultPosition(" + a(u5Var.b()) + ")");
        StringBuilder sb2 = new StringBuilder("mraidbridge.fireSizeChangeEvent(");
        sb2.append(b(u5Var.a()));
        sb2.append(")");
        a(sb2.toString());
    }

    @SuppressLint({"SetJavaScriptEnabled"})
    public void a(v5 v5Var) {
        this.f10245d = v5Var;
        WebSettings settings = v5Var.getSettings();
        if (settings != null) {
            settings.setJavaScriptEnabled(true);
            if (AdFormat.INTERSTITIAL.equals(this.f10242a)) {
                settings.setMediaPlaybackRequiresUserGesture(false);
            }
        }
        this.f10245d.setScrollContainer(false);
        this.f10245d.setVerticalScrollBarEnabled(false);
        this.f10245d.setHorizontalScrollBarEnabled(false);
        this.f10245d.setWebViewClient(this.f10243b);
        this.f10245d.setWebChromeClient(new d());
        this.f10245d.setVisibilityChangedListener(new e());
    }

    public final void a(String str) {
        if (this.f10245d == null) {
            ba.a("MraidBridge: Attempted to inject Javascript into MRAID WebView while was not attached - \n\t" + str);
            return;
        }
        String o10 = android.support.v4.media.c.o("javascript:window.", str, ";");
        ba.a("MraidBridge: Injecting Javascript into MRAID WebView " + hashCode() + " - " + o10);
        this.f10245d.a(o10);
    }

    public void a(String str, String str2) {
        a("mraidbridge.fireErrorEvent(" + JSONObject.quote(str2) + ", " + JSONObject.quote(str) + ")");
    }

    public void a(ArrayList<String> arrayList) {
        a("mraidbridge.setSupports(" + TextUtils.join(StringUtils.COMMA, arrayList) + ")");
    }

    public void a(boolean z6) {
        if (z6 != this.f10247f) {
            a("mraidbridge.setIsViewable(" + z6 + ")");
        }
        this.f10247f = z6;
    }

    public boolean a(r5 r5Var, JSONObject jSONObject) {
        v5 v5Var;
        String r5Var2 = r5Var.toString();
        if (r5Var.f10287a && (v5Var = this.f10245d) != null && !v5Var.g()) {
            a(r5Var2, "Cannot execute this command unless the user clicks");
            return false;
        } else if (this.f10244c == null) {
            a(r5Var2, "Invalid state to execute this command");
            return false;
        } else if (this.f10245d == null) {
            a(r5Var2, "The current WebView is being destroyed");
            return false;
        } else {
            r5Var2.getClass();
            char c10 = 65535;
            switch (r5Var2.hashCode()) {
                case -1910759310:
                    if (r5Var2.equals("vpaidInit")) {
                        c10 = 0;
                        break;
                    }
                    break;
                case -1886160473:
                    if (r5Var2.equals("playVideo")) {
                        c10 = 1;
                        break;
                    }
                    break;
                case -1289167206:
                    if (r5Var2.equals("expand")) {
                        c10 = 2;
                        break;
                    }
                    break;
                case -934437708:
                    if (r5Var2.equals("resize")) {
                        c10 = 3;
                        break;
                    }
                    break;
                case -733616544:
                    if (r5Var2.equals("createCalendarEvent")) {
                        c10 = 4;
                        break;
                    }
                    break;
                case 0:
                    if (r5Var2.equals("")) {
                        c10 = 5;
                        break;
                    }
                    break;
                case 3417674:
                    if (r5Var2.equals(TtmlNode.TEXT_EMPHASIS_MARK_OPEN)) {
                        c10 = 6;
                        break;
                    }
                    break;
                case 94756344:
                    if (r5Var2.equals("close")) {
                        c10 = 7;
                        break;
                    }
                    break;
                case 133423073:
                    if (r5Var2.equals("setOrientationProperties")) {
                        c10 = '\b';
                        break;
                    }
                    break;
                case 459238621:
                    if (r5Var2.equals("storePicture")) {
                        c10 = '\t';
                        break;
                    }
                    break;
                case 624734601:
                    if (r5Var2.equals("setResizeProperties")) {
                        c10 = '\n';
                        break;
                    }
                    break;
                case 892543864:
                    if (r5Var2.equals("vpaidEvent")) {
                        c10 = 11;
                        break;
                    }
                    break;
                case 1797992422:
                    if (r5Var2.equals("playheadEvent")) {
                        c10 = '\f';
                        break;
                    }
                    break;
            }
            switch (c10) {
                case 0:
                    this.f10244c.d();
                    break;
                case 1:
                    ba.a("MraidBridge: playVideo is currently unsupported");
                    return false;
                case 2:
                    return this.f10244c.b(jSONObject != null ? Uri.parse(jSONObject.getString(ImagesContract.URL)) : null);
                case 3:
                    return this.f10244c.e();
                case 4:
                    ba.a("MraidBridge: createCalendarEvent is currently unsupported");
                    return false;
                case 5:
                    a(r5Var2, "Unspecified MRAID Javascript command");
                    return false;
                case 6:
                    if (jSONObject != null) {
                        this.f10244c.a(Uri.parse(jSONObject.getString(ImagesContract.URL)));
                        break;
                    } else {
                        a(r5Var2, "open params cannot be null");
                        return false;
                    }
                case 7:
                    this.f10244c.c();
                    break;
                case '\b':
                    if (jSONObject == null) {
                        a(r5Var2, "setOrientationProperties params cannot be null");
                        return false;
                    }
                    boolean z6 = jSONObject.getBoolean("allowOrientationChange");
                    String string = jSONObject.getString("forceOrientation");
                    s5 a8 = s5.a(string);
                    if (a8 == null) {
                        a(r5Var2, "wrong orientation " + string);
                        return false;
                    }
                    return this.f10244c.a(z6, a8);
                case '\t':
                    ba.a("MraidBridge: storePicture is currently unsupported");
                    return false;
                case '\n':
                    if (jSONObject == null) {
                        a(r5Var2, "setResizeProperties params cannot be null");
                        return false;
                    }
                    return this.f10244c.a(jSONObject.getInt("width"), jSONObject.getInt("height"), jSONObject.getInt("offsetX"), jSONObject.getInt("offsetY"), jSONObject.optBoolean("allowOffscreen", false), c.a(jSONObject.optString("customClosePosition")));
                case 11:
                    if (jSONObject == null) {
                        a(r5Var2, "vpaidEvent params cannot be null");
                        return false;
                    }
                    return this.f10244c.a(jSONObject.getString("event"));
                case '\f':
                    if (jSONObject == null) {
                        a(r5Var2, "playheadEvent params cannot be null");
                        return false;
                    }
                    return this.f10244c.a((float) jSONObject.getDouble("remain"), (float) jSONObject.getDouble("duration"));
            }
            return true;
        }
    }

    public final String b(Rect rect) {
        return rect.width() + StringUtils.COMMA + rect.height();
    }

    public final void b() {
        if (this.f10246e) {
            return;
        }
        this.f10246e = true;
        a aVar = this.f10244c;
        if (aVar != null) {
            aVar.a(this, this.f10245d.getWebView());
        }
    }

    public final void c(String str) {
        a("mraidbridge.nativeComplete(" + JSONObject.quote(str) + ")");
    }

    public boolean c() {
        v5 v5Var = this.f10245d;
        return v5Var != null && v5Var.h();
    }

    public void d() {
        a("mraidbridge.fireReadyEvent()");
    }

    public void d(String str) {
        a("mraidbridge.setPlacementType(" + JSONObject.quote(str) + ")");
    }

    public void e(String str) {
        a("mraidbridge.setState(" + JSONObject.quote(str) + ")");
    }

    public void f(String str) {
        v5 v5Var = this.f10245d;
        if (v5Var == null) {
            ba.a("MraidBridge: MRAID bridge called setContentHtml before WebView was attached");
            return;
        }
        this.f10246e = false;
        v5Var.a("https://ad.mail.ru/", str, "text/html", "UTF-8", null);
    }
}