My Android advanced tutorial ------) Create and view a custom Debug version Android signature certificate in Android

Source: Internet
Author: User
Tags certificate fingerprint

My Android advanced tutorial ------) Create and view a custom Debug version Android signature certificate in Android

When Android Application Development accesses various sdks, it will find that many sdks need to be identified by the package name and the certificate fingerprint SHA1 code, such as the Baidu map SDK. In this way, using the default automatically generated debug will cause some trouble for development and debugging. In this case, you can modify the official release keystore to generate a temporary custom debugging certificate that complies with the rules for development. The specific method is as follows.

First, you must know where the default debug certificate is located. Open Eclipse --> Windows --> Preferences

--> Android --> Build, as shown in:

 

 

Then open cmd to view, enter the. android directory, and enter the command to view the details of the debug. keystore. As follows:

C: Documents and SettingsAdministrator. android> keytool-list-v-keystore debug. keystore enter keystore password: keystore type: JKS keystore provider: SUN your keystore contains one entry alias: androiddebugkey creation date: entry type: PrivateKeyEntry certificate chain length: 1 certificate [1]: Owner: CN = Android Debug, O = Android, C = US Publisher: CN = Android Debug, O = Android, C = US serial number: 4ccdc980 validity period start date: Mon Sep 07 14:00:58 CST 2015, deadline: Wed Aug 30 14:00:58 CST 2045 certificate fingerprint: MD5: 95: 15: A3: 05: C6: 02: 86: 07: C3: 42: D7: AF: E8: F1: B6: ED SHA1: E1: F7: 8E: 35: DF: DC: 85: 9E: 7D: AB: 62: 83: 5A: F0: AD: D6: A3: 41: D8: 06 SHA256: BB: 06: CD: 55: 45: 5F: 43: 58: C5: 5B: 59: 3D: 6B: 1D: F1: 85: B0: F1: 15: 69: 98: 4D: 7A: 2C: 17: 0B: E9: BB: 13: a1: 82: 51 signature algorithm name: SHA256withRSA version: 3 extension: #1: ObjectId: 2.5.29.14 Criticality = falseSubjectKeyIdentifier [KeyIdentifier [0000: AA 1C 94 38 C4 8B 6D 03 38 2D 37 79 69 B5 69 4D... 8 .. m.8-7yi. iM0010: 86 33 B8 19. 3 ..] **************************************** **************************************** ******


You can obtain the following information:
Keystore name: "debug. keystore"
Keystore password: "android"
Key alias: "androiddebugkey"
Key password: "android"
CN: "CN = Android Debug, O = Android, C = US"

 

Therefore, we can follow this rule to use custom debugging certificates.

 

 

Step 1: generate a formal certificate for our application. As shown in.

1. Create a New keystore, select the export location, enter the password, and set the password to ouyangpeng.

2. Enter the alias and password, and set the password to ouyangpeng.

 

3, so in the corresponding directory, the corresponding certificate is generated, I give the name is baiduMapLoc-release-key.keystore

4. View information about the generated baiduMapLoc-release-key.keystore through the command.

 

C: Documents and SettingsAdministrator desktop aiduMapLoc> keytool-list-v-keystore baiduMapLoc-release-key.keystore enter keystore password: keystore type: JKS keystore provider: SUN your keystore contains one entry alias: baidumaploc created on: entry type: PrivateKeyEntry certificate chain length: 1 certificate [1]: Owner: CN = ouyangpeng, OU = ouyangpeng, O = ouyangpeng, L = Shenzhen, ST = Guangdong, C = Chinese publisher: CN = ouyangpeng, OU = ouyangpeng, O = ouyangpeng, L = Shenzhen, ST = Guangdong, C = Chinese serial number: 5eac1cda validity period start date: Sat Oct 10 11:50:39 CST 2015, deadline: Mon Oct 02 11:50:39 CST 2045 certificate fingerprint: MD5: 91: 15: 11: 06: 05: CB: E0: CB: 4B: 2B: 36: 02: 81: 16: A7: DF SHA1: E9: A3: E4: 95: 1F: D2: 11: 0E: 3E: 89: 45: 26: AB: EF: A2: FB: DB: 3F: 5B: 1A SHA256: C4: D6: 15: 27: 23: 81: EC: 3A: 53: 68: FE: 04: 63: 91: 70: 79: B6: 93: A6: 5F: 3D: 29: ED: 62: 43: 01: 67: 11: F3: 28: 91: 8C signature algorithm name: SHA256withRSA version: 3 extension: #1: ObjectId: 2.5.29.14 Criticality = falseSubjectKeyIdentifier [KeyIdentifier [0000: 69 D8 5C C9 2C 8E 9E B8 49 E3 E1 31 A7 35 B2 D1 I ..,... I .. 1. 5 .. 0010: 10 52 FB 17. R ..] **************************************** **************************************** ******

