Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package com.facebook.appevents.codeless.internal;
/* loaded from: classes2.dex */
public final class Constants {
public static final String APP_INDEXING = "app_indexing";
public static final String APP_INDEXING_ENABLED = "is_app_indexing_enabled";
public static final int APP_INDEXING_SCHEDULE_INTERVAL_MS = 1000;
public static final String BUTTON_SAMPLING = "button_sampling";
public static final String DEVICE_SESSION_ID = "device_session_id";
public static final String EVENT_MAPPING_PATH_TYPE_KEY = "path_type";
public static final String EXTINFO = "extinfo";
public static final Constants INSTANCE = new Constants();
public static final String IS_CODELESS_EVENT_KEY = "_is_fb_codeless";
public static final int MAX_TREE_DEPTH = 25;
public static final String PATH_TYPE_ABSOLUTE = "absolute";
public static final String PATH_TYPE_RELATIVE = "relative";
public static final String PLATFORM = "android";
private Constants() {
}
}

View File

@@ -0,0 +1,212 @@
package com.facebook.appevents.codeless.internal;
import com.tapjoy.TJAdUnitConstants;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class EventBinding {
public static final Companion Companion = new Companion(null);
private final String activityName;
private final String appVersion;
private final String componentId;
private final String eventName;
private final MappingMethod method;
private final List<ParameterComponent> parameters;
private final List<PathComponent> path;
private final String pathType;
private final ActionType type;
public static final EventBinding getInstanceFromJson(JSONObject jSONObject) throws JSONException, IllegalArgumentException {
return Companion.getInstanceFromJson(jSONObject);
}
public static final List<EventBinding> parseArray(JSONArray jSONArray) {
return Companion.parseArray(jSONArray);
}
public final String getActivityName() {
return this.activityName;
}
public final String getAppVersion() {
return this.appVersion;
}
public final String getComponentId() {
return this.componentId;
}
public final String getEventName() {
return this.eventName;
}
public final MappingMethod getMethod() {
return this.method;
}
public final String getPathType() {
return this.pathType;
}
public final ActionType getType() {
return this.type;
}
public EventBinding(String eventName, MappingMethod method, ActionType type, String appVersion, List<PathComponent> path, List<ParameterComponent> parameters, String componentId, String pathType, String activityName) {
Intrinsics.checkNotNullParameter(eventName, "eventName");
Intrinsics.checkNotNullParameter(method, "method");
Intrinsics.checkNotNullParameter(type, "type");
Intrinsics.checkNotNullParameter(appVersion, "appVersion");
Intrinsics.checkNotNullParameter(path, "path");
Intrinsics.checkNotNullParameter(parameters, "parameters");
Intrinsics.checkNotNullParameter(componentId, "componentId");
Intrinsics.checkNotNullParameter(pathType, "pathType");
Intrinsics.checkNotNullParameter(activityName, "activityName");
this.eventName = eventName;
this.method = method;
this.type = type;
this.appVersion = appVersion;
this.path = path;
this.parameters = parameters;
this.componentId = componentId;
this.pathType = pathType;
this.activityName = activityName;
}
public final List<PathComponent> getViewPath() {
List<PathComponent> unmodifiableList = Collections.unmodifiableList(this.path);
Intrinsics.checkNotNullExpressionValue(unmodifiableList, "unmodifiableList(path)");
return unmodifiableList;
}
public final List<ParameterComponent> getViewParameters() {
List<ParameterComponent> unmodifiableList = Collections.unmodifiableList(this.parameters);
Intrinsics.checkNotNullExpressionValue(unmodifiableList, "unmodifiableList(parameters)");
return unmodifiableList;
}
public enum MappingMethod {
MANUAL,
INFERENCE;
/* renamed from: values, reason: to resolve conflict with enum method */
public static MappingMethod[] valuesCustom() {
MappingMethod[] valuesCustom = values();
return (MappingMethod[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
public enum ActionType {
CLICK,
SELECTED,
TEXT_CHANGED;
/* renamed from: values, reason: to resolve conflict with enum method */
public static ActionType[] valuesCustom() {
ActionType[] valuesCustom = values();
return (ActionType[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final List<EventBinding> parseArray(JSONArray jSONArray) {
ArrayList arrayList = new ArrayList();
if (jSONArray != null) {
try {
int length = jSONArray.length();
if (length > 0) {
int i = 0;
while (true) {
int i2 = i + 1;
JSONObject jSONObject = jSONArray.getJSONObject(i);
Intrinsics.checkNotNullExpressionValue(jSONObject, "array.getJSONObject(i)");
arrayList.add(getInstanceFromJson(jSONObject));
if (i2 >= length) {
break;
}
i = i2;
}
}
} catch (IllegalArgumentException | JSONException unused) {
}
}
return arrayList;
}
public final EventBinding getInstanceFromJson(JSONObject mapping) throws JSONException, IllegalArgumentException {
int length;
Intrinsics.checkNotNullParameter(mapping, "mapping");
String eventName = mapping.getString(TJAdUnitConstants.PARAM_PLACEMENT_NAME);
String string = mapping.getString("method");
Intrinsics.checkNotNullExpressionValue(string, "mapping.getString(\"method\")");
Locale ENGLISH = Locale.ENGLISH;
Intrinsics.checkNotNullExpressionValue(ENGLISH, "ENGLISH");
String upperCase = string.toUpperCase(ENGLISH);
Intrinsics.checkNotNullExpressionValue(upperCase, "(this as java.lang.String).toUpperCase(locale)");
MappingMethod valueOf = MappingMethod.valueOf(upperCase);
String string2 = mapping.getString("event_type");
Intrinsics.checkNotNullExpressionValue(string2, "mapping.getString(\"event_type\")");
Intrinsics.checkNotNullExpressionValue(ENGLISH, "ENGLISH");
String upperCase2 = string2.toUpperCase(ENGLISH);
Intrinsics.checkNotNullExpressionValue(upperCase2, "(this as java.lang.String).toUpperCase(locale)");
ActionType valueOf2 = ActionType.valueOf(upperCase2);
String appVersion = mapping.getString("app_version");
JSONArray jSONArray = mapping.getJSONArray("path");
ArrayList arrayList = new ArrayList();
int length2 = jSONArray.length();
int i = 0;
if (length2 > 0) {
int i2 = 0;
while (true) {
int i3 = i2 + 1;
JSONObject jsonPath = jSONArray.getJSONObject(i2);
Intrinsics.checkNotNullExpressionValue(jsonPath, "jsonPath");
arrayList.add(new PathComponent(jsonPath));
if (i3 >= length2) {
break;
}
i2 = i3;
}
}
String pathType = mapping.optString(Constants.EVENT_MAPPING_PATH_TYPE_KEY, Constants.PATH_TYPE_ABSOLUTE);
JSONArray optJSONArray = mapping.optJSONArray("parameters");
ArrayList arrayList2 = new ArrayList();
if (optJSONArray != null && (length = optJSONArray.length()) > 0) {
while (true) {
int i4 = i + 1;
JSONObject jsonParameter = optJSONArray.getJSONObject(i);
Intrinsics.checkNotNullExpressionValue(jsonParameter, "jsonParameter");
arrayList2.add(new ParameterComponent(jsonParameter));
if (i4 >= length) {
break;
}
i = i4;
}
}
String componentId = mapping.optString("component_id");
String activityName = mapping.optString("activity_name");
Intrinsics.checkNotNullExpressionValue(eventName, "eventName");
Intrinsics.checkNotNullExpressionValue(appVersion, "appVersion");
Intrinsics.checkNotNullExpressionValue(componentId, "componentId");
Intrinsics.checkNotNullExpressionValue(pathType, "pathType");
Intrinsics.checkNotNullExpressionValue(activityName, "activityName");
return new EventBinding(eventName, valueOf, valueOf2, appVersion, arrayList, arrayList2, componentId, pathType, activityName);
}
}
}

View File

@@ -0,0 +1,76 @@
package com.facebook.appevents.codeless.internal;
import java.util.ArrayList;
import java.util.List;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class ParameterComponent {
public static final Companion Companion = new Companion(null);
private static final String PARAMETER_NAME_KEY = "name";
private static final String PARAMETER_PATH_KEY = "path";
private static final String PARAMETER_VALUE_KEY = "value";
private final String name;
private final List<PathComponent> path;
private final String pathType;
private final String value;
public final String getName() {
return this.name;
}
public final List<PathComponent> getPath() {
return this.path;
}
public final String getPathType() {
return this.pathType;
}
public final String getValue() {
return this.value;
}
public ParameterComponent(JSONObject component) {
int length;
Intrinsics.checkNotNullParameter(component, "component");
String string = component.getString("name");
Intrinsics.checkNotNullExpressionValue(string, "component.getString(PARAMETER_NAME_KEY)");
this.name = string;
String optString = component.optString("value");
Intrinsics.checkNotNullExpressionValue(optString, "component.optString(PARAMETER_VALUE_KEY)");
this.value = optString;
String optString2 = component.optString(Constants.EVENT_MAPPING_PATH_TYPE_KEY, Constants.PATH_TYPE_ABSOLUTE);
Intrinsics.checkNotNullExpressionValue(optString2, "component.optString(Constants.EVENT_MAPPING_PATH_TYPE_KEY, Constants.PATH_TYPE_ABSOLUTE)");
this.pathType = optString2;
ArrayList arrayList = new ArrayList();
JSONArray optJSONArray = component.optJSONArray("path");
if (optJSONArray != null && (length = optJSONArray.length()) > 0) {
int i = 0;
while (true) {
int i2 = i + 1;
JSONObject jSONObject = optJSONArray.getJSONObject(i);
Intrinsics.checkNotNullExpressionValue(jSONObject, "jsonPathArray.getJSONObject(i)");
arrayList.add(new PathComponent(jSONObject));
if (i2 >= length) {
break;
} else {
i = i2;
}
}
}
this.path = arrayList;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,114 @@
package com.facebook.appevents.codeless.internal;
import java.util.Arrays;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class PathComponent {
public static final Companion Companion = new Companion(null);
private static final String PATH_CLASS_NAME_KEY = "class_name";
private static final String PATH_DESCRIPTION_KEY = "description";
private static final String PATH_HINT_KEY = "hint";
private static final String PATH_ID_KEY = "id";
private static final String PATH_INDEX_KEY = "index";
private static final String PATH_MATCH_BITMASK_KEY = "match_bitmask";
private static final String PATH_TAG_KEY = "tag";
private static final String PATH_TEXT_KEY = "text";
private final String className;
private final String description;
private final String hint;
private final int id;
private final int index;
private final int matchBitmask;
private final String tag;
private final String text;
public final String getClassName() {
return this.className;
}
public final String getDescription() {
return this.description;
}
public final String getHint() {
return this.hint;
}
public final int getId() {
return this.id;
}
public final int getIndex() {
return this.index;
}
public final int getMatchBitmask() {
return this.matchBitmask;
}
public final String getTag() {
return this.tag;
}
public final String getText() {
return this.text;
}
public enum MatchBitmaskType {
ID(1),
TEXT(2),
TAG(4),
DESCRIPTION(8),
HINT(16);
private final int value;
public final int getValue() {
return this.value;
}
MatchBitmaskType(int i) {
this.value = i;
}
/* renamed from: values, reason: to resolve conflict with enum method */
public static MatchBitmaskType[] valuesCustom() {
MatchBitmaskType[] valuesCustom = values();
return (MatchBitmaskType[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
public PathComponent(JSONObject component) {
Intrinsics.checkNotNullParameter(component, "component");
String string = component.getString(PATH_CLASS_NAME_KEY);
Intrinsics.checkNotNullExpressionValue(string, "component.getString(PATH_CLASS_NAME_KEY)");
this.className = string;
this.index = component.optInt(PATH_INDEX_KEY, -1);
this.id = component.optInt("id");
String optString = component.optString("text");
Intrinsics.checkNotNullExpressionValue(optString, "component.optString(PATH_TEXT_KEY)");
this.text = optString;
String optString2 = component.optString("tag");
Intrinsics.checkNotNullExpressionValue(optString2, "component.optString(PATH_TAG_KEY)");
this.tag = optString2;
String optString3 = component.optString("description");
Intrinsics.checkNotNullExpressionValue(optString3, "component.optString(PATH_DESCRIPTION_KEY)");
this.description = optString3;
String optString4 = component.optString("hint");
Intrinsics.checkNotNullExpressionValue(optString4, "component.optString(PATH_HINT_KEY)");
this.hint = optString4;
this.matchBitmask = component.optInt(PATH_MATCH_BITMASK_KEY);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,151 @@
package com.facebook.appevents.codeless.internal;
import android.text.method.PasswordTransformationMethod;
import android.util.Patterns;
import android.view.View;
import android.widget.TextView;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import kotlin.text.CharsKt__CharKt;
import kotlin.text.Regex;
/* loaded from: classes2.dex */
public final class SensitiveUserDataUtils {
public static final SensitiveUserDataUtils INSTANCE = new SensitiveUserDataUtils();
private SensitiveUserDataUtils() {
}
public static final boolean isSensitiveUserData(View view) {
if (CrashShieldHandler.isObjectCrashing(SensitiveUserDataUtils.class)) {
return false;
}
try {
if (!(view instanceof TextView)) {
return false;
}
SensitiveUserDataUtils sensitiveUserDataUtils = INSTANCE;
if (!sensitiveUserDataUtils.isPassword((TextView) view) && !sensitiveUserDataUtils.isCreditCard((TextView) view) && !sensitiveUserDataUtils.isPersonName((TextView) view) && !sensitiveUserDataUtils.isPostalAddress((TextView) view) && !sensitiveUserDataUtils.isPhoneNumber((TextView) view)) {
if (!sensitiveUserDataUtils.isEmail((TextView) view)) {
return false;
}
}
return true;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, SensitiveUserDataUtils.class);
return false;
}
}
private final boolean isPassword(TextView textView) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
if (textView.getInputType() == 128) {
return true;
}
return textView.getTransformationMethod() instanceof PasswordTransformationMethod;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
private final boolean isEmail(TextView textView) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
if (textView.getInputType() == 32) {
return true;
}
String textOfView = ViewHierarchy.getTextOfView(textView);
if (textOfView != null && textOfView.length() != 0) {
return Patterns.EMAIL_ADDRESS.matcher(textOfView).matches();
}
return false;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
private final boolean isPersonName(TextView textView) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
return textView.getInputType() == 96;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
private final boolean isPostalAddress(TextView textView) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
return textView.getInputType() == 112;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
private final boolean isPhoneNumber(TextView textView) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
return textView.getInputType() == 3;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
private final boolean isCreditCard(TextView textView) {
int i;
int digitToInt;
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
String replace = new Regex("\\s").replace(ViewHierarchy.getTextOfView(textView), "");
int length = replace.length();
if (length >= 12 && length <= 19) {
int i2 = length - 1;
if (i2 >= 0) {
boolean z = false;
i = 0;
while (true) {
int i3 = i2 - 1;
char charAt = replace.charAt(i2);
if (!Character.isDigit(charAt)) {
return false;
}
digitToInt = CharsKt__CharKt.digitToInt(charAt);
if (z && (digitToInt = digitToInt * 2) > 9) {
digitToInt = (digitToInt % 10) + 1;
}
i += digitToInt;
z = !z;
if (i3 < 0) {
break;
}
i2 = i3;
}
} else {
i = 0;
}
return i % 10 == 0;
}
return false;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
}

View File

@@ -0,0 +1,58 @@
package com.facebook.appevents.codeless.internal;
import android.util.Log;
import java.lang.reflect.Method;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class UnityReflection {
private static final String CAPTURE_VIEW_HIERARCHY_METHOD = "CaptureViewHierarchy";
private static final String EVENT_MAPPING_METHOD = "OnReceiveMapping";
private static final String FB_UNITY_GAME_OBJECT = "UnityFacebookSDKPlugin";
public static final UnityReflection INSTANCE = new UnityReflection();
private static final String TAG = UnityReflection.class.getCanonicalName();
private static final String UNITY_PLAYER_CLASS = "com.unity3d.player.UnityPlayer";
private static final String UNITY_SEND_MESSAGE_METHOD = "UnitySendMessage";
private static Class<?> unityPlayer;
private UnityReflection() {
}
private final Class<?> getUnityPlayerClass() {
Class<?> cls = Class.forName("com.unity3d.player.UnityPlayer");
Intrinsics.checkNotNullExpressionValue(cls, "forName(UNITY_PLAYER_CLASS)");
return cls;
}
public static final void sendMessage(String str, String str2, String str3) {
try {
if (unityPlayer == null) {
unityPlayer = INSTANCE.getUnityPlayerClass();
}
Class<?> cls = unityPlayer;
if (cls != null) {
Method method = cls.getMethod(UNITY_SEND_MESSAGE_METHOD, String.class, String.class, String.class);
Class<?> cls2 = unityPlayer;
if (cls2 != null) {
method.invoke(cls2, str, str2, str3);
return;
} else {
Intrinsics.throwUninitializedPropertyAccessException("unityPlayer");
throw null;
}
}
Intrinsics.throwUninitializedPropertyAccessException("unityPlayer");
throw null;
} catch (Exception e) {
Log.e(TAG, "Failed to send message to Unity", e);
}
}
public static final void captureViewHierarchy() {
sendMessage(FB_UNITY_GAME_OBJECT, CAPTURE_VIEW_HIERARCHY_METHOD, "");
}
public static final void sendEventMapping(String str) {
sendMessage(FB_UNITY_GAME_OBJECT, EVENT_MAPPING_METHOD, str);
}
}

View File

@@ -0,0 +1,712 @@
package com.facebook.appevents.codeless.internal;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.AdapterView;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RatingBar;
import android.widget.Spinner;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.TimePicker;
import androidx.annotation.RestrictTo;
import com.facebook.appevents.internal.ViewHierarchyConstants;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import java.io.ByteArrayOutputStream;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes2.dex */
public final class ViewHierarchy {
private static final String CLASS_RCTROOTVIEW = "com.facebook.react.ReactRootView";
private static final String CLASS_RCTVIEWGROUP = "com.facebook.react.views.view.ReactViewGroup";
private static final String CLASS_TOUCHTARGETHELPER = "com.facebook.react.uimanager.TouchTargetHelper";
private static final int ICON_MAX_EDGE_LENGTH = 44;
private static final String METHOD_FIND_TOUCHTARGET_VIEW = "findTouchTargetView";
private static Method methodFindTouchTargetView;
public static final ViewHierarchy INSTANCE = new ViewHierarchy();
private static final String TAG = ViewHierarchy.class.getCanonicalName();
private static WeakReference<View> RCTRootViewReference = new WeakReference<>(null);
private ViewHierarchy() {
}
public static final ViewGroup getParentOfView(View view) {
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class) || view == null) {
return null;
}
try {
ViewParent parent = view.getParent();
if (parent instanceof ViewGroup) {
return (ViewGroup) parent;
}
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return null;
}
}
public static final List<View> getChildrenOfView(View view) {
int childCount;
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return null;
}
try {
ArrayList arrayList = new ArrayList();
if ((view instanceof ViewGroup) && (childCount = ((ViewGroup) view).getChildCount()) > 0) {
int i = 0;
while (true) {
int i2 = i + 1;
arrayList.add(((ViewGroup) view).getChildAt(i));
if (i2 >= childCount) {
break;
}
i = i2;
}
}
return arrayList;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return null;
}
}
public static final void updateBasicInfoOfView(View view, JSONObject json) {
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(view, "view");
Intrinsics.checkNotNullParameter(json, "json");
try {
String textOfView = getTextOfView(view);
String hintOfView = getHintOfView(view);
Object tag = view.getTag();
CharSequence contentDescription = view.getContentDescription();
json.put(ViewHierarchyConstants.CLASS_NAME_KEY, view.getClass().getCanonicalName());
json.put(ViewHierarchyConstants.CLASS_TYPE_BITMASK_KEY, getClassTypeBitmask(view));
json.put("id", view.getId());
if (!SensitiveUserDataUtils.isSensitiveUserData(view)) {
json.put("text", Utility.coerceValueIfNullOrEmpty(Utility.sha256hash(textOfView), ""));
} else {
json.put("text", "");
json.put(ViewHierarchyConstants.IS_USER_INPUT_KEY, true);
}
json.put(ViewHierarchyConstants.HINT_KEY, Utility.coerceValueIfNullOrEmpty(Utility.sha256hash(hintOfView), ""));
if (tag != null) {
json.put("tag", Utility.coerceValueIfNullOrEmpty(Utility.sha256hash(tag.toString()), ""));
}
if (contentDescription != null) {
json.put("description", Utility.coerceValueIfNullOrEmpty(Utility.sha256hash(contentDescription.toString()), ""));
}
json.put(ViewHierarchyConstants.DIMENSION_KEY, INSTANCE.getDimensionOfView(view));
} catch (JSONException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
}
}
public static final void updateAppearanceOfView(View view, JSONObject json, float f) {
Bitmap bitmap;
Typeface typeface;
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(view, "view");
Intrinsics.checkNotNullParameter(json, "json");
try {
JSONObject jSONObject = new JSONObject();
if ((view instanceof TextView) && (typeface = ((TextView) view).getTypeface()) != null) {
jSONObject.put(ViewHierarchyConstants.TEXT_SIZE, ((TextView) view).getTextSize());
jSONObject.put(ViewHierarchyConstants.TEXT_IS_BOLD, typeface.isBold());
jSONObject.put(ViewHierarchyConstants.TEXT_IS_ITALIC, typeface.isItalic());
json.put(ViewHierarchyConstants.TEXT_STYLE, jSONObject);
}
if (view instanceof ImageView) {
Drawable drawable = ((ImageView) view).getDrawable();
if (drawable instanceof BitmapDrawable) {
float f2 = 44;
if (view.getHeight() / f > f2 || view.getWidth() / f > f2 || (bitmap = ((BitmapDrawable) drawable).getBitmap()) == null) {
return;
}
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
json.put(ViewHierarchyConstants.ICON_BITMAP, Base64.encodeToString(byteArrayOutputStream.toByteArray(), 0));
}
}
} catch (JSONException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
}
}
public static final JSONObject getDictionaryOfView(View view) {
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return null;
}
try {
Intrinsics.checkNotNullParameter(view, "view");
if (Intrinsics.areEqual(view.getClass().getName(), CLASS_RCTROOTVIEW)) {
RCTRootViewReference = new WeakReference<>(view);
}
JSONObject jSONObject = new JSONObject();
try {
updateBasicInfoOfView(view, jSONObject);
JSONArray jSONArray = new JSONArray();
List<View> childrenOfView = getChildrenOfView(view);
int size = childrenOfView.size() - 1;
if (size >= 0) {
int i = 0;
while (true) {
int i2 = i + 1;
jSONArray.put(getDictionaryOfView(childrenOfView.get(i)));
if (i2 > size) {
break;
}
i = i2;
}
}
jSONObject.put(ViewHierarchyConstants.CHILDREN_VIEW_KEY, jSONArray);
} catch (JSONException e) {
Log.e(TAG, "Failed to create JSONObject for view.", e);
}
return jSONObject;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return null;
}
}
/* JADX WARN: Removed duplicated region for block: B:24:0x004a A[Catch: all -> 0x0044, TryCatch #0 {all -> 0x0044, blocks: (B:6:0x000a, B:9:0x0016, B:11:0x001c, B:12:0x001e, B:14:0x0024, B:15:0x0026, B:17:0x002a, B:19:0x0030, B:21:0x0036, B:22:0x0046, B:24:0x004a, B:27:0x0039, B:29:0x003d, B:31:0x004d, B:33:0x0051, B:36:0x0056, B:38:0x005a, B:40:0x005e, B:42:0x0062, B:44:0x0065, B:46:0x0069), top: B:5:0x000a }] */
/* JADX WARN: Removed duplicated region for block: B:26:? A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final int getClassTypeBitmask(android.view.View r5) {
/*
java.lang.Class<com.facebook.appevents.codeless.internal.ViewHierarchy> r0 = com.facebook.appevents.codeless.internal.ViewHierarchy.class
boolean r1 = com.facebook.internal.instrument.crashshield.CrashShieldHandler.isObjectCrashing(r0)
r2 = 0
if (r1 == 0) goto La
return r2
La:
java.lang.String r1 = "view"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r5, r1) // Catch: java.lang.Throwable -> L44
boolean r1 = r5 instanceof android.widget.ImageView // Catch: java.lang.Throwable -> L44
if (r1 == 0) goto L15
r1 = 2
goto L16
L15:
r1 = r2
L16:
boolean r3 = r5.isClickable() // Catch: java.lang.Throwable -> L44
if (r3 == 0) goto L1e
r1 = r1 | 32
L1e:
boolean r3 = isAdapterViewItem(r5) // Catch: java.lang.Throwable -> L44
if (r3 == 0) goto L26
r1 = r1 | 512(0x200, float:7.17E-43)
L26:
boolean r3 = r5 instanceof android.widget.TextView // Catch: java.lang.Throwable -> L44
if (r3 == 0) goto L4d
r3 = r1 | 1025(0x401, float:1.436E-42)
boolean r4 = r5 instanceof android.widget.Button // Catch: java.lang.Throwable -> L44
if (r4 == 0) goto L42
r3 = r1 | 1029(0x405, float:1.442E-42)
boolean r4 = r5 instanceof android.widget.Switch // Catch: java.lang.Throwable -> L44
if (r4 == 0) goto L39
r1 = r1 | 9221(0x2405, float:1.2921E-41)
goto L46
L39:
boolean r4 = r5 instanceof android.widget.CheckBox // Catch: java.lang.Throwable -> L44
if (r4 == 0) goto L42
r3 = 33797(0x8405, float:4.736E-41)
r1 = r1 | r3
goto L46
L42:
r1 = r3
goto L46
L44:
r5 = move-exception
goto L7f
L46:
boolean r5 = r5 instanceof android.widget.EditText // Catch: java.lang.Throwable -> L44
if (r5 == 0) goto L7e
r1 = r1 | 2048(0x800, float:2.87E-42)
goto L7e
L4d:
boolean r3 = r5 instanceof android.widget.Spinner // Catch: java.lang.Throwable -> L44
if (r3 != 0) goto L7c
boolean r3 = r5 instanceof android.widget.DatePicker // Catch: java.lang.Throwable -> L44
if (r3 == 0) goto L56
goto L7c
L56:
boolean r3 = r5 instanceof android.widget.RatingBar // Catch: java.lang.Throwable -> L44
if (r3 == 0) goto L5e
r5 = 65536(0x10000, float:9.1835E-41)
r1 = r1 | r5
goto L7e
L5e:
boolean r3 = r5 instanceof android.widget.RadioGroup // Catch: java.lang.Throwable -> L44
if (r3 == 0) goto L65
r1 = r1 | 16384(0x4000, float:2.2959E-41)
goto L7e
L65:
boolean r3 = r5 instanceof android.view.ViewGroup // Catch: java.lang.Throwable -> L44
if (r3 == 0) goto L7e
com.facebook.appevents.codeless.internal.ViewHierarchy r3 = com.facebook.appevents.codeless.internal.ViewHierarchy.INSTANCE // Catch: java.lang.Throwable -> L44
java.lang.ref.WeakReference<android.view.View> r4 = com.facebook.appevents.codeless.internal.ViewHierarchy.RCTRootViewReference // Catch: java.lang.Throwable -> L44
java.lang.Object r4 = r4.get() // Catch: java.lang.Throwable -> L44
android.view.View r4 = (android.view.View) r4 // Catch: java.lang.Throwable -> L44
boolean r5 = r3.isRCTButton(r5, r4) // Catch: java.lang.Throwable -> L44
if (r5 == 0) goto L7e
r1 = r1 | 64
goto L7e
L7c:
r1 = r1 | 4096(0x1000, float:5.74E-42)
L7e:
return r1
L7f:
com.facebook.internal.instrument.crashshield.CrashShieldHandler.handleThrowable(r5, r0)
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.appevents.codeless.internal.ViewHierarchy.getClassTypeBitmask(android.view.View):int");
}
private static final boolean isAdapterViewItem(View view) {
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return false;
}
try {
ViewParent parent = view.getParent();
if (parent instanceof AdapterView) {
return true;
}
ViewHierarchy viewHierarchy = INSTANCE;
Class<?> existingClass = viewHierarchy.getExistingClass("android.support.v4.view.NestedScrollingChild");
if (existingClass != null && existingClass.isInstance(parent)) {
return true;
}
Class<?> existingClass2 = viewHierarchy.getExistingClass("androidx.core.view.NestedScrollingChild");
if (existingClass2 != null) {
return existingClass2.isInstance(parent);
}
return false;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return false;
}
}
public static final String getTextOfView(View view) {
CharSequence valueOf;
Object selectedItem;
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return null;
}
try {
if (view instanceof TextView) {
valueOf = ((TextView) view).getText();
if (view instanceof Switch) {
valueOf = ((Switch) view).isChecked() ? "1" : "0";
}
} else if (view instanceof Spinner) {
if (((Spinner) view).getCount() > 0 && (selectedItem = ((Spinner) view).getSelectedItem()) != null) {
valueOf = selectedItem.toString();
}
valueOf = null;
} else {
int i = 0;
if (view instanceof DatePicker) {
int year = ((DatePicker) view).getYear();
int month = ((DatePicker) view).getMonth();
int dayOfMonth = ((DatePicker) view).getDayOfMonth();
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
valueOf = String.format("%04d-%02d-%02d", Arrays.copyOf(new Object[]{Integer.valueOf(year), Integer.valueOf(month), Integer.valueOf(dayOfMonth)}, 3));
Intrinsics.checkNotNullExpressionValue(valueOf, "java.lang.String.format(format, *args)");
} else if (view instanceof TimePicker) {
Integer currentHour = ((TimePicker) view).getCurrentHour();
Intrinsics.checkNotNullExpressionValue(currentHour, "view.currentHour");
int intValue = currentHour.intValue();
Integer currentMinute = ((TimePicker) view).getCurrentMinute();
Intrinsics.checkNotNullExpressionValue(currentMinute, "view.currentMinute");
int intValue2 = currentMinute.intValue();
StringCompanionObject stringCompanionObject2 = StringCompanionObject.INSTANCE;
valueOf = String.format("%02d:%02d", Arrays.copyOf(new Object[]{Integer.valueOf(intValue), Integer.valueOf(intValue2)}, 2));
Intrinsics.checkNotNullExpressionValue(valueOf, "java.lang.String.format(format, *args)");
} else if (view instanceof RadioGroup) {
int checkedRadioButtonId = ((RadioGroup) view).getCheckedRadioButtonId();
int childCount = ((RadioGroup) view).getChildCount();
if (childCount > 0) {
while (true) {
int i2 = i + 1;
View childAt = ((RadioGroup) view).getChildAt(i);
if (childAt.getId() == checkedRadioButtonId && (childAt instanceof RadioButton)) {
valueOf = ((RadioButton) childAt).getText();
break;
}
if (i2 >= childCount) {
break;
}
i = i2;
}
}
valueOf = null;
} else {
if (view instanceof RatingBar) {
valueOf = String.valueOf(((RatingBar) view).getRating());
}
valueOf = null;
}
}
if (valueOf == null) {
return "";
}
String obj = valueOf.toString();
return obj == null ? "" : obj;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return null;
}
}
public static final String getHintOfView(View view) {
CharSequence hint;
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return null;
}
try {
if (view instanceof EditText) {
hint = ((EditText) view).getHint();
} else {
hint = view instanceof TextView ? ((TextView) view).getHint() : null;
}
if (hint == null) {
return "";
}
String obj = hint.toString();
return obj == null ? "" : obj;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return null;
}
}
private final JSONObject getDimensionOfView(View view) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("top", view.getTop());
jSONObject.put("left", view.getLeft());
jSONObject.put("width", view.getWidth());
jSONObject.put("height", view.getHeight());
jSONObject.put(ViewHierarchyConstants.DIMENSION_SCROLL_X_KEY, view.getScrollX());
jSONObject.put(ViewHierarchyConstants.DIMENSION_SCROLL_Y_KEY, view.getScrollY());
jSONObject.put(ViewHierarchyConstants.DIMENSION_VISIBILITY_KEY, view.getVisibility());
} catch (JSONException e) {
Log.e(TAG, "Failed to create JSONObject for dimension.", e);
}
return jSONObject;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public static final View.OnClickListener getExistingOnClickListener(View view) {
Field declaredField;
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return null;
}
try {
Field declaredField2 = Class.forName("android.view.View").getDeclaredField("mListenerInfo");
if (declaredField2 != null) {
declaredField2.setAccessible(true);
}
Object obj = declaredField2.get(view);
if (obj == null || (declaredField = Class.forName("android.view.View$ListenerInfo").getDeclaredField("mOnClickListener")) == null) {
return null;
}
declaredField.setAccessible(true);
Object obj2 = declaredField.get(obj);
if (obj2 != null) {
return (View.OnClickListener) obj2;
}
throw new NullPointerException("null cannot be cast to non-null type android.view.View.OnClickListener");
} catch (ClassNotFoundException | IllegalAccessException | NoSuchFieldException unused) {
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return null;
}
}
public static final void setOnClickListener(View view, View.OnClickListener onClickListener) {
Field field;
Field field2;
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(view, "view");
Object obj = null;
try {
try {
field = Class.forName("android.view.View").getDeclaredField("mListenerInfo");
try {
field2 = Class.forName("android.view.View$ListenerInfo").getDeclaredField("mOnClickListener");
} catch (ClassNotFoundException | NoSuchFieldException unused) {
field2 = null;
if (field != null) {
}
view.setOnClickListener(onClickListener);
return;
}
} catch (Exception unused2) {
return;
}
} catch (ClassNotFoundException | NoSuchFieldException unused3) {
field = null;
}
if (field != null || field2 == null) {
view.setOnClickListener(onClickListener);
return;
}
field.setAccessible(true);
field2.setAccessible(true);
try {
field.setAccessible(true);
obj = field.get(view);
} catch (IllegalAccessException unused4) {
}
if (obj == null) {
view.setOnClickListener(onClickListener);
} else {
field2.set(obj, onClickListener);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
}
}
public static final View.OnTouchListener getExistingOnTouchListener(View view) {
Field declaredField;
try {
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return null;
}
try {
try {
Field declaredField2 = Class.forName("android.view.View").getDeclaredField("mListenerInfo");
if (declaredField2 != null) {
declaredField2.setAccessible(true);
}
Object obj = declaredField2.get(view);
if (obj == null || (declaredField = Class.forName("android.view.View$ListenerInfo").getDeclaredField("mOnTouchListener")) == null) {
return null;
}
declaredField.setAccessible(true);
Object obj2 = declaredField.get(obj);
if (obj2 != null) {
return (View.OnTouchListener) obj2;
}
throw new NullPointerException("null cannot be cast to non-null type android.view.View.OnTouchListener");
} catch (NoSuchFieldException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
return null;
}
} catch (ClassNotFoundException e2) {
Utility utility2 = Utility.INSTANCE;
Utility.logd(TAG, e2);
return null;
} catch (IllegalAccessException e3) {
Utility utility3 = Utility.INSTANCE;
Utility.logd(TAG, e3);
return null;
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
return null;
}
}
private final View getTouchReactView(float[] fArr, View view) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
initTouchTargetHelperMethods();
Method method = methodFindTouchTargetView;
if (method != null && view != null) {
try {
if (method == null) {
throw new IllegalStateException("Required value was null.".toString());
}
Object invoke = method.invoke(null, fArr, view);
if (invoke == null) {
throw new NullPointerException("null cannot be cast to non-null type android.view.View");
}
View view2 = (View) invoke;
if (view2.getId() > 0) {
Object parent = view2.getParent();
if (parent != null) {
return (View) parent;
}
throw new NullPointerException("null cannot be cast to non-null type android.view.View");
}
} catch (IllegalAccessException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
} catch (InvocationTargetException e2) {
Utility utility2 = Utility.INSTANCE;
Utility.logd(TAG, e2);
}
}
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public final boolean isRCTButton(View view, View view2) {
View touchReactView;
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
Intrinsics.checkNotNullParameter(view, "view");
if (!Intrinsics.areEqual(view.getClass().getName(), CLASS_RCTVIEWGROUP) || (touchReactView = getTouchReactView(getViewLocationOnScreen(view), view2)) == null) {
return false;
}
return touchReactView.getId() == view.getId();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
private final boolean isRCTRootView(View view) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
return Intrinsics.areEqual(view.getClass().getName(), CLASS_RCTROOTVIEW);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
public static final View findRCTRootView(View view) {
if (CrashShieldHandler.isObjectCrashing(ViewHierarchy.class)) {
return null;
}
while (view != null) {
try {
if (!INSTANCE.isRCTRootView(view)) {
Object parent = view.getParent();
if (!(parent instanceof View)) {
break;
}
view = (View) parent;
} else {
return view;
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, ViewHierarchy.class);
}
}
return null;
}
private final float[] getViewLocationOnScreen(View view) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
view.getLocationOnScreen(new int[2]);
return new float[]{r2[0], r2[1]};
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
private final void initTouchTargetHelperMethods() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (methodFindTouchTargetView != null) {
return;
}
try {
Method declaredMethod = Class.forName(CLASS_TOUCHTARGETHELPER).getDeclaredMethod(METHOD_FIND_TOUCHTARGET_VIEW, float[].class, ViewGroup.class);
methodFindTouchTargetView = declaredMethod;
if (declaredMethod == null) {
throw new IllegalStateException("Required value was null.".toString());
}
declaredMethod.setAccessible(true);
} catch (ClassNotFoundException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
} catch (NoSuchMethodException e2) {
Utility utility2 = Utility.INSTANCE;
Utility.logd(TAG, e2);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final Class<?> getExistingClass(String str) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
return Class.forName(str);
} catch (ClassNotFoundException unused) {
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
}