Comments (11)
I got it working. It looks like Whatsapp have changed the schema of the db a lot. I had to recreate the view
and insert it into the android msgstore.db manually.
I found the original view here
This is what I wrote:
CREATE view legacy_available_messages_view
AS
SELECT messages.*,
chat._id AS chat_row_id,
expire_timestamp,
jid.raw_string AS key_remote_jid,
jid2.raw_string AS remote_resource,
messages.text_data AS data,
messages.from_me AS key_from_me
FROM message AS messages
JOIN chat
ON chat._id = messages.chat_row_id
JOIN jid AS jid
ON chat.jid_row_id = jid._id
LEFT JOIN jid AS jid2
ON messages.sender_jid_row_id = jid2._id
LEFT JOIN deleted_chat_job AS job
ON job.chat_row_id = chat._id
LEFT JOIN message_ephemeral AS message_ephemeral
ON messages._id = message_ephemeral.message_row_id
WHERE Ifnull(NOT( ( Ifnull(messages.starred, 0) = 0
AND messages._id <= Ifnull(job.deleted_message_row_id, 1)
)
OR ( Ifnull(messages.starred, 0) = 1
AND messages._id <=
Ifnull(job.deleted_starred_message_row_id,
1) )
OR ( ( job.deleted_message_categories IS NOT NULL )
AND ( ( Ifnull(messages.starred, 0) = 0
AND messages._id <=
Ifnull(job.deleted_categories_message_row_id,
1) )
OR ( Ifnull(messages.starred, 0) = 1
AND messages._id <=
Ifnull(job.deleted_categories_starred_message_row_id,
1) ) ) ) ), 0)
This is me just hacking to get something to work. Some values are missing such as messages.media_wa_type from orig db (not sure what this should be).
Someone will need to change watoi code to either create the view if missing or change this query:
- (void) importMessages {
NSString *query = @"SELECT * FROM legacy_available_messages_view where"
" key_remote_jid == '%@'"
" AND status != 6" // Some system messages
" ORDER BY timestamp";
from watoi.
whatsapp-viewer also failed due to this new table, here is issue detail.
from watoi.
Hey @davidvella , I tried the sql commands on my database but now I'm getting this error:
Loaded 466 chat(s)
no such column: messages.textdata
zsh: abort watoi/build/Release/watoi msgstore.db ./ChatStorage.sqlite
from watoi.
Fixed by replacing messages.textdata AS text,
with messages.text_data AS text,
in the SQL Query.
from watoi.
Fixed by replacing
messages.textdata AS text,
withmessages.text_data AS text,
in the SQL Query.
Thanks @officialasit. I originally made changes in both the sql and the code. Thanks for spotting the typo. Will update original comment
from watoi.
@davidvella I have restored the messages, but all the messages seem to be blank. Like its showing the conversations, but no text in them. Any solutions?
from watoi.
@davidvella I have restored the messages, but all the messages seem to be blank. Like its showing the conversations, but no text in them. Any solutions?
It looks like my mistake again.
If you look at:
Line 494 in 4ede6ff
The text column should be data in the view.
I did hack the solution. Something else I must have changed.
Updated the view again
from watoi.
@davidvella Thanks a lot. It worked this time. :)
from watoi.
@davidvella many thanks, manages to successfully restored using the hack you suggested
from watoi.
@davidvella can you please tell the steps to insert the legacy_available_messages_view into msgstore.db?
from watoi.
nvm. i used https://sqlitebrowser.org/dl/ to open the db file and update the view
from watoi.
Related Issues (20)
- New WhatsApp version errors HOT 6
- Can this program be made working with encrypted iOS backups? HOT 1
- I have windows 10 and Android device to transfer the data to iPhone HOT 1
- stuck at ld: unknown option: -target HOT 1
- unable to open database file HOT 2
- Basic tutorial please, thank you so so much (: HOT 6
- is it possible to use this amazing trick on windows ? HOT 1
- Partially transferred Messages HOT 2
- bedit.sh operation not permitted HOT 3
- Migration only was successfully completed for groups HOT 1
- trying to make a simple whatsapp filter. HOT 1
- NSInvalidArgumentException key cannot be nil HOT 2
- I dont have a macbook. Is there any chance on linux or windows to run this program HOT 1
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSDictionaryM setObject:forKey:]: key cannot be nil' HOT 5
- Need help with migration HOT 3
- Does this still work? HOT 1
- no such table: legacy_available_messages_view HOT 2
- This NSPersistentStoreCoordinator has no persistent stores (corrupt file). It cannot perform a save operation. HOT 1
- Official migration from Android to iPhone is now available HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watoi.