From 952eef3e0bc47b238ae13b25585c73c213b7f4ac Mon Sep 17 00:00:00 2001 From: ColdWindScholar <3590361911@qq.com> Date: Sun, 3 Dec 2023 14:32:54 +0800 Subject: [PATCH] init --- Magisk.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Magisk.py b/Magisk.py index e0d32f8..1524648 100644 --- a/Magisk.py +++ b/Magisk.py @@ -122,9 +122,18 @@ def patch(self): if self.SHA1: config.write(f'SHA1={self.SHA1}') self.SKIP64 = '' if self.IS64BIT else '#' - self.exec('compress=xz', os.path.join(self.Magisk_dir, "magisk32"), 'magisk32.xz') if os.path.exists(os.path.join(self.Magisk_dir, "magisk32")) else self.SKIP32 = '#' - self.exec('compress=xz', os.path.join(self.Magisk_dir, "magisk64"), 'magisk64.xz') if os.path.exists(os.path.join(self.Magisk_dir, "magisk64")) else self.SKIP64 = '#' - self.exec('compress=xz', os.path.join(self.Magisk_dir, "stub.apk"), 'stub.xz') if os.path.exists(os.path.join(self.Magisk_dir, "stub.apk")) else self.SKIPSTUB = '#' + if os.path.exists(os.path.join(self.Magisk_dir, "magisk32")): + self.exec('compress=xz', os.path.join(self.Magisk_dir, "magisk32"), 'magisk32.xz') + else: + self.SKIP32 = '#' + if os.path.exists(os.path.join(self.Magisk_dir, "magisk64")): + self.exec('compress=xz', os.path.join(self.Magisk_dir, "magisk64"), 'magisk64.xz') + else: + self.SKIP64 = '#' + if os.path.exists(os.path.join(self.Magisk_dir, "stub.apk")): + self.exec('compress=xz', os.path.join(self.Magisk_dir, "stub.apk"), 'stub.xz') + else: + self.SKIPSTUB = '#' self.exec('cpio', 'ramdisk.cpio', f"add 0750 {self.init} {os.path.join(self.Magisk_dir, 'magiskinit')}", "mkdir 0750 overlay.d",