🌿 Patch Instagram APK to remove Reels, Explore and addictive features. Smali-level tab removal + API endpoint blocking. Automated build pipeline for split APKs.
  • Python 98.1%
  • Dockerfile 1.9%
Find a file
Cyril Leblanc 2f75efa5f5 feat: navbar reels button removed + explore endpoint nullify
- NavbarReelsFilter: patch LX/9za.A04() to return '' instead of 'clips'
  for tab index 1, removing the Reels tab from the bottom navbar.
  LX/9zc.A01('') returns null → tab skipped in the list builder.

- ExploreFilter: nullify discover/topical_explore/ endpoint URL in 4 files.

- Clean up: remove dead patches (explore_reels_filter, parser_trace,
  tigon_filter), clean config, align registry.
2026-05-17 16:53:04 +02:00
docs refactor: endpoint URL nullification for reels+explore, remove dead patches 2026-05-17 16:33:28 +02:00
src feat: navbar reels button removed + explore endpoint nullify 2026-05-17 16:53:04 +02:00
.dockerignore refactor: modular patcher architecture, Docker build, remove dead MITM code 2026-05-16 14:50:12 +02:00
.gitignore refactor: modular patcher architecture, Docker build, remove dead MITM code 2026-05-16 14:50:12 +02:00
compose.yml refactor: modular patcher architecture, Docker build, remove dead MITM code 2026-05-16 14:50:12 +02:00
Dockerfile refactor: modular patcher architecture, Docker build, remove dead MITM code 2026-05-16 14:50:12 +02:00
LICENSE first commit 2026-05-14 16:07:34 +00:00
README.md refactor: modular patcher architecture, Docker build, remove dead MITM code 2026-05-16 14:50:12 +02:00

HealthyIG Custom

Patch Instagram to remove ads, suggested content, and addictive features — directly in the app.

Platform Requires Docker Requires ADB No Root No Proxy

How it works

HealthyIG patches the Instagram APK to intercept network responses inside the app itself — no proxy, no MITM, no root. A Java filter removes unwanted content (ads, suggestions, explore ads) from API responses before the app renders them.

flowchart LR
    subgraph Instagram App
        A[Tigon Network Stack] --> B["onBody()"]
        B -->|"accumulate chunks"| C["onEOM()"]
        C -->|"filterResponse()"| D["ResponseFilter.java"]
        D -->|"remove ads/suggested"| E["healthyig_modified"]
        E -->|"A00() consumer hook"| F[UI]
    end

    G[Instagram Server] -->|API response| A

    style D fill:#f96,stroke:#333
    style E fill:#6f9,stroke:#333

What gets filtered

Content Removed
Feed ads (injected posts)
Suggested users
Explore/story ads
ads/graphql responses (blocked entirely)
Legit posts, stories, DMs (preserved)

Filters are in java/com/healthyig/ResponseFilter.java — easy to customize.

Quick start

Prerequisites

  • Docker + Docker Compose
  • ADB (Android Debug Bridge)
  • An Instagram APK (extract via ADB or download from APKMirror)

Build

# 1. Place Instagram APK in input/
adb pull $(adb shell pm path com.instagram.android | sed 's/package://') input/base.apk

# 2. Build patched APK
docker compose run --rm patcher

Output: output/HealthyIG.apk (+ signed splits in output/splits/)

Install

adb uninstall com.instagram.android
adb install-multiple --no-streaming output/splits/*.apk output/HealthyIG.apk

Verify

adb logcat -s HealthyIG:*
HEALTHCHECK PASS: 2/3 items removed, legit item preserved
HOOK_onBody: chunk accumulated
HOOK_onEOM: filtered bytes stored in C3os
HOOK_A00: serving filtered bytes

Architecture

flowchart TB
    subgraph "Build Pipeline (Docker)"
        RF["ResponseFilter.java"] -->|"javac → d8 → baksmali"| SMALI["ResponseFilter.smali"]
        SMALI --> INJECT["inject_filter patch"]
        APK["Instagram APK"] -->|"apktool d"| DECOM["Decompiled smali"]
        DECOM --> PATCHES["5 smali patches"]
        INJECT --> PATCHES
        PATCHES -->|"apktool b + sign"| OUT["HealthyIG.apk"]
    end

    subgraph "Patches"
        P1["inject_filter — Copy compiled filter into APK"]
        P2["healthcheck — Self-test at app startup"]
        P3["consumer_fields — Add filtered bytes storage to X/3os"]
        P4["consumer_hook — Serve filtered bytes to parser in 4K chunks"]
        P5["tigon_filter — Accumulate body + filter in onEOM"]
    end

    PATCHES -.-> P1 & P2 & P3 & P4 & P5

Project structure

healthyig-custom/
├── src/                        # Patcher (Python, modular)
│   ├── main.py                 # CLI — build orchestration
│   ├── apk.py                  # Java compile, APK decompile/recompile/sign
│   ├── log.py                  # Colored console output
│   └── patches/
│       ├── __init__.py         # PatchBase, registry, PatchContext
│       ├── inject_filter.py    # Copy compiled ResponseFilter.smali
│       ├── healthcheck.py      # Hook <clinit> → self-test
│       ├── consumer_fields.py  # Add fields to X/3os
│       ├── consumer_hook.py    # Hook A00() — serve filtered bytes
│       └── tigon_filter.py     # Hook onBody/onEOM on X/3op
├── java/
│   └── com/healthyig/
│       └── ResponseFilter.java # Content filter (edit this!)
├── Dockerfile                  # Build environment
├── compose.yml                 # Volume mount for dev
└── input/                      # Place Instagram APK here

Adding a patch

  1. Create src/patches/my_patch.py:
from src.patches import PatchBase, PatchContext

class MyPatch(PatchBase):
    name = "my_patch"
    target = "tigon_consumer"  # key in TARGETS dict
    description = "What it does"

    def apply(self, ctx: PatchContext) -> bool:
        content, path = ctx.read_smali(self.target)
        # ... pattern matching + replacement ...
        ctx.write_smali(path, patched)
        return True
  1. Register in src/patches/__init__.py:
from src.patches.my_patch import MyPatch

ACTIVE_PATCHES = [
    # ... existing patches ...
    MyPatch,
]
  1. Rebuild: docker compose run --rm patcher

Customizing filters

Edit java/com/healthyig/ResponseFilter.java. Available toggles:

public static boolean REMOVE_ADS = true;
public static boolean REMOVE_SUGGESTED_USERS = true;
public static boolean REMOVE_SUGGESTED_POSTS = true;
public static boolean REMOVE_INJECTED_STORIES = true;
public static boolean REMOVE_LIVES = false;          // off by default
public static boolean BLOCK_ADS_GRAPHQL = true;

Rebuild after changes: docker compose run --rm patcher

Disclaimer

This project is for educational and research purposes only.

  • You are responsible for compliance with Instagram/Meta's Terms of Service
  • This project does not distribute any Instagram code or APKs — you provide your own
  • The authors are not responsible for any consequences of using this software
  • This is not affiliated with or endorsed by Instagram or Meta

Credits

License

Apache 2.0 — see LICENSE