正在查看: Kickcash v16.1 应用的 e.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Kickcash v16.1 应用的 e.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.microsoft.clarity.qn;
import android.content.Context;
import android.net.Uri;
import android.os.Trace;
import com.microsoft.clarity.gr.q;
import com.microsoft.clarity.hr.b0;
import com.microsoft.clarity.hr.k;
import com.microsoft.clarity.jn.a0;
import com.microsoft.clarity.models.AssetType;
import com.microsoft.clarity.models.SessionMetadata;
import com.microsoft.clarity.models.ingest.AssetCheck;
import com.microsoft.clarity.models.ingest.AssetMetadata;
import com.microsoft.clarity.models.ingest.CollectRequest;
import com.microsoft.clarity.models.ingest.Envelope;
import com.microsoft.clarity.models.ingest.IngestConfigs;
import com.microsoft.clarity.models.ingest.SerializedSessionPayload;
import com.microsoft.clarity.sn.j;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import kotlin.Pair;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONObject;
public final class e implements a {
@NotNull
public final Context a;
@NotNull
public final com.microsoft.clarity.rn.b b;
@NotNull
public final a0 c;
@NotNull
public final com.microsoft.clarity.jn.b d;
public e(@NotNull Context context, @NotNull com.microsoft.clarity.rn.b bVar, @NotNull a0 a0Var, @NotNull com.microsoft.clarity.jn.b bVar2) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(bVar, "faultyCollectRequestsStore");
Intrinsics.checkNotNullParameter(a0Var, "telemetryTracker");
Intrinsics.checkNotNullParameter(bVar2, "networkUsageTracker");
this.a = context;
this.b = bVar;
this.c = a0Var;
this.d = bVar2;
}
@Override
public final boolean a(@NotNull String str, @NotNull String str2, @NotNull String str3, @NotNull byte[] bArr) {
Intrinsics.checkNotNullParameter(str, "ingestUrl");
Intrinsics.checkNotNullParameter(str2, "projectId");
Intrinsics.checkNotNullParameter("all", "version");
Intrinsics.checkNotNullParameter(str3, "path");
Intrinsics.checkNotNullParameter(bArr, "asset");
String uri = Uri.parse(str).buildUpon().appendPath(str2).appendPath("upload-web-asset").appendPath("all").build().toString();
Intrinsics.checkNotNullExpressionValue(uri, "parse(ingestUrl)\n …)\n .toString()");
HttpURLConnection c = com.microsoft.clarity.sn.g.c(uri, "POST", b0.k(new Pair[]{q.a("Content-Type", "application/octet-stream"), q.a("Content-Path", str3)}));
try {
com.microsoft.clarity.sn.g.f(c, bArr);
c.connect();
boolean g = com.microsoft.clarity.sn.g.g(c);
if (g) {
double length = bArr.length;
try {
Trace.setCounter("Clarity_UploadWebAssetBytes", (long) length);
this.c.n("Clarity_UploadWebAssetBytes", length);
} catch (Exception unused) {
}
this.d.b(bArr.length);
}
return g;
} finally {
c.disconnect();
}
}
@Override
public final boolean b(@NotNull SessionMetadata sessionMetadata, @NotNull String str, @NotNull byte[] bArr, @NotNull AssetMetadata assetMetadata) {
Intrinsics.checkNotNullParameter(sessionMetadata, "sessionMetadata");
Intrinsics.checkNotNullParameter(str, "hash");
Intrinsics.checkNotNullParameter(bArr, "asset");
Intrinsics.checkNotNullParameter(assetMetadata, "assetMetadata");
Uri.Builder appendPath = Uri.parse(sessionMetadata.getIngestUrl()).buildUpon().appendPath(sessionMetadata.getProjectId()).appendPath("upload-asset").appendPath(str).appendPath(String.valueOf(assetMetadata.getAssetType().ordinal()));
if (assetMetadata.getAssetType() == AssetType.Image) {
appendPath.appendQueryParameter("width", String.valueOf(assetMetadata.getWidth())).appendQueryParameter("height", String.valueOf(assetMetadata.getHeight()));
}
String uri = appendPath.build().toString();
Intrinsics.checkNotNullExpressionValue(uri, "uri\n .build()\n .toString()");
HttpURLConnection c = com.microsoft.clarity.sn.g.c(uri, "POST", b0.k(new Pair[]{q.a("Content-Type", "application/octet-stream"), q.a("Content-Hash", str)}));
try {
com.microsoft.clarity.sn.g.f(c, bArr);
c.connect();
boolean g = com.microsoft.clarity.sn.g.g(c);
if (g) {
double length = bArr.length;
try {
Trace.setCounter("Clarity_UploadAssetBytes", (long) length);
this.c.n("Clarity_UploadAssetBytes", length);
} catch (Exception unused) {
}
this.d.b(bArr.length);
}
return g;
} finally {
c.disconnect();
}
}
@Override
public final boolean c(@NotNull SerializedSessionPayload serializedSessionPayload, @NotNull SessionMetadata sessionMetadata) {
Intrinsics.checkNotNullParameter(serializedSessionPayload, "serializedSessionPayload");
Intrinsics.checkNotNullParameter(sessionMetadata, "sessionMetadata");
String uri = Uri.parse(sessionMetadata.getIngestUrl()).buildUpon().appendPath("collect").build().toString();
Intrinsics.checkNotNullExpressionValue(uri, "parse(ingestUrl)\n …)\n .toString()");
Map l = b0.l(new Pair[]{q.a("Content-Type", "application/json")});
l.put("Accept", "application/x-clarity-gzip");
l.put("Accept-Encoding", "gzip, deflate, br");
String packageName = this.a.getPackageName();
Intrinsics.checkNotNullExpressionValue(packageName, "context.packageName");
l.put("ApplicationPackage", packageName);
HttpURLConnection c = com.microsoft.clarity.sn.g.c(uri, "POST", l);
try {
String serialize = new CollectRequest(new Envelope(sessionMetadata, serializedSessionPayload.getPageNum(), serializedSessionPayload.getSequence(), serializedSessionPayload.getStart(), serializedSessionPayload.getDuration()), serializedSessionPayload.getEvents(), serializedSessionPayload.getFrames()).serialize();
byte[] b = com.microsoft.clarity.sn.b.b(serialize);
com.microsoft.clarity.sn.g.f(c, b);
c.connect();
boolean g = com.microsoft.clarity.sn.g.g(c);
if (g) {
double length = b.length;
try {
Trace.setCounter("Clarity_UploadSessionSegmentBytes", (long) length);
this.c.n("Clarity_UploadSessionSegmentBytes", length);
} catch (Exception unused) {
}
this.d.b(b.length);
} else {
f(serialize, sessionMetadata);
}
return g;
} finally {
c.disconnect();
}
}
@Override
@NotNull
public final Map d(@NotNull String str, @NotNull String str2, @NotNull ArrayList arrayList) {
Intrinsics.checkNotNullParameter(str, "ingestUrl");
Intrinsics.checkNotNullParameter(str2, "projectId");
Intrinsics.checkNotNullParameter(arrayList, "assets");
if (arrayList.isEmpty()) {
return b0.h();
}
String uri = Uri.parse(str).buildUpon().appendPath(str2).appendPath("check-asset").build().toString();
Intrinsics.checkNotNullExpressionValue(uri, "parse(ingestUrl)\n …)\n .toString()");
HttpURLConnection c = com.microsoft.clarity.sn.g.c(uri, "POST", b0.f(q.a("Content-Type", "application/json")));
try {
ArrayList arrayList2 = new ArrayList(k.t(arrayList, 10));
Iterator it = arrayList.iterator();
while (it.hasNext()) {
arrayList2.add(((AssetCheck) it.next()).toJsonObject());
}
String jSONArray = new JSONArray((Collection) arrayList2).toString();
Intrinsics.checkNotNullExpressionValue(jSONArray, "JSONArray(assets.map { i…sonObject() }).toString()");
byte[] bytes = jSONArray.getBytes(com.microsoft.clarity.cs.a.b);
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
long length = bytes.length + 0;
com.microsoft.clarity.sn.g.f(c, bytes);
c.connect();
String a = com.microsoft.clarity.sn.g.a(c);
long length2 = length + a.length();
if (com.microsoft.clarity.sn.g.g(c)) {
double d = length2;
try {
Trace.setCounter("Clarity_CheckAssetBytes", (long) d);
this.c.n("Clarity_CheckAssetBytes", d);
} catch (Exception unused) {
}
this.d.b(length2);
}
return j.b(new JSONObject(a));
} finally {
c.disconnect();
}
}
@NotNull
public final IngestConfigs e(@NotNull String str) {
HttpURLConnection c;
Intrinsics.checkNotNullParameter(str, "projectId");
String uri = Uri.parse("https://www.clarity.ms/").buildUpon().appendPath("tag").appendPath("mobile").appendPath(str).build().toString();
Intrinsics.checkNotNullExpressionValue(uri, "parse(BuildConfig.API_BA…)\n .toString()");
c = com.microsoft.clarity.sn.g.c(uri, "GET", b0.h());
try {
c.connect();
String a = com.microsoft.clarity.sn.g.a(c);
if (com.microsoft.clarity.sn.g.g(c)) {
double length = a.length();
try {
Trace.setCounter("Clarity_TagBytes", (long) length);
this.c.n("Clarity_TagBytes", length);
} catch (Exception unused) {
}
this.d.b(a.length());
}
return IngestConfigs.Companion.fromJson(a);
} finally {
c.disconnect();
}
}
public final void f(String str, SessionMetadata sessionMetadata) {
String str2 = sessionMetadata.getSessionId() + '_' + System.currentTimeMillis() + ".json";
StringBuilder a = com.microsoft.clarity.fn.b.a("Bad collect request for session ");
a.append(sessionMetadata.getSessionId());
a.append(". Saved at ");
a.append(str2);
a.append('.');
com.microsoft.clarity.sn.h.g(a.toString());
this.b.f(str2, str, com.microsoft.clarity.rn.d.OVERWRITE);
}
}