mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-06 07:20:47 -05:00
Fix clippy warnings across native codebase
Address clippy warnings including collapsible match statements in bootstages, daemon, su daemon, and db modules, as well as iterator loops in files.rs. Assisted-by: Gemini 3.6 Flash
This commit is contained in:
@@ -252,17 +252,13 @@ impl MagiskD {
|
||||
warn!("Root access is disabled!");
|
||||
return Ok(Arc::new(SuInfo::deny(uid)));
|
||||
}
|
||||
RootAccess::AdbOnly => {
|
||||
if uid != AID_SHELL {
|
||||
warn!("Root access limited to ADB only!");
|
||||
return Ok(Arc::new(SuInfo::deny(uid)));
|
||||
}
|
||||
RootAccess::AdbOnly if uid != AID_SHELL => {
|
||||
warn!("Root access limited to ADB only!");
|
||||
return Ok(Arc::new(SuInfo::deny(uid)));
|
||||
}
|
||||
RootAccess::AppsOnly => {
|
||||
if uid == AID_SHELL {
|
||||
warn!("Root access is disabled for ADB!");
|
||||
return Ok(Arc::new(SuInfo::deny(uid)));
|
||||
}
|
||||
RootAccess::AppsOnly if uid == AID_SHELL => {
|
||||
warn!("Root access is disabled for ADB!");
|
||||
return Ok(Arc::new(SuInfo::deny(uid)));
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
|
||||
@@ -95,26 +95,14 @@ impl MagiskD {
|
||||
// Check user root access settings
|
||||
match cfg.root_access {
|
||||
RootAccess::Disabled => return false,
|
||||
RootAccess::AppsOnly => {
|
||||
if uid == AID_SHELL {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
RootAccess::AdbOnly => {
|
||||
if uid != AID_SHELL {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
RootAccess::AppsOnly if uid == AID_SHELL => return false,
|
||||
RootAccess::AdbOnly if uid != AID_SHELL => return false,
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// Check multiuser settings
|
||||
match cfg.multiuser_mode {
|
||||
MultiuserMode::OwnerOnly => {
|
||||
if to_user_id(uid) != 0 {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
MultiuserMode::OwnerOnly if to_user_id(uid) != 0 => return false,
|
||||
MultiuserMode::OwnerManaged => uid = to_app_id(uid),
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user