mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-22 12:51:32 +00:00
Remove unused hasGMS variable
This commit is contained in:
parent
12a0870bc9
commit
8e73536e02
@ -47,7 +47,6 @@ object Info {
|
|||||||
private set
|
private set
|
||||||
private var crypto = ""
|
private var crypto = ""
|
||||||
|
|
||||||
var hasGMS = true
|
|
||||||
val isEmulator =
|
val isEmulator =
|
||||||
Build.DEVICE.contains("vsoc")
|
Build.DEVICE.contains("vsoc")
|
||||||
|| getProperty("ro.kernel.qemu", "0") == "1"
|
|| getProperty("ro.kernel.qemu", "0") == "1"
|
||||||
|
@ -5,7 +5,6 @@ import com.squareup.moshi.Moshi
|
|||||||
import com.topjohnwu.magisk.ProviderInstaller
|
import com.topjohnwu.magisk.ProviderInstaller
|
||||||
import com.topjohnwu.magisk.core.BuildConfig
|
import com.topjohnwu.magisk.core.BuildConfig
|
||||||
import com.topjohnwu.magisk.core.Config
|
import com.topjohnwu.magisk.core.Config
|
||||||
import com.topjohnwu.magisk.core.Info
|
|
||||||
import com.topjohnwu.magisk.core.utils.LocaleSetting
|
import com.topjohnwu.magisk.core.utils.LocaleSetting
|
||||||
import okhttp3.Cache
|
import okhttp3.Cache
|
||||||
import okhttp3.ConnectionSpec
|
import okhttp3.ConnectionSpec
|
||||||
@ -72,9 +71,7 @@ fun createOkHttpClient(context: Context): OkHttpClient {
|
|||||||
chain.proceed(request.build())
|
chain.proceed(request.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ProviderInstaller.install(context)) {
|
ProviderInstaller.install(context)
|
||||||
Info.hasGMS = false
|
|
||||||
}
|
|
||||||
|
|
||||||
return builder.build()
|
return builder.build()
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,12 @@ public class ProviderInstaller {
|
|||||||
|
|
||||||
private static final String GMS_PACKAGE_NAME = "com.google.android.gms";
|
private static final String GMS_PACKAGE_NAME = "com.google.android.gms";
|
||||||
|
|
||||||
public static boolean install(Context context) {
|
public static void install(Context context) {
|
||||||
try {
|
try {
|
||||||
// Check if gms is a system app
|
// Check if gms is a system app
|
||||||
ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(GMS_PACKAGE_NAME, 0);
|
ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(GMS_PACKAGE_NAME, 0);
|
||||||
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
|
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try installing new SSL provider from Google Play Service
|
// Try installing new SSL provider from Google Play Service
|
||||||
@ -22,9 +22,7 @@ public class ProviderInstaller {
|
|||||||
.loadClass("com.google.android.gms.common.security.ProviderInstallerImpl")
|
.loadClass("com.google.android.gms.common.security.ProviderInstallerImpl")
|
||||||
.getMethod("insertProvider", Context.class)
|
.getMethod("insertProvider", Context.class)
|
||||||
.invoke(null, gms);
|
.invoke(null, gms);
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user