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

Worth collecting: The most complete product operation knowledge framework

Why do operations What is Operations? If you can’...

Changlu Teacher Chip Conversion Ultimate Edition

Introduction to the Ultimate Edition of Changlu T...

How does APP choose marketing and promotion channels?

Q: How to choose marketing promotion channels ? A...

Internet Product Manager From Beginner to Master Course

This course starts with the basics and explains i...

Why do we eat mooncakes during the Mid-Autumn Festival? The origin of mooncakes!

There is still more than a month until the Mid-Au...

Product operation strategy of Dianping Points Mall

Life service apps are closely related to users’ l...

Ibuprofen is banned? Attention! These 223 drugs are no longer produced or sold

Expert of this article: Zhang Xing, deputy chief ...

How to build an event operation and promotion framework in 4 steps?

We often see various commercial activities: Tmall...

The COVID-19 situation is severe. How can we protect ourselves and our families?

Recently, the number of new COVID-19 cases in man...