From 04d75adf33106950e869d3a70d521c34c094688b Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sat, 11 Dec 2021 20:49:58 +0800 Subject: [PATCH] Try to skip magisk env fix step --- .github/workflows/magisk.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/magisk.yml b/.github/workflows/magisk.yml index 424c5b3..5c8a34f 100644 --- a/.github/workflows/magisk.yml +++ b/.github/workflows/magisk.yml @@ -27,7 +27,7 @@ jobs: - name: Dependencies run: | pip3 install beautifulsoup4 lxml - sudo apt-get update && sudo apt-get install setools lzip + sudo apt-get update && sudo apt-get install setools lzip qemu-utils - name: Download WSA shell: python run: | @@ -107,7 +107,12 @@ jobs: 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") extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskinit", "magisk") - extract_as(zip, f"lib/{ abi_map['x64'][0] }/libmagiskinit.so", "magiskpolicy", "magisk") + extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskpolicy", "magisk") + extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagiskboot.so", "magiskboot", "magisk") + extract_as(zip, f"lib/{ abi_map[arch][0] }/libbusybox.so", "busybox", "magisk") + extract_as(zip, f"lib/{ abi_map['x64'][0] }/libmagiskinit.so", "magiskpolicy", ".") + extract_as(zip, f"assets/boot_patch.sh", "boot_patch.sh", "magisk") + extract_as(zip, f"assets/util_functions.sh", "util_functions.sh", "magisk") - name: Download OpenGApps if: ${{ github.event.inputs.gapps_variant != 'none' && github.event.inputs.gapps_variant != '' }} shell: python @@ -155,10 +160,13 @@ jobs: - name: Mount images run: | sudo mkdir system + sudo mkdir userdata sudo mount -o loop ${{ matrix.arch }}/system.img system sudo mount -o loop ${{ matrix.arch }}/vendor.img system/vendor sudo mount -o loop ${{ matrix.arch }}/product.img system/product sudo mount -o loop ${{ matrix.arch }}/system_ext.img system/system_ext + qemu-img convert -O raw ${{ matrix.arch }}/userdata.vhdx userdata.img + sudo mount -o loop userdata.img userdata - name: Integrate Magisk if: ${{ github.event.inputs.root_sol == 'magisk' || github.event.inputs.root_sol == '' }} run: | @@ -168,8 +176,14 @@ jobs: sudo chown root:root system/sbin sudo chmod 0700 system/sbin sudo cp magisk/* system/sbin/ + sudo mkdir -p userdata/adb/magisk + sudo chmod -R 700 userdata/adb + sudo cp magisk/* userdata/adb/magisk/ + sudo find userdata/adb/magisk -type f -exec chmod 0755 {} \; + sudo cp magisk.zip userdata/adb/magisk/magisk.apk sudo tee -a system/sbin/loadpolicy.sh <