• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Busybox Uninstaller v1.0 - Remove busybox & its +600 symlink files [26 Aug 2012]

Search This thread

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,054
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



420pxwarningiconsvg.png


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:
  • Download attached zip file from this post
  • Copy the file you downloaded to external sd card
  • Boot into stock recovery (volume up+home+power), and select "apply update from external storage". Now select the Busy_Box_Uninstaller_v1.0-signed.zip file downloaded above
  • If you use CWM Recovery, you can put the zip file in internal or external SD
  • Busybox will be completely removed with its +600 symlink files



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:
  • This small script will remove busybox from /system/xbin and from /system/bin.
  • It will search and remove all symlinks installed in the above 2 folders. Those are over 600 files !
  • It will make a backup for each file before deleting it. Backups are located on the external sdcard.
  • If backup file fails (sdcard full), it will abort and last file that failed the backup will not be removed. You can just resume the process later when you fixed the free space issue for backup.
  • Backup in tar.gz format with path in filename for easier restore if needed.
  • Will not overwrite any files during backup.
  • Log file written in sdcard backup directory.
  • Number of files deleted displayed when done.



To come: Depending on demand and my time, I think at:
  • Search for busybox in all phone and sets path to look for symlinks to delete. However, not sure if it is welcome!
  • Date/Time stamped backup folder. No need to delete a previous backup to proceed with script.
  • Code cleaning (was a bit hard as android and busybox shell are very restrictive).



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


Code:
#!/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 [email protected]">>$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 [email protected]" ; 
echo "=========================================" ;
 

Attachments

  • Busy_Box_Uninstaller_v1.0-signed.zip
    863.8 KB · Views: 54,484
Last edited:

nayak.aj

Senior Member
Jan 16, 2011
337
220
Bangalore
But why ?

I m sorry to question you on this, but why would one want to remove busybox ? given that there are 600+ symlinks .. but what is the benefit / effects of removing it or NOT removing it ?

Knowing this would educate people as to why people people should do this... its a solid noob question which should be added to the OP FAQ/ description if you ask me :) ... no offense :)
 

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,054
I m sorry to question you on this, but why would one want to remove busybox ? given that there are 600+ symlinks .. but what is the benefit / effects of removing it or NOT removing it ?

Knowing this would educate people as to why people people should do this... its a solid noob question which should be added to the OP FAQ/ description if you ask me :) ... no offense :)

When you install busybox in a folder, it creates about 328 symlinks in install folder (xbin often). Most cwm roms add to this a symlink for all commands to the bin folder.
Now, each busybox version comes with its active applets. You can end up with shortcuts installed by a previous version but that are not supported by the actual version.
At worst, some apps can have unpredictable behaviour. If link is removed, app will just end with a not found (also causing impredictable behaviour) . Actually, i never had any of these supposed issues, but why keep non working shortcuts in your system path?

This script is for people that tested so many web installers and busybox versions mainly. Flashing a full ROM in odin will clean it too.
Personally, when I change busybox version, i would use it to clean previous install. Why uninstall a program and leave hundreds of files?

Sent from my GT-I9100 using Tapatalk 2
 
Last edited:

karendar

Senior Member
Aug 9, 2010
2,214
883
Montreal
When you install busybox in a folder, it creates about 328 symlinks in install folder (xbin often). Most cwm roms add to this a symlink for all commands to the bin folder.
Now, each busybox version comes with its active applets. You can end up with shortcuts installed by a previous version but that are not supported by the actual version.
At worst, some apps can have unpredictable behaviour. If link is removed, app will just end with a not found (also causing impredictable behaviour) . Actually, i never had any of these supposed issues, but why keep non working shortcuts in your system path?

This script is for people that tested so many web installers and busybox versions mainly. Flashing a full ROM in odin will clean it too.
Personally, when I change busybox version, i would use it to clean previous install. Why uninstall a program and leave hundreds of files?

Sent from my GT-I9100 using Tapatalk 2

So to resume, this script exists just because it can be done and because someone, somewhere, somehow may someday need it. :D
 

ngagephone

Senior Member
Jul 24, 2006
746
156
36
Doncaster (Town)
perfect example you install a Rom it comes with all applets installed you check the busybox version and its old so you wish to remove all applets then install new busybox.

Sent from my GT-I9100 using Tapatalk 2
 
  • Like
Reactions: ctindell1981

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,054
When I uninstall an app, I hate when it leaves folders and files around
And busybox around installers can leave up to +600 of such files in just 2 folders, and you can install elsewhere too

Now, a clean approach is to install busybox in a custom folder and add it to path. No trash over the system. However, some apps look for it selectively in system folders and not in path
 

shoey63

