• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Script to remove stock apk's after flash

You'd have to make a bash script and put it on the phone, chmod +x it, and add whatever stuff you want to remove, as well as the remount command.

Am I on the right track here?


#!/system/bin/sh
mount -o rw,remount /dev/block/mtdblock3 /system
cd /system/app
rm -r HtcTwitter.apk
rm -r Stock.apk
 
Upvote 0
My best guess so far... If anyone can modify this to work better, please do. I'm trying :p


Make a text file and save it as "remove.sh" put the following text in

#! /system/bin/sh
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
rm /system/app/com.htc.TwitterWidget.apk
rm /system/app/com.htc.StockWidget.apk
rm /system/app/HtcTwitter.apk
rm /system/app/Stock.apk
rm /system/app/VVMStub_v3.apk
exit
exit
exit


Download any Terminal Emulator from the market

From Terminal, Enter

sh /sdcard/remove.sh

If anyone wants to try this, please let me know what you find.

Thanks
 
Upvote 0
My best guess so far... If anyone can modify this to work better, please do. I'm trying :p


Make a text file and save it as "remove.sh" put the following text in

#! /system/bin/sh
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
rm /system/app/com.htc.TwitterWidget.apk
rm /system/app/com.htc.StockWidget.apk
rm /system/app/HtcTwitter.apk
rm /system/app/Stock.apk
rm /system/app/VVMStub_v3.apk
exit
exit
exit


Download any Terminal Emulator from the market

From Terminal, Enter

sh /sdcard/remove.sh

If anyone wants to try this, please let me know what you find.

Thanks

Thank you. Will have to test this after my next flash as I already removed these files. Dont forget to remove the odex files either. :)
 
Upvote 0
Here is what I came up with. Like an idiot, I removed all the packages before doing this. When I tried it, it just sits there, so I dont know if its because the stuff isnt there or its wrong. Anyone?

#! /system/bin/sh
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
rm /system/app/com.htc.TwitterWidget.apk
rm /system/app/com.htc.TwitterWidget.odex
rm /system/app/com.htc.StockWidget.apk
rm /system/app/com.htc.StockWidget.odex
rm /system/app/HtcTwitter.apk
rm /system/app/HtcTwitter.odex
rm /system/app/Stock.apk
rm /system/app/Stock.odex
rm /system/app/VVMStub_v3.apk
rm /system/app/VVMStub_v3.odex
rm /system/app/amazonmp3.apk
rm /system/app/DCSStock.apk
rm /system/app/DCSStock.odex
rm /system/app/Mms.apk
rm /system/app/Mms.odex
rm /system/app/amazonmp3.apk
rm /system/app/amazonmp3.odex

exit
exit
exit
 
Upvote 0
Anyone having luck with this? I get a not found, mount: no such file or directory, and then read only error

This is what I have, what am I doing wrong?

#! /system/bin/sh
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
rm -f /system/app/com.htc.TwitterWidget.apk
rm -f /system/app/com.htc.TwitterWidget.odex
rm -f /system/app/com.htc.StockWidget.apk
rm -f /system/app/com.htc.StockWidget.odex
rm -f /system/app/HtcTwitter.apk
rm -f /system/app/HtcTwitter.odex
rm -f /system/app/Stock.apk
rm -f /system/app/Stock.odex
rm -f /system/app/VVMStub_v3.apk
rm -f /system/app/VVMStub_v3.odex
rm -f /system/app/amazonmp3.apk
rm -f /system/app/DCSStock.apk
rm -f /system/app/DCSStock.odex
rm -f /system/app/Mms.apk
rm -f /system/app/Mms.odex
rm -f /system/app/amazonmp3.apk
rm -f /system/app/amazonmp3.odex
exit
exit
exit

EDIT: Just re-read the posts GrdLock put and it seems this wont work. I gotta read more of the link he posted when I get time.
 
Upvote 0
Since no one answered on this, I figured a lil out. The rm -f doesnt work on our phones (from what I have tried, I could be wrong since I know nothing about linux) so what I did was open a cmd window in windows and went into the /tools/ dir and then ran the first 3 commands of line:

#! /system/bin/sh
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

and then copy and pasted the rest:

rm /system/app/com.htc.TwitterWidget.apk
rm /system/app/com.htc.TwitterWidget.odex
rm /system/app/com.htc.StockWidget.apk
rm /system/app/com.htc.StockWidget.odex
rm /system/app/HtcTwitter.apk
rm /system/app/HtcTwitter.odex
rm /system/app/Stock.apk
rm /system/app/Stock.odex
rm /system/app/VVMStub_v3.apk
rm /system/app/VVMStub_v3.odex
rm /system/app/amazonmp3.apk
rm /system/app/DCSStock.apk
rm /system/app/DCSStock.odex
rm /system/app/Mms.apk
rm /system/app/Mms.odex
rm /system/app/amazonmp3.apk
rm /system/app/amazonmp3.odex

