10.03.20, 14:53
0
Thank you for your help, CTHTC! I actually don't need to copy my messages to Android, iOS or whatever, just read them and that's it. I've found this instruction on russian website https://4pda{.}ru/forum/index.php?showtopic=871443&st=20, which is very simple and doesn't even require any paid tools.
0) Backup all your media just in case.
1) Unlock your phone using WPInternals
2) In Mass Storage Mode, go to Data\Users\DefApps (or DefApps.WindowsPhone)\Local\Packages\5319275A.WhatsApp_cv1g1gvanyjgm\LocalState and copy files "messages.db" and "key"
In my case, the folder above was inaccessible, so i've backed up Data partition via WPInternals and copied files from there using 7-Zip.
3) Download sqilte-tools from sqlite{.}com/download.html (choose file sqlite-tools-win32-x86-whatever.zip) and empty Android database ( mega{.}nz/#!bmQnSArA!SMmDaiYDmkwiB0mwMdIZgd64LfQKeZOlAeY54wmcy4s ). If the link is inaccessible and 4pda is returning 404's, just register there, it doesn't allow downloads without registration.
Extract sqlite-tools, msgstore.db and messages.db, open sqlite3 and run following commands:
[FONT="]ATTACH 'msgstore.db' AS android;
[/FONT][FONT="] ATTACH 'messages.db' AS winphone;
[/FONT] [FONT="]INSERT INTO messages(key_remote_jid, key_from_me, key_id, status, remote_resource, data, media_url, media_mime_type, media_wa_type, media_size, media_name, media_hash, media_caption, latitude, longitude, participant_hash, starred, raw_data, timestamp) SELECT KeyRemoteJid, KeyFromMe, KeyId, Status, RemoteResource, Data, MediaUrl, MediaMimeType, MediaWaType, MediaSize, MediaName, MediaHash, MediaCaption, Latitude, Longitude, ParticipantsHash, IsStarred, BinaryData, TimestampLong FROM winphone.Messages;
[/FONT] [FONT="]INSERT INTO chat_list(key_remote_jid, subject, creation, last_message_table_id, unseen_message_count, archived, message_table_id, sort_timestamp) SELECT Jid, GroupSubject, GroupCreationT, LastMessageID, UnreadMessageCount, IsArchived, LastMessageID, Timestamp FROM Conversations;
[/FONT] [FONT="]INSERT INTO messages_vcards(sender_jid, message_row_id ) SELECT Jid, MessageId FROM ContactVCards;
[/FONT][FONT="]UPDATE messages SET timestamp = timestamp*1000;
[/FONT][FONT="] [/FONT][FONT="].quit
[/FONT]4) Download WhatsApp Viewer to check the created base from github{.}com/andreas-mausch/whatsapp-viewer/releases/
5) If the database is fine, put it in /data/data/сom.whatsapp/databases/ (you may need WhatsApp v2.18.248, I didn't test it)
If you don't have root rights on your phone, you may try (but no guarantee it will work) encrypting it using whatcrypt{.}com/?cmd=_cryptkey and restoring it as in official guide: faq{.}whatsapp{.}com/en/android/20887921/?category=5245251#restore.
0) Backup all your media just in case.
1) Unlock your phone using WPInternals
2) In Mass Storage Mode, go to Data\Users\DefApps (or DefApps.WindowsPhone)\Local\Packages\5319275A.WhatsApp_cv1g1gvanyjgm\LocalState and copy files "messages.db" and "key"
In my case, the folder above was inaccessible, so i've backed up Data partition via WPInternals and copied files from there using 7-Zip.
3) Download sqilte-tools from sqlite{.}com/download.html (choose file sqlite-tools-win32-x86-whatever.zip) and empty Android database ( mega{.}nz/#!bmQnSArA!SMmDaiYDmkwiB0mwMdIZgd64LfQKeZOlAeY54wmcy4s ). If the link is inaccessible and 4pda is returning 404's, just register there, it doesn't allow downloads without registration.
Extract sqlite-tools, msgstore.db and messages.db, open sqlite3 and run following commands:
[FONT="]ATTACH 'msgstore.db' AS android;
[/FONT][FONT="] ATTACH 'messages.db' AS winphone;
[/FONT] [FONT="]INSERT INTO messages(key_remote_jid, key_from_me, key_id, status, remote_resource, data, media_url, media_mime_type, media_wa_type, media_size, media_name, media_hash, media_caption, latitude, longitude, participant_hash, starred, raw_data, timestamp) SELECT KeyRemoteJid, KeyFromMe, KeyId, Status, RemoteResource, Data, MediaUrl, MediaMimeType, MediaWaType, MediaSize, MediaName, MediaHash, MediaCaption, Latitude, Longitude, ParticipantsHash, IsStarred, BinaryData, TimestampLong FROM winphone.Messages;
[/FONT] [FONT="]INSERT INTO chat_list(key_remote_jid, subject, creation, last_message_table_id, unseen_message_count, archived, message_table_id, sort_timestamp) SELECT Jid, GroupSubject, GroupCreationT, LastMessageID, UnreadMessageCount, IsArchived, LastMessageID, Timestamp FROM Conversations;
[/FONT] [FONT="]INSERT INTO messages_vcards(sender_jid, message_row_id ) SELECT Jid, MessageId FROM ContactVCards;
[/FONT][FONT="]UPDATE messages SET timestamp = timestamp*1000;
[/FONT][FONT="] [/FONT][FONT="].quit
[/FONT]4) Download WhatsApp Viewer to check the created base from github{.}com/andreas-mausch/whatsapp-viewer/releases/
5) If the database is fine, put it in /data/data/сom.whatsapp/databases/ (you may need WhatsApp v2.18.248, I didn't test it)
If you don't have root rights on your phone, you may try (but no guarantee it will work) encrypting it using whatcrypt{.}com/?cmd=_cryptkey and restoring it as in official guide: faq{.}whatsapp{.}com/en/android/20887921/?category=5245251#restore.