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