我一直在试图编写一个脚本来硬化android。我没有成功!脚本跑得太快!可能
我正在通过模拟器运行一个AVD,并尝试了这两个android外壳和bash外壳,我加载。这个脚本很简单,你会在下面看到,每个命令都可以独立运行,但是在一个脚本中它只是运行得太快或者其他东西。
我知道在顶部没有shebang,但这是因为我插入一个错误。
我的脚本是:
echo ANDROID
echo HARDENING STARTED
device=/dev/block/mtdblock0
mount -o rw,remount $device /system
#removing files in the /system/xbin directory
rm /system/xbin/tcpdump
rm /system/xbin/su
#removing files in the /system/bin directory
rm /system/bin/bootanimation
rm /system/bin/dumpstate
rm /system/bin/ping
rm /system/bin/ping6
echo ANDROID
echo HARDENING COMPLETE
我已经采取了一切缩进了,因为我认为这可能会导致错误和目录和文件肯定存在。我已经穿着这件衣服三天了,穿着很瘦。
我在开始时选择了一个if语句来选择其他手机上的设备,但为了减少错误(这就是为什么我声明设备而不是挂载)的原因。
这里是错误:
ANDROID
HARDENING STARTED
mount: no such file or directory exist
, no such file or directorytcpdump
, no such file or directorysu
, no such file or directoryootanimation
, no such file or directoryumpstate
, no such file or directorying
, no such file or directorying6
ANDROID
HARDENING COMPLETED
注意合并目录在这之后是不是笔误。
感谢瑞安
看来$ device变量是空的;你可以在mount命令之前尝试'echo $ device'吗? – Alepac