Android Studio generates signature files, automatically signs, and obtains SHA1 and MD5 values

Android Studio generates signature files, automatically signs, and obtains SHA1 and MD5 values

Preface:

Android Studio is an IDE environment tool provided by Google for developers in 2013. After several updates, Android Studio has become a very powerful IDE development environment. Google also announced that Android Studio will replace Eclipse. Using as for development has been very popular among mobile developers. We will not say more nonsense here. If you don't know it, you will be surprised. This article mainly talks about what is often used in the development process. How to use as to generate a signature file, configure gradle to automatically sign the app, and how to generate SHA1 and MD5 values.

1. Generate a signature file

1. Find the "build" column in the AS menu bar and select "Generate Signed APK"

2. Choose to create a new file here.

"Create new..." Create a new signature file

"Choose existing..." Select an existing signature file

3. Fill in the complete signature information. Here, the password is "android" and the alias is "key". The other information is filled in according to the actual situation and needs, which is not very important.

Key store path: signature file path

Password: Signature password

Confirm : Confirm password

Alias ​​: Alias

Validity ( years ) : Limited period (years)

First and Last Name : Full name

Organizational Unit:

Organization:

City or Locality : City or Locality

State or Province :

Country Code(XX) : Country code

4. After filling in the form, select OK. You will be taken to the following page.

5. Click Next. Select the build type release in Build Type. Click Finish to generate the signature file.

APK Destination Folder: apk destination folder

Build Type: Build type

Release is the signature file used for the release version

debug is the signature file used for debugging

2. Configure gradle to automatically sign the APP

1. Select the following icon in the as menu bar

2. Select the "String" menu bar -> select "+" to add a tag -> fill in a custom name -> fill in the information according to the new signature file

3. After filling in the form, select OK. After the studio is compiled, the following configuration information will be automatically generated in the build.gradle file.

3. Studio generates SHA1 and MD5 values

Method 1: Generate SHA1 and MD5 values ​​using DOS window commands. In as, we can directly use the Terminal tool

1. Select the Terminal tool in the bottom menu bar of AS

2. Use the DOS command to switch the directory to the donkor.jks file directory, enter keytool -list -v -keystore donkor.jks, and press Enter. Enter the keystore password android (this is the password corresponding to the complete information filled in when creating a new signature file, "android" is the password I filled in at that time), and it's done.

Method 2: In the Studio tool, find the menu bar on the right, "Gradle" -> "APP name" -> "Tasks" -> "android" -> double-click "signReport". At this time, only the debug SHA1 and MD5 values ​​are generated.

If you want to generate the SHA1 and MD5 values ​​of release, you need to configure the following in build.gradle. Repeat the above steps to get the SHA1 and MD5 values ​​of debug and release.

Thanks to Dongfeng Jiuge for proposing method 2.

Original address: http://blog.csdn.net/donkor_/article/details/53487133

<<:  HTML5 – Local Storage

>>:  Android quickly implements WeChat payment

Recommend

Can "eating dirt" cure enteritis? What kind of weird linkage is this?

Recently, a new research result published in Natu...

A review of 15 best-selling marketing campaigns in the first half of 2018

Looking back at the first half of 2018, marketing...

How to get on the charts on iOS platform? 10 App Store Survival Guides

Obtaining App Store qualifications has never been...

Will Android become history? Google is launching a new operating system

The market share of Android system continues to e...

Pan Yi's Basic TCM Training Camp Video

Pan Yi's Basic TCM Training Camp Video Pan Yi...

iPhone 6s is close to perfection if it does these 6 things

Whether it is called "iPhone 6s/6s Plus"...