Files
rr3-apk/decompiled/sources/com/facebook/internal/CustomTabUtils.java
Daniel Elliott f9d20bb3fc 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>
2026-02-18 14:52:23 -08:00

74 lines
3.2 KiB
Java

package com.facebook.internal;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import androidx.browser.customtabs.CustomTabsService;
import com.facebook.FacebookSdk;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class CustomTabUtils {
public static final CustomTabUtils INSTANCE = new CustomTabUtils();
private static final String[] CHROME_PACKAGES = {"com.android.chrome", "com.chrome.beta", "com.chrome.dev"};
private CustomTabUtils() {
}
public static final String getDefaultRedirectURI() {
if (CrashShieldHandler.isObjectCrashing(CustomTabUtils.class)) {
return null;
}
try {
return Intrinsics.stringPlus(Validate.CUSTOM_TAB_REDIRECT_URI_PREFIX, FacebookSdk.getApplicationContext().getPackageName());
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, CustomTabUtils.class);
return null;
}
}
public static final String getValidRedirectURI(String developerDefinedRedirectURI) {
if (CrashShieldHandler.isObjectCrashing(CustomTabUtils.class)) {
return null;
}
try {
Intrinsics.checkNotNullParameter(developerDefinedRedirectURI, "developerDefinedRedirectURI");
Validate validate = Validate.INSTANCE;
return Validate.hasCustomTabRedirectActivity(FacebookSdk.getApplicationContext(), developerDefinedRedirectURI) ? developerDefinedRedirectURI : Validate.hasCustomTabRedirectActivity(FacebookSdk.getApplicationContext(), getDefaultRedirectURI()) ? getDefaultRedirectURI() : "";
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, CustomTabUtils.class);
return null;
}
}
public static final String getChromePackage() {
HashSet hashSet;
if (CrashShieldHandler.isObjectCrashing(CustomTabUtils.class)) {
return null;
}
try {
Context applicationContext = FacebookSdk.getApplicationContext();
List<ResolveInfo> queryIntentServices = applicationContext.getPackageManager().queryIntentServices(new Intent(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION), 0);
Intrinsics.checkNotNullExpressionValue(queryIntentServices, "context.packageManager.queryIntentServices(serviceIntent, 0)");
hashSet = ArraysKt___ArraysKt.toHashSet(CHROME_PACKAGES);
Iterator<ResolveInfo> it = queryIntentServices.iterator();
while (it.hasNext()) {
ServiceInfo serviceInfo = it.next().serviceInfo;
if (serviceInfo != null && hashSet.contains(serviceInfo.packageName)) {
return serviceInfo.packageName;
}
}
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, CustomTabUtils.class);
return null;
}
}
}