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,134 @@
package com.facebook.appevents.ondeviceprocessing;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.annotation.RestrictTo;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEvent;
import com.facebook.appevents.AppEventsConstants;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import java.util.Set;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.SetsKt__SetsKt;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes2.dex */
public final class OnDeviceProcessingManager {
private static final Set<String> ALLOWED_IMPLICIT_EVENTS;
public static final OnDeviceProcessingManager INSTANCE = new OnDeviceProcessingManager();
private OnDeviceProcessingManager() {
}
static {
Set<String> of;
of = SetsKt__SetsKt.setOf((Object[]) new String[]{AppEventsConstants.EVENT_NAME_PURCHASED, AppEventsConstants.EVENT_NAME_START_TRIAL, AppEventsConstants.EVENT_NAME_SUBSCRIBE});
ALLOWED_IMPLICIT_EVENTS = of;
}
public static final boolean isOnDeviceProcessingEnabled() {
if (CrashShieldHandler.isObjectCrashing(OnDeviceProcessingManager.class)) {
return false;
}
try {
if (FacebookSdk.getLimitEventAndDataUsage(FacebookSdk.getApplicationContext()) || Utility.isDataProcessingRestricted()) {
return false;
}
return RemoteServiceWrapper.isServiceAvailable();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, OnDeviceProcessingManager.class);
return false;
}
}
public static final void sendInstallEventAsync(final String str, final String str2) {
if (CrashShieldHandler.isObjectCrashing(OnDeviceProcessingManager.class)) {
return;
}
try {
final Context applicationContext = FacebookSdk.getApplicationContext();
if (applicationContext == null || str == null || str2 == null) {
return;
}
FacebookSdk.getExecutor().execute(new Runnable() { // from class: com.facebook.appevents.ondeviceprocessing.OnDeviceProcessingManager$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
OnDeviceProcessingManager.m520sendInstallEventAsync$lambda0(applicationContext, str2, str);
}
});
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, OnDeviceProcessingManager.class);
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sendInstallEventAsync$lambda-0, reason: not valid java name */
public static final void m520sendInstallEventAsync$lambda0(Context context, String str, String str2) {
if (CrashShieldHandler.isObjectCrashing(OnDeviceProcessingManager.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(context, "$context");
SharedPreferences sharedPreferences = context.getSharedPreferences(str, 0);
String stringPlus = Intrinsics.stringPlus(str2, "pingForOnDevice");
if (sharedPreferences.getLong(stringPlus, 0L) == 0) {
RemoteServiceWrapper.sendInstallEvent(str2);
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putLong(stringPlus, System.currentTimeMillis());
edit.apply();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, OnDeviceProcessingManager.class);
}
}
public static final void sendCustomEventAsync(final String applicationId, final AppEvent event) {
if (CrashShieldHandler.isObjectCrashing(OnDeviceProcessingManager.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(applicationId, "applicationId");
Intrinsics.checkNotNullParameter(event, "event");
if (INSTANCE.isEventEligibleForOnDeviceProcessing(event)) {
FacebookSdk.getExecutor().execute(new Runnable() { // from class: com.facebook.appevents.ondeviceprocessing.OnDeviceProcessingManager$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
OnDeviceProcessingManager.m519sendCustomEventAsync$lambda1(applicationId, event);
}
});
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, OnDeviceProcessingManager.class);
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sendCustomEventAsync$lambda-1, reason: not valid java name */
public static final void m519sendCustomEventAsync$lambda1(String applicationId, AppEvent event) {
if (CrashShieldHandler.isObjectCrashing(OnDeviceProcessingManager.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(applicationId, "$applicationId");
Intrinsics.checkNotNullParameter(event, "$event");
RemoteServiceWrapper remoteServiceWrapper = RemoteServiceWrapper.INSTANCE;
RemoteServiceWrapper.sendCustomEvents(applicationId, CollectionsKt__CollectionsJVMKt.listOf(event));
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, OnDeviceProcessingManager.class);
}
}
private final boolean isEventEligibleForOnDeviceProcessing(AppEvent appEvent) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
return (appEvent.isImplicit() ^ true) || (appEvent.isImplicit() && ALLOWED_IMPLICIT_EVENTS.contains(appEvent.getName()));
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
}

View File

@@ -0,0 +1,94 @@
package com.facebook.appevents.ondeviceprocessing;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import com.facebook.appevents.AppEvent;
import com.facebook.appevents.eventdeactivation.EventDeactivationManager;
import com.facebook.appevents.ondeviceprocessing.RemoteServiceWrapper;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import java.util.Collection;
import java.util.List;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONArray;
/* loaded from: classes2.dex */
public final class RemoteServiceParametersHelper {
public static final RemoteServiceParametersHelper INSTANCE = new RemoteServiceParametersHelper();
private static final String TAG = RemoteServiceWrapper.class.getSimpleName();
private RemoteServiceParametersHelper() {
}
public static final Bundle buildEventsBundle(RemoteServiceWrapper.EventType eventType, String applicationId, List<AppEvent> appEvents) {
if (CrashShieldHandler.isObjectCrashing(RemoteServiceParametersHelper.class)) {
return null;
}
try {
Intrinsics.checkNotNullParameter(eventType, "eventType");
Intrinsics.checkNotNullParameter(applicationId, "applicationId");
Intrinsics.checkNotNullParameter(appEvents, "appEvents");
Bundle bundle = new Bundle();
bundle.putString(NotificationCompat.CATEGORY_EVENT, eventType.toString());
bundle.putString("app_id", applicationId);
if (RemoteServiceWrapper.EventType.CUSTOM_APP_EVENTS == eventType) {
JSONArray buildEventsJson = INSTANCE.buildEventsJson(appEvents, applicationId);
if (buildEventsJson.length() == 0) {
return null;
}
bundle.putString("custom_events", buildEventsJson.toString());
}
return bundle;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, RemoteServiceParametersHelper.class);
return null;
}
}
private final JSONArray buildEventsJson(List<AppEvent> list, String str) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
JSONArray jSONArray = new JSONArray();
List<AppEvent> mutableList = CollectionsKt___CollectionsKt.toMutableList((Collection) list);
EventDeactivationManager.processEvents(mutableList);
boolean includeImplicitEvents = includeImplicitEvents(str);
for (AppEvent appEvent : mutableList) {
if (appEvent.isChecksumValid()) {
if (!(!appEvent.isImplicit())) {
if (appEvent.isImplicit() && includeImplicitEvents) {
}
}
jSONArray.put(appEvent.getJsonObject());
} else {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, Intrinsics.stringPlus("Event with invalid checksum: ", appEvent));
}
}
return jSONArray;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
private final boolean includeImplicitEvents(String str) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
FetchedAppSettings queryAppSettings = FetchedAppSettingsManager.queryAppSettings(str, false);
if (queryAppSettings != null) {
return queryAppSettings.supportsImplicitLogging();
}
return false;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
}

