# Before releasing on Google Play, give Firebase the SHA of your release keys

The step `firebase_auth.google_release_sha`, for [`firebase_auth`](https://doc.saymyframe.com/modules/firebase-auth.md).

Google recognizes the Android app by the SHA-1 and SHA-256 of the key that signs it. The script `dart tool/enable_firebase_sign_in.dart` registers those of the debug key of your machine, so sign-in with Google works in debug builds. A release build is signed with other keys, and until Firebase knows them, sign-in with Google fails in the release, for example in a test track of Google Play.

You do this once, before the first release on Google Play, and again if you change the keys.

:::tip
The screenshots show the example package name `com.example.my_app` and the example Firebase project `my-app-12345`. The orange frames mark what to click, in the order of their numbers.
:::

**1. Find the SHA of the release keys.** With Play App Signing, which Google Play uses for every new app, two keys matter:

- **The app signing key**, with which Google Play signs what it delivers to users.
- **The upload key**, with which you sign what you upload to Google Play.

Both are in the [Play Console](https://play.google.com/console): open the app, then **Test and release > App integrity**, then **App signing**. Copy the **SHA-1** and the **SHA-256** of both certificates.

Before the app is in the Play Console, read the upload key from its keystore:

```bash
keytool -list -v -keystore upload-keystore.jks -alias upload
```

**2. Add them in Firebase.** In the [Firebase console](https://console.firebase.google.com/), open your project. In the menu on the left, point at **Settings** and click **General**. Under **Your apps**, select the Android app. Under **SHA certificate fingerprints**, the debug fingerprints that the script registered are listed already. Click **Add fingerprint** (1).

![Your apps, with the Android app my_app, its SHA certificate fingerprints and Add fingerprint marked 1](https://doc.saymyframe.com/assets/images/android-sha-0295d36b27f9f62b10427ca2262388cf.png)

Paste one of the fingerprints (2) and click **Save** (3). Firebase tells SHA-1 and SHA-256 apart by their length. Repeat for each of the four.

![The field Certificate fingerprint with a SHA-256 marked 2 and the button Save marked 3](https://doc.saymyframe.com/assets/images/android-add-sha-ad8b2a33d540628bb7f6eec73809c480.png)

The Firebase CLI does the same, with the id of the Android app from `firebase.json` of the app:

```bash
firebase apps:android:sha:create <appId> <sha>
```

**Check.** Install the release from a test track of Google Play and sign in with Google.
