YuvrajRaghuvanshiS / WhatsApp-Key-Database-Extractor

The most advanced and complete solution for extracting WhatsApp key/DB from package directory (/data/data/com.whatsapp) without root access.
MIT License
463 stars 59 forks source link

Possibility to run this tool directly from the phone (really longterm feature) #14

Closed roberts011 closed 3 years ago

roberts011 commented 3 years ago

I don't even know if that's possible, but I think a really longterm goal could be that this tool can run on the device with WhatsApp completly without a Laptop / PC necessary.

Maybe using somethin like this: https://github.com/tytydraco/ladb

YuvrajRaghuvanshiS commented 3 years ago

Tried that in termux edition. The way you proposed this is to work my making an android app first and then somehow running this entire python based project inside that. However no matter what I did I could not "fluff" whatsapp.ab android backup file to "whatsapp.tar" using abe.jar on android when I was working on termux edition. I could not fix this and then did not try further.

YuvrajRaghuvanshiS commented 3 years ago

Also as of now only latest stock android supports explicit wireless debugging via TCP, toggle on option in developer option. Other variants of android or skinned android like MIUI do not provide that option and to enable wireless debugging you first need to run adb tcpip <port> from computer which defeats the purpose of No Computer.

roberts011 commented 3 years ago

Okay I understand.

  1. If you dont mind I'd like to look a bit deeper into the fluffing topic. Can you reccomend some Google topics / terms to get started, 'cause I've never heard of fluffing before.

Well, than this would only be relevant for Android 10(?) upwards, right? But, seeing as this would perspectively in that direction, I think it would be mwort looking into more.

YuvrajRaghuvanshiS commented 3 years ago

Fluffing is a made up term. You can start from here

YuvrajRaghuvanshiS commented 3 years ago

Also adb backup is deprecated. So I don't think this method of extracting will work in newer versions of android.

roberts011 commented 3 years ago

Do you know if there is a followup command planned?

YuvrajRaghuvanshiS commented 3 years ago

I can't say. I have set Termux Edition as No Longer Maintained. I stopped all work there a while ago and not planning to continue before getting any solid workaround. You are more than welcome to do your research on this topic and contribute.

roberts011 commented 3 years ago

Okay I will look into it.

roberts011 commented 3 years ago

https://github.com/nelenkov/android-backup-extractor the original source of the backup extractor

roberts011 commented 3 years ago

Okay so apperantly adb backup just calls a function called bu. https://github.com/nelenkov/android-backup-extractor/issues/83#issuecomment-769028915 Thats good news, right?

YuvrajRaghuvanshiS commented 3 years ago

https://youtu.be/qFJVUnXmVMI Requires two phones. Workable tho, requires some changes in commands, thinking of making that work in termux.

roberts011 commented 3 years ago

Would be cool if you could get this running, but without the second phone, maybe via ldab https://github.com/tytydraco/ladb

YuvrajRaghuvanshiS commented 3 years ago

This requires compiling it into an android app.

roberts011 commented 3 years ago

You mean ladp as an android app? You can also run adb from Termux via a package: https://github.com/tytydraco/LADB/issues/1

YuvrajRaghuvanshiS commented 3 years ago

He was mentioning Termux-ADB and that was how I initially approached this problem and named my branch based on that (Termux-Edition), however this requires you to either have wireless debugging option enabled in developer option which only AOSP has in latest versions and not modified ROMs like MIUI or Samsung's or run adb tcpip 5555 to get wireless debugging going on your device which requires computer.

roberts011 commented 3 years ago

So besides the "'ADB over network' only on Android 11+ via phone enableble" problem (which will solve itself over time I think), if I run the adb adb tcpip 5555 via PC, the Termux edition should work then right?

YuvrajRaghuvanshiS commented 3 years ago

Yes that'd work but that breaks at converting .ab to .tar and I could not figure out why, here. #3

roberts011 commented 3 years ago

I thought the extraction happens after the decrytion?

YuvrajRaghuvanshiS commented 3 years ago

yes, decryption then conversion to tar and then extraction.

roberts011 commented 3 years ago

Might want to move away from the Haxus repo, as it is no longer maintained, and instead use the same script in an updated version from here https://github.com/MasterDevX/Termux-Java

YuvrajRaghuvanshiS commented 3 years ago

You're working on Termux-Edition, that's your choice. :D

roberts011 commented 3 years ago

true, but its still your project ;-) added the updated link in the tr.py file

roberts011 commented 3 years ago

But if we get the damn extraction done, then this should work, right?

YuvrajRaghuvanshiS commented 3 years ago

That's open to contribution. And I'm working (almost finished except #24) on making this work via TCP so this script can work on any phone without USB cable.

YuvrajRaghuvanshiS commented 3 years ago

But if we get the damn extraction done, then this should work, right?

Yes

roberts011 commented 3 years ago

That's open to contribution. And I'm working (almost finished except #24) on making this work via TCP so this script can work on any phone without USB cable.

Oh that sounds cool tho! Mind just approving the pulls? :-)

roberts011 commented 3 years ago

Yes that'd work but that breaks at converting .ab to .tar and I could not figure out why, here. #3

Also could you point me to where in your code the decryption-conversion-extraction process happens?

YuvrajRaghuvanshiS commented 3 years ago

Also could you point me to where in your code the decryption-conversion-extraction process happens?

https://github.com/YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor/blob/40398255810530114fa2d70de81e53f4582830cd/view_extract.py#L54

roberts011 commented 3 years ago

So, as #3 is really the only thing that is still in the way, I propose to merge the two issues (is that possible?). Also, I think it might be a good idea to rename the Termux version to like "Mobile" or "App" version, as I do not think a lot of people (besides the ones that work with it of course) know what Termux is.

YuvrajRaghuvanshiS commented 3 years ago

Issues are closed, pulls are merged.

YuvrajRaghuvanshiS commented 3 years ago

Only link to termux is from master prerequisites section. I think that is understandable.

roberts011 commented 3 years ago

I understand. I think this issue can be closed then.