Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use mobilestack references in android builds #6039

Merged
merged 25 commits into from
Nov 4, 2024

Conversation

jophish
Copy link
Contributor

@jophish jophish commented Sep 18, 2024

Description

Makes the Android builds more brand agnostic. Replaces the existing keystore android keystore containing the upload key by:

  • Renaming the private key alias within the keystore from celo-release-key to mobilestack-release-key
  • Using the same password for both the store as well as the private key within

Test plan

Related issues

  • Fixes #[issue number here]

Backwards compatibility

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

@@ -39,8 +39,8 @@ jobs:
with:
secrets: |-
ANDROID_RELEASE_KEYSTORE:projects/1027349420744/secrets/ANDROID_RELEASE_KEYSTORE
CELO_RELEASE_KEY_PASSWORD:projects/1027349420744/secrets/CELO_RELEASE_KEY_PASSWORD
CELO_RELEASE_STORE_PASSWORD:projects/1027349420744/secrets/CELO_RELEASE_STORE_PASSWORD
MOBILESTACK_RELEASE_KEY_PASSWORD:projects/1027349420744/secrets/MOBILESTACK_RELEASE_KEY_PASSWORD
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've ported over these secrets in GCP

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.92%. Comparing base (f788797) to head (ef89804).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6039      +/-   ##
==========================================
- Coverage   88.93%   88.92%   -0.01%     
==========================================
  Files         737      737              
  Lines       31371    31371              
  Branches     5800     5800              
==========================================
- Hits        27899    27898       -1     
- Misses       3274     3429     +155     
+ Partials      198       44     -154     

see 66 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f788797...ef89804. Read the comment docs.

@@ -50,6 +50,9 @@ jobs:
yes | sdkmanager "platform-tools" "platforms;android-${{ inputs.android-api-level }}"
set -o pipefail

# Install Ninja
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See here; not sure why this is now needed, though I have to imagine it's related to the rest of the changes in this PR

@jophish
Copy link
Contributor Author

jophish commented Sep 19, 2024

This seems to fail on the nightly release that I tested due to the build looking for celo-release-key.keystore, despite having removed all apparent references of it from the repo... not sure why this is happening.

@jophish jophish changed the title refactor: Use mobilestack reference in android builds refactor: Use mobilestack references in android builds Sep 19, 2024
kathaypacific
kathaypacific previously approved these changes Sep 19, 2024
Copy link
Collaborator

@kathaypacific kathaypacific left a comment

Choose a reason for hiding this comment

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

LGTM!!

android/app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@kathaypacific kathaypacific dismissed their stale review September 19, 2024 08:27

Oh wait, I just saw your comment about the release not working with these changes 🙈

@jophish
Copy link
Contributor Author

jophish commented Sep 26, 2024

The nightly release test passed! https://valora-app.slack.com/archives/C02D08P412Q/p1727385960907899

Copy link
Collaborator

@kathaypacific kathaypacific left a comment

Choose a reason for hiding this comment

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

🚀 LGTM! remember to populate the PR description before merging :D

Copy link
Member

@jeanregisser jeanregisser left a comment

Choose a reason for hiding this comment

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

Great!

.github/workflows/release-fastlane-android.yml Outdated Show resolved Hide resolved
Comment on lines 21 to 24
# Note that the key alias lacks Mobile Stack naming, since updating this would
# require regenerating the keystore.
MOBILESTACK_RELEASE_STORE_FILE=mobilestack-release-key.keystore
MOBILESTACK_RELEASE_KEY_ALIAS=celo-key-alias
Copy link
Member

Choose a reason for hiding this comment

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

I think we can update the keystore. Also an opportunity to use the same password for the store and the key inside.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeanregisser What's the typical process for this? I assume we want to re-use our existing upload key; I can't seem to find an option in Android Studio (which is what I've used in the past for creating brand new upload keys/keystores) to create a new keystore from an existing key.

Copy link
Member

Choose a reason for hiding this comment

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

Hey, this can be done using the keytool cli:

WALLET.md Outdated Show resolved Hide resolved
.github/workflows/release-fastlane-android.yml Outdated Show resolved Hide resolved
.github/workflows/release-fastlane-android.yml Outdated Show resolved Hide resolved
android/app/build.gradle Outdated Show resolved Hide resolved
@jophish
Copy link
Contributor Author

jophish commented Oct 31, 2024

The android release has been successfully tested here using a newly generated keystore with a different alias for the upload key as well as identical passwords for the store and private key.

android/.project Outdated
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>celo</name>
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure how much this name matters, but should we have the name here and in app/.project consistent?

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="persona_inquiry_start_title">Valora would like to verify your identity</string>
<string name="persona_inquiry_start_title">This app would like to verify your identity</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

wonder if this can somehow use app name. I guess its a barely used feature so maybe not too important

@jophish jophish added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit 7e74af3 Nov 4, 2024
16 checks passed
@jophish jophish deleted the jophish/android-mobilestack branch November 4, 2024 14:45
jophish added a commit to mobilestack-xyz/mobilestack-runtime that referenced this pull request Nov 12, 2024
### Description

Makes the Android builds more brand agnostic. Replaces the existing
keystore android keystore containing the upload key by:
* Renaming the private key alias within the keystore from
`celo-release-key` to `mobilestack-release-key`
* Using the same password for both the store as well as the private key
within

### Test plan

<!-- Demonstrate the change is solid, or why it doesn't need testing.
Example: add any manual testing steps or scenarios (if not obvious),
screenshots / videos if the pull request changes the user interface.
-->

### Related issues

- Fixes #[issue number here]

### Backwards compatibility

<!-- Brief explanation of why these changes are/are not backwards
compatible. -->

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [ ] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
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.

4 participants