Add block scope request to configManager
This commit is contained in:
parent
5c499e6c02
commit
73a98d6b9d
|
|
@ -174,6 +174,8 @@ public class ConfigManager {
|
||||||
// packageName, userId, group, key, value
|
// packageName, userId, group, key, value
|
||||||
private final Map<Pair<String, Integer>, Map<String, HashMap<String, Object>>> cachedConfig = new ConcurrentHashMap<>();
|
private final Map<Pair<String, Integer>, Map<String, HashMap<String, Object>>> cachedConfig = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
private Set<String> scopeRequestBlocked = new HashSet<>();
|
||||||
|
|
||||||
private void updateCaches(boolean sync) {
|
private void updateCaches(boolean sync) {
|
||||||
synchronized (cacheHandler) {
|
synchronized (cacheHandler) {
|
||||||
requestScopeCacheTime = requestModuleCacheTime = SystemClock.elapsedRealtime();
|
requestScopeCacheTime = requestModuleCacheTime = SystemClock.elapsedRealtime();
|
||||||
|
|
@ -272,6 +274,8 @@ public class ConfigManager {
|
||||||
bool = config.get("enable_status_notification");
|
bool = config.get("enable_status_notification");
|
||||||
enableStatusNotification = bool == null || (boolean) bool;
|
enableStatusNotification = bool == null || (boolean) bool;
|
||||||
|
|
||||||
|
scopeRequestBlocked = (HashSet<String>) config.get("scope_request_blocked");
|
||||||
|
|
||||||
// Don't migrate to ConfigFileManager, as XSharedPreferences will be restored soon
|
// Don't migrate to ConfigFileManager, as XSharedPreferences will be restored soon
|
||||||
String string = (String) config.get("misc_path");
|
String string = (String) config.get("misc_path");
|
||||||
if (string == null) {
|
if (string == null) {
|
||||||
|
|
@ -998,6 +1002,24 @@ public class ConfigManager {
|
||||||
updateModulePrefs("lspd", 0, "config", "enable_dex_obfuscate", on);
|
updateModulePrefs("lspd", 0, "config", "enable_dex_obfuscate", on);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean scopeRequestBlocked(String packageName) {
|
||||||
|
return scopeRequestBlocked.contains(packageName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void blockScopeRequest(String packageName) {
|
||||||
|
var set = new HashSet<>(scopeRequestBlocked);
|
||||||
|
set.add(packageName);
|
||||||
|
updateModulePrefs("lspd", 0, "config", "scope_request_blocked", set);
|
||||||
|
scopeRequestBlocked = set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeBlockedScopeRequest(String packageName) {
|
||||||
|
var set = new HashSet<>(scopeRequestBlocked);
|
||||||
|
set.remove(packageName);
|
||||||
|
updateModulePrefs("lspd", 0, "config", "scope_request_blocked", set);
|
||||||
|
scopeRequestBlocked = set;
|
||||||
|
}
|
||||||
|
|
||||||
// this is for manager and should not use the cache result
|
// this is for manager and should not use the cache result
|
||||||
boolean dexObfuscate() {
|
boolean dexObfuscate() {
|
||||||
Map<String, Object> config = getModulePrefs("lspd", 0, "config");
|
Map<String, Object> config = getModulePrefs("lspd", 0, "config");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue