mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-06 07:20:47 -05:00
core: resolve user 0 assumptions for HSUM
On Headless System User Mode (HSUM) devices, user 0 is headless while human users operate under secondary user IDs. Eliminate residual assumptions in core native components where user 0 was presumed to be the sole or active manager user: - In setup_magisk_env, scan all existing users via get_users() to check if the app-local binary install directory exists. - In ensure_manager, check all users before falling back to stub install so an already-installed manager on a secondary user is recognized. - Pass --user all to pm install, pm uninstall, and appops set in package management scripts to handle manager lifecycle device-wide. Assisted-by: Gemini 3.8 Flash
This commit is contained in:
@@ -469,6 +469,12 @@ impl MagiskD {
|
||||
|
||||
pub fn ensure_manager(&self) {
|
||||
let mut info = self.manager_info.lock();
|
||||
for user in self.get_users() {
|
||||
let (_, pkg) = info.get_manager(self, user, false);
|
||||
if !pkg.is_empty() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
let _ = info.get_manager(self, 0, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user