one-file python script that just builds android app without downloading tons of stuff for gradle
this is not ready for serious projects, because...
- it doesn't support aar libs, only jar (the one with java classes)
- definitely won't work on windows (using sh syntax in build script)
- I have no idea how to do xml layouts blindly
- not really documented
- the code can be painful to look at
- something may be hardcoded
though there are some advantages:
- only requires android.jar (preferably from sdk 30) and binaries specified below for complete build
- pretty fast build (3-5 secs of clean build on i3-2100 machine or termux environment on OnePlus 9R)
- can do build in termux (though you have to do setenforce 0 to be able to autoinstall built app)
stages:
- create keystore if doesn't exist (requires keytool)
- build resources (using aapt2) and create early apk
- compile java code (using javac) and convert it to dex (using d8), and add to apk (using zip)
- zipalign (using... zipalign) apk and sign it (using apksigner)