package X; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; import android.util.Pair; import com.bytedance.covode.number.Covode; import com.facebook.m; import java.util.Collection; import java.util.List; /* renamed from: X.EhG reason: case insensitive filesystem */ public final class C37077EhG { public static final String LIZ = C37077EhG.class.getName(); static { Covode.recordClassIndex(35353); } public static List LIZ(PackageManager packageManager, Intent intent) { Pair<Boolean, Object> LIZ2 = AnonymousClass0UU.LIZ(packageManager, new Object[]{intent, 64}, 101311, "java.util.List", false, null); if (((Boolean) LIZ2.first).booleanValue()) { return (List) LIZ2.second; } List<ResolveInfo> queryIntentActivities = packageManager.queryIntentActivities(intent, 64); AnonymousClass0UU.LIZ(queryIntentActivities, packageManager, new Object[]{intent, 64}, 101311, "com_facebook_internal_Validate_android_content_pm_PackageManager_queryIntentActivities(Landroid/content/pm/PackageManager;Landroid/content/Intent;I)Ljava/util/List;"); return queryIntentActivities; } public static void LIZ() { if (!m.LIZ()) { throw new C37001Eg2("The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first."); } } public static void LIZ(Context context, boolean z) { LIZ((Object) context, "context"); if (context.checkCallingOrSelfPermission("android.permission.INTERNET") == -1 && z) { throw new IllegalStateException("No internet permissions granted for the app, please add <uses-permission android:name=\"android.permission.INTERNET\" /> to your AndroidManifest.xml."); } } public static void LIZ(Object obj, String str) { if (obj == null) { throw new NullPointerException("Argument '" + str + "' cannot be null"); } } public static void LIZ(String str, String str2) { if (C37072EhB.LIZ(str)) { throw new IllegalArgumentException("Argument '" + str2 + "' cannot be null or empty"); } } public static <T> void LIZ(Collection<T> collection, String str) { LIZJ(collection, str); LIZIZ(collection, str); } public static boolean LIZ(Context context, String str) { List<ResolveInfo> list; LIZ((Object) context, "context"); PackageManager packageManager = context.getPackageManager(); if (packageManager != null) { Intent intent = new Intent(); intent.setAction("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addCategory("android.intent.category.BROWSABLE"); intent.setData(Uri.parse(str)); list = LIZ(packageManager, intent); } else { list = null; } if (list == null) { return false; } boolean z = false; for (ResolveInfo resolveInfo : list) { ActivityInfo activityInfo = resolveInfo.activityInfo; if (!activityInfo.name.equals("com.facebook.CustomTabActivity") || !activityInfo.packageName.equals(context.getPackageName())) { return false; } z = true; } return z; } public static String LIZIZ() { LIZ(); String str = m.LIZ; if (str != null) { return str; } throw new IllegalStateException("No App ID found, please set the App ID."); } public static void LIZIZ(Context context, boolean z) { if (!z) { try { LIZJ(context, z); } catch (Exception unused) { } } else { LIZJ(context, z); } } public static <T> void LIZIZ(Collection<T> collection, String str) { if (collection.isEmpty()) { throw new IllegalArgumentException("Container '" + str + "' cannot be empty"); } } public static String LIZJ() { LIZ(); String str = m.LIZJ; if (str != null) { return str; } throw new IllegalStateException("No Client Token found, please set the Client Token."); } public static void LIZJ(Context context, boolean z) { LIZ((Object) context, "context"); PackageManager packageManager = context.getPackageManager(); if (packageManager != null) { try { if (packageManager.getActivityInfo(new ComponentName(context, "com.facebook.FacebookActivity"), 1) != null) { return; } } catch (PackageManager.NameNotFoundException unused) { } } if (z) { throw new IllegalStateException("FacebookActivity is not declared in the AndroidManifest.xml. If you are using the facebook-common module or dependent modules please add com.facebook.FacebookActivity to your AndroidManifest.xml file. See https://developers.facebook.com/docs/android/getting-started for more info."); } } public static <T> void LIZJ(Collection<T> collection, String str) { LIZ((Object) collection, str); for (T t : collection) { if (t == null) { throw new NullPointerException("Container '" + str + "' cannot contain null values"); } } } }