[Galaxy S II Themes and Apps] Phil3759:
Busybox Uninstaller v1.0 - Removes busybox and its +600 symlink files

It will backup all files before they are deleted + activity log written to sdcard

This is for Samsung phones only. Other phones need changes in sdcard mount position

Always do a nandroid backup before flashing anything.

Use at your own risk.​

How to use - Flash from recovery method:

How to use: run script in terminal:

This part does not apply for the beginners. If you don't understand this shell, use the recovery version attached

You can try the below shell script to run from terminal with root rights.

It just misses one line to remove the busybox main package at end of script. The attached zip will delete the package in updater-script rather than in the script. Either remove the busybox package manually when done or add the rm line at the end of script

Actual features:

To come: Depending on demand and my time, I think at:

Below is the shell code base used for those who want to know or give ideas to enhance it. Keep in mind it is busybox shell, very limited compared to Bash...

Code included is to run in terminal and will put backup files to internal sdcard (recovery version will put the backup on external sd)

I could include another shell, but would make the zip file bigger in size

Also, did not rely on android built in shell (/bin/sh) to avoid variations depending on shell version with devices / kernels

#!/bin/sh

bkdir="/sdcard/bb-uninstall" ;
if [ -d "$bkdir" ] ;
then
busybox echo "Backup folder $bkdir already exists. Please remove it to proceed...">>$bkdir/__Error_Backup_Folder_Already_Exists__.txt ;
busybox echo "Backup folder \"$bkdir\" already exists. Please remove it to proceed..." ;
exit 1 ;
else
busybox mkdir $bkdir ;
if [ ! -d "$bkdir" ] ;
then
busybox echo "Backup folder \"$bkdir\" could not be created" ;
busybox echo "Check if sdcard is present, mounted, has free space or you have permissions!!" ;
exit 1 ;
fi ;
fi ;

bbdir="/system/xbin /system/bin" ;
ndeletes=0 ;
for bbpath in $bbdir ;
do
for f in $(busybox find $bbpath -type l) ;
do
gnr=$(busybox readlink $f) ;
if echo "$gnr" |busybox grep -q busybox ;
then
busybox echo -e "$f \t is linked to \t $gnr ---> backup up in sdcard then deleted">>$bkdir/bb-uninstall.log ;
bkfile=`busybox echo "$f" | busybox tr '/' '.'` ;
bkfile=bak$bkfile ;
busybox tar zcf $bkdir/$bkfile.tar.gz -C / ${f:1} ;
if [ ! -f "$bkdir/$bkfile.tar.gz" ] ;
then
busybox echo "Error while creating backup file \"$bkdir/$bkfile.tar.gz\"" ;
busybox echo "File \"$f\" was not deleted" ;
busybox echo "Check free space on \"$bkdir\" or if you have needed permissions" ;
busybox echo "Uninstall will stop. Launch it again after fixing write issue to \"$bkdir\"" ;
exit 1 ;
fi ;
busybox echo "$f linking to $gnr backed-up. Now deleting" ;
busybox rm $f ;
ndeletes=`busybox expr $ndeletes + 1` ;
else busybox echo "$f is not linked to busybox, but to $gnr ---> file not deleted">>$bkdir/bb-uninstall.log ;
fi ;
done
done

echo >>$bkdir/bb-uninstall.log ;
echo "=========================================">>$bkdir/bb-uninstall.log ;
echo " Busybox Uninstaller v1.0 Completed !! ">>$bkdir/bb-uninstall.log ;
echo "=========================================">>$bkdir/bb-uninstall.log ;
echo " - Details - ">>$bkdir/bb-uninstall.log ;
echo "Number of deleted files: $ndeletes">>$bkdir/bb-uninstall.log ;
echo "Busybox cleaned folders: \"$bbdir\"">>$bkdir/bb-uninstall.log ;
echo "Backup folder: \"$bkdir\"">>$bkdir/bb-uninstall.log ;
echo "Log file: \"$bkdir/bb-uninstall.log\"">>$bkdir/bb-uninstall.log ;
echo >>$bkdir/bb-uninstall.log ;
echo "=========================================">>$bkdir/bb-uninstall.log ;
echo "Brought to you by Phil3759@xda-developers">>$bkdir/bb-uninstall.log ;
echo "=========================================">>$bkdir/bb-uninstall.log ;

echo ;
echo "=========================================" ;
echo " Busybox Uninstaller v1.0 Completed !! " ;
echo "=========================================" ;
echo " - Details - " ;
echo "Number of deleted files: $ndeletes" ;
echo "Busybox cleaned folders: \"$bbdir\"" ;
echo "Backup folder: \"$bkdir\"" ;
echo "Log file: \"$bkdir/bb-uninstall.log\"" ;
echo ;
echo "=========================================" ;
echo "Brought to you by Phil3759@xda-developers" ;
echo "=========================================" ;