正在查看: Hopscotch v9.7.2 应用的 Clarity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Hopscotch v9.7.2 应用的 Clarity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.microsoft.clarity;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.view.View;
import com.microsoft.clarity.a.A;
import com.microsoft.clarity.a.B;
import com.microsoft.clarity.a.C;
import com.microsoft.clarity.a.C0136f;
import com.microsoft.clarity.a.C0137g;
import com.microsoft.clarity.a.D;
import com.microsoft.clarity.a.E;
import com.microsoft.clarity.a.F;
import com.microsoft.clarity.a.j;
import com.microsoft.clarity.a.k;
import com.microsoft.clarity.a.l;
import com.microsoft.clarity.a.m;
import com.microsoft.clarity.a.n;
import com.microsoft.clarity.a.p;
import com.microsoft.clarity.a.q;
import com.microsoft.clarity.a.u;
import com.microsoft.clarity.a.x;
import com.microsoft.clarity.a.y;
import com.microsoft.clarity.a.z;
import com.microsoft.clarity.f.o;
import com.microsoft.clarity.f.s;
import com.microsoft.clarity.f.t;
import com.microsoft.clarity.m.f;
import com.microsoft.clarity.m.h;
import com.microsoft.clarity.models.LogLevel;
import com.microsoft.clarity.models.PageMetadata;
import com.microsoft.clarity.models.SessionMetadata;
import com.payu.india.Payu.PayuConstants;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.r;
public class Clarity {
public static String getCurrentSessionId() {
s sVar = F.a;
if (sVar == null) {
h.e("Clarity has not started yet.");
return null;
}
String a = t.a(sVar.b);
if (a != null) {
return a;
}
h.e("No Clarity session has started yet.");
return a;
}
public static String getCurrentSessionUrl() {
String a;
String userId;
SessionMetadata sessionMetadata;
s sVar = F.a;
if (sVar == null) {
h.e("Clarity has not started yet.");
a = null;
} else {
a = t.a(sVar.b);
if (a == null) {
h.e("No Clarity session has started yet.");
}
}
if (a == null) {
return null;
}
s sVar2 = F.a;
if (sVar2 == null) {
h.e("Clarity has not started yet.");
userId = null;
} else {
PageMetadata c = sVar2.b.c();
userId = (c == null || (sessionMetadata = c.getSessionMetadata()) == null) ? null : sessionMetadata.getUserId();
if (userId == null) {
h.e("No Clarity session has started yet.");
}
}
if (userId == null) {
return null;
}
ClarityConfig clarityConfig = F.d;
String projectId = clarityConfig != null ? clarityConfig.getProjectId() : null;
if (projectId == null) {
h.e("Clarity has not started yet.");
}
if (projectId == null) {
return null;
}
return Uri.parse("https://clarity.microsoft.com/player/").buildUpon().appendPath(projectId).appendPath(userId).appendPath(a).build().toString();
}
public static Boolean initialize(Context context, ClarityConfig clarityConfig) {
if (context == null || clarityConfig == null) {
h.c("context and config parameters cannot be null.");
return Boolean.FALSE;
}
s sVar = F.a;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(clarityConfig, PayuConstants.CONFIG);
return Boolean.valueOf(f.a(new C0136f(null, context, clarityConfig), C0137g.a, (o) null, 26));
}
public static Boolean isPaused() {
boolean z;
synchronized (F.p) {
z = F.o;
}
return Boolean.valueOf(z);
}
public static Boolean maskView(View view) {
if (view == null) {
h.c("View cannot be null.");
return Boolean.FALSE;
}
s sVar = F.a;
Intrinsics.checkNotNullParameter(view, "view");
LogLevel logLevel = h.a;
h.d("Mask view " + view + '.');
return Boolean.valueOf(f.a(new j(view), k.a, (o) null, 26));
}
public static Boolean pause() {
s sVar = F.a;
return Boolean.valueOf(f.a(l.a, m.a, (o) null, 26));
}
public static Boolean resume() {
s sVar = F.a;
return Boolean.valueOf(f.a(n.a, com.microsoft.clarity.a.o.a, (o) null, 26));
}
public static boolean sendCustomEvent(String str) {
if (str == null) {
h.c("Custom event value cannot be null.");
return false;
}
s sVar = F.a;
Intrinsics.checkNotNullParameter(str, "value");
if (r.i(str)) {
h.c("Custom event value cannot be blank.");
return false;
}
if (str.length() < 254) {
return f.a(new p(str), q.a, (o) null, 26);
}
h.c("Custom event value length should be less than 254 characters.");
return false;
}
public static Boolean setCurrentScreenName(String str) {
s sVar = F.a;
boolean z = false;
if (str != null && r.i(str)) {
h.c("Current screen name cannot be blank.");
} else if (str == null || str.length() < 255) {
z = f.a(new z(str), A.a, (o) null, 26);
} else {
h.c("Current screen name length should be less than 255 characters.");
}
return Boolean.valueOf(z);
}
public static Boolean setCustomSessionId(String str) {
if (str == null) {
h.c("Custom session id cannot be null.");
return Boolean.FALSE;
}
s sVar = F.a;
Intrinsics.checkNotNullParameter(str, "customSessionId");
LogLevel logLevel = h.a;
h.d("Setting custom session id to " + str + '.');
boolean z = false;
if (r.i(str)) {
h.c("Custom session id cannot be blank.");
} else if (str.length() > 255) {
h.c("Custom session id length cannot exceed 255 characters.");
} else {
z = f.a(new com.microsoft.clarity.a.r(str), com.microsoft.clarity.a.s.a, (o) null, 26);
}
return Boolean.valueOf(z);
}
public static boolean setCustomTag(String str, String str2) {
if (str == null || str2 == null) {
h.c("Custom tag key and value cannot be null.");
return false;
}
s sVar = F.a;
Intrinsics.checkNotNullParameter(str, "key");
Intrinsics.checkNotNullParameter(str2, "value");
if (r.i(str) || r.i(str2)) {
h.c("Custom tag key and value cannot be blank.");
return false;
}
if (str.length() < 255 && str2.length() < 255) {
return f.a(new com.microsoft.clarity.a.t(str, str2), u.a, (o) null, 26);
}
h.c("Custom tag key and value length should be less than 255 characters.");
return false;
}
public static Boolean setCustomUserId(String str) {
if (str != null) {
return Boolean.valueOf(F.a(str));
}
h.c("Custom user id cannot be null.");
return Boolean.FALSE;
}
public static Boolean setOnSessionStartedCallback(Function1<String, Unit> function1) {
if (function1 == null) {
h.c("Callback function cannot be null.");
return Boolean.FALSE;
}
s sVar = F.a;
Intrinsics.checkNotNullParameter(function1, "callback");
return Boolean.valueOf(f.a(new x(function1), y.a, (o) null, 26));
}
public static Boolean startNewSession(Function1<String, Unit> function1) {
s sVar = F.a;
return Boolean.valueOf(f.a(new B(function1), C.a, (o) null, 26));
}
public static Boolean unmaskView(View view) {
if (view == null) {
h.c("View cannot be null.");
return Boolean.FALSE;
}
s sVar = F.a;
Intrinsics.checkNotNullParameter(view, "view");
LogLevel logLevel = h.a;
h.d("Unmask view " + view + '.');
return Boolean.valueOf(f.a(new D(view), E.a, (o) null, 26));
}
public static Boolean initialize(Activity activity, ClarityConfig clarityConfig) {
if (activity != null && clarityConfig != null) {
s sVar = F.a;
Context applicationContext = activity.getApplicationContext();
Intrinsics.checkNotNullParameter(applicationContext, "context");
Intrinsics.checkNotNullParameter(clarityConfig, PayuConstants.CONFIG);
return Boolean.valueOf(f.a(new C0136f(activity, applicationContext, clarityConfig), C0137g.a, (o) null, 26));
}
h.c("activity and config parameters cannot be null.");
return Boolean.FALSE;
}
}