1.init.rc配置:
on property:init.svc.bootanim=stopped
start preinstall
service preinstall /system/bin/preinstall.sh
user root
group root
disabled
oneshot
2./system/bin/preinstall.sh脚本文件:
#!/system/bin/sh
MARK=/data/local/symbol_thirdpart_apks_installed
PKGS=/system/preinstall/
if [ ! -e $MARK ]; then
echo "booting the first time, so pre-install some APKs."
busybox find $PKGS -name "*\.apk" -exec sh /system/bin/pm install {} \;
# NO NEED to delete these APKs since we keep a mark under data partition.
# And the mark will be wiped out after doing factory reset, so you can install
# these APKs again if files are still there.
# busybox rm -rf $PKGS
touch $MARK
echo "OK, installation complet