Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging with Signal and Whatsapp imports #27

Open
roberts011 opened this issue Apr 18, 2021 · 22 comments
Open

Merging with Signal and Whatsapp imports #27

roberts011 opened this issue Apr 18, 2021 · 22 comments

Comments

@roberts011
Copy link

Hello @johanw666 ,

thank you very much for this fork.
In conjunction with @jukefoxer s fork of it, this is currently the only possibility of importing Whatsapp Chats to Signal.

To improve the transition process to Signal from other apps overall, I wanted to ask whether you are strategically considering to merge this into the main Signal app.

Furthermore, as @jukefoxer doesn't seem to be around anymore (and with no possibility of contacting them), I'd kindly ask you if you could try to add his "Whatsapp database import function" into your fork.

Regards

Robert S.

@roberts011 roberts011 changed the title Merging with main Signal Merging with Signal and Whatsapp imports Apr 18, 2021
@johanw666
Copy link
Owner

Merging is on the long time planning, but currently I'm recovering from Covid19 and I honestly have no energy to take on this task right now.

@roberts011
Copy link
Author

Omg now I feel like a jerk.
Take your time to get better.

@roberts011
Copy link
Author

If you want help, hit me up.

My idea was mainly to copy the Whatsapp Import feature of @jukefoxer s fork into this, so it all can be merged into the main app.

@jukefoxer
Copy link

jukefoxer commented Apr 18, 2021 via email

@roberts011
Copy link
Author

Hey Sam,

thats great to hear! (Didn't actually expect this to work)

Could you maybe point us to the place in your fork where you changed / inserted the "import Whatsapp msgstore.db" part?

That would make things far easier.
I would be happy to organize the merge / import / copy. As your (@jukefoxer) Signal version doesn't support the latest changes to the backup system, namely the switch to a singular backup file (.backup), anymore.

Ps: Your email is censored out, was that intentional?

@jukefoxer
Copy link

The 2 main files that do the import are:

https://github.com/jukefoxer/Signal-Android/blob/master/app/src/main/java/org/thoughtcrime/securesms/database/WhatsappBackupImporter.java

(contains the main entry point) and

https://github.com/jukefoxer/Signal-Android/blob/master/app/src/main/java/org/thoughtcrime/securesms/database/WhatsappBackup.java

The strings that I added are in the file:

https://github.com/jukefoxer/Signal-Android/blob/master/app/src/main/res/values/strings1.xml

I also added an import dialog which is in (code and xml)

https://github.com/jukefoxer/Signal-Android/blob/master/app/src/main/java/org/thoughtcrime/securesms/ImportWhatsappDialog.java
https://github.com/jukefoxer/Signal-Android/blob/master/app/src/main/res/layout/dialog_import_whatsapp.xml

The main entry point is the method:

public static void importWhatsappFromSd(Context context, ProgressDialog progressDialog, boolean importGroups, boolean avoidDuplicates, boolean importMedia, int numDaysToImport)

in the WhatsappBackupImporter.java file.

... Seems like there is no way I can let you know my email address that is non-public...

@roberts011
Copy link
Author

roberts011 commented Apr 19, 2021

Hey Sam,

thanks a lot for that!
Don't worry about the email. Personally I think its totally fine if you're reachable here. If you want you can PM me it tho.

@johanw666 do you think you can integrate those parts? (obviously after you recovered)

@johanw666
Copy link
Owner

The explanation of jukefoxer is helpful, I know what to do. I've already bought a 2nd device and put Android 11 on it, required for the manage storage stuff but rooting it causes problems (bootloops, unable to unlock the device, TWRP does not store its settings) so I'll have to wait until that is fixed.

@jukefoxer
Copy link

Hi Johan,
Did you try an Android 11 emulator? To my knowledge these are rooted by default.

@johanw666
Copy link
Owner

johanw666 commented May 31, 2021

Hi Johan,
Did you try an Android 11 emulator? To my knowledge these are rooted by default.

Unfortunately my laptop is not going to handle that. It has the maximum amount of memory that it can handle (12GB) and a clean compile from Signal takes over 10 minutes (when no new libraries have to be downloaded).

@roberts011
Copy link
Author

roberts011 commented Jul 3, 2021

Hey @johanw666 ,
sorry for being absent. University exams came down upon me and a conference that was supposed to be fun turned into an organizational nightmare.
I was just checking and saw your code is up to date with the current Signal version, thats great!
Did you manange to make any progress including jukefoxers code?

Kind regards
Robert

Also adding a reference here: YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor#64 (comment)

@Wollwolke
Copy link

Hey guys,
In advance: I'm not an android developer, I just tried to make it work for me :)
I added the commits from @jukefoxer to the latest version of this repo (with some additions).
Maybe this is helpful for you: wa-db-import in Signal 5.23.1.1-JW

@jukefoxer
Copy link

Hey guys,
In advance: I'm not an android developer, I just tried to make it work for me :)
I added the commits from @jukefoxer to the latest version of this repo (with some additions).
Maybe this is helpful for you: wa-db-import in Signal 5.23.1.1-JW

That's great! Thanks for letting us know.

@roberts011
Copy link
Author

roberts011 commented Sep 7, 2021 via email

@Wollwolke
Copy link

Unfortunately I don't have access to my development PC for the next week. But I can send you the version that is installed on my phone. It's a self-signed PlayProdRelease build for arm64-v8a of version 5.23.1.0-JW

https://drive.google.com/file/d/1jDB6SdYupE2ClUXZlYfCCxMPW8VeUOYF/view?usp=sharing

@johanw666
Copy link
Owner

I finally found the time to merge this in my build and released in 5.23.6.1-JW.

When I tested this I noticed 2 things: it crashed on my WA database when I selected "Import group chats", and when importing has reached the last record it just stops, I had to force-close Signal and then the new data was visible in Signal. Should I hard-close Signal from code when it is finished reading all WA data?

@roberts011
Copy link
Author

I mean if it is a necessity, yes of course. Maybe try to do it with a little informational prompt or message tho.

@Wollwolke
Copy link

I didn't get the behavior at the end, the process just ends and I can click on the back key to get back to the chats overview. But I didn't import group chats... I'll try that in the next couple of days

@johanw666
Copy link
Owner

johanw666 commented Sep 13, 2021

I didn't get the behavior at the end, the process just ends and I can click on the back key to get back to the chats overview.

I might have missed something in the merge.

But I didn't import group chats... I'll try that in the next couple of days

The groups import just crashed. I'll try again and see what the error was. Edit: I didn't create a same-named group in Signal first. But it shouldn't crash on that.

@johanw666
Copy link
Owner

johanw666 commented May 11, 2022

@jukefoxer @roberts01 now that WhatsApp has also introduced message reactions, can anyone please check if it is easy to update the WA import code with this? I also got this question about the import when the senders are not in yur phone book: #49 , would that be difficult to fix?

@jukefoxer
Copy link

jukefoxer commented May 13, 2022 via email

@johanw666
Copy link
Owner

johanw666 commented May 13, 2022

Getting unencrypted WA databases is not a problem, all my Android devices are rooted so access to these is trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants