From 10b26893d519dfe6a053fc8d912f440463c59778 Mon Sep 17 00:00:00 2001 From: ColdWindScholar <3590361911@qq.com> Date: Mon, 19 Feb 2024 20:35:08 +0800 Subject: [PATCH] [Normal] Support android --- contextpatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contextpatch.py b/contextpatch.py index 7e728f7..72e5be0 100644 --- a/contextpatch.py +++ b/contextpatch.py @@ -11,7 +11,7 @@ "bin/e2fsck": "u:object_r:fsck_exec:s0", "bin/logcat": "u:object_r:logcat_exec:s0", "system/bin": "u:object_r:system_file:s0", - "/system/bin/init": "u:object_r:init_exec:s0", + "/system/bin/init": "u:object_r:init_exec:s0", r"/lost\+found": "u:object_r:rootfs:s0" } @@ -41,7 +41,7 @@ def scan_dir(folder) -> list: # 读取解包的目录,返回一个字典 def str_to_selinux(string: str): - return escape(string).replace('\\-', '-') + return escape(string).replace('\\-', '-').replace(r'\@', '@').replace('@', r'\@') def context_patch(fs_file, dir_path) -> tuple: # 接收两个字典对比