Repository navigation
manager: code cleanup and bug fixes - #3552
Merged
Merged
Conversation
- Remove unused imports and dead code - Use mutableIntStateOf for integer state holders - Place Modifier parameter first in composable signatures - Prefer Duration-typed delay/debounce/timeout overloads - Replace .equals() with == for string comparison - Add missing @RequiresApi and @SuppressLint annotations - Add SDK version guard for RuntimeShader usage Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Replace raw Int encoding (sortType * 2 + reverseFlag) with AppSortType enum and AppSortConfig data class. This centralizes encode/decode logic into fromInt()/toInt(), eliminating duplicated arithmetic across the ViewModel and both UI theme files. - Rename filterAndSort() to filterApps(), removing its redundant sort that was always overridden by sortGroups() after UID grouping - Unify label sorting to use Collator instead of String.lowercase() - Remove shouldUmount from groupRank() as it is unrelated to permission priority - SharedPreferences format unchanged, existing preferences preserved Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
u9521
marked this pull request as draft
July 2, 2026 08:12
u9521
marked this pull request as ready for review
July 2, 2026 08:24
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on Android Manager cleanup and small behavior fixes, primarily by centralizing settings access through SettingsRepositoryImpl, improving sorting/locale handling, and addressing a few UI/state and lint-related issues.
Changes:
- Centralize multiple Manager preference reads/writes into
SettingsRepository/SettingsRepositoryImpl, updating ViewModels and theming to consume the repository. - Improve UI behavior and state persistence (e.g., SearchBar snackbar placement; persist pending module-install dialog state via
rememberSaveable). - Refine sorting/collation logic (use
Collator) and modernize time APIs (switch variousdelay/debounce/withTimeoutOrNullcalls toDuration).
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| manager/build.gradle.kts | Refactors shared Gradle extra properties to map-style extra[...] assignments. |
| manager/app/build.gradle.kts | Updates consumers to read typed values from rootProject.extra[...]. |
| manager/app/src/main/res/xml/filepaths.xml | Removes FileProvider <root-path> exposure (keeps cache-path). |
| manager/app/src/main/java/me/weishu/kernelsu/ui/webui/WebUIActivity.kt | Switches UI mode/theme reads to SettingsRepositoryImpl + updated ThemeController API. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/SuperUserViewModel.kt | Introduces sort config types, centralizes prefs into settings repo, refines collation. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/SulogViewModel.kt | Persists Sulog filters via SettingsRepository instead of raw prefs. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/SearchViewModelHelper.kt | Uses Duration.milliseconds for debounce. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/ModuleViewModel.kt | Moves module list prefs to SettingsRepository; uses Duration timeout. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/ModuleRepoViewModel.kt | Moves repo sort order persistence into SettingsRepository. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/MainActivityViewModel.kt | Updates theming settings access; adjusts lifecycle cleanup in onCleared(). |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/HomeViewModel.kt | Reads update-check preference via SettingsRepository. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/util/SELinuxChecker.kt | Removes unused permissive-check helper in favor of raw status API. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/util/module/ModuleRepoApi.kt | Simplifies JSON numeric parsing for downloadCount. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/util/LogEvent.kt | Refactors long shell command string formatting for kallsyms capture. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/theme/Theme.kt | Makes theming read from SettingsRepository; adjusts KernelSUTheme signature/defaults. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/superuser/SuperUserUiState.kt | Migrates superuser sort state/action from Int to AppSortConfig. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/superuser/SuperUserScreen.kt | Wires UI to new updateSortConfig API. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/superuser/SuperUserMiuix.kt | Updates sort UI to new sort config; replaces refresh tick with mutableIntStateOf. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/superuser/SuperUserMaterial.kt | Updates sort UI to new sort config. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/modulerepo/ModuleRepoScreen.kt | Cleans up "null" URL checks. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/modulerepo/ModuleRepoMiuix.kt | Replaces refresh tick with mutableIntStateOf. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/modulerepo/ModuleRepoMaterial.kt | Replaces refresh tick with mutableIntStateOf; adds lint suppression for locale formatting. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/module/ModuleShortcutState.kt | Removes unused availableTypes computed property. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/module/ModuleMiuix.kt | Replaces refresh tick with mutableIntStateOf. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeScreen.kt | Uses Duration.milliseconds for delayed timeout handling. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/flash/FlashUtils.kt | Uses Duration.milliseconds for countdown delay. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/navigation3/Navigator.kt | Adds suppression annotation for unused warning. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/navigation3/IntentDispatcher.kt | Persists pending install action via rememberSaveable + saver. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/effect/BgEffectModifier.kt | Adds API annotations/suppressions for shader-based background drawing. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/effect/BgEffectBackground.kt | Adds SDK guard for shader path; uses Duration delay. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/EditText.kt | Reorders parameters to place modifier first. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/DropdownItem.kt | Reorders parameters to place modifier first. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/animation/DampedDragAnimation.kt | Simplifies flow chain by using first { ... } with predicate. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SearchBar.kt | Fixes snackbar host placement by wrapping in a bottom-aligned box. |
| manager/app/src/main/java/me/weishu/kernelsu/KernelSUApplication.kt | Reads predictive back setting via SettingsRepositoryImpl. |
| manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepositoryImpl.kt | Adds additional persisted settings (modules/superuser/sulog/repo sort). |
| manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepository.kt | Extends settings contract with additional persisted keys. |
| manager/app/src/main/java/me/weishu/kernelsu/data/repository/ModuleRepoRepositoryImpl.kt | Simplifies JSON numeric parsing for versionCode. |
ðĄ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
YuKongA
approved these changes
Jul 4, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.