[Samsung Galaxy Note 9 Themes, Apps, and Mods] lodk:
Hello XDA,

This is the first script I have ever made.

I would like to thank the developers here on XDA for inspiring me to learn. this would not have been possible without you all posting the information you freely post.

I want to also personally thank user bbtdev, your post

https://xdaforums.com/galaxy-note-9/how-to/note-9-debloat-bash-script-t3907659

was my inspiration to dig in and learn scripting in bash. and my work is based off of your post.

I wanted to have something automated that I can use to run ADB without having to put in all the redundent stuff. Not just to debloat my unrooted note9 but to also enable it back again if the need arised. After starting I thought maybe there might also be a need to do some individual packages and decided that would also be a nice option as well. To keep this short the script at this time debloat what I have debloated of my Note 9, this could be different on yours but everything I need works great. it will also allow you to undo the debloat process and enable everything it disabled. You can easily look at enable,disabled,system and third party packages wit just the click of a button. Also you can just manually enable or disable packages just by adding the name of the package.

I am sure experienced programmers will find some easier way to code it or even bugs, but like I said my first attempt and just wanted to share what I have learned over the past day. i also understand there may be other scripts like this I am not sure but if so it is not my intent to copy. my intent is just to learn and practice.

so have a look.

thanks.

#!/bin/bash
#My first bash script inspired by developers on XDA
#This is the start of the script my intro title (LODK)
begin() {
clear
echo " (◣_◢)--Lodk--(◣_◢) "
echo " ADB Debloat Tool "
echo " "
sleep 2.0
clear
}
#will kill then start the server for ADB maybe don't need the sleep
start() {
adb kill-server
adb start-server
sleep 1.0
clear
}
#this is what happens if you say no device is found in main menu
ts() {
echo " (◣_◢)--Lodk--(◣_◢) "
echo " Troubleshooting "
echo " Check List "
echo "1. Is your USB-Cable plugged in and in working order? "
echo "2. Are your Drivers installed correctly? "
echo "3. Have you enabled USB-Debugging in developers options? "
echo "4. Have you allowed USB Debugging from your device? "
echo " If all these things check out please retry "
exit
}
#if you say yes device is found in main menu
connected() {
echo " (◣_◢)--Lodk--(◣_◢) "
echo "Thats Great lets begin"
echo ""
sleep 2.5
clear
}
#when Debloat is selected in menu2 any one can be commented out if you need to
debloat() {
echo "Now deactivating all bloatware"
adb shell pm disable-user --user 0 com.sec.android.widgetapp.samsungapps
adb shell pm disable-user --user 0 com.google.android.youtube
adb shell pm disable-user --user 0 com.sec.location.nsflp2
adb shell pm disable-user --user 0 com.samsung.android.app.cocktailbarservice
adb shell pm disable-user --user 0 com.cnn.mobile.android.phone.edgepanel
adb shell pm disable-user --user 0 com.sec.android.mimage.gear360editor
adb shell pm disable-user --user 0 com.samsung.android.knox.containercore
adb shell pm disable-user --user 0 com.samsung.android.app.settings.bixby
adb shell pm disable-user --user 0 com.sec.android.app.billing
adb shell pm disable-user --user 0 com.samsung.android.game.gamehome
adb shell pm disable-user --user 0 com.samsung.android.widgetapp.yahooedge.finance
adb shell pm disable-user --user 0 com.sec.enterprise.knox.attestation
adb shell pm disable-user --user 0 com.samsung.systemui.bixby2
adb shell pm disable-user --user 0 com.microsoft.skydrive
adb shell pm disable-user --user 0 com.samsung.android.knox.containeragent
adb shell pm disable-user --user 0 com.samsung.SMT
adb shell pm disable-user --user 0 com.samsung.knox.keychain
adb shell pm disable-user --user 0 com.samsung.android.aircommandmanager
adb shell pm disable-user --user 0 com.samsung.android.bixby.service
adb shell pm disable-user --user 0 com.samsung.android.widgetapp.yahooedge.sport
adb shell pm disable-user --user 0 com.samsung.android.samsungpositioning
adb shell pm disable-user --user 0 com.samsung.android.bixby.agent
adb shell pm disable-user --user 0 com.hancom.office.editor.hidden
adb shell pm disable-user --user 0 com.samsung.android.hmt.vrsvc
adb shell pm disable-user --user 0 com.samsung.knox.securefolder
adb shell pm disable-user --user 0 com.samsung.android.game.gametools
adb shell pm disable-user --user 0 com.samsung.android.service.peoplestripe
adb shell pm disable-user --user 0 com.samsung.android.app.taskedge
adb shell pm disable-user --user 0 com.samsung.android.app.mirrorlink
adb shell pm disable-user --user 0 flipboard.boxer.app
adb shell pm disable-user --user 0 com.google.android.feedback
adb shell pm disable-user --user 0 com.sec.android.app.sbrowser
adb shell pm disable-user --user 0 com.samsung.android.bixbyvision.framework
adb shell pm disable-user --user 0 com.samsung.app.highlightplayer
adb shell pm disable-user --user 0 com.samsung.android.beaconmanager
adb shell pm disable-user --user 0 com.sec.android.soagent
adb shell pm disable-user --user 0 com.samsung.android.fmm
adb shell pm disable-user --user 0 com.samsung.android.bixby.wakeup
adb shell pm disable-user --user 0 com.samsung.android.samsungpass
adb shell pm disable-user --user 0 com.samsung.android.fast
adb shell pm disable-user --user 0 com.samsung.android.knox.analytics.uploader
adb shell pm disable-user --user 0 com.sec.android.emergencylauncher
adb shell pm disable-user --user 0 com.samsung.android.dlp.service
adb shell pm disable-user --user 0 com.samsung.android.visionintelligence
adb shell pm disable-user --user 0 com.samsung.android.app.watchmanagerstub
adb shell pm disable-user --user 0 com.samsung.android.mateagent
adb shell pm disable-user --user 0 com.enhance.gameservice
adb shell pm disable-user --user 0 com.google.vr.vrcore
adb shell pm disable-user --user 0 com.sec.enterprise.knox.cloudmdm.smdms
adb shell pm disable-user --user 0 com.wssyncmldm
adb shell pm disable-user --user 0 com.tmobile.services.nameid
adb shell pm disable-user --user 0 com.samsung.android.app.clipboardedge
adb shell pm disable-user --user 0 com.samsung.upsmtheme
echo "All bloatware is now inactive"
echo "Your phone will now reboot"
read -p "press [Enter] to continue..."
adb reboot
clear
}
# when rebloat is selected in menu2 anyone can be commented out if you need too
# if you add to Debloat list also add to rebloat list so you can always return what was disabled to enabled automatically
rebloat() {
echo "Now enabling all bloatware"
adb shell pm enable --user 0 com.sec.android.widgetapp.samsungapps
adb shell pm enable --user 0 com.google.android.youtube
adb shell pm enable --user 0 com.sec.location.nsflp2
adb shell pm enable --user 0 com.samsung.android.app.cocktailbarservice
adb shell pm enable --user 0 com.cnn.mobile.android.phone.edgepanel
adb shell pm enable --user 0 com.sec.android.mimage.gear360editor
adb shell pm enable --user 0 com.samsung.android.knox.containercore
adb shell pm enable --user 0 com.samsung.android.app.settings.bixby
adb shell pm enable --user 0 com.sec.android.app.billing
adb shell pm enable --user 0 com.samsung.android.game.gamehome
adb shell pm enable --user 0 com.samsung.android.widgetapp.yahooedge.finance
adb shell pm enable --user 0 com.sec.enterprise.knox.attestation
adb shell pm enable --user 0 com.samsung.systemui.bixby2
adb shell pm enable --user 0 com.microsoft.skydrive
adb shell pm enable --user 0 com.samsung.android.knox.containeragent
adb shell pm enable --user 0 com.samsung.SMT
adb shell pm enable --user 0 com.samsung.knox.keychain
adb shell pm enable --user 0 com.samsung.android.aircommandmanager
adb shell pm enable --user 0 com.samsung.android.bixby.service
adb shell pm enable --user 0 com.samsung.android.widgetapp.yahooedge.sport
adb shell pm enable --user 0 com.samsung.android.samsungpositioning
adb shell pm enable --user 0 com.samsung.android.bixby.agent
adb shell pm enable --user 0 com.hancom.office.editor.hidden
adb shell pm enable --user 0 com.samsung.android.hmt.vrsvc
adb shell pm enable --user 0 com.samsung.knox.securefolder
adb shell pm enable --user 0 com.samsung.android.game.gametools
adb shell pm enable --user 0 com.samsung.android.service.peoplestripe
adb shell pm enable --user 0 com.samsung.android.app.taskedge
adb shell pm enable --user 0 com.samsung.android.app.mirrorlink
adb shell pm enable --user 0 flipboard.boxer.app
adb shell pm enable --user 0 com.google.android.feedback
adb shell pm enable --user 0 com.sec.android.app.sbrowser
adb shell pm enable --user 0 com.samsung.android.bixbyvision.framework
adb shell pm enable --user 0 com.samsung.app.highlightplayer
adb shell pm enable --user 0 com.samsung.android.beaconmanager
adb shell pm enable --user 0 com.sec.android.soagent
adb shell pm enable --user 0 com.samsung.android.fmm
adb shell pm enable --user 0 com.samsung.android.bixby.wakeup
adb shell pm enable --user 0 com.samsung.android.samsungpass
adb shell pm enable --user 0 com.samsung.android.fast
adb shell pm enable --user 0 com.samsung.android.knox.analytics.uploader
adb shell pm enable --user 0 com.sec.android.emergencylauncher
adb shell pm enable --user 0 com.samsung.android.dlp.service
adb shell pm enable --user 0 com.samsung.android.visionintelligence
adb shell pm enable --user 0 com.samsung.android.app.watchmanagerstub
adb shell pm enable --user 0 com.samsung.android.mateagent
adb shell pm enable --user 0 com.enhance.gameservice
adb shell pm enable --user 0 com.google.vr.vrcore
adb shell pm enable --user 0 com.sec.enterprise.knox.cloudmdm.smdms
adb shell pm enable --user 0 com.wssyncmldm
adb shell pm enable --user 0 com.tmobile.services.nameid
adb shell pm enable --user 0 com.samsung.android.app.clipboardedge
adb shell pm enable --user 0 com.samsung.upsmtheme

echo "All bloatware is now active"
echo "Your phone will now reboot"
read -p "press [Enter] to continue..."
adb reboot
clear
}
#this will use adb to manually enable packages just add name when asked
menable() {
echo ""
read -p "enter package name you would like to enable:" p
adb shell pm enable --user 0 "$p"
menu2
}
#this will use adb to manually disable packages just add name when asked
mdisable() {

echo ""
read -p "enter package name you would like to disable:" p
adb shell pm disable-user --user 0 "$p"
menu2
}
#this is the manual ADB menu
menu4() {
echo " (◣_◢)--Lodk--(◣_◢) "
echo " Manual ADB Comands "
echo "------------------------------------"
echo "Press 1 to manualy disable a package"
echo "Press 2 to manualy enable a package "
echo "Press 3 to go to Main Menu "
echo "Press 4 to quit "
read value
if [ "$value" == "1" ]; then
clear
mdisable
fi
if [ "$value" == "2" ]; then
clear
menable
fi
if [ "$value" == "3" ]; then
clear
menu2
fi
if [ "$value" == "4" ]; then
clear
echo "(◕‿-) Goodbye (◕‿-) "
exit
fi
clear
}
# menu for package manager
menu3() {
echo " (◣_◢)--Lodk--(◣_◢) "
echo " Package Manager Menu "
echo "------------------------------------"
echo "Press 1 to list disabled packages "
echo "Press 2 to list enabled packages "
echo "Press 3 to list system packages "
echo "Press 4 to list third party packages"
echo "Press 5 to go the Main menu "
echo "Press 6 to quit "
read value
if [ "$value" == "1" ]; then
adb shell pm list packages -d
menu2
fi
if [ "$value" == "2" ]; then
adb shell pm list packages -e
menu2
fi
if [ "$value" == "3" ]; then
adb shell pm list packages -s
menu2
fi
if [ "$value" == "4" ]; then
adb shell pm list packages -3
menu2
fi
if [ "$value" == "5" ]; then
menu2
fi
if [ "$value" == "5" ]; then
echo "(◕‿-) Goodbye (◕‿-) "
exit
fi
}
#prompt you to make sure your device is connected
menu1() {
echo " (◣_◢)--Lodk--(◣_◢) "
echo " Is your device listed "
echo "----------------------------- "
echo "Press 1 for yes. "
echo "Press 2 for no. "
read value
if [ "$value" == "1" ]; then
clear
connected
fi
if [ "$value" == "2" ]; then
clear
ts
fi
clear
}
#after device connection is varified this will be the menu you get
menu2() {
echo " (◣_◢)--Lodk--(◣_◢) "
echo " ADB MENU "
echo "----------------------------- "
echo "Press 1 to run debloat. "
echo "Press 2 to run rebloat. "
echo "Press 3 to run Package Manager"
echo "Press 4 to run manual ADB "
echo "Press 5 to quit "
read value
if [ "$value" == "1" ]; then
clear
debloat
fi
if [ "$value" == "2" ]; then
clear
rebloat
fi
if [ "$value" == "3" ]; then
clear
menu3
fi
if [ "$value" == "4" ]; then
clear
menu4
fi
if [ "$value" == "5" ]; then
clear
echo "(◕‿-) Goodbye (◕‿-) "
exit
fi
}
#this runs all the functions listed above
begin
start
adb devices
menu1
menu2