From 3d00cea9c549d0ee8f55a0c8aabfbf82025e61ef Mon Sep 17 00:00:00 2001 From: LoveSy <631499712@qq.com> Date: Sat, 21 May 2022 01:58:57 +0800 Subject: [PATCH] Temporary fix for 12L version --- .github/workflows/magisk.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/magisk.yml b/.github/workflows/magisk.yml index 49bed1d..ea52047 100644 --- a/.github/workflows/magisk.yml +++ b/.github/workflows/magisk.yml @@ -235,14 +235,18 @@ jobs: arch = "${{ matrix.arch }}" variant = "${{ github.event.inputs.gapps_variant }}" abi_map = {"x64" : "x86_64", "arm64": "arm64"} + # TODO: keep it 11.0 since opengapps does not support 12+ yet + # As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and + # download the corresponding version + release = "11.0" try: res = requests.get(f"https://api.opengapps.org/list") j = json.loads(res.content) - link = {i["name"]: i for i in j["archs"][abi_map[arch]]["apis"]["11.0"]["variants"]}[variant]["zip"] + link = {i["name"]: i for i in j["archs"][abi_map[arch]]["apis"][release]["variants"]}[variant]["zip"] except Exception: print("Failed to fetch from opengapps api, fallbacking to sourceforge rss...") res = requests.get(f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100') - link = re.search(f'https://.*{abi_map[arch]}/.*{variant}.*\.zip/download', res.text).group().replace('.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps') + link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace('.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps') print(f"downloading link: {link}", flush=True) @@ -260,10 +264,11 @@ jobs: e2fsck -yf ${{ matrix.arch }}/system.img resize2fs ${{ matrix.arch }}/system.img $(( $(du -sB512 gapps | cut -f1) + $(du -sB512 ${{ matrix.arch }}/system.img | cut -f1) ))s + # TODO: calculate the size dynamically for better compatibility 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 + resize2fs ${{ matrix.arch }}/system_ext.img 200M - name: Expand vendor run: | e2fsck -yf ${{ matrix.arch }}/vendor.img