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

SEM practical case: How to do Baidu bidding promotion?

There are too many articles about bidding on the ...

Fission Methodology | Free Bait: Teach you how to swipe the screen like NetEase?

While I was busy this week, I was thinking about ...

Will the surge in international oil prices hit the Chinese auto market hard?

When filling up a tank of gas costs more than 20 ...

A must-read for entrepreneurs: How long does it take to develop an App?

[[219589]] With an estimated 350 billion mobile a...

Aston Martin: Sales in China to plummet 49% in 2024

Recently, it was reported that, against the backdr...

The "giant" that captures sunlight draws the "green miracle" of Ulan Buhe

In the vast national territory, desert control an...

How to effectively activate new users?

Attracting new users does not mean activating new...

Why are konjac shreds white and konjac cubes black?

In summer, all the fat people know one thing: &qu...

Kuaishou’s tips on how to create hits!

As a social method for the younger generation, &q...

10 Tips to Become an Outstanding Java Programmer

If you are a Java programmer who is passionate ab...

Marketing must-read: Limited-time flash sales operation and influencing factors

Limited-time flash sales are a marketing applicat...

Methuselah is older than the universe? Are we mistaken?

Is there anything in the universe that is older t...

How are you targeted by ads?

Nowadays, enterprises are paying more and more at...