36 lines
1.2 KiB
Java
36 lines
1.2 KiB
Java
package com.google.android.gms.common.util;
|
|
|
|
import android.content.Context;
|
|
import android.content.pm.ApplicationInfo;
|
|
import android.content.pm.PackageInfo;
|
|
import android.content.pm.PackageManager;
|
|
import android.os.Bundle;
|
|
import com.google.android.gms.common.wrappers.Wrappers;
|
|
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ClientLibraryUtils {
|
|
public static int a(Context context, String str) {
|
|
ApplicationInfo applicationInfo;
|
|
Bundle bundle;
|
|
PackageInfo b = b(context, str);
|
|
if (b == null || (applicationInfo = b.applicationInfo) == null || (bundle = applicationInfo.metaData) == null) {
|
|
return -1;
|
|
}
|
|
return bundle.getInt("com.google.android.gms.version", -1);
|
|
}
|
|
|
|
private static PackageInfo b(Context context, String str) {
|
|
try {
|
|
return Wrappers.a(context).b(str, PeripheralType.SERVO);
|
|
} catch (PackageManager.NameNotFoundException unused) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static boolean c(Context context, String str) {
|
|
"com.google.android.gms".equals(str);
|
|
return (Wrappers.a(context).a(str, 0).flags & 2097152) != 0;
|
|
}
|
|
}
|