Skip to content

Commit 8e73536

Browse files
aviraxptopjohnwu
authored andcommitted
Remove unused hasGMS variable
1 parent 12a0870 commit 8e73536

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

app/core/src/main/java/com/topjohnwu/magisk/core/Info.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ object Info {
4747
private set
4848
private var crypto = ""
4949

50-
var hasGMS = true
5150
val isEmulator =
5251
Build.DEVICE.contains("vsoc")
5352
|| getProperty("ro.kernel.qemu", "0") == "1"

app/core/src/main/java/com/topjohnwu/magisk/core/di/Networking.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import com.squareup.moshi.Moshi
55
import com.topjohnwu.magisk.ProviderInstaller
66
import com.topjohnwu.magisk.core.BuildConfig
77
import com.topjohnwu.magisk.core.Config
8-
import com.topjohnwu.magisk.core.Info
98
import com.topjohnwu.magisk.core.utils.LocaleSetting
109
import okhttp3.Cache
1110
import okhttp3.ConnectionSpec
@@ -72,9 +71,7 @@ fun createOkHttpClient(context: Context): OkHttpClient {
7271
chain.proceed(request.build())
7372
}
7473

75-
if (!ProviderInstaller.install(context)) {
76-
Info.hasGMS = false
77-
}
74+
ProviderInstaller.install(context)
7875

7976
return builder.build()
8077
}

app/shared/src/main/java/com/topjohnwu/magisk/ProviderInstaller.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ public class ProviderInstaller {
77

88
private static final String GMS_PACKAGE_NAME = "com.google.android.gms";
99

10-
public static boolean install(Context context) {
10+
public static void install(Context context) {
1111
try {
1212
// Check if gms is a system app
1313
ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(GMS_PACKAGE_NAME, 0);
1414
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
15-
return false;
15+
return;
1616
}
1717

1818
// Try installing new SSL provider from Google Play Service
@@ -22,9 +22,7 @@ public static boolean install(Context context) {
2222
.loadClass("com.google.android.gms.common.security.ProviderInstallerImpl")
2323
.getMethod("insertProvider", Context.class)
2424
.invoke(null, gms);
25-
} catch (Exception e) {
26-
return false;
25+
} catch (Exception ignored) {
2726
}
28-
return true;
2927
}
3028
}

0 commit comments

Comments
 (0)