mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-25 09:07:25 +00:00
Revert to old behavior on old MagiskHide versions
This commit is contained in:
parent
8e9a7b25a1
commit
10f50e2401
@ -39,6 +39,7 @@ import java.util.Set;
|
|||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import java9.util.Comparators;
|
import java9.util.Comparators;
|
||||||
import java9.util.Objects;
|
import java9.util.Objects;
|
||||||
|
import java9.util.Sets;
|
||||||
import java9.util.stream.Collectors;
|
import java9.util.stream.Collectors;
|
||||||
import java9.util.stream.Stream;
|
import java9.util.stream.Stream;
|
||||||
import java9.util.stream.StreamSupport;
|
import java9.util.stream.StreamSupport;
|
||||||
@ -48,6 +49,7 @@ public class ApplicationAdapter extends SectionedAdapter
|
|||||||
|
|
||||||
private static final String SAFETYNET_PROCESS = "com.google.android.gms.unstable";
|
private static final String SAFETYNET_PROCESS = "com.google.android.gms.unstable";
|
||||||
private static final String GMS_PACKAGE = "com.google.android.gms";
|
private static final String GMS_PACKAGE = "com.google.android.gms";
|
||||||
|
private static boolean old_hide = false;
|
||||||
|
|
||||||
/* A list of apps that should not be shown as hide-able */
|
/* A list of apps that should not be shown as hide-able */
|
||||||
private static final List<String> HIDE_BLACKLIST = Arrays.asList(
|
private static final List<String> HIDE_BLACKLIST = Arrays.asList(
|
||||||
@ -243,6 +245,9 @@ public class ApplicationAdapter extends SectionedAdapter
|
|||||||
fullList = StreamSupport.stream(pm.getInstalledApplications(0))
|
fullList = StreamSupport.stream(pm.getInstalledApplications(0))
|
||||||
.filter(info -> !HIDE_BLACKLIST.contains(info.packageName) && info.enabled)
|
.filter(info -> !HIDE_BLACKLIST.contains(info.packageName) && info.enabled)
|
||||||
.map(info -> {
|
.map(info -> {
|
||||||
|
if (old_hide) {
|
||||||
|
return new HideAppInfo(info, Sets.of(info.packageName));
|
||||||
|
} else {
|
||||||
Set<String> set = new ArraySet<>();
|
Set<String> set = new ArraySet<>();
|
||||||
PackageInfo pkg = getPackageInfo(info.packageName);
|
PackageInfo pkg = getPackageInfo(info.packageName);
|
||||||
if (pkg != null) {
|
if (pkg != null) {
|
||||||
@ -254,6 +259,7 @@ public class ApplicationAdapter extends SectionedAdapter
|
|||||||
if (set.isEmpty())
|
if (set.isEmpty())
|
||||||
return null;
|
return null;
|
||||||
return new HideAppInfo(info, set);
|
return new HideAppInfo(info, set);
|
||||||
|
}
|
||||||
}).filter(Objects::nonNull).sorted()
|
}).filter(Objects::nonNull).sorted()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
@ -368,13 +374,14 @@ public class ApplicationAdapter extends SectionedAdapter
|
|||||||
String process;
|
String process;
|
||||||
|
|
||||||
HideTarget(String line) {
|
HideTarget(String line) {
|
||||||
String[] split = line.split("\\|");
|
String[] split = line.split("\\|", 2);
|
||||||
pkg = split[0];
|
pkg = split[0];
|
||||||
if (split.length >= 2) {
|
if (split.length == 2) {
|
||||||
process = split[1];
|
process = split[1];
|
||||||
} else {
|
} else {
|
||||||
// Backwards compatibility
|
// Backwards compatibility
|
||||||
process = pkg.equals(GMS_PACKAGE) ? SAFETYNET_PROCESS : pkg;
|
old_hide = true;
|
||||||
|
process = pkg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user