Recognized Contributor
Jun 5, 2012
4,034
4,013
Somewhere in Oz...
I m sorry to question you on this, but why would one want to remove busybox ? given that there are 600+ symlinks .. but what is the benefit / effects of removing it or NOT removing it ?

Knowing this would educate people as to why people people should do this... its a solid noob question which should be added to the OP FAQ/ description if you ask me :) ... no offense :)
Why would anyone want to leave 600 files on their phone if they dont need them?






So to resume, this script exists just because it can be done and because someone, somewhere, somehow may someday need it. :D
Plenty of people in plenty of places with issues arising from installing busybox from market many a day will need it;)



Sent from my GT-N7000 using xda app-developers app
 

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,054
Hey congrats on your work.I have a problem if you can provide help:i flashed the uninstaller via stock recovery but after phone reboot wifi couldn't obtain ip adress.
Any help?

Can you attach the file here
Code:
/sdcard/bb-uninstall/bb-uninstall.log
Also, under that folder you have a backup of each deleted file, so keep it so you can restore if needed

Sounds like some files in system/bin were removed wrongly, but I doubt my script would do it as I tested it fully and I even include the specific temporary busybox needed for the script

Post the log file so I can see
 

Invalid_GR

Senior Member
Mar 17, 2012
81
10
Salllonika
OnePlus 6
OnePlus 8
Can you attach the file here
Code:
/sdcard/bb-uninstall/bb-uninstall.log
Also, under that folder you have a backup of each deleted file, so keep it so you can restore if needed

Sounds like some files in system/bin were removed wrongly, but I doubt my script would do it as I tested it fully and I even include the specific temporary busybox needed for the script

Post the log file so I can see

First of all thanx for the quick responce.Here is the file you asked :

https://dl.dropbox.com/u/98804712/bb-uninstall.log

