Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Merging with Signal and Whatsapp imports

Open ghost opened this issue 3 years ago • 22 comments

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.

ghost avatar Apr 18 '21 05:04 ghost

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.

johanw666 avatar Apr 18 '21 15:04 johanw666

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

roberts011 avatar Apr 18 '21 16:04 roberts011

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.

roberts011 avatar Apr 18 '21 17:04 roberts011

Hi Johan and Robert,

it would be great if my fork would be merged into Johan's fork and I would welcome your contribution.

Yes, I had to abandon the project because I'm currently pretty overworked with the upcoming product launch of my startup.

If you decide to do the merge, feel free to contact me with any questions ( @.***).

@Johan: I'm sorry to hear about your Covid-infection and wish you a good recovery.

Best,

Sam

Am So., 18. Apr. 2021 um 19:09 Uhr schrieb Robert S. < @.***>:

If you want help, hit me up.

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/johanw666/Signal-Android/issues/27#issuecomment-822025194, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHDWBQYA6Y6IYGJO5MUPVDTJMG25ANCNFSM43D2OOQQ .

jukefoxer avatar Apr 18 '21 18:04 jukefoxer

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?

roberts011 avatar Apr 18 '21 19:04 roberts011

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...

jukefoxer avatar Apr 19 '21 08:04 jukefoxer

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)

roberts011 avatar Apr 19 '21 12:04 roberts011

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.

johanw666 avatar May 30 '21 23:05 johanw666

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

jukefoxer avatar May 31 '21 08:05 jukefoxer

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).

johanw666 avatar May 31 '21 17:05 johanw666

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: https://github.com/YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor/discussions/64#discussion-3343630

roberts011 avatar Jul 03 '21 15:07 roberts011

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

Wollwolke avatar Sep 06 '21 18:09 Wollwolke

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.

jukefoxer avatar Sep 07 '21 08:09 jukefoxer

Thanks! Could you build a version of that?

From: Samuel Welten @.> Sent: Tuesday, 7 September, 2021 10:14 To: johanw666/Signal-Android @.> Cc: Robert S. @.>; Author @.> Subject: Re: [johanw666/Signal-Android] Merging with Signal and Whatsapp imports (#27)

Hey guys, In advance: I'm not an android developer, I just tried to make it work for me :) I added the commits from @jukefoxerhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjukefoxer&data=04%7C01%7C%7C2c59d5ccf3924aeadec908d971d77464%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637665992443905720%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=16lgcJZNwdJ3O1y5epEERc9yFR2KS%2F2UNUfeyAc8TWs%3D&reserved=0 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</Wollwolke/Signal-Android/tree/feature/wa-db-import>

That's great! Thanks for letting us know.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjohanw666%2FSignal-Android%2Fissues%2F27%23issuecomment-914090680&data=04%7C01%7C%7C2c59d5ccf3924aeadec908d971d77464%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637665992443915714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=R%2BKqU2%2F1nW5Aq0ef7ljQu7nleCn1m%2FqVwzYm4NtZGq0%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHSNGCUZWIZU4QOEVQM7UCLUAXCUVANCNFSM43D2OOQQ&data=04%7C01%7C%7C2c59d5ccf3924aeadec908d971d77464%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637665992443915714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=vnl12Su9T9ggYKF%2BJJAqNpY0gHUoJvx%2BWDy1O0wZxzQ%3D&reserved=0.

roberts011 avatar Sep 07 '21 08:09 roberts011

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

Wollwolke avatar Sep 07 '21 13:09 Wollwolke

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?

johanw666 avatar Sep 13 '21 11:09 johanw666

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

roberts011 avatar Sep 13 '21 16:09 roberts011

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

Wollwolke avatar Sep 13 '21 16:09 Wollwolke

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 avatar Sep 13 '21 17:09 johanw666

@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: https://github.com/johanw666/Signal-Android/issues/49 , would that be difficult to fix?

johanw666 avatar May 11 '22 09:05 johanw666

I'm unable to help directly, sorry. I don't have access to Whatsapp anymore. If it helps, my approach to import specific Whatsapp features was something like this:

  • Set up an Android emulator, install Whatsapp and connect it to my phone number
  • Extract the Whatsapp DB
  • Send/Receive 2-3 different messages using the feature I wanted to import
  • Extract the Whatsapp DB again
  • Inspect the DB to see what changed. The semantics of WA tables and columns usually becomes clear, because one knows what should have been inserted.
  • Search the Signal source code to find out how this feature is handled in Signal
  • Add an import method to the general import process

Am Mi., 11. Mai 2022 um 11:46 Uhr schrieb johanw666 < @.***>:

@jukefoxer https://github.com/jukefoxer @roberts01 https://github.com/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: #49 https://github.com/johanw666/Signal-Android/issues/49 , would that be difficult to fix?

— Reply to this email directly, view it on GitHub https://github.com/johanw666/Signal-Android/issues/27#issuecomment-1123459270, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHDWBWKF42PQOTMYM5ITW3VJN6WNANCNFSM43D2OOQQ . You are receiving this because you were mentioned.Message ID: @.***>

jukefoxer avatar May 13 '22 07:05 jukefoxer

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

johanw666 avatar May 13 '22 09:05 johanw666