- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
112 lines
4.4 KiB
Java
112 lines
4.4 KiB
Java
package com.facebook.appevents.integrity;
|
|
|
|
import com.facebook.FacebookSdk;
|
|
import com.facebook.appevents.ml.ModelManager;
|
|
import com.facebook.internal.FetchedAppGateKeepersManager;
|
|
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.collections.CollectionsKt___CollectionsKt;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class IntegrityManager {
|
|
public static final IntegrityManager INSTANCE = new IntegrityManager();
|
|
public static final String INTEGRITY_TYPE_ADDRESS = "address";
|
|
public static final String INTEGRITY_TYPE_HEALTH = "health";
|
|
public static final String INTEGRITY_TYPE_NONE = "none";
|
|
private static final String RESTRICTIVE_ON_DEVICE_PARAMS_KEY = "_onDeviceParams";
|
|
private static boolean enabled;
|
|
private static boolean isSampleEnabled;
|
|
|
|
private IntegrityManager() {
|
|
}
|
|
|
|
public static final void enable() {
|
|
if (CrashShieldHandler.isObjectCrashing(IntegrityManager.class)) {
|
|
return;
|
|
}
|
|
try {
|
|
enabled = true;
|
|
FetchedAppGateKeepersManager fetchedAppGateKeepersManager = FetchedAppGateKeepersManager.INSTANCE;
|
|
isSampleEnabled = FetchedAppGateKeepersManager.getGateKeeperForKey("FBSDKFeatureIntegritySample", FacebookSdk.getApplicationId(), false);
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, IntegrityManager.class);
|
|
}
|
|
}
|
|
|
|
public static final void processParameters(Map<String, String> parameters) {
|
|
if (CrashShieldHandler.isObjectCrashing(IntegrityManager.class)) {
|
|
return;
|
|
}
|
|
try {
|
|
Intrinsics.checkNotNullParameter(parameters, "parameters");
|
|
if (!enabled || parameters.isEmpty()) {
|
|
return;
|
|
}
|
|
try {
|
|
List<String> list = CollectionsKt___CollectionsKt.toList(parameters.keySet());
|
|
JSONObject jSONObject = new JSONObject();
|
|
for (String str : list) {
|
|
String str2 = parameters.get(str);
|
|
if (str2 == null) {
|
|
throw new IllegalStateException("Required value was null.".toString());
|
|
}
|
|
String str3 = str2;
|
|
IntegrityManager integrityManager = INSTANCE;
|
|
if (!integrityManager.shouldFilter(str) && !integrityManager.shouldFilter(str3)) {
|
|
}
|
|
parameters.remove(str);
|
|
if (!isSampleEnabled) {
|
|
str3 = "";
|
|
}
|
|
jSONObject.put(str, str3);
|
|
}
|
|
if (jSONObject.length() != 0) {
|
|
String jSONObject2 = jSONObject.toString();
|
|
Intrinsics.checkNotNullExpressionValue(jSONObject2, "restrictiveParamJson.toString()");
|
|
parameters.put(RESTRICTIVE_ON_DEVICE_PARAMS_KEY, jSONObject2);
|
|
}
|
|
} catch (Exception unused) {
|
|
}
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, IntegrityManager.class);
|
|
}
|
|
}
|
|
|
|
private final boolean shouldFilter(String str) {
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return false;
|
|
}
|
|
try {
|
|
return !Intrinsics.areEqual("none", getIntegrityPredictionResult(str));
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private final String getIntegrityPredictionResult(String str) {
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
float[] fArr = new float[30];
|
|
for (int i = 0; i < 30; i++) {
|
|
fArr[i] = 0.0f;
|
|
}
|
|
ModelManager modelManager = ModelManager.INSTANCE;
|
|
String[] predict = ModelManager.predict(ModelManager.Task.MTML_INTEGRITY_DETECT, new float[][]{fArr}, new String[]{str});
|
|
if (predict == null) {
|
|
return "none";
|
|
}
|
|
String str2 = predict[0];
|
|
return str2 == null ? "none" : str2;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
}
|