Refactor dtb in rust

This commit is contained in:
LoveSy
2023-09-19 00:12:49 -07:00
committed by John Wu
parent 8e1a91509c
commit 8d7c7c3dfb
14 changed files with 403 additions and 626 deletions
+1 -6
View File
@@ -1,11 +1,11 @@
use std::cmp::Ordering;
use std::collections::HashMap;
use std::env;
use std::str::from_utf8;
use base::libc::{S_IFDIR, S_IFMT, S_IFREG};
use base::{LoggedResult, Utf8CStr};
use crate::check_env;
use crate::cpio::{Cpio, CpioEntry};
use crate::patch::{patch_encryption, patch_verity};
@@ -20,11 +20,6 @@ const MAGISK_PATCHED: i32 = 1 << 0;
const UNSUPPORTED_CPIO: i32 = 1 << 1;
const SONY_INIT: i32 = 1 << 2;
#[inline(always)]
fn check_env(env: &str) -> bool {
env::var(env).map_or(false, |var| var == "true")
}
impl MagiskCpio for Cpio {
fn patch(&mut self) {
let keep_verity = check_env("KEEPVERITY");