[null,null,["最后更新时间 (UTC):2025-08-17。"],[[["\u003cp\u003eSome Google Play services require the SHA-1 of your app's signing certificate to create an OAuth2 client and API key.\u003c/p\u003e\n"],["\u003cp\u003eWhen using Play App Signing, the SHA-1 can be found in the Google Play Console.\u003c/p\u003e\n"],["\u003cp\u003eIf self-signing your application, Keytool or Gradle's Signing Report can be used to get the SHA-1.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ekeytool\u003c/code\u003e provides both release and debug certificate fingerprints.\u003c/p\u003e\n"],["\u003cp\u003eGradle's \u003ccode\u003esigningReport\u003c/code\u003e command offers signing information for each app variant.\u003c/p\u003e\n"]]],["Google Play services need the SHA-1 of your signing certificate to create OAuth2 clients and API keys. If using Play App Signing, retrieve the SHA-1 from the Google Play Console's App Integrity page. Otherwise, use Keytool or Gradle's Signing Report. Keytool commands can retrieve release and debug certificate fingerprints, including from APK/AAB files. Gradle's `signingReport` task displays signing information for each app variant. Note that the upload key differs from the app signing key when using Play App Signing.\n"],null,["# Client authentication\n\n\u003cbr /\u003e\n\nCertain Google Play services (such as Google Sign-in and App Invites) require\nyou to provide the SHA-1 of your signing certificate so we can create an OAuth2\nclient and API key for your app.\n\nPlay App Signing\n----------------\n\nIf you've published your app using\n[Play App Signing](https://developer.android.com/studio/publish/app-signing#app-signing-google-play),\na requirement when using\n[Android App Bundle](https://developer.android.com/platform/technology/app-bundle),\nyou can get your SHA-1 from the\n[Google Play Console](https://developer.android.com/studio/publish/app-signing#api-providers)\non the **Release \\\u003e Setup \\\u003e App Integrity** page.\n\nSelf-sign your application\n--------------------------\n\nIf you're not using Play App Signing, follow the instructions in the following\nsections to use Keytool or Gradle's Signing Report to get your SHA-1.\n\n### Keytool on the certificate\n\nOpen a terminal and run the `keytool` utility provided with Java to get the\nSHA-1 fingerprint of the certificate. You should get both the release and debug\ncertificate fingerprints.\n\nTo get the release certificate fingerprint: \n\n keytool -list -v \\\n -alias \u003cyour-key-name\u003e -keystore \u003cpath-to-production-keystore\u003e\n\nTo get the debug certificate fingerprint:\nMac/Linux \n\n```\nkeytool -list -v \\\n-alias androiddebugkey -keystore ~/.android/debug.keystore\n \n```\nWindows \n\n```\nkeytool -list -v \\\n-alias androiddebugkey -keystore %USERPROFILE%\\.android\\debug.keystore\n \n```\n\nThe keytool utility prompts you to enter a password for the keystore. The\ndefault password for the debug keystore is `android`. The keytool then prints\nthe fingerprint to the terminal. For example: \n\n Certificate fingerprint: SHA1: DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09\n\n| **Note:** When using Play App Signing, the upload key certificate will be different than the app signing key certificate.\n\n### Keytool on an APK or AAB\n\nTo get the certificate of an application binary: \n\n # APK file\n keytool -printcert -jarfile app.apk\n # AAB file\n keytool -printcert -jarfile app.aab\n\n| **Note:** When using Play App Signing, the signature of the binary signed by the upload key certificate will be different than the binary distributed by Google Play.\n\n### Gradle's signing report\n\nYou can also get the SHA-1 of your signing certificate using the Gradle\n`signingReport` command: \n\n ./gradlew signingReport\n\nThe signing report will include the signing information for each of your app's\nvariants: \n\n \u003e Task :app:signingReport\n Variant: debug\n Config: debug\n Store: ~/.android/debug.keystore\n Alias: AndroidDebugKey\n MD5: A5:88:41:04:8D:06:71:6D:FE:33:76:87:AC:AD:19:23\n SHA1: A7:89:E5:05:C8:17:A1:22:EA:90:6E:A6:EA:A3:D4:8B:3A:30:AB:18\n SHA-256: 05:A2:2C:35:EE:F2:51:23:72:4D:72:67:A5:6C:8C:58:22:2A:00:D6:DB:F6:45:D5:C1:82:D2:80:A4:69:A8:FE\n Valid until: Wednesday, August 10, 2044\n\nTo learn more about digital signing on Android, see\n[Signing Your Applications](https://developer.android.com/tools/publishing/app-signing.html)."]]