mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2024-11-13 07:05:10 +01:00
fix: android 12.1 system and vendor size
This commit is contained in:
parent
70a6c19103
commit
41d53dd299
30
.github/workflows/magisk.yml
vendored
30
.github/workflows/magisk.yml
vendored
@ -3,7 +3,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
arch:
|
arch:
|
||||||
description: "Build arch"
|
description: "Build architecture"
|
||||||
required: true
|
required: true
|
||||||
default: "x64"
|
default: "x64"
|
||||||
type: choice
|
type: choice
|
||||||
@ -31,7 +31,7 @@ on:
|
|||||||
- beta
|
- beta
|
||||||
- canary
|
- canary
|
||||||
gapps_variant:
|
gapps_variant:
|
||||||
description: "Variants of gapps"
|
description: "Variants of GApps"
|
||||||
required: true
|
required: true
|
||||||
default: "full"
|
default: "full"
|
||||||
type: choice
|
type: choice
|
||||||
@ -46,6 +46,14 @@ on:
|
|||||||
- pico
|
- pico
|
||||||
- tvstock
|
- tvstock
|
||||||
- tvmini
|
- tvmini
|
||||||
|
gapps_version:
|
||||||
|
description: "Android version of GApps"
|
||||||
|
required: true
|
||||||
|
default: "11.0"
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- 11.0
|
||||||
|
- 12.1
|
||||||
root_sol:
|
root_sol:
|
||||||
description: "Root solution"
|
description: "Root solution"
|
||||||
required: true
|
required: true
|
||||||
@ -235,14 +243,18 @@ jobs:
|
|||||||
arch = "${{ matrix.arch }}"
|
arch = "${{ matrix.arch }}"
|
||||||
variant = "${{ github.event.inputs.gapps_variant }}"
|
variant = "${{ github.event.inputs.gapps_variant }}"
|
||||||
abi_map = {"x64" : "x86_64", "arm64": "arm64"}
|
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 = "${{ github.event.inputs.gapps_version }}"
|
||||||
try:
|
try:
|
||||||
res = requests.get(f"https://api.opengapps.org/list")
|
res = requests.get(f"https://api.opengapps.org/list")
|
||||||
j = json.loads(res.content)
|
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:
|
except Exception:
|
||||||
print("Failed to fetch from opengapps api, fallbacking to sourceforge rss...")
|
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')
|
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)
|
print(f"downloading link: {link}", flush=True)
|
||||||
|
|
||||||
@ -260,14 +272,15 @@ jobs:
|
|||||||
|
|
||||||
e2fsck -yf ${{ matrix.arch }}/system.img
|
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
|
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
|
e2fsck -yf ${{ matrix.arch }}/product.img
|
||||||
resize2fs ${{ matrix.arch }}/product.img 1024M
|
resize2fs ${{ matrix.arch }}/product.img 1024M
|
||||||
e2fsck -yf ${{ matrix.arch }}/system_ext.img
|
e2fsck -yf ${{ matrix.arch }}/system_ext.img
|
||||||
resize2fs ${{ matrix.arch }}/system_ext.img 108M
|
resize2fs ${{ matrix.arch }}/system_ext.img 200M
|
||||||
- name: Expand vendor
|
- name: Expand vendor
|
||||||
run: |
|
run: |
|
||||||
e2fsck -yf ${{ matrix.arch }}/vendor.img
|
e2fsck -yf ${{ matrix.arch }}/vendor.img
|
||||||
resize2fs ${{ matrix.arch }}/vendor.img 320M
|
resize2fs ${{ matrix.arch }}/vendor.img 400M
|
||||||
- name: Mount images
|
- name: Mount images
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir system
|
sudo mkdir system
|
||||||
@ -419,7 +432,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from io import TextIOWrapper
|
from io import TextIOWrapper
|
||||||
from os import system
|
from os import system, path
|
||||||
from typing import OrderedDict
|
from typing import OrderedDict
|
||||||
|
|
||||||
|
|
||||||
@ -461,6 +474,9 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
def fix_prop(sec, prop):
|
def fix_prop(sec, prop):
|
||||||
|
if not path.exists(prop):
|
||||||
|
return
|
||||||
|
|
||||||
print(f"fixing {prop}", flush=True)
|
print(f"fixing {prop}", flush=True)
|
||||||
with open(prop, 'r') as f:
|
with open(prop, 'r') as f:
|
||||||
p = Prop(f)
|
p = Prop(f)
|
||||||
|
Loading…
Reference in New Issue
Block a user