diff --git a/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java index e6f6baa3..4e0ed9f1 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/SettingsActivity.java @@ -27,6 +27,8 @@ import com.afollestad.materialdialogs.folderselector.FolderChooserDialog; import com.topjohnwu.superuser.Shell; +import org.meowcat.edxposed.manager.adapter.AppHelper; +import org.meowcat.edxposed.manager.adapter.ApplicationListAdapter; import org.meowcat.edxposed.manager.util.RepoLoader; import org.meowcat.edxposed.manager.util.ThemeUtil; import org.meowcat.edxposed.manager.widget.IconListPreference; @@ -207,6 +209,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { prefWhiteListMode.setOnPreferenceChangeListener((preference, newValue) -> { boolean enabled = (Boolean) newValue; if (enabled) { + new ApplicationListAdapter(getContext(), AppHelper.isWhiteListMode()).generateCheckedList(); FileOutputStream fos = null; try { fos = new FileOutputStream(mWhiteListModeFlag.getPath()); @@ -300,6 +303,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { prefBlackWhiteListMode.setOnPreferenceChangeListener((preference, newValue) -> { boolean enabled = (Boolean) newValue; if (enabled) { + new ApplicationListAdapter(getContext(), AppHelper.isWhiteListMode()).generateCheckedList(); FileOutputStream fos = null; try { fos = new FileOutputStream(mBlackWhiteListModeFlag.getPath()); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/WelcomeActivity.java b/app/src/main/java/org/meowcat/edxposed/manager/WelcomeActivity.java index 21d67c34..29eae617 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/WelcomeActivity.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/WelcomeActivity.java @@ -23,6 +23,8 @@ import com.google.android.material.navigation.NavigationView; import com.google.android.material.snackbar.Snackbar; +import org.meowcat.edxposed.manager.adapter.AppHelper; +import org.meowcat.edxposed.manager.adapter.ApplicationListAdapter; import org.meowcat.edxposed.manager.util.ModuleUtil; import org.meowcat.edxposed.manager.util.ModuleUtil.InstalledModule; import org.meowcat.edxposed.manager.util.ModuleUtil.ModuleListener; @@ -49,6 +51,7 @@ public class WelcomeActivity extends XposedBaseActivity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ThemeUtil.setTheme(this); + new ApplicationListAdapter(getApplicationContext(), AppHelper.isWhiteListMode()).generateCheckedList(); setContentView(R.layout.activity_welcome); mDrawerLayout = findViewById(R.id.drawer_layout); diff --git a/app/src/main/java/org/meowcat/edxposed/manager/adapter/ApplicationListAdapter.java b/app/src/main/java/org/meowcat/edxposed/manager/adapter/ApplicationListAdapter.java index 53bfe736..fa06bd7f 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/adapter/ApplicationListAdapter.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/adapter/ApplicationListAdapter.java @@ -2,10 +2,12 @@ import android.content.Context; import android.content.pm.ApplicationInfo; +import android.util.Log; import android.widget.CompoundButton; import com.google.android.material.snackbar.Snackbar; +import org.meowcat.edxposed.manager.MeowCatApplication; import org.meowcat.edxposed.manager.R; import org.meowcat.edxposed.manager.XposedApp; import org.meowcat.edxposed.manager.util.ModuleUtil; @@ -30,12 +32,13 @@ public ApplicationListAdapter(Context context, boolean isWhiteListMode) { // } @Override - protected List generateCheckedList() { + public List generateCheckedList() { if (XposedApp.getPreferences().getBoolean("hook_modules", true)) { Collection installedModules = ModuleUtil.getInstance().getModules().values(); for (ModuleUtil.InstalledModule info : installedModules) { FORCE_WHITE_LIST_MODULE.add(info.packageName); } + Log.d(MeowCatApplication.TAG, "ApplicationList -> generateCheckedList: Force add modules to list"); } AppHelper.makeSurePath(); if (isWhiteListMode) { @@ -43,6 +46,7 @@ protected List generateCheckedList() { } else { checkedList = AppHelper.getBlackList(); } + Log.d(MeowCatApplication.TAG, "ApplicationList -> generateCheckedList: generate done"); return checkedList; }