I have been attempting to write a script to harden android. I have had no success!
I am running a AVD via emulator and have tried this with both the android shell and bash shell which i loaded. The script is simple as you will see below and each command runs fine independently but in a script it just runs through too fast or something.
I know there's no shebang at the top but that's because of errors when i inserted one.
my script is:
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
I have taken all indenting out as i thought this may be causing the error and the directories and files definitely exist. I have been on this for three days now and its wearing thin.
I had an if statement at the beginning to select devices on other handsets but i took this out in attempt to reduce errors (that's why i declare device instead of mounting).
here is the error:
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
NOTICE THE MERGING AFTER DIRECTORY THIS IS NOT A TYPO.
thanks Ryan