原理
静默安装、卸载的原理就是利用pm install 命令来安装apk,pm uninstall 来卸载apk。 智能安装是利用android系统提供的无障碍服务AccessibilityService,来模拟用户点击,从而自动安装。
pm命令介绍
(1) pm install
pm install 命令的用法及参数解释如下:
pm install [-l][-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH
pm命令介绍
(1) pm install
pm install 命令的用法及参数解释如下:
pm install [-l][-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH
Options:
-l: install the package with FORWARD_LOCK.
-r: reinstall an exisiting app, keeping itsdata.
-t: allow test .apks to be installed.
-i: specify the installer package name.
-s: install package on sdcard.
-f: install package on internal flash.
(2) pm uninstall
pm uninstall 命令的用法及参数解释如下:
pm uninstall[-k] PACKAGE
Options:
-k: keep the data and cache directoriesaround.
上面英语很简单,不解释了.
|