[Galaxy S II Themes and Apps] kuma82:
@Phil3759

Thanks for you sweet script, I'm sure it took a lot of work to get it running properly.

I was wondering is there anyway I can run your bb-uninstaller.sh while the system is bootup.

I've installed busybox into /data/local/tmp & placed you script inside as well. However, I can get it to run properly. Is there any modification I can make that will cause the script to use the /data/local/tmp/busybox.

I'm thinking about modifying the script to something like this

#!/system/bin/sh
busybox="/data/local/busybox";
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 ;

Thanks, I'll report back if the following works

lol I make a mistake, it's suppose to point to /data/local/tmp/busybox

UPDATE

Well that didn't work, lol. I just checked out the log hahaha

Update 2:

Well I changed your script to the following and it removed all system links to busybox :D

#!/system/bin/sh
busybox="/data/local/tmp/busybox";
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 ;

However, I'm not 100% that all of the applets were used by /data/local/tmp/busybox :-/

I'll have to do some testing to make sure.