iHelp101 / XInsta

137 stars 32 forks source link

Direct Messages problem #115

Open lol7344 opened 4 years ago

lol7344 commented 4 years ago

Hi. Thanks for the awesome Xposed module. I've been using it for years as my main Instagram add-on, and I have recently discovered a probably known problem: images and videos sent privately in DM are not downloaded nor handled in any way. I noticed this issue started appearing after Instagram v. 91.0.0.18.118, build 1523675. I then went to look at the public Hooks.txt file in this GitHub repo, and found that:

  1. the number of total Hooks is the same (105 individual strings, including the version number) as the more recent versions.
  2. all versions before 91.0.0.18.118 had hooks at position 94 that contained the "direct" string, eg. "com.instagram.direct.fragment.visual.DirectVisualMessageViewerFragment", while all versions after that have some randomly (probably obfuscated) generated strings as "X.19B". I suspect this is where the problem comes from.

On the Android phone, I then tried searching for info in the XInsta app itself and I found out that if I manually try to edit Hooks, I can't find anything referring to "Direct Messages" or similar, thus being unable to even manually set my own DM hooks. Has this feature been removed? Why? I tried both the 2.1.0 version from 2018 and the experimental build you gave in issue #111, and found nothing. So the only hypothesis is that this feature was always hidden but still enabled and working, and then stopped working or got disabled by any of the devs via the Hooks file for more recent IG versions.

I then also tried decompiling an already supported but recent IG apk (v 115.0.0.26.111, build 177770652) and finding my Hooks manually using your other project, XInsta-Helper, then pasting them in the XInsta app, by chosing "Paste Hooks" from app Settings. I was able to find Hooks by copy-pasting all IG's smali files into a folder named "output", by maintaining the package names and subdirectories (output/com/instagram/...). I then ran Decompile.py with Python and copy-pasted the hooks saved in Hooks.txt to the XInsta app.

This did unfortunately not help.

So I'm kindly asking for any update on this subject. Thanks.

iHelp101 commented 4 years ago

I am driving home from work and will work on this.

iHelp101 commented 4 years ago

I found the error. I am looking into this hook issue.

Direct Private Download Failed - java.lang.NoSuchFieldError: Field of type X.2az in class X.19H

iHelp101 commented 4 years ago

It looks like Instagram puts the 2az field (Changed every update) in another classes. I am working on a fixed APK.

19H -> DirectVisualMessageViewerController -> 2az

lol7344 commented 4 years ago

That's great news! Thank you.

I would have happily looked into the code and tried fixing it myself, then making a new pull request - but I was soon overwhelmed by the lack of comments in the code :( I humbly suggest you start using them - for future's sake. You may get busier in life or tired of the project, but someone else may be happy to work on it and keep it up to date! Not mentioning that it would most likely greatly reduce your debugging and digging times when a new problem arises :)

P.S.: When and if you will release an updated/fixed apk about this issue, please change the version number to something different than 2.1.0 - it is really difficult to understand which version I have installed and it adds a point of failure in testing and verifying if the update actually fixed the problem: if both old and new/fixed apk have the same version number, I may be mislead to thinking that I have the updated version while I actually have the older one, thus causing mess and misunderstandings.

Also, I think there is some kind of issues in the "updating hooks" process. Let me explain:

  1. I first installed a recent and compatible (same build number as listed in hooks.txt, can't really remember which one) version of Instagram, then opened XInsta and updated hooks from github.
  2. I then restarted Instagram (and later also my phone), but XInsta was not hooking (correctly?) to it.
  3. I then uninstalled Instagram and reinstalled a lower version, precisely v115.0.0.26.111, build 177770652.
  4. I rebooted my phone and opened Instagram without updating hooks, and to my surprise, XInsta was working.
  5. At the end, I opened XInsta and updated hooks again - I got a message saying they were updated, and after restarting my phone, XInsta was no longer hooking to the very same Instagram version it was hooking before.

I think this is the same issue mentioned by @Teknosrp in #111's latest message. Looking at his Error.txt, it is clear that he has a compatible Instagram version (177770652), yet XInsta fails to hook to it.

iHelp101 commented 4 years ago

I will work on commenting the code. Regarding the hooks issue. Please update your hooks and then provide me an error log. That way I can see which version code you have and what hook it is actually fetching. When you open Instagram XInsta does a hook check to see if your hooks need updated. That is why you are seeing hooks updates on their own. I think the issue might be related to ARM64 version checks, but can not be sure with Teknosrp's error log due to his device name missing.

Teknosrp commented 4 years ago

@iHelp101 My device is an ARM32 one, it has a MT6580 SoC.