mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 23:14:03 -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:
+13
-17
@@ -226,25 +226,21 @@ impl MagiskD {
|
||||
| RequestCode::ZYGOTE_RESTART
|
||||
| RequestCode::SQLITE_CMD
|
||||
| RequestCode::DENYLIST
|
||||
| RequestCode::STOP_DAEMON => {
|
||||
if !is_root {
|
||||
client.write_pod(&RespondCode::ROOT_REQUIRED.repr).log_ok();
|
||||
return;
|
||||
}
|
||||
| RequestCode::STOP_DAEMON
|
||||
if !is_root =>
|
||||
{
|
||||
client.write_pod(&RespondCode::ROOT_REQUIRED.repr).log_ok();
|
||||
return;
|
||||
}
|
||||
RequestCode::REMOVE_MODULES => {
|
||||
if !is_root && !is_shell {
|
||||
// Only allow root and ADB shell to remove modules
|
||||
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
|
||||
return;
|
||||
}
|
||||
RequestCode::REMOVE_MODULES if !is_root && !is_shell => {
|
||||
// Only allow root and ADB shell to remove modules
|
||||
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
|
||||
return;
|
||||
}
|
||||
RequestCode::ZYGISK => {
|
||||
if !is_zygote {
|
||||
// Invalid client context
|
||||
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
|
||||
return;
|
||||
}
|
||||
RequestCode::ZYGISK if !is_zygote => {
|
||||
// Invalid client context
|
||||
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
|
||||
return;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user