Skip to content

feat: Add code signing for Android release artefacts#2724

Open
JohananOppongAmoateng wants to merge 9 commits intobeeware:mainfrom
JohananOppongAmoateng:publishing-android
Open

feat: Add code signing for Android release artefacts#2724
JohananOppongAmoateng wants to merge 9 commits intobeeware:mainfrom
JohananOppongAmoateng:publishing-android

Conversation

@JohananOppongAmoateng
Copy link
Contributor

Add code signing for Android release artefacts Closes #1268

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I've given a partial review; the general shape of things looks good, but there's some reorganisation that will be required, and I'm not 100% certain about some of the details in the implementation (specifically, if the -P arguments you're referring to are standard features, or something we'll need to accomodate).

I haven't done a full review of the test cases yet, mostly because they'll see a bunch of changes from the reorganisation.


* The project root directory
* The project's `.android/` subfolder
* `~/.android/`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ is UNIX-specific terminology - something like:

Suggested change
* `~/.android/`
* The `.android/` folder in the user's home directory

would be preferred here.

Comment on lines +414 to +415
> [!IMPORTANT]
> Keep your keystore file secure and backed up. If you lose it, you will not be able to publish updates to your app on the Play Store.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the syntax we use for callouts. See the admonitions and notes section of our style guide.

$ briefcase package android --identity /path/to/my-release-key.jks
```

You can also supply the alias and passwords non-interactively:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first mention of alias and passwords; this might need some clarification:

Suggested change
You can also supply the alias and passwords non-interactively:
If you are using a keystore that has been created with an alias or password, you can also supply those properties at the command line:

Also - what's the behavior if you interactively select an keystore from a list, but that keystore requires an alias or password?

def _keytool(self) -> Path:
"""Path to the keytool executable bundled with the JDK."""
ext = ".exe" if self.tools.host_os == "Windows" else ""
return self.tools.java.java_home / "bin" / f"keytool{ext}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These keytool calls seem out of place here. They should be part of the android_sdk integrations. (Although the signing tools ship with java, it's very much tied to android signing, so we might as well keep it there).

I'd suggest pulling these tools into a standalone object (a separate signing namespace) so android_sdk.signing.create_keystore() is how you create the initial keystore, etc.

f"-Pandroid.injected.signing.store.file={signing_config.keystore_path!s}",
f"-Pandroid.injected.signing.store.password={signing_config.store_password}",
f"-Pandroid.injected.signing.key.alias={signing_config.alias}",
f"-Pandroid.injected.signing.key.password={signing_config.key_password}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these standard configuration points, or do we need to modify the Android gradle template to support these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These work with the android gradle plugin so we dont need to modify the gradle template

"debug-apk": ("assembleDebug", "apk/debug/app-debug.apk"),
}[app.packaging_format]

build_type, build_artefact_path = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you removed the wait_bar usage here?

@JohananOppongAmoateng
Copy link
Contributor Author

@freakboy3742 i will address all your concerns later bogged down with work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add code signing for Android release artefacts

2 participants