mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
su: Enable logging and notify by default
When a UID makes a root request for the first time, no row exists in the policies table. Previously, RootSettings derived Default, which initialized log and notify to false. As a result, connect_app() skipped calling app_log() or app_notify() immediately after user approval on the initial su request. Explicitly implement Default for RootSettings with log and notify set to true by default. Assisted-by: Gemini 3.7 Flash
This commit is contained in:
@@ -12,13 +12,22 @@ impl Default for SuPolicy {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RootSettings {
|
||||
pub policy: SuPolicy,
|
||||
pub log: bool,
|
||||
pub notify: bool,
|
||||
}
|
||||
|
||||
impl Default for RootSettings {
|
||||
fn default() -> Self {
|
||||
RootSettings {
|
||||
policy: SuPolicy::Query,
|
||||
log: true,
|
||||
notify: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SqlTable for RootSettings {
|
||||
fn on_row(&mut self, columns: &[String], values: &DbValues) {
|
||||
for (i, column) in columns.iter().enumerate() {
|
||||
|
||||
Reference in New Issue
Block a user