Skip to content

Instantly share code, notes, and snippets.

@goofwear
Forked from larsvilhuber/add_datatoggle.sh
Created June 23, 2018 16:37
Show Gist options
  • Save goofwear/13d8a27c99a20b708c209b4976e1589d to your computer and use it in GitHub Desktop.
Save goofwear/13d8a27c99a20b708c209b4976e1589d 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment