jamulussoftware / jamulussoftware/jamulus
Android: Add proper APK signing & zipalign'ing
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 1.1k
- Fork
- 248
- Merge medio
- 2g 3h
- PR unite (30g)
- 9
Descrizione
APKs currently do not seem to be signed. The `androiddeployqt` does not contain the relevant parameters:
https://github.com/jamulussoftware/jamulus/blob/5f8ce856114f3ff34ba7bbd43bfaac0ff9579b52/autobuild/android/autobuild_apk_2_build.sh#L33
This means that APKs are currently signed with debug keys (which, I assume, are freshly generated in each new run).
```
02-19 11:55:00.948 1070 1625 W PackageManager: Package com.github.jamulussoftware.jamulus signatures do not match previously installed version; ignoring!
02-19 11:55:00.965 462 30113 E : Couldn't opendir /data/app/vmdl2123040391.tmp: No such file or directory
02-19 11:55:00.965 462 30113 E installd: Failed to delete /data/app/vmdl2123040391.tmp: No such file or directory
```
```
$ /opt/android-sdk/build-tools/30.0.3/apksigner verify --print-certs jamulus_3.8.2beta1_android.apk
Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
Signer #1 certificate SHA-256 digest: 027398c8681ae8f1eb530afc224e1acbc9a904752af435c37e4e8fcfd47e568f
Signer #1 certificate SHA-1 digest: e080c2b954df6cd94d1305fc025d96a4068f12c8
Signer #1 certificate MD5 digest: af64a6a9340ed57910e387fd8ba1d8b8
```
```
$ /opt/android-sdk/build-tools/30.0.3/apksigner verify --print-certs jamulus_3.8.2rc1_android.apk
Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
Signer #1 certificate SHA-256 digest: 61a02eb837389a9cf17bb7f4b91f3ec72e81e27e19b9a7d3a88fd59142f8497b
Signer #1 certificate SHA-1 digest: b584757c43598e2fb18cac1227ca47600a14816b
Signer #1 certificate MD5 digest: 07eea7058e5a4cd42e14984a50dc64f3
```
**Has this feature been discussed and generally agreed?**
No. I believe this is one (maybe even the one) reason for #1760. As signing is a separate, non-trivial task and as I'm not sure if it solves everything, I'm opening this as a dedicated issue.
**Describe the solution you'd like**
Without having put much effort into research, I assume that simply signing with a proper, permanent self-signed certificate should work: https://doc.qt.io/qtcreator/creator-deploying-android.html#signing-android-packages
Hints that this is the likely root cause:
https://stackoverflow.com/questions/41709102/package-signatures-do-not-match-the-previously-installed-version/41711890#41711890
https://qa.h-mdm.com/5207/cannot-upgrade-the-application-signatures-do-not-match
- [x] Only start work after autobuild logic refactoring has been completed
- [ ] Securely generate a key
- [ ] Store it in Github secrets
- [ ] Modify autobuild `androiddeployqt` call to use the key from Github secrets
- [ ] Ensure that `zipalign` is also run
- [ ] Verify that the Warnining/Error/Update problem goes away
**Describe alternatives that have been considered**
-
cc @NickHyHo
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Start with autobuild/android/autobuild_apk_2_build.sh at the referenced androiddeployqt call, after the autobuild logic refactoring is complete. Determine how a permanent signing key can be securely provided through GitHub secrets, then ensure signing and zipalign are applied and verify the APK with apksigner and the install/update behavior described in the issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android
- Ambito
- build-system, ci-cd, mobile-dev, security
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100