View File

@@ -0,0 +1,240 @@
package com.facebook.appevents.ondeviceprocessing;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import androidx.annotation.RestrictTo;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEvent;
import com.facebook.appevents.internal.AppEventUtility;
import com.facebook.internal.FacebookSignatureValidator;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import com.facebook.ppml.receiver.IReceiverService;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes2.dex */
public final class RemoteServiceWrapper {
public static final String RECEIVER_SERVICE_ACTION = "ReceiverService";
public static final String RECEIVER_SERVICE_PACKAGE = "com.facebook.katana";
public static final String RECEIVER_SERVICE_PACKAGE_WAKIZASHI = "com.facebook.wakizashi";
private static Boolean isServiceAvailable;
public static final RemoteServiceWrapper INSTANCE = new RemoteServiceWrapper();
private static final String TAG = RemoteServiceWrapper.class.getSimpleName();
private RemoteServiceWrapper() {
}
public static final boolean isServiceAvailable() {
if (CrashShieldHandler.isObjectCrashing(RemoteServiceWrapper.class)) {
return false;
}
try {
if (isServiceAvailable == null) {
isServiceAvailable = Boolean.valueOf(INSTANCE.getVerifiedServiceIntent(FacebookSdk.getApplicationContext()) != null);
}
Boolean bool = isServiceAvailable;
if (bool == null) {
return false;
}
return bool.booleanValue();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, RemoteServiceWrapper.class);
return false;
}
}
public static final ServiceResult sendInstallEvent(String applicationId) {
if (CrashShieldHandler.isObjectCrashing(RemoteServiceWrapper.class)) {
return null;
}
try {
Intrinsics.checkNotNullParameter(applicationId, "applicationId");
return INSTANCE.sendEvents(EventType.MOBILE_APP_INSTALL, applicationId, CollectionsKt__CollectionsKt.emptyList());
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, RemoteServiceWrapper.class);
return null;
}
}
public static final ServiceResult sendCustomEvents(String applicationId, List<AppEvent> appEvents) {
if (CrashShieldHandler.isObjectCrashing(RemoteServiceWrapper.class)) {
return null;
}
try {
Intrinsics.checkNotNullParameter(applicationId, "applicationId");
Intrinsics.checkNotNullParameter(appEvents, "appEvents");
return INSTANCE.sendEvents(EventType.CUSTOM_APP_EVENTS, applicationId, appEvents);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, RemoteServiceWrapper.class);
return null;
}
}
private final ServiceResult sendEvents(EventType eventType, String str, List<AppEvent> list) {
ServiceResult serviceResult;
String str2;
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
ServiceResult serviceResult2 = ServiceResult.SERVICE_NOT_AVAILABLE;
AppEventUtility.assertIsNotMainThread();
Context applicationContext = FacebookSdk.getApplicationContext();
Intent verifiedServiceIntent = getVerifiedServiceIntent(applicationContext);
if (verifiedServiceIntent == null) {
return serviceResult2;
}
RemoteServiceConnection remoteServiceConnection = new RemoteServiceConnection();
try {
if (applicationContext.bindService(verifiedServiceIntent, remoteServiceConnection, 1)) {
try {
try {
IBinder binder = remoteServiceConnection.getBinder();
if (binder != null) {
IReceiverService asInterface = IReceiverService.Stub.asInterface(binder);
Bundle buildEventsBundle = RemoteServiceParametersHelper.buildEventsBundle(eventType, str, list);
if (buildEventsBundle != null) {
asInterface.sendEvents(buildEventsBundle);
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, Intrinsics.stringPlus("Successfully sent events to the remote service: ", buildEventsBundle));
}
serviceResult2 = ServiceResult.OPERATION_SUCCESS;
}
applicationContext.unbindService(remoteServiceConnection);
Utility utility2 = Utility.INSTANCE;
Utility.logd(TAG, "Unbound from the remote service");
return serviceResult2;
} catch (RemoteException e) {
serviceResult = ServiceResult.SERVICE_ERROR;
Utility utility3 = Utility.INSTANCE;
str2 = TAG;
Utility.logd(str2, e);
applicationContext.unbindService(remoteServiceConnection);
Utility.logd(str2, "Unbound from the remote service");
return serviceResult;
}
} catch (InterruptedException e2) {
serviceResult = ServiceResult.SERVICE_ERROR;
Utility utility4 = Utility.INSTANCE;
str2 = TAG;
Utility.logd(str2, e2);
applicationContext.unbindService(remoteServiceConnection);
Utility.logd(str2, "Unbound from the remote service");
return serviceResult;
}
}
return ServiceResult.SERVICE_ERROR;
} catch (Throwable th) {
applicationContext.unbindService(remoteServiceConnection);
Utility utility5 = Utility.INSTANCE;
Utility.logd(TAG, "Unbound from the remote service");
throw th;
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
return null;
}
}
private final Intent getVerifiedServiceIntent(Context context) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
PackageManager packageManager = context.getPackageManager();
if (packageManager != null) {
Intent intent = new Intent(RECEIVER_SERVICE_ACTION);
intent.setPackage("com.facebook.katana");
if (packageManager.resolveService(intent, 0) != null && FacebookSignatureValidator.validateSignature(context, "com.facebook.katana")) {
return intent;
}
Intent intent2 = new Intent(RECEIVER_SERVICE_ACTION);
intent2.setPackage("com.facebook.wakizashi");
if (packageManager.resolveService(intent2, 0) != null) {
if (FacebookSignatureValidator.validateSignature(context, "com.facebook.wakizashi")) {
return intent2;
}
}
}
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public enum ServiceResult {
OPERATION_SUCCESS,
SERVICE_NOT_AVAILABLE,
SERVICE_ERROR;
/* renamed from: values, reason: to resolve conflict with enum method */
public static ServiceResult[] valuesCustom() {
ServiceResult[] valuesCustom = values();
return (ServiceResult[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
public enum EventType {
MOBILE_APP_INSTALL("MOBILE_APP_INSTALL"),
CUSTOM_APP_EVENTS("CUSTOM_APP_EVENTS");
private final String eventType;
@Override // java.lang.Enum
public String toString() {
return this.eventType;
}
EventType(String str) {
this.eventType = str;
}
/* renamed from: values, reason: to resolve conflict with enum method */
public static EventType[] valuesCustom() {
EventType[] valuesCustom = values();
return (EventType[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
public static final class RemoteServiceConnection implements ServiceConnection {
private IBinder binder;
private final CountDownLatch latch = new CountDownLatch(1);
@Override // android.content.ServiceConnection
public void onServiceDisconnected(ComponentName name) {
Intrinsics.checkNotNullParameter(name, "name");
}
@Override // android.content.ServiceConnection
public void onServiceConnected(ComponentName name, IBinder serviceBinder) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(serviceBinder, "serviceBinder");
this.binder = serviceBinder;
this.latch.countDown();
}
@Override // android.content.ServiceConnection
public void onNullBinding(ComponentName name) {
Intrinsics.checkNotNullParameter(name, "name");
this.latch.countDown();
}
public final IBinder getBinder() throws InterruptedException {
this.latch.await(5L, TimeUnit.SECONDS);
return this.binder;
}
}
}