diff --git a/.github/workflows/magisk.yml b/.github/workflows/magisk.yml index e489f3f..4f5c991 100644 --- a/.github/workflows/magisk.yml +++ b/.github/workflows/magisk.yml @@ -9,10 +9,10 @@ on: description: 'Download link to magisk apk.' required: true default: 'https://raw.githubusercontent.com/LSPosed/MagiskOnWSA/main/magisk.apk' - # gapps_variant: - # description: 'Variants of gapps. Should be: [none, aroma, super, stock, full, mini, micro, nano, pico, tvstock, tvmini]' - # required: true - # default: 'none' + gapps_variant: + description: 'Variants of gapps. Should be: [none, aroma, super, stock, full, mini, micro, nano, pico, tvstock, tvmini]' + required: true + default: 'none' jobs: build: @@ -24,7 +24,7 @@ jobs: - name: Dependencies run: | pip3 install beautifulsoup4 lxml - sudo apt-get update && sudo apt-get install setools + sudo apt-get update && sudo apt-get install setools lzip - name: Download AWS shell: python run: | @@ -132,8 +132,14 @@ jobs: print("done", flush=True) - name: Expand images run: | + e2fsck -yf ${{ matrix.arch }}/system.img + resize2fs ${{ matrix.arch }}/system.img 1280M e2fsck -yf ${{ matrix.arch }}/vendor.img resize2fs ${{ matrix.arch }}/vendor.img 320M + e2fsck -yf ${{ matrix.arch }}/product.img + resize2fs ${{ matrix.arch }}/product.img 1024M + e2fsck -yf ${{ matrix.arch }}/system_ext.img + resize2fs ${{ matrix.arch }}/system_ext.img 108M - name: Mount images run: | sudo mkdir system @@ -201,7 +207,31 @@ jobs: - name: Integrate GApps if: ${{ github.event.inputs.gapps_variant != 'none' && github.event.inputs.gapps_variant != '' }} run: | - echo 'Not supported yet' && false + mkdir gapps/tmp + cat gapps/{Core,GApps}/*.lz | tar --lzip -C gapps/tmp -xvf - -i --strip-components=2 --exclude='setupwizardtablet-x86_64' + + sudo cp -r gapps/tmp/{app,etc,framework,priv-app} system/system + sudo cp -r gapps/tmp/product/* system/product/ + + sudo find system/system/{app,etc,framework,priv-app} -exec chown root:root {} \; + sudo find system/product/{app,etc,overlay,priv-app} -exec chown root:root {} \; + + sudo find system/system/{app,etc,framework,priv-app} -type d -exec chmod 0755 {} \; + sudo find system/product/{app,etc,overlay,priv-app} -type d -exec chmod 0755 {} \; + + sudo find system/system/{app,framework,priv-app} -type f -exec chmod 0644 {} \; + sudo find system/system/etc/{permissions,default-permissions,preferred-apps,sysconfig} -type f -exec chmod 0644 {} \; + sudo find system/product/{app,etc,overlay,priv-app} -type f -exec chmod 0644 {} \; + + sudo find system/system/{app,framework,priv-app} -type d -exec chcon --reference=system/system/app {} \; + sudo find system/product/{app,etc,overlay,priv-app} -type d -exec chcon --reference=system/product/app {} \; + sudo find system/system/etc/{permissions,default-permissions,preferred-apps,sysconfig} -type d -exec chcon --reference=system/system/etc/permissions {} \; + + sudo find system/system/{app,framework,priv-app} -type f -exec chcon --reference=system/system/framework/ext.jar {} \; + sudo find system/system/etc/{permissions,default-permissions,preferred-apps,sysconfig} -type f -exec chcon --reference=system/system/etc/permissions {} \; + sudo find system/product/{app,etc,overlay,priv-app} -type f -exec chcon --reference=system/product/etc/permissions/privapp-permissions-venezia.xml {} \; + + sudo ./magisk/magiskpolicy --load system/vendor/etc/selinux/precompiled_sepolicy --save system/vendor/etc/selinux/precompiled_sepolicy "allow gmscore_app gmscore_app vsock_socket { create connect write read }" "allow gmscore_app device_config_runtime_native_boot_prop file read" - name: Umount images run: | sudo umount system/vendor