Android Silent Installation

Source: Internet
Author: User
Recently, an android project requires the software to automatically download and install the specified APK file without user operations, that is, Silent Installation. After reading Google and combining the methods, I found a relatively simplified method. However, this method was only tested in Android 4.0, you can try this method in other versions. To perform Silent Installation, you must have the permission to execute the PM install command. There are two steps in preparation: 1. Get the execution permission. 2. Execute the command. First, we will introduce the second step. How to execute the PM install command: Key Code In fact, there is one sentence: Runtime.getruntime(cmd.exe C ("PM install xxx.apk ");

Some people also mentioned on the Internet that they used bufferreader to read the output success from the console to determine whether the installation was successful, but I never caught the success, you have to use the volume er of package install to handle the operation after successful installation. Return to how to obtain permissions. 1. First, we need to use the source code of the Android system./Build/target/product/security directory , Find two signature files: Platform. x509.pem and platform. pk8 2. Find the source code of the signapk. jar file in the/build/tools/signapk directory and compile it into the signapk. jar file. 3. Add the install_packages permission to the manifest. xml file of the android project. 4. Export the APK file. Select "Export signature file" here. Right-click the project and choose "android Tools"> "Export signed application package..." 5. Execute jar signapk. Jar platform. X509 . Pem platform. pk8 signed APK target file. APK the generated target file APK can be installed in Android normally, and any specified APK file can be installed silently.

Download the following three files:

Signapk. Jar

Platform. x509.pem

Platform. pk8

 

Publish by note

     

    Related Article

    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.