导航菜单

页面标题

页面副标题

Kickcash v16.1 - g0.java 源代码

正在查看: Kickcash v16.1 应用的 g0.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.microsoft.clarity.jn;

import android.content.Context;
import android.net.Uri;
import com.microsoft.clarity.ClarityConfig;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.net.URL;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
import kotlin.text.MatchGroup;
import kotlin.text.MatchResult;
import kotlin.text.Regex;
import org.jetbrains.annotations.NotNull;

public final class g0 {

    @NotNull
    public final Context a;

    @NotNull
    public final ClarityConfig b;

    @NotNull
    public final Function2<String, byte[], Unit> c;

    @NotNull
    public final Regex d;

    @NotNull
    public final Regex e;

    @NotNull
    public final Regex f;

    @NotNull
    public final Regex g;

    @NotNull
    public final Regex h;

    @NotNull
    public final LinkedHashMap i;

    public static final class a {
        public final int a;
        public final int b;

        @NotNull
        public final String c;

        @NotNull
        public final String d;

        public a(@NotNull String str, int i, @NotNull String str2, int i2) {
            Intrinsics.checkNotNullParameter(str, "assetPath");
            Intrinsics.checkNotNullParameter(str2, "absoluteUrl");
            this.a = i;
            this.b = i2;
            this.c = str;
            this.d = str2;
        }

        @NotNull
        public final String a() {
            return this.d;
        }

        @NotNull
        public final String b() {
            return this.c;
        }

        public final int c() {
            return this.a;
        }

        public final int d() {
            return this.b;
        }
    }

    public static final class b {

        @NotNull
        public final c a;

        @NotNull
        public byte[] b;

        public b(@NotNull c cVar, @NotNull byte[] bArr) {
            Intrinsics.checkNotNullParameter(cVar, "metadata");
            Intrinsics.checkNotNullParameter(bArr, "content");
            this.a = cVar;
            this.b = bArr;
        }

        @NotNull
        public final byte[] a() {
            return this.b;
        }

        @NotNull
        public final c b() {
            return this.a;
        }
    }

    public static final class c {

        @NotNull
        public final String a;
        public final boolean b;

        @NotNull
        public String c;

        @NotNull
        public String d;
        public final Long e;

        @NotNull
        public List<String> f;

        public c(@NotNull String str, boolean z, @NotNull String str2, @NotNull String str3, @NotNull String str4, Long l, @NotNull List<String> list) {
            Intrinsics.checkNotNullParameter(str, "path");
            Intrinsics.checkNotNullParameter(str2, "hash");
            Intrinsics.checkNotNullParameter(str3, "pathWithHash");
            Intrinsics.checkNotNullParameter(str4, "absolutePathWithHash");
            Intrinsics.checkNotNullParameter(list, "dependencies");
            this.a = str;
            this.b = z;
            this.c = str3;
            this.d = str4;
            this.e = l;
            this.f = list;
        }

        @NotNull
        public final String a() {
            return this.d;
        }

        @NotNull
        public final List<String> b() {
            return this.f;
        }

        public final Long c() {
            return this.e;
        }

        @NotNull
        public final String d() {
            return this.a;
        }

        @NotNull
        public final String e() {
            return this.c;
        }

        public final boolean f() {
            return this.b;
        }
    }

    public g0(@NotNull Context context, @NotNull ClarityConfig clarityConfig, @NotNull Function2<? super String, ? super byte[], Unit> function2) {
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(clarityConfig, "config");
        Intrinsics.checkNotNullParameter(function2, "webAssetCallback");
        this.a = context;
        this.b = clarityConfig;
        this.c = function2;
        this.d = new Regex("\\[ClarityStyleContent]|\\[/ClarityStyleContent]|\\[ClarityLocalURL]|\\[/ClarityLocalURL]");
        this.e = new Regex("\\[ClarityLocalURL](.*?)\\[/ClarityLocalURL]");
        this.f = new Regex("\\[ClarityStyleContent](.*?)\\[/ClarityStyleContent]");
        this.g = new Regex("url\\((?:'|\\\\\"|\")?(.*?)(?:'|\\\\\"|\")?\\)");
        this.h = new Regex("@import\\s(?:'|\\\\\"|\")(.*?)(?:'|\\\\\"|\");");
        this.i = new LinkedHashMap();
    }

