Skip to content

feat(cli): setup Android signing - #9964

Closed
lucasfernog wants to merge 4 commits into
devfrom
feat/android-signing
Closed

feat(cli): setup Android signing#9964
lucasfernog wants to merge 4 commits into
devfrom
feat/android-signing

Conversation

@lucasfernog

Copy link
Copy Markdown
Member

Tweaks the default Android project to include a simple setup for Android signing.

Example Github Action usage:

- name: setup Android signing
        working-directory: src-tauri/gen/android
        run: |
          echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
          echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
          base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
          echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties

@lucasfernog
lucasfernog requested a review from a team as a code owner June 4, 2024 12:50
amrbashir
amrbashir previously approved these changes Jun 4, 2024
Comment on lines +12 to +19
val keystoreProperties = Properties()
try {
// release builds require the file to be set up
keystoreProperties.load(FileInputStream(rootProject.file("keystore.properties")))
} catch (e: Exception) {
// load a dummy file for debug purposes (signing config won't be used)
keystoreProperties.load(FileInputStream(rootProject.file("keystore.properties.dummy")))
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe we should just include keystore.properties by default instead of the dummy one, or even just remove this altogether and just document how users might want to add signing later on if they wish.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i'd be fine with this on docs instead @FabianLars @simonhyll

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It used to be in the docs but was lost in recent refactors of tauri documentation and whether we merge this PR or not, I think we will still need to have it documented

@lucasfernog

Copy link
Copy Markdown
Member Author

@FabianLars what do you think about this standard approach vs a documentation based one? I'd like to get this resolved asap..
Personally I like giving an easier path to this for users for DX, but I also agree this is usually handled by docs instead.

@amrbashir

Copy link
Copy Markdown
Member

I was going to PR the guide today, maybe I will do it tomorrow

@FabianLars

Copy link
Copy Markdown
Member

I really like the idea (though we should also document the manual approach) but maybe it makes more sense to match the other platforms where we rely on env vars (or maybe both)?

@amrbashir

amrbashir commented Jun 26, 2024

Copy link
Copy Markdown
Member

I opened a PR for signing guide tauri-apps/tauri-docs#2337 anyways as it needs to be documented nonetheless

@lucasfernog

Copy link
Copy Markdown
Member Author

I really like the idea (though we should also document the manual approach) but maybe it makes more sense to match the other platforms where we rely on env vars (or maybe both)?

in this case i think it's dangerous since we would end up writing secrets in plain text..

@lucasfernog

Copy link
Copy Markdown
Member Author

I opened a PR for signing guide tauri-apps/tauri-docs#2337 anyways as it needs to be documented nonetheless

if we merge this PR we also need to update that guide btw

@lucasfernog

Copy link
Copy Markdown
Member Author

another reason to merge this is that it helps people that do not commit the gen folder

@amrbashir

Copy link
Copy Markdown
Member

another reason to merge this is that it helps people that do not commit the gen folder

didn't we change that behavior? at least it should be fine to not ignore gen folder by default, there is only a couple of files that should be ignored and we can add them in the .gitignore

@FabianLars

Copy link
Copy Markdown
Member

Yes, we changed it, but that doesn't mean that everyone will want to commit the folder if they don't intend on changing files in it (ignoring the context of this pr)

@lucasfernog

Copy link
Copy Markdown
Member Author

by default we gitignore the gen folder IIRC

@socket-security

socket-security Bot commented Jun 26, 2024

Copy link
Copy Markdown

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/typescript@5.5.2

View full report↗︎

@amrbashir

Copy link
Copy Markdown
Member

by default we gitignore the gen folder IIRC

we don't, we only ignore gen/schemas

@amrbashir

Copy link
Copy Markdown
Member

the problem with this PR approach is it just as broken as if it wasn't configured, I would say even more broken, since without you can build your unsigned apk successfully but with this, it will always fail until signing is configured.

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.

3 participants