Android Debug DAFA Custom IDE Default signature file

Source: Internet
Author: User

Copyright NOTICE: Reprint must indicate this article transferred from Zhangjie's blog: http://blog.yanzhenjie.com

Android Debug DAFA Custom IDE Default signature file, do you bother debugging a third-party SDK when the debug signature and release signature collide? Do you pass the third-party feature test when you debug, and the release is not available?

If you haven't met the question I'm talking about, let me give you a few examples.

    1. Pay, login, share, debug debugging through, Release Si cho not up?
      • If you have not done so, you can read this article to log in and share the tutorial.
    2. Baidu map, Gold map, to constantly switch the debug signature, release signed hash value is very troublesome?
    3. ...

The above problems in the final analysis of the reason is that when we developed the direct operation, using the default debug.keystore signature file, and we packaged the formal environment with our custom xxx.keystore , xxx.jks such as signature files, two files hash value is different.

And the general third-party SDK is through the identification of our application package name and the hash of the signature to determine whether it is registered in their platform, is the official genuine application, if the verification does not pass, naturally can not adjust the third party's app.

Today's article is not much content, only 3 minutes to be able to read, but also to ensure that the above because of the signature caused by the problem.

How to solve the problem

The principle is to change our official signature file keystore password, alias and alias password are the same as the Android default signature debug.keystore , and in Eclipse , AndroidStudio specify our default debug signature file path, At this point when we run the project directly, the IDE will directly use the signature file we specify, at this time, our debug signature and the official release of the signature is consistent, so in the debugging of what, third-party payment is not a signature error and so on.

debug.keystorethe KeyStore password, alias, and alias password for the Android default signature file are:

    • KeyStore Password:android
    • Aliasandroiddebugkey
    • Alias Password:android

So the next step is to modify the three properties of the official signature.

Modify the KeyStore password alias alias password

Special Note: Modify the signature file password, alias, alias password is equivalent to destroy the file, so we modify the time must copy a signature file, and then modify the copy out of the file of the above three properties.

Environment configuration for Java

Modify keystore the password to use Java the command, so you must configure the Java environment in system if the configured person can skip this step, because I now use the Windows system, in order to take care of the small white classmate, also provides a Windows system of Java sublimation configuration method.

First step: Add JAVA_HOME
    1. Right click on the icon on the desktop 计算机 and click Properties.
    2. Click on the dialog "Environment variables" button below in the pop-up after clicking on the attribute.
    3. Under "Environment variables", "User Variables", click New (You can also choose a system variable, the difference is configured after all users of the system to play a role).
    4. Click New to fill in the pop-up dialog 变量名 , fill in the JAVA_HOME 变量值 jdk directory where you are.
    5. When the value is filled, click OK to finish.

Step diagram:

Some students may be confusing the JDK directory to fill in the parent directory or subdirectory, the following is my fill in the jdk directory opened:

Step Two, add CLASS_PATH
    1. Or just click New under the user variable, then copy the content below to 变量名 and 变量值 then save:
      Variable name: CLASS_PATH
      Variable Value: .;%JAVA_HOME%/lib/tools.jar;%JAVA_HOME%/lib/dt.jar;

Do not question any of the above punctuation, full copy can, I was so careful.

Step three, add PATH
    1. In the list of user variables, see if there is a variable named variable PATH , and if not, click New, and then click Edit If one is selected.

If it is new, then your variable name and variable value are like this:
Variable name: PATH
Variable Value: %JAVA_HOME%/bin;

If you are editing, then the value of your variable should be appended with another ; %JAVA_HOME%/bin; :

Fourth step, check the environment

When you open the System command line, enter the java -version following information to indicate that your configuration was successful:

Of course, if you do not rest assured, you can also enter in the command line, java javac such as command, there will be a first-off message output.

Confirm that there is no problem, we can proceed to the next modification keystore of the properties.

Modify the KeyStore password alias alias password

Suppose our signature file is called nohttp.jks or nohttp.keystore , anyway, the signature file you created.

  • The first step is to open the command line and go to the folder where your KeyStore file is located, such as my nohttp.jks desktop:

  • In the second step, change the keystore password and enter it at the command line:
    keytool -storepasswd -keystore nohttp.jks
    nohttp.jksThis is the full name of the signature file, which prompts you for the current password of the certificate, and then asks for a new password, and a new password to enter again. The current password of course only you know, Xinmi and repeat password according to the beginning, must be entered android .

  • The third step, keystore modified alias , is entered at the command line:
    keytool -changealias -keystore nohttp.jks -alias <alianame> -destalias androiddebugkey
    Which is the full name of the nohttp.jks signature file, is the name of the current certificate, followed <alianame> by the alias -destalias name to be modified, as the alias beginning of the said, here must be changed androiddebugkey ; for example alias , my name is nohttp Then my complete command is:
    keytool -changealias -keystore nohttp.jks -alias nohttp -destalias androiddebugkey
    Enter keystore the password (above has been modified android ) and the current alias password (this only you know).

  • Fourth step, change alias the password, enter in the command line:
    keytool -keypasswd -keystore nohttp.jks -alias androiddebugkey
    Which nohttp.jks is the full name of the signature file, enter after the prompt for the KeyStore password (the above has been modified to android ), alias password (this only you know), and then prompted to enter a new alias password, according to the beginning, must be entered android .

The operation to modify the properties here is alias all done, and the following is Eclipse AndroidStuio configured by default debug keystore for us after modifying the properties keystore .

Configuring the default KeyStore for development tools

We used to Android IDE be ADT the AndroidStudio same, the following provides two IDE configuration default debug keystore method.

Androidstudio

If you use it AndroidStudio , first we keystore will copy the previous and modified copies to the debug keystore project root directory.

Then you need to app module configure the files under the project gralde :

Android {...Defaultconfig {ApplicationID...        ...} signingconfigs {//debug default signature configuration, here the password and other information is just after we modified. Debug {storefile file (".. /sign_store_debug.jks ")//The default debug KeyStore path that has just been modified. Storepassword' Android 'The default debug keystore password. Keyalias' Androiddebugkey 'The default debug KeyStore alias. Keypassword' Android 'Default Debug KeyStore's alias password.        }//And the same as above, but the path and password of the official file, I use * instead. Release {StoreFile file (".. /sign_store_release.jks ") Storepassword * * * * keyalias * * * Keypassword}} buildtypes {...}}

Here's what I configured:

Eclipse + ADT

If you use ADT , then click on Eclipse the menu bar Window -and Preferences then select on the left Android - Build , on the right side out of the interface Customer debug keystore after selecting the item Browser just after we modified keystore , and then OK.

So far, to modify the IDE default signature files are all done, still waiting for what, try to configure your application to try it. There is also, finally inserted in a sentence, Welcome to join my blog on the left side of the communication group to drive/shy.

Copyright NOTICE: Reprint must indicate this article transferred from Zhangjie's blog: http://blog.yanzhenjie.com

Android Debug DAFA Custom IDE Default signature file

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.