From c37b8cd19478efb96cc0a534cd55b8922d11774d Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Thu, 18 Nov 2021 22:13:09 +0100 Subject: [PATCH] use aapt instead of aapt2 if it doesn't exist. --- patcher.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/patcher.sh b/patcher.sh index e3ac6f2..c53ce14 100755 --- a/patcher.sh +++ b/patcher.sh @@ -124,7 +124,12 @@ cp -Rp assets AM2RWrapper echo "Editing apktool.yml..." sed -i "s/doNotCompress:/doNotCompress:\n- ogg/" AM2RWrapper/apktool.yml #build -apkmod -r -i AM2RWrapper -o AM2R-"${VERSION}".apk +# check if aapt2 exists, if not use aapt instead +if [ -f /usr/bin/aapt2 ]; then + apkmod -r -i AM2RWrapper -o AM2R-"${VERSION}".apk +else + apkmod -a -r -i AM2RWrapper -o AM2R-"${VERSION}".apk +fi #Sign apk apkmod -s -i AM2R-"${VERSION}".apk -o AM2R-"${VERSION}"-signed.apk