(sorry xda didn't allow me to upload a log file so dropbox it is)
 
  • Like
Reactions: Phil3759

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,054
First of all thanx for the quick responce.Here is the file you asked :

https://dl.dropbox.com/u/98804712/bb-uninstall.log

(sorry xda didn't allow me to upload a log file so dropbox it is)

Problem seems in your system toolbox symlinks hijacked by a bad busybox installer

Code:
/system/bin/cat 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/chmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/chown 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/date 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/dd 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/df 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/dmesg 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/hd 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/id 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/ifconfig 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/insmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/ionice 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/kill 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/ln 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/ls 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/lsmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/mkdir 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/mount 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/mv 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/netstat 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/printenv 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/ps 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/renice 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/rm 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/rmdir 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/rmmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/route 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/sleep 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/sync 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/top 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/touch 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/umount 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
/system/bin/uptime 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted

All these entries should have been kept linked to toolbox instead of busybox. But, probbaly some third party busybox installer (market installers, a ROM you installed...) linked them to busybox without resetting toolbox links

So, as they are linked to busybox, they got deleted and you end up with a corrupted toolbox installation

Try this below script:

Code:
#!/system/bin/sh
toolbox ln -s /system/bin/toolbox /system/bin/cat
toolbox ln -s /system/bin/toolbox /system/bin/chmod
toolbox ln -s /system/bin/toolbox /system/bin/chown
toolbox ln -s /system/bin/toolbox /system/bin/date
toolbox ln -s /system/bin/toolbox /system/bin/dd
toolbox ln -s /system/bin/toolbox /system/bin/df
toolbox ln -s /system/bin/toolbox /system/bin/dmesg
toolbox ln -s /system/bin/toolbox /system/bin/hd
toolbox ln -s /system/bin/toolbox /system/bin/id
toolbox ln -s /system/bin/toolbox /system/bin/ifconfig
toolbox ln -s /system/bin/toolbox /system/bin/insmod
toolbox ln -s /system/bin/toolbox /system/bin/ionice
toolbox ln -s /system/bin/toolbox /system/bin/kill
toolbox ln -s /system/bin/toolbox /system/bin/ln
toolbox ln -s /system/bin/toolbox /system/bin/ls
toolbox ln -s /system/bin/toolbox /system/bin/lsmod
toolbox ln -s /system/bin/toolbox /system/bin/mkdir
toolbox ln -s /system/bin/toolbox /system/bin/mount
toolbox ln -s /system/bin/toolbox /system/bin/mv
toolbox ln -s /system/bin/toolbox /system/bin/netstat
toolbox ln -s /system/bin/toolbox /system/bin/printenv
toolbox ln -s /system/bin/toolbox /system/bin/ps
toolbox ln -s /system/bin/toolbox /system/bin/renice
toolbox ln -s /system/bin/toolbox /system/bin/rm
toolbox ln -s /system/bin/toolbox /system/bin/rmdir
toolbox ln -s /system/bin/toolbox /system/bin/rmmod
toolbox ln -s /system/bin/toolbox /system/bin/route
toolbox ln -s /system/bin/toolbox /system/bin/sleep
toolbox ln -s /system/bin/toolbox /system/bin/sync
toolbox ln -s /system/bin/toolbox /system/bin/top
toolbox ln -s /system/bin/toolbox /system/bin/touch
toolbox ln -s /system/bin/toolbox /system/bin/umount
toolbox ln -s /system/bin/toolbox /system/bin/uptime

Copy paste it in a sh file using notepad++ with EOL Conversion set to unix format and run it in a su terminal

If complicated for you, use attached file:
- download toolbox_fix.txt
- rename it to toolbox_fix.sh (do not open it or edit it in windows notepad or it will be corrupted)
- put it in /system/bin in your phone using a program like root explorer (you have to mount /system as rw in root explorer)
- in root explorer, long press the file name and select to change permissions, check all boxes there
- save settings
- open terminal and type:
Code:
su
sh /system/bin/toolbox_fix.sh
Now, reboot and all should be fine

If not, in terminal type:
Code:
su
ls -l /system/bin >/sdcard/ls_log.txt

And attach here the ls_log file you will find in root of your sdcard

Please report back if this fixed your issue. If it is the case (which I am quiet sure), I will edit my uninstaller script to automatically make these symlinks for people in situations like you
 

Attachments

  • toolbox_fix.txt
    1.7 KB · Views: 307
Last edited:

Invalid_GR

Senior Member
Mar 17, 2012
81
10
Salllonika
OnePlus 6
OnePlus 8
Once again thanx for your help.Yeah i used a market bustbox installer..Before i try anything could you please make clear what exactly i must do in the last step when you say "open terminal" sorry if it's noob level question..
 

Phil3759

Inactive Recognized Developer
May 30, 2012
9,579
33,054
Once again thanx for your help.Yeah i used a market bustbox installer..Before i try anything could you please make clear what exactly i must do in the last step when you say "open terminal" sorry if it's noob level question..

Download this application from market and install it:
https://play.google.com/store/apps/details?id=jackpal.androidterm

Then, open it (it is the terminal)
Then, you type the 2 commands line in code I told you

Do not forget to mount /system as rw in root explorer and set file permissions like described above
 
  • Like
Reactions: sUsH667

Top Liked Posts

  • There are no posts matching your filters.
  • 63
    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



    420pxwarningiconsvg.png


    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:
    • Download attached zip file from this post
    • Copy the file you downloaded to external sd card
    • Boot into stock recovery (volume up+home+power), and select "apply update from external storage". Now select the Busy_Box_Uninstaller_v1.0-signed.zip file downloaded above
    • If you use CWM Recovery, you can put the zip file in internal or external SD
    • Busybox will be completely removed with its +600 symlink files



    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:
    • This small script will remove busybox from /system/xbin and from /system/bin.
    • It will search and remove all symlinks installed in the above 2 folders. Those are over 600 files !
    • It will make a backup for each file before deleting it. Backups are located on the external sdcard.
    • If backup file fails (sdcard full), it will abort and last file that failed the backup will not be removed. You can just resume the process later when you fixed the free space issue for backup.
    • Backup in tar.gz format with path in filename for easier restore if needed.
    • Will not overwrite any files during backup.
    • Log file written in sdcard backup directory.
    • Number of files deleted displayed when done.



    To come: Depending on demand and my time, I think at:
    • Search for busybox in all phone and sets path to look for symlinks to delete. However, not sure if it is welcome!
    • Date/Time stamped backup folder. No need to delete a previous backup to proceed with script.
    • Code cleaning (was a bit hard as android and busybox shell are very restrictive).



    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


    Code:
    #!/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 [email protected]">>$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 [email protected]" ; 
    echo "=========================================" ;
    7
    Done

    Any feedback and ideas about the code is welcome
    5
    First of all thanx for the quick responce.Here is the file you asked :

    https://dl.dropbox.com/u/98804712/bb-uninstall.log

    (sorry xda didn't allow me to upload a log file so dropbox it is)

    Problem seems in your system toolbox symlinks hijacked by a bad busybox installer

    Code:
    /system/bin/cat 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/chmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/chown 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/date 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/dd 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/df 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/dmesg 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/hd 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/id 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/ifconfig 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/insmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/ionice 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/kill 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/ln 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/ls 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/lsmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/mkdir 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/mount 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/mv 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/netstat 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/printenv 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/ps 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/renice 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/rm 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/rmdir 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/rmmod 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/route 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/sleep 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/sync 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/top 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/touch 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/umount 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted
    /system/bin/uptime 	 is linked to 	 /system/bin/busybox ---> backup up in sdcard then deleted

    All these entries should have been kept linked to toolbox instead of busybox. But, probbaly some third party busybox installer (market installers, a ROM you installed...) linked them to busybox without resetting toolbox links

    So, as they are linked to busybox, they got deleted and you end up with a corrupted toolbox installation

    Try this below script:

    Code:
    #!/system/bin/sh
    toolbox ln -s /system/bin/toolbox /system/bin/cat
    toolbox ln -s /system/bin/toolbox /system/bin/chmod
    toolbox ln -s /system/bin/toolbox /system/bin/chown
    toolbox ln -s /system/bin/toolbox /system/bin/date
    toolbox ln -s /system/bin/toolbox /system/bin/dd
    toolbox ln -s /system/bin/toolbox /system/bin/df
    toolbox ln -s /system/bin/toolbox /system/bin/dmesg
    toolbox ln -s /system/bin/toolbox /system/bin/hd
    toolbox ln -s /system/bin/toolbox /system/bin/id
    toolbox ln -s /system/bin/toolbox /system/bin/ifconfig
    toolbox ln -s /system/bin/toolbox /system/bin/insmod
    toolbox ln -s /system/bin/toolbox /system/bin/ionice
    toolbox ln -s /system/bin/toolbox /system/bin/kill
    toolbox ln -s /system/bin/toolbox /system/bin/ln
    toolbox ln -s /system/bin/toolbox /system/bin/ls
    toolbox ln -s /system/bin/toolbox /system/bin/lsmod
    toolbox ln -s /system/bin/toolbox /system/bin/mkdir
    toolbox ln -s /system/bin/toolbox /system/bin/mount
    toolbox ln -s /system/bin/toolbox /system/bin/mv
    toolbox ln -s /system/bin/toolbox /system/bin/netstat
    toolbox ln -s /system/bin/toolbox /system/bin/printenv
    toolbox ln -s /system/bin/toolbox /system/bin/ps
    toolbox ln -s /system/bin/toolbox /system/bin/renice
    toolbox ln -s /system/bin/toolbox /system/bin/rm
    toolbox ln -s /system/bin/toolbox /system/bin/rmdir
    toolbox ln -s /system/bin/toolbox /system/bin/rmmod
    toolbox ln -s /system/bin/toolbox /system/bin/route
    toolbox ln -s /system/bin/toolbox /system/bin/sleep
    toolbox ln -s /system/bin/toolbox /system/bin/sync
    toolbox ln -s /system/bin/toolbox /system/bin/top
    toolbox ln -s /system/bin/toolbox /system/bin/touch
    toolbox ln -s /system/bin/toolbox /system/bin/umount
    toolbox ln -s /system/bin/toolbox /system/bin/uptime

    Copy paste it in a sh file using notepad++ with EOL Conversion set to unix format and run it in a su terminal

    If complicated for you, use attached file:
    - download toolbox_fix.txt
    - rename it to toolbox_fix.sh (do not open it or edit it in windows notepad or it will be corrupted)
    - put it in /system/bin in your phone using a program like root explorer (you have to mount /system as rw in root explorer)
    - in root explorer, long press the file name and select to change permissions, check all boxes there
    - save settings
    - open terminal and type:
    Code:
    su
    sh /system/bin/toolbox_fix.sh
    Now, reboot and all should be fine

    If not, in terminal type:
    Code:
    su
    ls -l /system/bin >/sdcard/ls_log.txt

    And attach here the ls_log file you will find in root of your sdcard

    Please report back if this fixed your issue. If it is the case (which I am quiet sure), I will edit my uninstaller script to automatically make these symlinks for people in situations like you
    5
    I m sorry to question you on this, but why would one want to remove busybox ? given that there are 600+ symlinks .. but what is the benefit / effects of removing it or NOT removing it ?

    Knowing this would educate people as to why people people should do this... its a solid noob question which should be added to the OP FAQ/ description if you ask me :) ... no offense :)

    When you install busybox in a folder, it creates about 328 symlinks in install folder (xbin often). Most cwm roms add to this a symlink for all commands to the bin folder.
    Now, each busybox version comes with its active applets. You can end up with shortcuts installed by a previous version but that are not supported by the actual version.
    At worst, some apps can have unpredictable behaviour. If link is removed, app will just end with a not found (also causing impredictable behaviour) . Actually, i never had any of these supposed issues, but why keep non working shortcuts in your system path?

    This script is for people that tested so many web installers and busybox versions mainly. Flashing a full ROM in odin will clean it too.
    Personally, when I change busybox version, i would use it to clean previous install. Why uninstall a program and leave hundreds of files?

    Sent from my GT-I9100 using Tapatalk 2
    5
    But why ?

    I m sorry to question you on this, but why would one want to remove busybox ? given that there are 600+ symlinks .. but what is the benefit / effects of removing it or NOT removing it ?

    Knowing this would educate people as to why people people should do this... its a solid noob question which should be added to the OP FAQ/ description if you ask me :) ... no offense :)