:

 

Step 2: copy the certificate baiduMapLoc-release-key.keystore of the generated formal version and rename the copied certificate to the baiduMapLoc-debug-key.keystore.

 

Step 3: change the password of the baiduMapLoc-debug-key.keystore

Because the keystore of the debug version requires that the password be android, change the original password ouyangpeng to android. As shown in.

 

C: Documents and SettingsAdministrator desktop aiduMapLoc> keytool-storepasswd-keystore baiduMapLoc-debug-key.keystore enter keystore password: New keystore password: re-enter new keystore password:

 

Step 4: Modify the alias for the baiduMapLoc-debug-key.keystore.

 

C: Documents and SettingsAdministrator desktop aiduMapLoc> keytool-changealias-keystore baiduMapLoc-debug-key.keystore-alias baiduMapLoc-destalias androiddebugkey enter keystore password: Enter
 
  
Key password
 

 

Because the keystore of the debug version requires that alias be androiddebugkey, change the original alias to baidumaploc to androiddebugkey. As shown in.

 

 

 

Step 5: change the password for the alias for the baiduMapLoc-debug-key.keystore.

C: Documents and SettingsAdministrator desktop aiduMapLoc> keytool-keypasswd-keystore baiduMapLoc-debug-key.keystore-alias androiddebugkey enter keystore password: enter a new keystore:

 

Because the debug keystore requires that alias be androiddebugkey and the alias password be android, we need to change the password from ouyangpeng to android, as shown in.

 

 

Step 6: view the updated baiduMapLoc-debug-key.keystore details

C: Documents and SettingsAdministrator desktop aiduMapLoc> keytool-list-v-keystore baiduMapLoc-debug-key.keystore enter keystore password: keystore type: JKS keystore provider: SUN your keystore contains one entry alias: androiddebugkey creation date: entry type: PrivateKeyEntry certificate chain length: 1 certificate [1]: Owner: CN = ouyangpeng, OU = ouyangpeng, O = ouyangpeng, L = Shenzhen, ST = Guangdong, C = Chinese publisher: CN = ouyangpeng, OU = ouyangpeng, O = ouyangpeng, L = Shenzhen, ST = Guangdong, C = Chinese serial number: 5eac1cda validity period start date: Sat Oct 10 11:50:39 CST 2015, deadline: Mon Oct 02 11:50:39 CST 2045 certificate fingerprint: MD5: 91: 15: 11: 06: 05: CB: E0: CB: 4B: 2B: 36: 02: 81: 16: A7: DF SHA1: E9: A3: E4: 95: 1F: D2: 11: 0E: 3E: 89: 45: 26: AB: EF: A2: FB: DB: 3F: 5B: 1A SHA256: C4: D6: 15: 27: 23: 81: EC: 3A: 53: 68: FE: 04: 63: 91: 70: 79: B6: 93: A6: 5F: 3D: 29: ED: 62: 43: 01: 67: 11: F3: 28: 91: 8C signature algorithm name: SHA256withRSA version: 3 extension: #1: ObjectId: 2.5.29.14 Criticality = falseSubjectKeyIdentifier [KeyIdentifier [0000: 69 D8 5C C9 2C 8E 9E B8 49 E3 E1 31 A7 35 B2 D1 I ..,... I .. 1. 5 .. 0010: 10 52 FB 17. R ..] **************************************** **************************************** ******


Compare the certificates of the release version. Both MD5 and SHA1 are the same.

 

Step 7: import the modified baiduMapLoc-debug-key.keystore to Eclipse

 

Step 8: Share the modified baiduMapLoc-debug-key.keystore with the team developers so that the debug version keystore is the same when you develop the same APP. In this way, both the MD5 code and the SHA1 code are the same. You can apply for a key in Baidu SDK.

 

 

 

 

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.