Advertisement
metalx1000

ADB Android Read SMS Text Messages

Jan 17th, 2025 (edited)
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.89 KB | None | 0 0
  1. # Get sms messages through adb Android Shell (no root needed)
  2. content query --uri content://sms/
  3.  
  4. # Specify fields returned
  5. projection="thread_id:address:person:date:date_sent:protocol:read:status:type:reply_path_present:subject:body:service_center:locked:sub_id:error_code:creator:seen"
  6. content query --uri content://sms/ --projection ${projection}
  7.  
  8. projection="thread_id:address:person:date_sent:body"
  9. content query --uri content://sms/ --projection ${projection}
  10.  
  11. # By default the newest messages are listed first
  12. # lets grab just the first 25 messages
  13. # and put them so the newest are at the bottom.
  14. # Some messages are multi line messages
  15. # lets put them on one line for sorting
  16. content query --uri content://sms/ --projection ${projection}|tr "\n" "|"|sed 's/|Row:/\nRow:/g'|head -n 25|tac
  17.  
  18. # This can take some time if you have a lot of messages
  19.  
  20. # also see https://pastebin.com/J1VDDJ11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement