Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save johnhany97/c61d10b3c30f507b8c86 to your computer and use it in GitHub Desktop.
Save johnhany97/c61d10b3c30f507b8c86 to your computer and use it in GitHub Desktop.
#!/system/bin/sh
#
# Shell script to disable read receipts for your sent Whatsapp messages.
# (Requires "sed" (ie "busybox") being installed on the system to work.)
#
# Author: Stephan Schmitz <eyecatchup@gmail.com>
# Source: https://gist.github.com/eyecatchup/9af90363732801b131bf
#
# In early Nov 2014, Whatsapp added a new "feature" - read receipts. Meaning,
# your chat partners will get a visual feedback (2 blue check marks) as soon as
# you read their message.
#
# Unfortunately, the Whatsapp dev team forgot to include a corresponding privacy
# setting for users to be able to turn off this feature. However, fortunately, I
# found it was fairly simple to disable the feature, since it is set in a public
# XML file in Whatsapp's app data directory.
#
# This script provides a convenient wrapper for Android users who do not live in
# the command line. ;-)
#
# USAGE
#
# - Save the script to your phones sdcard as "disable_whatsapp_read_receipts.sh"
# - Open a terminal on your device (remote or local doesn't matter)
# - Type "sh /sdcard/disable_whatsapp_read_receipts.sh" (without quotes, adjust path to fit yours!)
# - Hit the enter button. Done. (Whatsapp will restart afterwards)
#
#
# Successfully tested on version 2.11.432 and 2.11.399
#
WA_PREFS_PATH='/data/data/com.whatsapp/shared_prefs'
WA_PREFS_FILE='com.whatsapp_preferences.xml'
echo "Trying to disable read receipts for sent Whatsapp messages .."
echo "A backup copy of the original file will be saved in $WA_PREFS_PATH .."
# In order for sed inline replacement to match on PATTERN , we need to match the
# whole line containing PATTERN and then replace the whole line.
sed -i'.bak' 's/^.*\bread_receipts\b.*$/ <long name="read_receipts" value="0" \/>/g' $WA_PREFS_PATH/$WA_PREFS_FILE
echo "Done. For the change to take affect, restarting Whatsapp now."
echo `am start -n com.whatsapp/com.whatsapp.Conversation`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment