discord-jadx/app/src/main/java/c/i/a/f/e/c.java

212 lines
9.7 KiB
Java

package c.i.a.f.e;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.RecentlyNonNull;
import androidx.annotation.RecentlyNullable;
import c.d.b.a.a;
import c.i.a.f.e.k.h0;
import c.i.a.f.e.k.q0;
import c.i.a.f.e.p.b;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.google.android.gms.common.R;
import java.util.Objects;
/* compiled from: com.google.android.gms:play-services-basement@@17.4.0 */
public class c {
@RecentlyNonNull
public static final int a = 12451000;
public static final c b = new c();
static {
boolean z2 = e.a;
}
@RecentlyNullable
public Intent a(@Nullable Context context, @RecentlyNonNull int i, @Nullable String str) {
if (i == 1 || i == 2) {
if (context == null || !c.i.a.f.e.o.c.V(context)) {
StringBuilder L = a.L("gcore_");
L.append(a);
L.append("-");
if (!TextUtils.isEmpty(str)) {
L.append(str);
}
L.append("-");
if (context != null) {
L.append(context.getPackageName());
}
L.append("-");
if (context != null) {
try {
L.append(b.a(context).b(context.getPackageName(), 0).versionCode);
} catch (PackageManager.NameNotFoundException unused) {
}
}
String sb = L.toString();
int i2 = h0.a;
Intent intent = new Intent("android.intent.action.VIEW");
Uri.Builder appendQueryParameter = Uri.parse("market://details").buildUpon().appendQueryParameter("id", "com.google.android.gms");
if (!TextUtils.isEmpty(sb)) {
appendQueryParameter.appendQueryParameter("pcampaignid", sb);
}
intent.setData(appendQueryParameter.build());
intent.setPackage("com.android.vending");
intent.addFlags(524288);
return intent;
}
int i3 = h0.a;
Intent intent2 = new Intent("com.google.android.clockwork.home.UPDATE_ANDROID_WEAR_ACTION");
intent2.setPackage("com.google.android.wearable.app");
return intent2;
} else if (i != 3) {
return null;
} else {
int i4 = h0.a;
Uri fromParts = Uri.fromParts("package", "com.google.android.gms", null);
Intent intent3 = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
intent3.setData(fromParts);
return intent3;
}
}
/* JADX WARNING: Removed duplicated region for block: B:33:0x009d */
/* JADX WARNING: Removed duplicated region for block: B:34:0x009f */
/* JADX WARNING: Removed duplicated region for block: B:37:0x00ae */
/* JADX WARNING: Removed duplicated region for block: B:47:0x00d4 */
/* JADX WARNING: Removed duplicated region for block: B:48:0x00e2 */
/* JADX WARNING: Removed duplicated region for block: B:78:0x017f */
/* JADX WARNING: Removed duplicated region for block: B:82:0x0189 A[ORIG_RETURN, RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:83:? A[RETURN, SYNTHETIC] */
@RecentlyNonNull
public int b(@RecentlyNonNull Context context, @RecentlyNonNull int i) {
boolean z2;
String packageName;
int i2;
PackageInfo packageInfo;
boolean z3 = e.a;
try {
context.getResources().getString(R.a.common_google_play_services_unknown_issue);
} catch (Throwable unused) {
Log.e("GooglePlayServicesUtil", "The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.");
}
if (!"com.google.android.gms".equals(context.getPackageName()) && !e.d.get()) {
q0.a(context);
int i3 = q0.d;
if (i3 == 0) {
throw new IllegalStateException("A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />");
} else if (i3 != 12451000) {
StringBuilder sb = new StringBuilder(320);
sb.append("The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected ");
sb.append(12451000);
sb.append(" but found ");
sb.append(i3);
sb.append(". You must have the following declaration within the <application> element: <meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />");
throw new IllegalStateException(sb.toString());
}
}
boolean z4 = true;
if (!c.i.a.f.e.o.c.V(context)) {
if (c.i.a.f.e.o.c.f1062c == null) {
c.i.a.f.e.o.c.f1062c = Boolean.valueOf(context.getPackageManager().hasSystemFeature("android.hardware.type.iot") || context.getPackageManager().hasSystemFeature("android.hardware.type.embedded"));
}
if (!c.i.a.f.e.o.c.f1062c.booleanValue()) {
z2 = true;
AnimatableValueParser.m(i < 0);
packageName = context.getPackageName();
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo2 = null;
if (z2) {
try {
packageInfo2 = packageManager.getPackageInfo("com.android.vending", 8256);
} catch (PackageManager.NameNotFoundException unused2) {
Log.w("GooglePlayServicesUtil", String.valueOf(packageName).concat(" requires the Google Play Store, but it is missing."));
}
}
packageInfo = packageManager.getPackageInfo("com.google.android.gms", 64);
f.a(context);
if (f.d(packageInfo, true)) {
Log.w("GooglePlayServicesUtil", String.valueOf(packageName).concat(" requires Google Play services, but their signature is invalid."));
} else {
if (z2) {
Objects.requireNonNull(packageInfo2, "null reference");
if (!f.d(packageInfo2, true) || !packageInfo2.signatures[0].equals(packageInfo.signatures[0])) {
Log.w("GooglePlayServicesUtil", String.valueOf(packageName).concat(" requires Google Play Store, but its signature is invalid."));
}
}
int i4 = packageInfo.versionCode;
int i5 = -1;
int i6 = i4 == -1 ? -1 : i4 / 1000;
if (i != -1) {
i5 = i / 1000;
}
if (i6 < i5) {
StringBuilder sb2 = new StringBuilder(String.valueOf(packageName).length() + 82);
sb2.append("Google Play services out of date for ");
sb2.append(packageName);
sb2.append(". Requires ");
sb2.append(i);
sb2.append(" but found ");
sb2.append(i4);
Log.w("GooglePlayServicesUtil", sb2.toString());
i2 = 2;
} else {
ApplicationInfo applicationInfo = packageInfo.applicationInfo;
if (applicationInfo == null) {
try {
applicationInfo = packageManager.getApplicationInfo("com.google.android.gms", 0);
} catch (PackageManager.NameNotFoundException e) {
Log.wtf("GooglePlayServicesUtil", String.valueOf(packageName).concat(" requires Google Play services, but they're missing when getting application info."), e);
}
}
i2 = !applicationInfo.enabled ? 3 : 0;
}
if (i2 != 18) {
z4 = i2 == 1 ? e.b(context, "com.google.android.gms") : false;
}
if (!z4) {
return 18;
}
return i2;
}
i2 = 9;
if (i2 != 18) {
}
if (!z4) {
}
}
}
z2 = false;
AnimatableValueParser.m(i < 0);
packageName = context.getPackageName();
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo2 = null;
if (z2) {
}
try {
packageInfo = packageManager.getPackageInfo("com.google.android.gms", 64);
f.a(context);
if (f.d(packageInfo, true)) {
}
i2 = 9;
} catch (PackageManager.NameNotFoundException unused3) {
Log.w("GooglePlayServicesUtil", String.valueOf(packageName).concat(" requires Google Play services, but they are missing."));
i2 = 1;
if (i2 != 18) {
}
if (!z4) {
}
}
if (i2 != 18) {
}
if (!z4) {
}
}
}