-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
108 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const EVENT_POST_FS_DATA: u64 = 1; | ||
const EVENT_BOOT_COMPLETED: u64 = 2; | ||
const EVENT_MODULE_MOUNTED: u64 = 3; | ||
|
||
#[cfg(any(target_os = "linux", target_os = "android"))] | ||
pub fn get_version() -> i32 { | ||
rustix::process::ksu_get_version() | ||
} | ||
|
||
#[cfg(not(any(target_os = "linux", target_os = "android")))] | ||
pub fn get_version() -> i32 { | ||
0 | ||
} | ||
|
||
#[cfg(any(target_os = "linux", target_os = "android"))] | ||
fn report_event(event: u64) { | ||
rustix::process::ksu_report_event(event) | ||
} | ||
|
||
#[cfg(not(any(target_os = "linux", target_os = "android")))] | ||
fn report_event(_event: u64) {} | ||
|
||
#[cfg(any(target_os = "linux", target_os = "android"))] | ||
pub fn check_kernel_safemode() -> bool { | ||
rustix::process::ksu_check_kernel_safemode() | ||
} | ||
|
||
#[cfg(not(any(target_os = "linux", target_os = "android")))] | ||
pub fn check_kernel_safemode() -> bool { | ||
false | ||
} | ||
|
||
pub fn report_post_fs_data() { | ||
report_event(EVENT_POST_FS_DATA); | ||
} | ||
|
||
pub fn report_boot_complete() { | ||
report_event(EVENT_BOOT_COMPLETED); | ||
} | ||
|
||
pub fn report_module_mounted() { | ||
report_event(EVENT_MODULE_MOUNTED); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.