Android Pre-upload signature

Source: Internet
Author: User

     android Program Signature detailed, packaged, posted to Google Play steps  . Category: Cndn Li CSDN android Android app sign Android app release Google Play release  2012-09-03 12:49 8674 people Read reviews (0) Favorites report androidgoogle tools EC Lipsedos optimization directory (?) [+] This article focuses on the theoretical knowledge of the Android application signature, including: What is a signature, why to sign the application, how to sign the application, and so on. 1, what is the signature?       If this problem is not in Android development, if it is placed in an ordinary section, I think we all know the meaning of the signature. It is often that some of life's commonly used terminology in the field of computer science, people began to confuse. What does the computer do, or what the programming language does, not simulate reality as much as possible? So, the signature in the computer and the signature in life are the same in nature, and the function that it plays is the same!       Let's take a look at the signature in real life. For example, the following image:             This is the signature of actress Sun Li. Signing means writing your name on paper or elsewhere, or marking it somewhere as a unique sign of yourself, and when someone sees the signature, he will know that it's about you, not someone else. 2. Why do I need to sign the Android app?       If you can only answer this question in a simple sentence, I'll say, "This is what the Android system requires."      android system requires that every Android application must be digitally signed to be able to install into the system, which means that if an Android application is not digitally signed, there is no way to install it in the system! Android uses digital signatures to identify the author of an application and establish a trust relationship between applications, not to determine which applications the end user can install. This digital signature is done by the author of the application and does not require an authoritative digital certificate signing Authority authentication, which is only used to make the application package self-certified. 3. Why do I develop Android apps that do not have any signatures to run on the emulator and phone?       you did not sign the Android app and it doesn't mean that the Android app is not signed. To facilitate our development of the debug program, ADT automatically uses the debug key to sign the application. Debug key? Where is it? The Debug key is a file named Debug.keystore, which is located in:             system drive letter:/documents and settings/liufeng/. Android/debug.keystore "Liufeng" corresponds to your own Windows operating system user name, what, is not already found it. This means that if we want to have our own signature, instead of having ADT sign it for us, we also have a key file (*.keystore) that belongs to you. 4. Android Application Signing Step 1) Preparation      APK signature work can be done in two ways:             1) to complete the APK signature via the graphical interface provided by ADT,            2) complete the APK signature through DOS command. I prefer the 2nd way, So the following will explain how to complete the APK signature by command.       Give the APK a total of 3 tools, or 3 commands, respectively: Keytool, Jarsigner, and Zipalign, with a brief introduction to these 3 tools:            1) Keytool: Generate a digital certificate, the key, which is the type of file with the extension. KeyStore mentioned above;             2) Jarsigner: Use digital certificate to sign APK file,            3) Zipalign: Optimize the post-signed apk to improve the efficiency of interacting with Android system ( Android SDK1.6 version starts with this tool)       The effects of these 3 tools can also be seen in the order in which these 3 tools are used. Usually all of the applications we develop ourselves use the same signature, which isUsing the same digital certificate, this means: If you are signing the Android app for the first time, the above 3 tools will be used, but if you already have a digital certificate, and then give the other APK signature, only need to use Jarsigner and zipalign to complete.       To facilitate the use of the above 3 commands, you first need to add the paths of the above 3 tools to the environment variable path (I said it is for ease of use, not to say that this must be done). How to configure the environment variable is not explained here, it is necessary to say here the default path of the 3 tools:            1) Keytool: The tool is located in the bin directory of the JDK installation path;   & nbsp        2) Jarsigner: The tool is located in the bin directory of the JDK installation path;             3) Zipalign: The tool is located in the android-sdk-windows/tools/directory       Do not know if you notice that Keytool and Jarsigner two tools are the JDK comes with, It also means that the generation of digital certificates and file signatures is not a patent for Android, and that Jarsigner can also be literally guessed that the tool is primarily used to sign jar files. 2) Generate unsigned apk files       Since we are going to sign the apk ourselves, we no longer need the ADT to sign it for us by default. How do I get an unsigned apk file? Open Eclipse, right-click on the Android project name, select "Android Tools"-"Export Unsigned application Package ..." and select a storage location to save. This will get an unsigned apk file. 3) Generate digital certificates using the Keytool tool      keytool-genkey-v-keystore liufeng.keystore-alias liufeng.keystore-keyalg RSA -validity 20000 Description:      1) Keytool is the tool name,-genkey means to perform a digital certificate operation,-v means that the details of the generated certificate are printed out and displayed in a DOS window;      2)-keystore Liufeng.keystore indicates the file name of the generated digital certificate is "Liufeng.keystore";      3)-alias Liufeng.keystore indicates that the certificate alias is "Liufeng.keystore" and can of course not be the same as the file name above;       4)-keyalg RSA indicates that the algorithm used to generate the key file is RSA;      5)-validity 20000 indicates that the digital certificate is valid for 20,000 days, meaning that the certificate will expire after 20,000 days When you execute the above command to generate a digital certificate file, you are prompted to enter some information, including the password for the certificate, for example:       4) signing the Android app with the Jarsigner tool       Jarsigner-verbose-keystore Liufeng.keystore-signedjar notepad_signed.apk notepad.apk liufeng.keystore Description:   & nbsp  1) Jarsigner is the tool name,-verbose means that the details of the signature process are printed out and displayed in a DOS window;      2)-keystore Liufeng.keystore Indicates the location of the digital certificate used by the signature, there is no write path, indicated in the current directory;      3)-signedjar notepad_signed.apk notepad.apk Represents the signature of the notepad.apk file, the file name after the signature is notepad_signed.apk;      4) The last Liufeng.keystore represents the alias of the certificate, Corresponds to name 5 after the-alias parameter when generating a digital certificate use the Zipalign tool to optimize the signed apk (not required but recommended)      ZIPALIGN-V 4 notepad_signed.apk Notepad_signED_ALIGNED.APK Description:      1) zipalign is the tool name, and-v means detailed optimization information is printed in the DOS window;      2) notepad_signed.apk NOTEPAD_SIGNED_ALIGNED.APK indicates that the signed file notepad_signed.apk is optimized, and the optimized file name is notepad_signed_aligned.apk Note: If your previous program is a default signature (i.e. debug signature), once the new signature application will not overwrite the installation, the original program must be uninstalled before it can be installed. Because the program covers the installation main check two points:      1) Two program entry activity is the same. Two programs if the package name is different, even if all other code is exactly the same, it will not be considered as the same program version;      2) two programs use the same signature. If the signatures of the two programs are different, even if the package name is the same, it will not be treated as a different version of the same program and cannot overwrite the installation.       In addition, someone might think that the debug signature application can be installed anyway, and there's no need to sign it yourself. Do not think so, the debug signed application has such two restrictions, or risk:      1) Debug signed application cannot be sold on Android Market, it will force you to use your own signature;      2) Debug.keystore on different machines may not be the same, it means that if you change the machine for the APK version upgrade, then the above program will not cover the installation of the problem. Do not belittle this problem, if you develop the program only you use, of course, no matter, uninstall and install it. But if your software has a lot of customer use, this is a big problem, the equivalent of software does not have upgrade features! "" "(" "" "" "" "" "" "" "In" "," "" "in" the Google market is now called Google Play on the steps "" "," "", "" "," "" "," "", "" "," "the" "    wrote a period of Android applications, Just install it on your phone. Application for Android developer last week requires a one-time program development registration fee of $25. Costs need to use Google CheckoUT, so you have to apply for Google Checkout first. Domestic credit cards are generally supported by visa and can be registered successfully with the Hong Kong address as the payment address. After successful registration, you can also purchase a mobile phone for development from Google. This will allow you to access the Android Market publishing home page. This is the first app I've published: image developed a test example that reads a program that has an Android-led page-flipping effect. Prior to signing the need to understand the first need to know, Android Market publishing application, no man-made audit process, if met the requirements, as long as the submission, will be effective immediately. The application needs to be signed before it can be published, and the main purpose of the signature is to let people know which Android developer account you are publishing. The signature will generate a binary private key file (the private key). In fact, if using windows+eclipse ADT Development, under the user directory:. Android\debug.keystore path file, it is already a private key, but this is the debug with the private key. That is, Android cannot install the APK without a signature, if the APK is installed by means of debug (developer via USB connection), the APK is actually generated using debug signature. The APK file signed with the debug private key cannot be published to Android Market. Public and private keys, concepts in asymmetric key systems. The rationale here is that the user can encrypt the data through their private key (the fingerprint part of the application), the data can be seen through the public key decoding, the main purpose is to ensure that the source of information is not tampered with. The step signature for generating the private key file is simple, using the tool in the Bin directory of the JDK, Keytool.exe. The command is as follows: Keytool.exe-genkey-v-keystore The file name of the private key-alias own individual name-keyalg rsa-validity 10000 There is no movement except the Chinese part. Run the command, there will be interactive prompts, similar to the following: image this will generate a private key file, the file should be properly kept, to prevent the use of others. The Eclipse ADT Plugin can also be used to generate the private key, and the interface is the same as the one below the signature application. Using Eclipse ADT with the private key file signing application makes it easy to generate signed applications. Image then: Image here to select the private key file that you just generated, and enter the correct password to generate the private key. Then: image to enter the password for the alias. Next, it is simple, choose the path to generate files. Image publishing applications mainly upload application files, related files, such as the screen, as well as the text description of the program. Image this part of the upload file will not say, mainly the screen, encountered a little trouble, here only support two sizes of pictures, my Nexus One 480x800 incredibly did not, had to use the 480x854 format, need to use the software to modify the size (a little more blank). Otherwise, an error will be prompted after uploading. Image This section, may need to increase such as the introduction of Chinese pre-research, but no Simplified Chinese, using the traditional Chinese language. Image Finally, tick agree to Google's request. Publish. You can see your app on Android Market right away. Image

Android pre-upload signature

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.