Advertisement
metalx1000

Android ADB Shell view SMS Text Message Notifications

Feb 28th, 2023
1,214
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.27 KB | None | 1 0
  1. #!/system/bin/sh
  2. ######################################################################
  3. #Copyright (C) 2023  Kris Occhipinti
  4. #https://filmsbykris.com
  5.  
  6. #This program is free software: you can redistribute it and/or modify
  7. #it under the terms of the GNU General Public License as published by
  8. #the Free Software Foundation version 3 of the License.
  9.  
  10. #This program is distributed in the hope that it will be useful,
  11. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #GNU General Public License for more details.
  14.  
  15. #You should have received a copy of the GNU General Public License
  16. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17. ######################################################################
  18.  
  19. #view SMS Text Message Notifications
  20.  
  21. data="$(dumpsys notification --noredact)"
  22. sms="$(echo "$data"|grep Bundle -A 10|dos2unix|tr "\n" "|"|
  23. sed 's/sender_person=/\n/g'|grep 'sender='|
  24. sed 's/, /\n/g;s/}]|/\n/g'|grep -e "^sender" -A2|
  25. sed 's/^sender=//g;s/^text=//g'|tr "|" "\n")"
  26.  
  27. echo "$sms"|while read l
  28. do
  29.   #convert time stamp to date format
  30.   if [[ $l == "time="* ]]
  31.   then
  32.     time="$(echo "$l"|cut -d\= -f2)"
  33.     date -d @$time
  34.   else
  35.     echo "$l"
  36.   fi
  37. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement