Android development for application signature packaging

Source: Internet
Author: User

Android Development to the application signature packaging what is signature packaging?

In an Android system, all applications installed to the system must have a digital certificate that identifies the author of the application and establishes a trust relationship between the applications, if a permission ProtectionLevel is signature, Then only applications that have the same digital certificate as the program where the permission resides can get that permission. Android uses the Java digital certificate-related mechanism to stamp the APK with a digital certificate.

The Android system requires that every application installed into the system is signed with a digital certificate, and the private key of the digital certificate is stored in the programmer's hands. Android uses digital certificates to identify the author of an application and to establish a trust relationship between applications, not to determine which applications the end user can install. This digital certificate does not require an authoritative digital certificate signing Authority authentication, it is only used to make the application package self-certified.

Note: Crossing friends may have questions? We usually write some small programs, installed on the simulator or on the real machine, there is no signature ah! How can I install it?

In fact, our development tool generates a Debug.keystore for our application by default.

    • Default build Path: C:\Users\ Your user name \.android

    • Key's password:android

We may as well open this debug.keystore, open cmd, go to the directory of the file, try the following steps:

1. Input command: Keytool-list-keystore debug.keystore

2. Enter your password: Android

Why should I package an app signature?

Let's say that when we have an app installed on our phone, when we install an app again, and the app's package name is exactly the same as the app package name that was previously installed, the app will overwrite the previous app.

This is a very dangerous situation!

Signature reason: In order to prevent other people's application to cover their own applications, the application of the signature can be a good solution to this problem.

Image said: is to your app installed a lock, and this lock key only you have.

How do I package an application for signature? First package Signature

1. Right-click on your project->android Tools->export signed application Package

2.next:

Note: Keep the KeyStore file in good order and remember the password

3. Related parameters

Note: The red box is required, others do not need to fill in

4.next

5. Click Finish and we see the console print as follows:

And, under the path we chose, the packaged and signed apk and KeyStore files were successfully generated:

Apply upgrade Overrides

When we upgrade the app again, we don't have to generate the KeyStore file again, referencing the previously generated KeyStore file:

1. Right-click on your project->android Tools->export signed application Package

2.next:

Re-enter the password;

4. Build version 2apk,finish:

5. You can see that the APK file was successfully generated so that you can overwrite the previous application

Summarize

Each application in the Android system is digitally signed, and the private key of the digital certificate is stored in the app owner's hands, and Android uses the digital certificate to identify the author of the application and establish a trust relationship between the applications, which means that no one else is allowed to overwrite others ' apps at will!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android development for application signature packaging

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.