Android Development Essentials--Modify Debug signature

Source: Internet
Author: User
Tags sha1

Objective

The small partners who are engaged in the development of Android will surely encounter such problems. When you need to integrate Baidu maps, Aurora push and other third-party platforms, you will apply for a thing called Appkey. At the same time, you have to provide MD5 or SHA1 to apply the signature information. And then it's sad to find that this function works only when packaged with the specified signature file. If you are using the debug KeyStore signature information of the development tool, run it directly, if you are using the KeyStore of the app release, you will have to export an apk every time you test. Hearts 10,000 grass mud horse in the Pentium have wood there?

Landlord before the small trick is to apply for two appkey, respectively, corresponding to the debug KeyStore and release KeyStore. Then in the heart silently for their own wit point a praise. However, some of the more intelligent partners than the landlord found that eclipse can replace the signature file. So full of joy to designate a keystore, look forward to such a picture ( note I here MD5 and SHA1):

But what you see is this:

The heart of a small partner should be broken.

Signature file (KeyStore)

When generating the signature file, the most important three messages entered are:store password,key alias,key password. Children's shoes with eclipse export apk experience should be clear about the effects of these three messages.

It should be a good idea to understand the previous error, because when you specify debug KeyStore, Eclipse does not allow you to enter the above three information at all. I just smiled and laughed ... Looking at the default debug KeyStore, there is an illusion that the signature file does not have a password.

However, the facts are not the same as we thought. The three messages for the default debug KeyStore are as follows:

    1. Store Password:android
    2. Key Alias:androiddebugkey
    3. Key Password:android

Also, the debug keystore for Eclipse only recognized the keystore that contained the three messages.

Modify a signature file

Already know the cause of the error, then the next solution can only try to modify the KeyStore in the three information. Can't you just regenerate a keystore that contains this three information? And then the egg ...

Before you change, check the information in KeyStore:

Note that the MD5 and SHA1 here are consistent with the previous.

View KeyStore Info: keytool-list-v-keystore "KeyStore file"-storepass "KeyStore password"

Change the above three information in three steps. Compared to the pit father is, here can only play with the command ( before modifying, remember to back up the original signature file ).

    1. Modify the store password.

      Command: Keytool-storepasswd-keystore "KeyStore file".
      You will be prompted to enter your old password and enter your new password two times to change your new password to Android.

    2. Modify the key alias.

      Command: Keytool-changealias-keystore "KeyStore file"-alias "KeyStore alias"-destalias "Destination alias".
      Change the destination alias to: Androiddebugkey, will be prompted to enter the first password, is the first step of the Android, the second password is the previous key password.

    3. Modify key password.

      Command: Keytool-keypasswd-keystore "KeyStore file"-alias "specify Alias for password change"
      Because, in a keystore, you can store multiple alias, so here you need to specify the alias that modifies the password (this should be Androiddebugkey), and then you need to enter the store password:android (modified). Then enter the old key password (previously just modified Alias:androiddebugkey). Finally, enter two new key password:android.

Finally, review the signature file information again:

The key vault password entered has been modified to Android,alias has also been modified to Androiddebugkey. Now you can put it in eclipse and replace it.

The powerful Androidstudio

See here, the heart is very tired have wood have? It feels like eclipse is an incredible pit-daddy. Curious, androidstudio How to achieve this function, then the next operation, may make you stunned.

The first step is to add a signature file configuration information. Select KeyStore and enter the store password, key alias,key password.

In the second step, in debug mode, select the signature file configuration information that you added earlier.

It can also be configured directly in the Gradle.

Then, then, there was no more. There is only one evaluation for studio, Android development artifact. No one ...

No, I'm going to uninstall eclipse.

Android Development Essentials--Modify Debug signature

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.