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

The terrifying bird inherited the "legacy" of the dinosaurs!

In today's South America, there lives a stran...

Is it too early to invest in the children's market of smart robots?

After nearly three years of development, the domes...

How to get more customers smartly?

If we divide the company's customer base base...

Night Grass and Chollima 7-day Case Study Practice Training Camp 14th

Night Grass and Chollima 7-day Case Study Practic...

Why can’t mobile phones be multi-tasked like computers?

The human brain seems to be naturally equipped wi...

Panzhihua City, why doesn’t it look like a city in Sichuan?

Panzhihua City in Sichuan Province is undoubtedly...

How does the biological clock work? Does it also have gears and pointers?

Science Fiction Network, April 7th. We all have a...

Product analysis of Zuoyebang APP!

Currently, the entire Internet education market i...

A family member is suddenly diagnosed with cancer, what can we do for them?

It is inevitable that relatives, friends, and acq...

Few Tik Tok fans? A practical tutorial on how to increase followers on Douyin!

What if you want to gain 1 million followers in 7...

How to operate Weibo? Sharing of Weibo operation ideas

Recently, many people have asked me how to operat...