Remove force add modules
This commit is contained in:
parent
272e69ad70
commit
c312f93a2e
|
|
@ -26,7 +26,6 @@ import java.util.Comparator;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import io.github.lsposed.manager.App;
|
||||
import io.github.lsposed.manager.Constants;
|
||||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.util.CompileUtil;
|
||||
|
|
@ -38,8 +37,6 @@ public class AppHelper {
|
|||
private static final String BASE_PATH = Constants.getBaseDir();
|
||||
private static final String SCOPE_LIST_PATH = "conf/%s.conf";
|
||||
|
||||
public static List<String> forceWhiteList = new ArrayList<>();
|
||||
|
||||
private static final HashMap<String, List<String>> scopeList = new HashMap<>();
|
||||
|
||||
public static void showMenu(@NonNull Context context,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import io.github.lsposed.manager.Constants;
|
|||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.databinding.ActivitySettingsBinding;
|
||||
import io.github.lsposed.manager.ui.widget.IntegerListPreference;
|
||||
import io.github.lsposed.manager.util.ModuleUtil;
|
||||
|
||||
public class SettingsActivity extends BaseActivity {
|
||||
private static final String KEY_PREFIX = SettingsActivity.class.getName() + '.';
|
||||
|
|
@ -110,14 +109,6 @@ public class SettingsActivity extends BaseActivity {
|
|||
public void onCreatePreferencesFix(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.prefs);
|
||||
|
||||
SwitchPreferenceCompat prefHookModules = findPreference("hook_modules");
|
||||
if (prefHookModules != null) {
|
||||
prefHookModules.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
ModuleUtil.getInstance().reloadInstalledModules((Boolean) newValue);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
SwitchPreferenceCompat prefVerboseLogs = findPreference("disable_verbose_log");
|
||||
if (prefVerboseLogs != null) {
|
||||
prefVerboseLogs.setChecked(Files.exists(disableVerboseLogsFlag));
|
||||
|
|
|
|||
|
|
@ -14,11 +14,6 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import io.github.lsposed.manager.App;
|
||||
import io.github.lsposed.manager.Constants;
|
||||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.adapters.AppHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -28,6 +23,11 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import io.github.lsposed.manager.App;
|
||||
import io.github.lsposed.manager.Constants;
|
||||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.adapters.AppHelper;
|
||||
|
||||
public final class ModuleUtil {
|
||||
// xposedminversion below this
|
||||
public static int MIN_MODULE_VERSION = 2; // reject modules with
|
||||
|
|
@ -68,11 +68,6 @@ public final class ModuleUtil {
|
|||
}
|
||||
|
||||
public void reloadInstalledModules() {
|
||||
reloadInstalledModules(prefs.getBoolean("hook_modules", true));
|
||||
}
|
||||
|
||||
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
|
||||
public void reloadInstalledModules(boolean hookModules) {
|
||||
synchronized (this) {
|
||||
if (isReloading)
|
||||
return;
|
||||
|
|
@ -80,7 +75,6 @@ public final class ModuleUtil {
|
|||
}
|
||||
|
||||
Map<String, InstalledModule> modules = new HashMap<>();
|
||||
AppHelper.forceWhiteList.clear();
|
||||
for (PackageInfo pkg : pm.getInstalledPackages(PackageManager.GET_META_DATA)) {
|
||||
ApplicationInfo app = pkg.applicationInfo;
|
||||
if (!app.enabled)
|
||||
|
|
@ -89,7 +83,6 @@ public final class ModuleUtil {
|
|||
if (app.metaData != null && app.metaData.containsKey("xposedmodule")) {
|
||||
InstalledModule installed = new InstalledModule(pkg, false);
|
||||
modules.put(pkg.packageName, installed);
|
||||
if (hookModules) AppHelper.forceWhiteList.add(pkg.packageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,4 +162,6 @@
|
|||
<string name="menu_sort">Sorting…</string>
|
||||
<string name="enable_module">Enable module</string>
|
||||
<string name="no_scope_selected">You did not select any app. Continue?</string>
|
||||
<string name="menu_show_games">Games</string>
|
||||
<string name="menu_show_modules">Modules</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -11,13 +11,6 @@
|
|||
android:summary="@string/skip_xposedminversion_check_summ"
|
||||
android:title="@string/skip_xposedminversion_check"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="hook_modules"
|
||||
android:summary="@string/hook_modules_summary"
|
||||
android:title="@string/hook_modules"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/settings_group_theme"
|
||||
|
|
|
|||
Loading…
Reference in New Issue