2

Docs Google's docs is not clear can someone please help me in this I already searched a lot no one is giving proper explanation about it. I've marked over lines which are making me confuse... like where to append the hex sting where to write the fuckin command they didn't mentioned and they said compute the sha-256 sum of the combined string but how??? at last they give you one more command by saying you will get the 11 characters long hash which is working fine but I'm getting wrong hash key again.

I need proper explanation of this docs many people are searching for this already it will help them as well

enter image description here

4

1 回答 1

0

第 1 步。(如果您直接签署 APK,请跳过它)

首先,前往您的Google Play 控制台并下载您的应用签名证书 ( deployment_cert.der)。然后转到安装 Java Jdk 的文件夹并在终端中打开 bin 文件夹。然后键入以下命令将应用签名证书导入临时密钥库:

keytool -importcert -file deployment_cert.der -keystore temporary.keystore -alias PlayDeploymentCert

您必须在其中提及您的app signing certificate file. 如果你得到 keytool command not found 错误,只需键入以下命令,如下所示,

./keytool -importcert -file deployment_cert.der -keystore temporary.keystore -alias PlayDeploymentCert.

第2步:

在您上面提到的文档中,解释了所有步骤,但要获取应用程序的哈希键,请键入以下命令,

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

如果您正在使用 Google Play 的 App Signing 并完全按照我所做的第 1 步执行,那么只需键入temporary.keystore代替MyProductionKeys.keystore并将包名称更改为com.example.myapp您的应用程序包名称。然后按回车键,你会得到你的哈希键。

对于那些直接签署他们的 APK 的人,您需要提及您的 KeyStore 文件的完整路径,然后更改输入您的别名密钥,-alias 然后com.example.myapp根据您的应用程序的包名称进行更改。然后按回车键,你会得到你的哈希键。

或者,您可以从 SMS 检索器示例应用程序中使用AppSignatureHelper 类获取您的应用程序的哈希字符串。但是,如果您使用帮助程序类,请确保在获得哈希字符串后将其从您的应用程序中删除。不要在验证消息中使用在客户端上动态计算的哈希字符串。

于 2021-10-27T06:22:55.777 回答