Skip to content

Instantly share code, notes, and snippets.

@larsvilhuber
Last active May 14, 2020 09:17
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save larsvilhuber/548bcc3154ce9d9f6967fa8f96ca0da4 to your computer and use it in GitHub Desktop.
Save larsvilhuber/548bcc3154ce9d9f6967fa8f96ca0da4 to your computer and use it in GitHub Desktop.
Add a Data Toggle Tile to Samsung devices without root
#!/bin/bash
# Based on https://www.xda-developers.com/how-to-restore-mobile-data-quick-settings-tile-toggle-on-samsung-galaxy-devices/
# This will work with minor adjustments to your installation of the Android SDK or wherever you put adb.
# Should work on Linux and Mac, but only tested on Linux
PATH=../android-sdk-linux/platform-tools:$PATH
outfile=list.$(date +%F)
adb devices
echo "Do you see your device? [y|N]"
read answer
case $answer in
y)
echo "Continuing"
;;
*)
echo Sorry
exit 2
;;
esac
[[ -f $outfile ]] && rm -i $outfile
adb shell settings get secure sysui_qs_tiles > $outfile
#echo "Old Contents of sysui_qs_tiles"
#cat $outfile
echo "=============================="
cat $outfile | sed 's/DormantMode,/DormantMode,MobileData,/' > ${outfile}.new
echo "Changes we will be making"
diff $outfile ${outfile}.new
echo "=============================="
echo "Good to go? [y|N]"
read answer
case $answer in
y)
echo "Continuing"
;;
*)
echo Sorry
exit 2
;;
esac
# Uncomment the following line once you are certain that everything is right
# Until then, this program does nothing to your Android device!!!
#adb shell settings put secure sysui_qs_tiles "$(cat ${outfile}.new)"
echo Done. Settings are now like this:
adb shell settings get secure sysui_qs_tiles
@oldman20
Copy link

Hi, would you make Data Saver visble into quick setting? Im using Samsung galaxy note9 but cant make it working!
thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment