root command:
/system/xbin/sqlite3 /data/data/com.whatsapp/databases/wa.db "SELECT display_name FROM wa_contacts WHERE is_whatsapp_user='1' ORDER BY _id;"
Call me stupid but how to make result (stdout) a valid list?
Thanks
sqlite3?
Moderator: Martin
Re: sqlite3?
You want to extract out the WA contacts? I should start to learn sqlite soon, this could come in handy.
The stdout from the sqlite is contact name separated by newline. You can simply use split() to split them into list.
The stdout from the sqlite is contact name separated by newline. You can simply use split() to split them into list.
Code: Select all
wacontact = split(stdout,"\n");
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: sqlite3?
Yes, its for an multi choice contact picker that shows wa contacts only. However, it shows groups too.
If you need the jid's aswell you can use
/system/xbin/sqlite3 /data/data/com.whatsapp/databases/wa.db "SELECT display_name,jid FROM wa_contacts WHERE is_whatsapp_user == '1'"
Now you got contact name and its WhatsApp ID seperated by '|'
Regards
If you need the jid's aswell you can use
/system/xbin/sqlite3 /data/data/com.whatsapp/databases/wa.db "SELECT display_name,jid FROM wa_contacts WHERE is_whatsapp_user == '1'"
Now you got contact name and its WhatsApp ID seperated by '|'
Regards
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: sqlite3?
Code: Select all
find("FirstName Lastname|123456", "\|")
First item: Everything before '|'
Second item: '|'
Third item: Everything behind '|'
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: sqlite3?
sqlite is to read a sqldump file into memory and perform sql queries onto this.
A sqldump is a series of logged sql statements.
When you play them, the database reconstructs.
A sqldump is a series of logged sql statements.
When you play them, the database reconstructs.
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands