magiatranslate-client/ci_download_src_apk.sh
segfault-bilibili 2e4f815732
Automatic build with GitHub Actions (#5)
* extract armv7 lib; make build.bat immune to spaced path

* update submodules

1.update dobby to latest:
original commit hash: b0176de574104726bb68dff3b77ee666300fc338
plus compilation error fix

2.update untp to include plistlib fix

* fix build errors

1. define RS_SUCCESS in MagiaClient.cpp,
which was deleted in Dobby f4643b8d14d7cc94516b446ca77d952d0b986d50

2. fix dobby not being statically linked

* terminate build script on error

let build.sh exit on error
let build.bat fail if signing fails

* sign_example.bat: use zipalign and apksigner

* upgrade to apktool 2.7.0; check hash of apktool

* handle fake python3

* control whether to include audiofix

* build.bat: go back to base dir on exit

* update readme

* update suggested ndk path

* build and release with GitHub Actions

* avoid unnecessary rebuild

* remove nodejs dependency

fix Dobby so that we can implement audiofix in MagiaHook again

* automatic build

* update apktool to 2.8.1

* fix max method number exceeded
2023-08-10 20:11:14 +01:00

27 lines
880 B
Bash

#!/bin/bash
set -e
verify_apk() {
. ci_versions/deps.sh
"./deps/Android/Sdk/build-tools/${BUILD_TOOLS_VER}/apksigner" verify --print-certs "$1" > /tmp/result.txt || exit 1
grep -q "$2" /tmp/result.txt && return 0
echo "Cert SHA256 digest mismatch" >&2
exit 2
}
UA="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
URL_PREFIX="https://jp.rika.ren/apk/Origin/com.aniplex.magireco"
ARMV8_URL="${URL_PREFIX}.arm8.apk"
ARMV7_URL="${URL_PREFIX}.arm7.apk"
. ci_versions/src_apk.sh
rm -fr apk armv7apk
mkdir -p apk armv7apk
curl -A "${UA}" -o out.apk -L "${ARMV8_URL}"
verify_apk out.apk "${SRCAPK_CERT_SHA256}" && mv out.apk "./apk/src_${SRCAPK_VER}.apk"
curl -A "${UA}" -o out.apk -L "${ARMV7_URL}"
verify_apk out.apk "${SRCAPK_CERT_SHA256}" && mv out.apk "./armv7apk/armv7src_${SRCAPK_VER}.apk"