android4.0 Silent Installation

Source: Internet
Author: User

The latest project involves two apk, if installed separately, there will be two prompt boxes, the user experience is not very good. But it would be troublesome to merge the source code of the two projects, and there would be a lot of conflicting places to adjust. So I've been trying to find a way to do this. When installing one of the APK, you can install another apk, which is called silent installation, without ejecting the installation prompt. The relevant information on the Internet a search a large pile, just at the beginning of the confidence, thought according to the practice of the great God, can easily solve the problem, however, did not make progress for two or three days, the online method is always unworkable, although not reported abnormal, but also always do not have the desired effect. Until today to see a great God's blog, inside a few simple steps, I did not believe at first, but fortunately recently nothing busy, plenty of time to test, also try, the result of a exultation, incredibly can!!! Now, based on the Great God's foundation, organize the implementation method:

  I. Generating KeyStore

Dos into the JDK bin directory, run the following command:

Keytool-genkey-alias android.keystore-keyalg rsa-validity 20000-keystore android.keystore

Enter KeyStore Password: ******
Enter the new password again: ******
What is your first and last name?
[Unknown]: qiaoling What is your organizational unit name?
[Unknown]: www.chinaandroid.com
What is your organization's name?
[Unknown]: www.chinaandroid.com
What is the name of your city or region?
[Unknown]: Haidian
What is the name of your state or province?
[Unknown]: BJ
What is the two-letter country code for this unit?
[Unknown]: 86
Cn=qiaoling, ou=www.chinaandroid.com, o=www.chinaandroid.com, L=haidian, ST=BJ, c=86 right?
[No]: Y
Enter <android.keystore> master password (if same as KeyStore password, press ENTER):
A Adroid.keystore file is generated in the bin directory of the JDK.


Where the parameter-validity is valid for the certificate number of days, here we write 10,000 days larger. There is no echo when you enter the password (even if you lose it) and backspace, tab and so on are the password content, this password is required for the. apk file signature.


  Two. Export Signature apk

In Eclipse, right-click the project that needs to be signed-->android Tools-->export signed application package ... The following dialog box appears, selecting the project to be signed

  Three. Get Permissions

1. From the/build/target/product/security directory of Android system source , find two signature files: Platform.x509.pem and Platform.pk8

2. Locate the source code of the Signapk.jar file in the/build/tools/signapk directory and compile it into Signapk.jar file .

3. In the manifest.xml file of the Android project, add install_packages permissions

4. Place the Platform.x509.pem and Platform.pk8, Signapk.jar files, and the signature apk generated in the second step under the same path. Open cmd, switch to the directory, and run the following command:

Java-jar Signapk.jar Platform.x509.pem platform.pk8 signature. apk  Final apk

A "final. apk" is generated at this point. This apk will be able to install the other apk silently. ("Final. APK "In the code to add the shell command to install APK: Runtime.getruntime (). EXEC (" ***.apk ");)

android4.0 Silent Installation

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.