Sign APK in classic SignApk format so it installs on Android <= 4.2

Replace jarsigner + zipalign.py with tools/signapk.py, which writes the v1
signature the way old JarUtils expects and aligns the APK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xockoandClaude Opus 5.5 committed 2026-10-14 19:46:20 +02:00
1 parent 0df8124629
commit 948d1198ad
3 files changed
+153 -7

No files matched your search

+4 -2
View File
@@ -72,8 +72,10 @@ tools/setup_toolchain.sh # once: fetches aapt2, the API 8 android.jar, buil
```
`build.sh` runs `aapt2` (resources), `javac` (Java 8 bytecode checked against the API 8
`android.jar`), `dx` (dex 035), `jarsigner` (v1 signature with SHA-1, which Android < 4.3 requires)
and `tools/zipalign.py`. The debug key in `signing/` (password `minamp123`) is what this APK is
`android.jar`), `dx` (dex 035) and `tools/signapk.py`, which writes the v1 signature in the
classic Android SignApk format and aligns the APK. (Modern `jarsigner` output does *not* install on
Android 4.2 and older: it names digests `SHA-1-Digest` and labels the PKCS#7 signer algorithm in a
way old `JarUtils` can't read, so the phone treats the APK as unsigned.) The debug key in `signing/` (password `minamp123`) is what this APK is
signed with, so rebuilt APKs install over it.
Tests (desktop JVM, no device):