It removed all the files that were still there and the ones that were not it just gave an error. Is it auto? No but it works instead of having to type 1 line after another. I will test making an script .bat that does this from windows since I cant figure it out how to do it on the phone the same way.
 
Upvote 0
Since no one answered on this, I figured a lil out. The rm -f doesnt work on our phones (from what I have tried, I could be wrong since I know nothing about linux) so what I did was open a cmd window in windows and went into the /tools/ dir and then ran the first 3 commands of line:

#! /system/bin/sh
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

and then copy and pasted the rest:

rm /system/app/com.htc.TwitterWidget.apk
rm /system/app/com.htc.TwitterWidget.odex
rm /system/app/com.htc.StockWidget.apk
rm /system/app/com.htc.StockWidget.odex
rm /system/app/HtcTwitter.apk
rm /system/app/HtcTwitter.odex
rm /system/app/Stock.apk
rm /system/app/Stock.odex
rm /system/app/VVMStub_v3.apk
rm /system/app/VVMStub_v3.odex
rm /system/app/amazonmp3.apk
rm /system/app/DCSStock.apk
rm /system/app/DCSStock.odex
rm /system/app/Mms.apk
rm /system/app/Mms.odex
rm /system/app/amazonmp3.apk
rm /system/app/amazonmp3.odex

It removed all the files that were still there and the ones that were not it just gave an error. Is it auto? No but it works instead of having to type 1 line after another. I will test making an script .bat that does this from windows since I cant figure it out how to do it on the phone the same way.


first off you can remove the -t yaffs2 its redundant because android already knows mtdblock3 is mounted on a yaffs2 partition


so try this

Code:
#!/system/bin/sh

/system/bin/mount -o remount,rw /dev/block/mtdblock3 /system

cd /system/app

rm com.htc.TwitterWidget.apk
rm com.htc.TwitterWidget.odex
rm com.htc.StockWidget.apk
rm com.htc.StockWidget.odex
rm HtcTwitter.apk
rm HtcTwitter.odex
rm Stock.apk
rm Stock.odex
rm VVMStub_v3.apk
rm VVMStub_v3.odex
rm amazonmp3.apk
rm DCSStock.apk
rm DCSStock.odex
rm Mms.apk
rm Mms.odex
rm amazonmp3.apk
rm amazonmp3.odex

exit


and dont forget we do have code tags :p
 
Upvote 0
Tried this and came up with ''No such file or directory errors'' and ''command not found''

My Script:

#! /system/bin/sh

mount -o rw,remount /dev/block/mtdblock3 /system

cd /system/app

rm teeter.apk
rm htcmailwidgets.apk
rm htcmsgwidgets.apk
rm htcbookmarkwidget.apk
rm htccalendarwidgets.apk
rm com.htc.TwitterWidget.apk
rm com.htc.StockWidget.apk
rm com.htc.MusicWidget.apk
rm amazonmp3.apk
rm Sprint_TVWidget.apk
rm Sprint_TV.apk
rm Sprint_Nscar.apk
rm Sprint_NFL.apk
rm Sprint_Core.apk
rm SetupWizard.apk
rm LearnMore.apk
rm SocialNetworkProvider.apk
rm IM.apk
rm HtcTwitter.apk
rm HtcPhotoWidget.apk
rm HtcNaviPanel.apk
rm HtcFootprintsWidget.apk
rm HtcFootprints.apk
rm HTCSetupWizard.apk
rm Flickr.apk
rm Facebook.apk
rm gtalkservice.apk

cd /data/data

rm -R com.htc.photo.widgets
rm -R com.mobitv.client.sprinttv
rm -R com.mobitv.sprint.tvwidget
rm -R com.htc.socialnetwork.flickr
rm -R com.htc.lockscreen
rm -R com.amazon.mp3
rm -R com.htc.MusicWidget
rm -R com.htc.TwitterWidget
rm -R com.htc.StockWidget
rm -R com.google.android.apps.gtalkservice
rm -R com.htc.htcbookmarkwidget
rm -R com.htc.htccalendarwidgets
rm -R com.htc.htcmailwidgets
rm -R com.htc.htcmsgwidgets
rm -R com.htc.htctwitter
rm -R com.htc.android.teeter
rm -R com.htc.HtcNaviPanel
rm -R com.htc.android.footprints
rm -R com.htc.android.htcsetupwizard
rm -R com.htc.footprints.widgets

exit

______

Any help will be appreciated.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones