导航菜单

页面标题

页面副标题

Housing v14.7.8 - f.java 源代码

正在查看: Housing v14.7.8 应用的 f.java JAVA 源代码文件

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


package com.contentsquare.android.api;

import android.webkit.WebView;
import androidx.camera.camera2.internal.t2;
import com.cashfree.pg.core.api.ui.l;
import com.google.android.gms.common.internal.ImagesContract;
import f7.i6;
import f7.t5;
import java.util.LinkedHashMap;
import kotlin.Metadata;
import kotlin.collections.t0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.r;
import kotlinx.coroutines.k;
import kotlinx.coroutines.l0;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import zp.j0;
import zp.s;

@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0000\u0018\u0000 \u00122\u00020\u0001:\u0001\u0013B?\u0012\n\b\u0002\u0010\u0003\u001a\u0004\u0018\u00010\u0002\u0012\b\b\u0002\u0010\u0004\u001a\u00020\u0002\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0002\u0012\b\b\u0002\u0010\u0007\u001a\u00020\u0006\u0012\n\b\u0002\u0010\t\u001a\u0004\u0018\u00010\b¢\u0006\u0004\b\n\u0010\u000bR\u0016\u0010\u0003\u001a\u0004\u0018\u00010\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0003\u0010\fR\u0014\u0010\u0004\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0004\u0010\fR\u0016\u0010\u0005\u001a\u0004\u0018\u00010\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0005\u0010\fR\u0014\u0010\u0007\u001a\u00020\u00068\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0007\u0010\rR\u0016\u0010\t\u001a\u0004\u0018\u00010\b8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\t\u0010\u000eR\u0014\u0010\u0010\u001a\u00020\u000f8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0010\u0010\u0011¨\u0006\u0014"}, d2 = {"Lcom/contentsquare/android/api/f;", "", "", "tagId", "packageName", "userId", "Lf7/i6;", "tagDownloader", "Lcom/contentsquare/android/core/system/d;", "deviceInfo", "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lf7/i6;Lcom/contentsquare/android/core/system/d;)V", "Ljava/lang/String;", "Lf7/i6;", "Lcom/contentsquare/android/core/system/d;", "Lcom/contentsquare/android/core/features/logging/d;", "logger", "Lcom/contentsquare/android/core/features/logging/d;", "Companion", "a", "library_release"}, k = 1, mv = {1, 8, 0})
public final class f {

    @NotNull
    public static final Companion INSTANCE = new Companion(null);

    @Nullable
    private final com.contentsquare.android.core.system.d deviceInfo;

    @NotNull
    private final com.contentsquare.android.core.features.logging.d logger;

    @NotNull
    private final String packageName;

    @NotNull
    private final i6 tagDownloader;

    @Nullable
    private final String tagId;

    @Nullable
    private final String userId;

    @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lcom/contentsquare/android/api/f$a;", "", "library_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    public f() {
        this(null, null, null, null, null, 31, null);
    }

    public final void a(WebView webView, String str) {
        r.k(str, "tagData");
        this.logger.k("Injecting local tag into the WebView");
        e(true);
        if (webView != null) {
            webView.evaluateJavascript("window.CS_isWebView = true;", new l(2));
        }
        if (webView != null) {
            webView.evaluateJavascript(t2.p("\n            if (!Array.from(document.getElementsByTagName(\"script\")).some(script => {\n            const src = script.src;\n            return src && src.includes(\"contentsquare.net\") && /t.*\\\\.contentsquare\\\\.net/.test(src);\n        })) {\n            window._uxa = window._uxa || [];           \n            window._uxa.push(['setOption', 'isWebView', true]);\n            ", str, "\n        }"), new l(2));
        }
    }

    public final void b(WebView webView, String str) {
        r.k(str, "tagId");
        this.logger.k("Injecting tag into the WebView");
        e(false);
        if (webView != null) {
            webView.evaluateJavascript("window.CS_isWebView = true;", new l(2));
        }
        if (webView != null) {
            webView.evaluateJavascript(t2.p("(function () {\n    window._uxa = window._uxa || [];\n    window._uxa.push(['setOption', 'isWebView', true]);\n\n    var newScriptSrc = \"https://t.contentsquare.net/uxa/", str, ".js\";\n    // match any subdomain of contentsquare.net in the old script's src\n    var oldScriptRegex = /https?:\\/\\/.*\\.contentsquare\\.net\\/wvt\\/web-view\\.js/;\n\n    var scripts = document.getElementsByTagName(\"script\");\n\n    // Remove old script if it matches the regex\n    for (var i = 0; i < scripts.length; i++) {\n        if (oldScriptRegex.test(scripts[i].src)) {\n            scripts[i].parentNode.removeChild(scripts[i]);\n            break; // Assuming there's only one instance of the old script\n        }\n    }\n\n    // Check if new script already exists\n    var scriptExists = Array.from(scripts).some(script => script.src === newScriptSrc);\n\n    // Inject new script if it doesn't exist\n    if (!scriptExists) {\n        var mt = document.createElement(\"script\");\n        mt.type = \"text/javascript\";\n        mt.async = true;\n        mt.src = newScriptSrc;\n        document.getElementsByTagName(\"head\")[0].appendChild(mt);\n    }\n})();"), new l(2));
        }
    }

    public final void c(WebView webView) {
        String str = this.tagId;
        j0 j0Var = null;
        if (str != null) {
            if (str.length() <= 0 || str.equals("null")) {
                d();
            } else {
                h hVar = new h(this, webView, str);
                i iVar = new i(this, webView);
                i6 i6Var = this.tagDownloader;
                String str2 = this.packageName;
                String str3 = this.userId;
                g gVar = new g(this);
                i6Var.getClass();
                r.k(str2, "packageName");
                k.c(i6Var.d, (kotlin.coroutines.f) null, (l0) null, new t5(i6Var, str, str3, str2, gVar, iVar, hVar, null), 3);
            }
            j0Var = j0.INSTANCE;
        }
        if (j0Var == null) {
            d();
        }
    }

    public final void d() {
        com.contentsquare.android.core.system.c b;
        this.logger.k("Tracking tag is null or not available!");
        LinkedHashMap l = t0.l(new s[]{new s("tagAvailable", String.valueOf(this.tagId != null))});
        com.contentsquare.android.core.system.d dVar = this.deviceInfo;
        l.put("connectionType", String.valueOf((dVar == null || (b = dVar.b()) == null) ? -1 : b.getValue()));
        z6.a.INSTANCE.getClass();
        z6.a.c(l, "tag_injection");
    }

    public final void e(boolean z) {
        com.contentsquare.android.core.system.c b;
        LinkedHashMap l = t0.l(new s[]{new s("injectionType", z ? ImagesContract.LOCAL : "remote")});
        com.contentsquare.android.core.system.d dVar = this.deviceInfo;
        l.put("connectionType", String.valueOf((dVar == null || (b = dVar.b()) == null) ? -1 : b.getValue()));
        z6.a.INSTANCE.getClass();
        z6.a.c(l, "tag_injection");
    }

    public f(@Nullable String str, @NotNull String str2, @Nullable String str3, @NotNull i6 i6Var, @Nullable com.contentsquare.android.core.system.d dVar) {
        r.k(str2, "packageName");
        r.k(i6Var, "tagDownloader");
        this.tagId = str;
        this.packageName = str2;
        this.userId = str3;
        this.tagDownloader = i6Var;
        this.deviceInfo = dVar;
        this.logger = new com.contentsquare.android.core.features.logging.d("CsWebViewTagInjector");
    }

    public f(java.lang.String r2, java.lang.String r3, java.lang.String r4, f7.i6 r5, com.contentsquare.android.core.system.d r6, int r7, kotlin.jvm.internal.DefaultConstructorMarker r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.contentsquare.android.api.f.<init>(java.lang.String, java.lang.String, java.lang.String, f7.i6, com.contentsquare.android.core.system.d, int, kotlin.jvm.internal.DefaultConstructorMarker):void");
    }
}