mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 23:14:03 -05:00
Introduce path! macro for FsPath
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::ffi::{backup_init, BootConfig, MagiskInit};
|
||||
use base::{cstr, debug, BytesExt, FsPath, MappedFile};
|
||||
use base::{debug, path, BytesExt, MappedFile};
|
||||
use std::ffi::CStr;
|
||||
|
||||
impl BootConfig {
|
||||
@@ -27,11 +27,11 @@ impl BootConfig {
|
||||
|
||||
impl MagiskInit {
|
||||
pub(crate) fn check_two_stage(&self) -> bool {
|
||||
FsPath::from(cstr!("/first_stage_ramdisk")).exists() ||
|
||||
FsPath::from(cstr!("/second_stage_resources")).exists() ||
|
||||
FsPath::from(cstr!("/system/bin/init")).exists() ||
|
||||
path!("/first_stage_ramdisk").exists() ||
|
||||
path!("/second_stage_resources").exists() ||
|
||||
path!("/system/bin/init").exists() ||
|
||||
// Use the apex folder to determine whether 2SI (Android 10+)
|
||||
FsPath::from(cstr!("/apex")).exists() ||
|
||||
path!("/apex").exists() ||
|
||||
// If we still have no indication, parse the original init and see what's up
|
||||
MappedFile::open(backup_init())
|
||||
.map(|data| data.contains(b"selinux_setup"))
|
||||
|
||||
Reference in New Issue
Block a user