TOS中安装第三方recovery后,刷入SuperSU刷机包,重启后发现无法获取su权限,原因是daemonsu进程没有运行。
解决方法是将/system/etc/install-qrom-recovery.sh文件替换成/system/etc/install-recovery.sh,这样,重启手机后才会创建daemonsu进程。同时,还需要删除/system/vendor/bin/su,因为会优先使用这个su。
另外,贴一下TOS中每次自动刷recovery的脚本。
#!/system/bin/sh
if ! applypatch -c EMMC:/dev/block/platform/msm_sdcc.1/by-name/recovery:12238848
:ff0553f96edc2bffa97e4ee722422a04f2b66504; then
log -t recovery "Installing new recovery image"
# At most 32M, It is enough currently
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/recovery bs=4096 cou
nt=8192
dd if=/system/etc/recovery.img of=/dev/block/platform/msm_sdcc.1/by-name/recov
ery || log -t recovery "Dump into /dev/block/platform/msm_sdcc.1/by-name/recover
y error!"
else
log -t recovery "Recovery image already installed"
fi