Skip to content

How to manage app signing

Shen Yang edited this page Oct 17, 2021 · 5 revisions

If the google play key was lost, contact google support to request a key reset.

If the app is not signed properly, a url bar will be shown at the top of the page.
untrusted TWA

To sign the app, first generate a key.

Key Generation

  1. In the menu bar, click Build > Generate Signed Bundle/APK.
  2. In the Generate Signed Bundle or APK dialog, select Android App Bundle or APK and click Next.
  3. Below the field for Key store path, click Create new.
  4. On the New Key Store window, provide the following information for your keystore and key, as shown below. untrusted TWA
  5. Keystore
    • Key store path: Select the location where your keystore should be created.
    • Password: Create and confirm a secure password for your keystore.
  6. Key
    • Alias: Enter an identifying name for your key.
    • Password: Create and confirm a secure password for your key. This should be different from the password you chose for your keystore.
    • Validity (years): Set the length of time in years that your key will be valid. Your key should be valid for at least 25 years, so you can sign app updates with the same key through the lifespan of your app.
    • Certificate: Enter some information about yourself for your certificate. This information is not displayed in your app, but is included in your certificate as part of the APK.
  7. Once you complete the form, click OK.

Name the key file CASA_keystore.jsk and put it one level above the repo root.
Use the same password for the keystore file and key.

Next make a keystore.properties file at the repo root containing:
App.signing.storeFile=../../CASA_keystore.jsk
App.signing.password=password-from-above
App.signing.alias=your-alias-from-above
Next generate a fingerprint for the key using the same 3 fields
keytool -list -v -keystore [path] -alias [alias] -storepass [password] -keypass [password]

In the output, look for the line starting with SHA256: It should look something like SHA256: CC:92:56:F9:DE:F0:A1:AD:9F:B0:C1:45:12:C7:77:31:F5:76:36:23:9C:95:E0:B5:2B:D8:C6:E8:BF:30:ED:70

Copy the part starting at CC:92... and set an environment variable where the website is hosted called ANDROID_CERTIFICATE_FINGERPRINT to the value

See https://developer.android.com/studio/publish/app-signing#generate-key