人们问了很多这样的问题。但没有一个对我有用。
问题:
我能够使用 AppSignatureHelper.java 获得正确的 key 在 Debug模式下并且一切按预期工作。我已经在 Play 商店上发布了我的应用程序,并在签名的 apk 上使用了相同的类来检索 HASH key ,但它不起作用。我尝试了之前很多问题中提到的所有其他方法,例如 this 。以及使用 keystore 的以下代码:
keytool -exportcert -alias PlayDeploymentCert -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11
他们都没有在已发布的应用程序中工作。短信根本不读!!任何帮助将不胜感激。
最佳答案
您应该从 keystore 文件而不是 AppSignatureHelper 类中获取哈希 key ...
Google 在其文档中正式提及“如果您使用帮助程序类,请务必在获取哈希字符串后将其从应用程序中删除”
因此从 keystore 文件生成哈希 key ...
检查如何生成哈希字符串:Computing your app hash string
Note : If you use app signing by Google Play, download your app signing certificate (deployment_cert.der) from the App signing section of the Google Play console.
Then, import the app signing certificate into a temporary key store
关于java - SMS Retriever API 中发布的 APK 上的 HASH 字符串 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61235902/