Advertisement
metalx1000

Android SMS and MMS Text Message info

Nov 2nd, 2019 (edited)
1,100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.93 KB | None | 0 0
  1. #Android SMS text messages are stored in sqlite db:
  2. db="/data/data/com.android.providers.telephony/databases/mmssms.db"
  3.  
  4. #list messages info:
  5. sqlite3 $db "SELECT * FROM sms"
  6. sqlite3 $db "SELECT date,address,body,type FROM sms"
  7.  
  8. #filter by phone number
  9. sqlite3 $db "SELECT date,address,body,type FROM sms WHERE address LIKE '%5555555%'"
  10.  
  11. #Search through MMS Attachments
  12. sqlite3 $db "select * from part"
  13.  
  14. #Get Text from MMS messages
  15. sqlite3 $db "SELECT text FROM part WHERE name LIKE '%text%';"
  16.  
  17. #Get list of Image file attachments
  18. SELECT _data FROM part WHERE cl LIKE "%image%";
  19.  
  20. #Android MMS Attachments are stored in:
  21. /data/user_de/0/com.android.providers.telephony/app_parts/
  22.  
  23. #Get Last 50 Messages by date
  24. SELECT * FROM (SELECT * FROM sms ORDER BY date DESC LIMIT 50) ORDER BY date ASC;
  25.  
  26. #last 50 as JSON
  27. sqlite3 -json $db "SELECT * FROM (SELECT * FROM sms ORDER BY date DESC LIMIT 50) ORDER BY date ASC;" |jq .
  28.  
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement