Silent installation, which refers to installation without any user intervention, directly to the default settings to install the app. Because, it does not need user intervention, in many cases become the user does not know, the application unknowingly installed. is in the promotion of extremely rogue means, very similar to the bundled installation on the PC. Because the silent installation is extremely rogue promotion behavior, so, its promotion price is extremely high.
installing using the PM command
The PM command is an android Packagemanage command line that is used to install the package operation. And the system is mainly to provide us in ADB
The PM command is used in the shell, so the PM command also exists under the "/system" directory, and of course, the application with the root authority can use it for silent installation.
Xxx.apk placed in the root directory of the built-in storage execcommand ("SYSTEM/BIN/PM install-r" + "sdcard/xxx.apk"); //execute commandpublic booleanexeccommand (String cmd) {process process = null; try {process = Runtime.getruntime (). exec (cmd); process.waitfor ();} catch (Exception e) { return false;} finally { try {Process.destroy ();} catch (Exception e) {}} return true;}
PM Command Source directory:/frameworks/base/cmds/pm/src/com/android/commands/pm/pm.java
Andrid Silent Installation