Skip to content

More apk-ng changes - #10021

Merged
topjohnwu merged 4 commits into
masterfrom
dev
Aug 20, 2026
Merged

More apk-ng changes#10021
topjohnwu merged 4 commits into
masterfrom
dev

Conversation

@topjohnwu

Copy link
Copy Markdown
Owner

No description provided.

Because HorizontalPager pre-renders all tab composables, LaunchedEffect
with a Unit key was only executing once on initial creation. As a result,
changes to configuration (e.g. update channel) calling resetUpdate()
did not trigger a reload when returning to the Home tab, causing the
install/reinstall dialog to display an empty changelog.

Trigger startLoading() whenever a tab becomes active (isCurrentPage).

Assisted-by: Gemini 3.7 Flash
Refactor apk-ng UI components and screens to follow idiomatic Jetpack
Compose patterns:
- Hoist state across dialogs and bottom sheets, replacing MutableState
  parameter passing with standard boolean flags and event callbacks.
- Add modifier parameter to all UI composables and apply proper modifier
  chaining.
- Decouple screen composables from MainActivity host casting by
  providing explicit authentication and permission callbacks.
- Scope SuperuserViewModel to MainActivity and share across MainScreen
  and SuperuserDetailScreen.
- Unify loose mutable states in SuRequestViewModel into an immutable
  UiState StateFlow.
- Fix dynamic loop remember allocations in MainActivity dialogs.
- Provide stable item keys for LazyColumn in MagiskLogTab.

Assisted-by: Gemini 3.7 Flash
Refactor apk-ng to adhere to modern Android and Jetpack Compose best
practices:
- Migrate VMFactory to the type-safe AndroidX viewModelFactory DSL.
- Use collectAsStateWithLifecycle across all screen composables to
  pause flow collection when backgrounded.
- Convert PolicyItem, ModuleItem, DenyAppState, and DenyProcessState
  to pure immutable data classes, removing Compose MutableState from
  ViewModels.
- Extract shell operations from UI model classes into ViewModels.
- Bridge Info.isConnected LiveData to coroutine Flow using callbackFlow
  and collect in viewModelScope without modifying :core.
- Consolidate magisk and manager version state into
  HomeViewModel.UiState.
- Add contentType to LazyColumn items for optimal list recycling.
- Restore proper localized string resolution in MainActivityDialogs.

Assisted-by: Gemini 3.7 Flash
@topjohnwu
topjohnwu merged commit 99a6e27 into master Aug 20, 2026
25 checks passed
@topjohnwu
topjohnwu deleted the dev branch August 20, 2026 21:36
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.

1 participant