-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathWhatsApp_Chatstorage_sqlite.sql
37 lines (34 loc) · 1.53 KB
/
WhatsApp_Chatstorage_sqlite.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- IOS11 - WhatsApp messages - \Application Groups\net.whatsapp.WhatsApp.shared\ChatStorage.sqlite
-- net.whatsapp.WhatsApp 2.17.52.40
Select
zwamessage.z_pk as 'pk',
zwamessage.ZMESSAGETYPE as 'Type',
datetime('2001-01-01', zwamessage.ZMESSAGEDATE || ' seconds') as 'MessageDate',
ZWACHATSESSION.ZPARTNERNAME as 'SessionPartnerName',
zwamessage.ZFROMJID as 'From',
case zwamessage.ZISFROMME
when 0 then zwamessage.ZTEXT
end as 'Incoming Message',
case zwamessage.ZISFROMME
when 1 then zwamessage.ZTEXT
end as 'Outgoing Message',
zwamessage.ZTOJID as 'Sent To',
datetime('2001-01-01', zwamessage.ZSENTDATE || ' seconds') as 'SentDate',
zwamessage.ZMEDIASECTIONID as 'MediaDate',
ZWAMEDIAITEM.ZMEDIALOCALPATH as 'Path',
ZWAMEDIAITEM.ZVCARDSTRING as 'MediaType',
time(ZWAMEDIAITEM.ZMOVIEDURATION,'unixepoch') as 'Duration',
ZWAMEDIAITEM.ZMEDIAURL as 'Media_URL',
datetime('2001-01-01', ZWAMEDIAITEM.ZMEDIAURLDATE || ' seconds') as 'UrlDate',
ZWAMEDIAITEM.ZTITLE as 'Media_Title',
ZWAMEDIAITEM.ZLONGITUDE as 'Longitude',
ZWAMEDIAITEM.ZLATITUDE as 'Latitude',
ZWAMEDIAITEM.ZFILESIZE as 'Size',
zwamessage.ZPUSHNAME as 'PushName(To)',
ZWAMESSAGEINFO.ZRECEIPTINFO as 'ReceiptInfo(BLOOB)'
from zwamessage
left join ZWACHATSESSION on zwamessage.ZCHATSESSION = ZWACHATSESSION.Z_PK
left join ZWAPROFILEPUSHNAME on zwamessage.ZPUSHNAME = ZWAPROFILEPUSHNAME.ZPUSHNAME
left join ZWAMEDIAITEM on ZWAMEDIAITEM.ZMESSAGE = zwamessage.Z_PK
left join ZWAMESSAGEINFO on ZWAMESSAGEINFO.ZMESSAGE = zwamessage.Z_PK
order by MessageDate desc