fix(android): sign release APK v2+v3 only (drop invalid v1 JAR signature) #111
Reference in New Issue
Block a user
Delete Branch "fix/apk-signing-v1-obtainium"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The released APK installs via direct sideload but fails in Obtainium at install with:
Root cause: the
apksignerstep relied on auto scheme selection and produced an APK carrying an invalid v1 (JAR) signature —META-INF/*.SF/*.RSApresent but failing v1 verification (apksignerreportsv1 scheme: false, while v2/v3 verify). Android installs it fine via v2/v3, but Obtainium parses the legacy v1 certificate at install time, gets an empty cert list, and crashes. That matches the symptom exactly: adds fine (Gitea API only) but fails on install (APK parse).Fix
minSdk is 26, so v1/JAR signing is unnecessary. Sign explicit v2+v3 only (what modern Android tooling produces for minSdk >= 24), pass
--min-sdk-version 26, and add a post-sign guard that fails the build if anyMETA-INFv1 signature files remain. Verified locally: re-signing with these flags yields a clean, aligned, valid v2+v3 APK with no stray cert files.Needs a follow-up patch release (v0.40.1) to publish a re-signed APK.
🤖 Generated with Claude Code