From a26b32e8cbfab2cac217bf864c86544f2715ac7a Mon Sep 17 00:00:00 2001 From: MustardChef <68516357+MustardChef@users.noreply.github.com> Date: Sun, 14 Jul 2024 13:57:37 +0100 Subject: [PATCH] Fix Magisk Extraction. --- MagiskOnWSA/scripts/extractMagisk.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MagiskOnWSA/scripts/extractMagisk.py b/MagiskOnWSA/scripts/extractMagisk.py index b5a80df..20d64f1 100644 --- a/MagiskOnWSA/scripts/extractMagisk.py +++ b/MagiskOnWSA/scripts/extractMagisk.py @@ -52,7 +52,6 @@ workdir.mkdir(parents=True, exist_ok=True) abi_map = {"x64": ["x86_64", "x86"], "arm64": ["arm64-v8a", "armeabi-v7a"]} - def extract_as(zip, name, as_name, dir): info = zip.getinfo(name) info.filename = as_name @@ -71,7 +70,11 @@ with zipfile.ZipFile(magisk_zip) as zip: env.MAGISK_VERSION_CODE = versionCode with open(os.environ['WSA_WORK_ENV'], 'w') as environ_file: environ_file.write(str(env)) - extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk") - extract_as(zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk") + try: + extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk") + extract_as(zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk") + except: + extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk.so", "magisk64", "magisk") + extract_as(zip, f"lib/{ abi_map[arch][1] }/libmagisk.so", "magisk32", "magisk") extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskinit", "magisk") extract_as(zip, f"lib/{ abi_map[host_abi][0] }/libmagiskboot.so", "magiskboot", "magisk")