Summary of Android wechat signature knowledge

preface

Recently, an application of a project needs to log in on wechat. We all know that wechat login needs to be applied on the open platform. After creating a mobile application on the wechat development platform, you need to fill in:

problem

The application signature here is MD5 of the keystore certificate, but wechat has only one input box to fill in. Unlike Baidu map and Gaode map, there are two kinds of SHA1 on the cable and SHA1 for development and debugging. This is tangled. During development and operation, the signature keystore used by as ide by default is system debug The keystore of the system must be different from the MD5 and SHA1 of the keystore on its own project line. The problem is how to use the online one uniformly without affecting the development and debugging.

Solution

Since we can't use the online and system debugged keystore at the same time, we can use the same one. It's ok as long as we ensure the consistency of MD5 and SHA1. On wechat, we continue to use the online MD5, baidu map, high-end map and other third-party services to use the online keystore for both online and development and debugging SHA1:

From the command line, enter the directory where the online keystore file is located, and then enter the following command to view the signature.

Copy an online keystore file in the same folder:

Modify the alias alias of the keystore file to Android debugkey (this is the alias of the debug.keystore of the system. If it is not this alias, it will fail to compile when debugging and running, prompting the need to use this alias). Use the following command to modify it:

-Alias is followed by the original alias and - destalia is followed by the new alias. Remember to use Android debugkey as the alias.

Modify the passwords of storepasswd and keypasswd of keystore for debugging to "Android" (the same password as that of debug.keystore of the system is also required). Use the following command to modify:

After each command line, you need to enter the original keystore and key password, and then enter the new password:

Then use the commands MD5 and SHA1 at the beginning to view the new keystore file for debugging and development to see if the signature is the same as that on the line.

Finally, configure in gradle:

After configuration, resynchronize gradle, and then rebuild the project. Click build -- rebuild project in the menu bar of Android studio, and the new certificate will take effect. (as long as the signature certificate is replaced or modified, the project needs to be rebuilt)

summary

The above is the whole content of this article. I hope the content of this article can be helpful to Android developers. If you have any questions, you can leave a message.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>