[APP][MOD][4.4+] Instagram without ads and annoyances

Search This thread

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    ...I an using instander for a 1 year now....
    I've been using it almost since the first version and couldn't be happier, my only "complain" is it doesn't have an option to completely mute stories, given the fact I use my phone as my main music player while I'm at work.
  • 107
    Hi all. It seems like there's a lot of people annoyed by ads on Instagram. I was, too, until I figured out a novel way to patch it.

    • Removed ads in the feed.
    • Removed ads in stories.
    • Removed "who to follow" blocks in the feed.
    • Removed stories in the feed (those between the posts, not those on top of course).
    • Carousel posts always show the first media instead of randomly jumping to the second one.
    • Analytics requests are blocked.
    • Enabled "internal" settings, accessible by either long-pressing the home tab or in the settings menu. These allow doing a lot, so use with care. The most useful feature so far is the ability to manually override each of the gazillion server-side configuration values.

    Without further ado, here's the link: Download.

    How my patch works
    Instagram, as, probably, all the other Facebook apps, uses Proxygen for its HTTP client. Since Proxygen is written in C++, it needs JNI bindings to be used in an Android app. This means that the Java classes that interface with the native code can't be obfuscated. So, instead of digging through piles of obfuscated code that gets reshuffled with each update, I did the most straightforward thing: I injected my code into Proxygen's Java part. I had to make minimal modifications to the bytecode in order to intercept the API responses and pass them through my code before the app gets any chance to process them.

    To repeat the process yourself:
    1. Download any Instagram apk or pull one from your device.
    2. Run apktool d on it.
    3. Download View attachment 4752809 and unpack it. Place the two files into smail/com/facebook/proxygen in your disassembled Instagram folder, replacing the existing ones.
    4. Download View attachment 4842971, unpack it and place the folder into any of the smali folders; I did smali_classes3 because there was no room for method references in the first dex.
    5. Build the new apk with apktool b.
    6. Sign it.
    7. Install it.
    8. Enjoy!
    The sources for the hooks are in View attachment 4842969. You compile these with javac, then run dx to convert them to dex, then baksmali to get the smali files that apktool can then integrate into Instagram's dex.

    Unlocking the developer settings is another thing entirely as it doesn't depend on the API. There's no getting around the obfuscated code. You need to find an enum class that has RELEASE, DEBUG, INHOUSE as its values. There are several methods that return boolean; you need to change the one that returns true to false (this determines whether this is a release build), and then another one to return true so that the build type returned ends up as INHOUSE. Decompiling it using jadx makes figuring this out a lot easier.

    I'll probably automate the patching process at some point in the future.

    Hope you enjoy!

    13/10/2019: updated to v114 and updated hooks files.
    V123 arm64 patched with no follower list crash.

    If you do a clean install, you will see sponsored posts in the home feed when you first log in. Just force stop the app and the sponsored posts should disappear.
    V120 arm64 patched with no follower list crash.

    If you do a clean install, you will see sponsored posts in the home feed when you first log in. Just force stop the app and the sponsored posts should disappear.

    I have also noticed sponsored posts appearing in the explore section. I'm not sure if OP's patches get rid of sponsored posts there, so just live with it.