mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 03:20:46 -05:00
MagiskInstaller.exec() only cleared its static session flag after the operation returned normally. When the calling coroutine was cancelled, withContext() threw once the blocking operation finished and the flag stayed set, so every later install, patch, uninstall, restore or environment fix failed immediately until the app process died. Restore images and Fix environment ran in a composition scope through rememberLoadingDialog(), so this happened just by rotating while their loading dialog was showing, which also lost the result toast and the reboot after fixing the environment. Leaving a running flash screen triggered it too. Release the flag in a finally block, and run both operations in HomeViewModel, which survives configuration changes. Remove rememberLoadingDialog(), which has no other users. Assisted-by: Claude Opus 5.5