Skip to content

manager: code cleanup and bug fixes - #3552

Merged
YuKongA merged 6 commits into
tiann:mainfrom
u9521:webui-extlink
Jul 4, 2026
Merged

YuKongA merged 6 commits into
tiann:mainfrom
u9521:webui-extlink

Conversation

@u9521

@u9521 u9521 commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor
  • Fix SearchBar snackbar positioning and module install dialog missing callbak
  • Centralize settings preferences into SettingsRepositoryImpl()
  • Refine superuser sorting and label collation
  • Resolve lint warnings

u9521 added 5 commits July 2, 2026 16:09
- 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
u9521 marked this pull request as draft July 2, 2026 08:12
@u9521 u9521 changed the title manager: add external link warning for WebUI manager: code cleanup and bug fixes Jul 2, 2026
@u9521
u9521 marked this pull request as ready for review July 2, 2026 08:24
@5ec1cff
5ec1cff requested a review from Copilot July 3, 2026 04:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 various delay/debounce/withTimeoutOrNull calls to Duration).

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.

@5ec1cff
5ec1cff requested review from KOWX712 and YuKongA July 4, 2026 06:21
1
Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
@YuKongA
YuKongA merged commit 824f2f2 into tiann:main Jul 4, 2026
@u9521
u9521 deleted the webui-extlink branch July 4, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants