mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2025-01-12 11:19:08 +01:00
Download gapps
This commit is contained in:
parent
ab82646e1a
commit
c637f0de6c
37
.github/workflows/magisk.yml
vendored
37
.github/workflows/magisk.yml
vendored
@ -9,6 +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'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -93,6 +97,39 @@ jobs:
|
||||
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")
|
||||
- name: Download OpenGApps
|
||||
if: ${{ github.event.inputs.gapps_variant != 'none' && github.event.inputs.gapps_variant != '' }}
|
||||
shell: python
|
||||
run: |
|
||||
import requests
|
||||
import zipfile
|
||||
import os
|
||||
import urllib.request
|
||||
import json
|
||||
|
||||
arch = "${{ matrix.arch }}"
|
||||
variant = "${{ github.event.inputs.gapps_variant }}"
|
||||
abi_map = {"x64" : "x86_64", "arm64": "arm64"}
|
||||
|
||||
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"]
|
||||
|
||||
print(f"downloading link: {link}", flush=True)
|
||||
|
||||
out_file = "gapps.zip"
|
||||
|
||||
if not os.path.isfile(out_file):
|
||||
urllib.request.urlretrieve(link, out_file)
|
||||
|
||||
out_dir = "gapps"
|
||||
with zipfile.ZipFile(out_file) as zip:
|
||||
if not os.path.isdir(out_dir):
|
||||
print(f"unzipping from {out_file}", flush=True)
|
||||
zip.extractall(out_dir)
|
||||
print("done", flush=True)
|
||||
- name: Expand images
|
||||
run: |
|
||||
e2fsck -yf ${{ matrix.arch }}/vendor.img
|
||||
|
Loading…
x
Reference in New Issue
Block a user