Add code signing for Android release artefacts
What is the problem or limitation you are having?
Briefcase currently supports code signing on macOS and Windows. Code signing is also required for Android release artefacts.
Describe the solution you'd like
briefcase package android --identity <identity> should accept a path to a keystore, and use that keystore to sign the app.
briefcase package android should prompt the user to do one of:
- Ad-hoc sign the app (i.e., do nothing explicit with signatures, as is done currently)
- Look for any file named
*.jksin the project folder, the.androidsubfolder of the project folder, or the user's~/.androidfolder, and provide those files as candidate keystores to use. - Create a new keystore named
org.example.myapp.jksin a.androidfolder of the project directory, and use that keystore.
Describe alternatives you've considered
Continue to require manual signing. The process of generating a keystore and signing the app; this is a simplification process.
Additional context
No response
You can configure both the debug and the release keystore with a build.gradle setting like this. To add it to your app, put a build_gradle_extra_content setting in the android section of your pyproject.toml file (probably as a TOML multi-line string), then rerun briefcase create android.
For a complete example, see https://github.com/beeware/briefcase/issues/2189#issuecomment-2721878049.