You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Introduce path! macro for FsPath
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::package::ManagerInfo;
|
||||
use crate::su::SuInfo;
|
||||
use base::libc::{O_CLOEXEC, O_RDONLY};
|
||||
use base::{
|
||||
cstr, error, info, libc, open_fd, AtomicArc, BufReadExt, FsPath, FsPathBuf, ResultExt, Utf8CStr,
|
||||
cstr, error, info, libc, open_fd, path, AtomicArc, BufReadExt, FsPathBuf, ResultExt, Utf8CStr,
|
||||
};
|
||||
use std::fs::File;
|
||||
use std::io::BufReader;
|
||||
@@ -105,7 +105,7 @@ impl MagiskD {
|
||||
self.preserve_stub_apk();
|
||||
|
||||
// Check secure dir
|
||||
let secure_dir = FsPath::from(cstr!(SECURE_DIR));
|
||||
let secure_dir = path!(SECURE_DIR);
|
||||
if !secure_dir.exists() {
|
||||
if self.sdk_int < 24 {
|
||||
secure_dir.mkdir(0o700).log_ok();
|
||||
@@ -172,7 +172,7 @@ impl MagiskD {
|
||||
self.set_db_setting(DbEntryKey::BootloopCount, 0).log_ok();
|
||||
|
||||
// At this point it's safe to create the folder
|
||||
let secure_dir = FsPath::from(cstr!(SECURE_DIR));
|
||||
let secure_dir = path!(SECURE_DIR);
|
||||
if !secure_dir.exists() {
|
||||
secure_dir.mkdir(0o700).log_ok();
|
||||
}
|
||||
@@ -244,7 +244,7 @@ pub fn daemon_entry() {
|
||||
}
|
||||
|
||||
let mut sdk_int = -1;
|
||||
if let Ok(file) = FsPath::from(cstr!("/system/build.prop")).open(O_RDONLY | O_CLOEXEC) {
|
||||
if let Ok(file) = path!("/system/build.prop").open(O_RDONLY | O_CLOEXEC) {
|
||||
let mut file = BufReader::new(file);
|
||||
file.foreach_props(|key, val| {
|
||||
if key == "ro.build.version.sdk" {
|
||||
|
||||
Reference in New Issue
Block a user