    public final com.microsoft.clarity.jn.g0.a a(java.lang.String r21, java.lang.String r22, boolean r23, int r24, int r25, int r26) {
        throw new UnsupportedOperationException("Method not decompiled: com.microsoft.clarity.jn.g0.a(java.lang.String, java.lang.String, boolean, int, int, int):com.microsoft.clarity.jn.g0$a");
    }

    public final b b(b bVar, boolean z, int i) {
        Base64.Encoder urlEncoder;
        String encodeToString;
        String str = new String(bVar.a(), com.microsoft.clarity.cs.a.b);
        ArrayList e = e(str, kotlin.text.d.L0(bVar.b().d(), '/', ""), z, 0, i);
        if (e.isEmpty()) {
            return bVar;
        }
        StringBuilder sb = new StringBuilder(str);
        if (e.size() > 1) {
            com.microsoft.clarity.hr.k.w(e, new h0());
        }
        Iterator it = e.iterator();
        while (it.hasNext()) {
            a aVar = (a) it.next();
            sb.replace(aVar.c(), aVar.d() + 1, aVar.a());
        }
        String sb2 = sb.toString();
        Intrinsics.checkNotNullExpressionValue(sb2, "newDataBuilder.toString()");
        byte[] bytes = sb2.getBytes(com.microsoft.clarity.cs.a.b);
        Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
        String d = bVar.b().d();
        Long c2 = bVar.b().c();
        boolean f = bVar.b().f();
        ArrayList arrayList = new ArrayList(com.microsoft.clarity.hr.k.t(e, 10));
        Iterator it2 = e.iterator();
        while (it2.hasNext()) {
            arrayList.add(((a) it2.next()).b());
        }
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            byte[] c3 = com.microsoft.clarity.rr.b.c(new DigestInputStream(byteArrayInputStream, messageDigest));
            urlEncoder = Base64.getUrlEncoder();
            encodeToString = urlEncoder.encodeToString(messageDigest.digest());
            Intrinsics.checkNotNullExpressionValue(encodeToString, "contentHash");
            String obj = kotlin.text.d.n0(d, com.microsoft.clarity.sn.f.b(d), encodeToString).toString();
            b bVar2 = new b(new c(d, f, encodeToString, obj, k(obj), c2, arrayList), c3);
            com.microsoft.clarity.rr.c.a(byteArrayInputStream, (Throwable) null);
            return bVar2;
        } finally {
        }
    }

    public final String c(String str, String str2, boolean z) {
        if (z) {
            return kotlin.text.d.O0(d(new URL(str2), false), new char[]{'/'});
        }
        String canonicalPath = com.microsoft.clarity.rr.h.n(new File(str), kotlin.text.d.O0(str2, new char[]{'/'})).getCanonicalPath();
        Intrinsics.checkNotNullExpressionValue(canonicalPath, "File(pageFolderPath)\n   …           .canonicalPath");
        String O0 = kotlin.text.d.O0(canonicalPath, new char[]{'/'});
        String str3 = this.b.isCordova$sdk_prodRelease() ? "www" : this.b.isIonic$sdk_prodRelease() ? "public" : null;
        if (str3 == null || kotlin.text.d.C(O0, str3, false, 2, (Object) null)) {
            return O0;
        }
        return str3 + '/' + O0;
    }

    public final String d(URL url, boolean z) {
        String str;
        String path = url.getPath();
        if (Intrinsics.c(url.getProtocol(), "file")) {
            Intrinsics.checkNotNullExpressionValue(path, "path");
            str = "/android_asset";
        } else {
            if (!Intrinsics.c(url.getHost(), "appassets.androidplatform.net")) {
                if (this.b.isIonic$sdk_prodRelease() && Intrinsics.c(url.getHost(), "localhost") && z) {
                    path = "/";
                }
                Intrinsics.checkNotNullExpressionValue(path, "path");
                return path;
            }
            Intrinsics.checkNotNullExpressionValue(path, "path");
            str = "assets";
        }
        path = kotlin.text.d.i0(path, str);
        Intrinsics.checkNotNullExpressionValue(path, "path");
        return path;
    }

    public final ArrayList e(String str, String str2, boolean z, int i, int i2) {
        Sequence<MatchResult> r = kotlin.sequences.c.r(Regex.d(this.g, str, 0, 2, (Object) null), Regex.d(this.h, str, 0, 2, (Object) null));
        ArrayList arrayList = new ArrayList();
        for (MatchResult matchResult : r) {
            String str3 = (String) matchResult.a().get(1);
            if (((kotlin.text.d.U(str3, "://", 0, false, 6, (Object) null) > 0 || kotlin.text.d.U(str3, "//", 0, false, 6, (Object) null) == 0 || kotlin.text.d.C(str3, "data:", false, 2, (Object) null)) ? false : true) || l(str3)) {
                String path = Uri.parse(str3).getPath();
                if (path != null) {
                    MatchGroup matchGroup = matchResult.b().get(1);
                    Intrinsics.e(matchGroup);
                    a a2 = a(path, str2, z, matchGroup.a().f() + i, (path.length() + r4) - 1, i2 + 1);
                    if (a2 != null) {
                        arrayList.add(a2);
                    }
                }
            }
        }
        return arrayList;
    }

    public final void f() {
        this.i.clear();
    }

    public final void g(@org.jetbrains.annotations.NotNull com.microsoft.clarity.models.ingest.WebViewMutationEvent r18) {
        throw new UnsupportedOperationException("Method not decompiled: com.microsoft.clarity.jn.g0.g(com.microsoft.clarity.models.ingest.WebViewMutationEvent):void");
    }

    public final boolean h(String str) {
        List<String> j;
        c cVar = (c) this.i.get(str);
        if (cVar == null || (j = cVar.b()) == null) {
            j = com.microsoft.clarity.hr.k.j();
        }
        for (String str2 : j) {
            if (j(str2) || h(str2)) {
                return true;
            }
        }
        return false;
    }

    public final boolean i(java.net.URL r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.microsoft.clarity.jn.g0.i(java.net.URL):boolean");
    }

    public final boolean j(String str) {
        Long c2;
        c cVar = (c) this.i.get(str);
        if (Intrinsics.c(cVar != null ? Boolean.valueOf(cVar.f()) : null, Boolean.TRUE)) {
            return false;
        }
        c cVar2 = (c) this.i.get(str);
        return new File(str).lastModified() > ((cVar2 == null || (c2 = cVar2.c()) == null) ? 0L : c2.longValue());
    }

    public final String k(String str) {
        String uri = Uri.parse("https://clarity.microsoft.com/").buildUpon().appendPath("app").appendPath("webasset").appendPath("v1").appendPath(this.b.getProjectId()).appendPath("*clarity-playback-token-placeholder*").appendPath("all").appendEncodedPath(str).build().toString();
        Intrinsics.checkNotNullExpressionValue(uri, "parse(BuildConfig.WEB_AS…)\n            .toString()");
        return uri;
    }

    public final boolean l(String str) {
        URL url;
        try {
            url = new URL(str);
        } catch (Exception unused) {
        }
        if (!Intrinsics.c(url.getProtocol(), "file") && !Intrinsics.c(url.getHost(), "appassets.androidplatform.net")) {
            if (this.b.isIonic$sdk_prodRelease() || this.b.isCordova$sdk_prodRelease()) {
                if (Intrinsics.c(url.getHost(), "localhost")) {
                }
            }
            return false;
        }
        return true;
    }
}