A summary of Android micro-letter Signature Knowledge _android

Source: Internet
Author: User
Tags sha1

Objective

Recently encountered a project application to the micro-letter login, we all know that micro-letter login is required to open platform applications, in the micro-trust development platform to create mobile applications, you need to fill in:


What needs to be filled in

Problem

Here the application signature is keystore the MD5 of the certificate, but the micro-letter this only a fill in the input box, unlike the Baidu map, the gold map, wired on the SHA1 and development and commissioning of the SHA1 two species, then this is entangled, in the development of the runtime as the default signature used by the IDE keystore is a system debug.keystore, the system and their own project line of keystore MD5, SHA1 Affirmation is not the same, then the problem, how to unify the line, without affecting the development of debugging.

Solution

Since you can't use both the online and debug the system keystore , then we use the same one, as long as to ensure that MD5, SHA1 consistent on the OK, micro-letter on our continued use of online MD5, Baidu Map, high-end maps and other third-party services to the online and development of debugging SHA1 are used online keystoreof:

The command line enters keystore the directory of the files on the line, and then enter the following command to view the signature.

Keytool-list-v-keystore App-release.jks

Copy a line of keystore files under the same folder:


Modify the keystore alias of this file, change to (the system's alias androiddebugkey debug.keystore alias is this, if not this alias, debug run time will compile not to pass, prompt to use such alias), use the following command to modify:

Keytool-changealias-keystore Ishopping-debug.jks-alias Ishopping-destalias Androiddebugkey

-aliasThe original alias is followed by the -destalias new alias, and remember to use it androiddebugkey as an alias.

Modify Debug with keystore the storepasswd keypasswd password "Android" (also need to use the same password as the system debug.keystore ), use the following command to modify:

Modify Key Password
keytool-keypasswd-keystore ishopping-debug.jks-alias androiddebugkey
//Modify KeyStore password
keytool- Storepasswd-keystore Ishopping-debug.jks

Each line command, you need to enter the original KeyStore and key password, and then enter a new password:


Modify password

Then use the opening view signature MD5 and SHA1 commands to see the new Debug development keystore file to see if the signature is the same as the line.

Finally in the Gradle inside configuration:

Signingconfigs { 
 Release { 
 //Here is a relative path, you can create a new key folder under Module app to copy keystore files into
 storefile file (' key/ Ishopping.jks ') 
 } 
 Debug { 
 storefile file (' Key/ishopping-debug.jks ')}}
buildtypes { Release 
 { 
 minifyenabled false 
 proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro ' 
 signingconfig signingconfigs.release 
 } 
 Debug { 
 signingconfig Signingconfigs.debug 
 }
}

After the configuration is complete, resynchronize the gradle, then rebuild the project, and click on the Android Studio menu bar Build- Rebuild project, the new certificate will not take effect. (As long as you replace the signature certificate, you will need to rebuild the project)

Summarize

The above is the entire content of this article, I hope this article on the content of Android developers can help, if you have questions you can message exchange.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.