Block reels on Instagram

Instagram is great for connecting with people, seeing stories, and replying to friends.

But scrolling endlessly through reels or suggested feeds is really addictive, useless, and time-consuming. If you also feel like this, you are in the right place.

I will show you how to patch the Instagram app to get rid of the addictive reels feed. No need to root your phone, install an external APK, or use sketchy programs. All the steps are completely transparent.

We will decompile the original app, remove the endpoints that load the reels, and recompile it again. Let’s go!

Disclaimer:

This guide is for educational purposes, any action you choose to take is at your own discretion and risk.

Disclaimer:

This guide is detailed step by step. However, I understand that some parts and installing the tooling needed may require some effort and technical knowledge. If you feel stuck or simply don’t feel like crafting an app by yourself. You can check out this other solution, Mediaddiction.

How do the reels arrive at the Instagram app? – The API

(Want to jump directly to action? Skip this section and go to Step 1)

Think of Instagram as a restaurant with a menu that has two types of food: Healthy and Unhealthy. The restaurant makes more money when they sell junk food, it’s addictive and easy to make, so the owner of the restaurant is promoting it in all possible ways.

Imagine that every dish has a reference identifier. For example: A fried chicken with the reference “friedchicken” and a salad with the reference “healthysalad”. We are going to call this reference the endpoint.

To order food, write down your dish reference (endpoint) and send it to the Kitchen. In the kitchen, they prepare the dish that corresponds to that reference and they bring it to your table.

Now, suppose you have a friend who is trying to improve his diet, but he or she doesn’t have enough willpower to not order junk food. To help our friend we will tamper his order, replacing every reference to “friedchicken” with a random endpoint “adfajd”. We are breaking the reference!

When the order arrives in the kitchen, the reference to the dish “adfajd” does not exist, so the chef will ignore it and no unhealthy food will arrive on the table.

This is exactly what we are going to do with Instagram, we are going to break any reference to Instagram reels on the Instagram app. When the broken request arrives on the servers of Instagram, this will be simply ignored. So no more reels! 🙂

Tooling

  • Linux OS (Recommended)
  • ADB (Optional)
  • Apktool (version 2.7.0, I encounter problems with older versions)
  • Keytool
  • Apksigner

Step 1: Get the original Instagram APK

  • OPTION 1: Download the original app from apkpure or apkmirror. If you are concerned about security, verify that the app has not been altered by comparing the signature of the original app and the downloaded one.
  • OPTION 2: (Recommended) Install the original app from the PlayStore on your phone and extract it with adb.
    • On your phone, enable USB Debugging: "Settings" > "Developer Options". If you don’t see “Developer Options” go to “About Phone” and tap 7 times on “Build number” to enable Developer Options. Then, enable “USB Debugging” in Developer options
    • Connect your device to the computer. Get the path of the APK:
      adb shell pm path com.instagram.android
      The output should be something like package:/data/app……base.apk
    • Retrieve the APK:
      adb pull <PATH OF THE APK FROM THE PREVIOUS STEP>
    • You should find the file base.apk in your directory. Rename it to instagram_original.apk:
      mv base.apk instagram_original.apk

Step 2: Decompile the APK

Once we have the original apk, we need to decompile it to access to the resources that we will modify.

java -jar ~/apktool_2.7.0.jar d -r -f -o instagram_patched instagram_original.apk
  • d: Decode
  • -r: Do not decode resources
  • -f: Force delete destination directory

Go to the newly created directory instagram_original. This directory contains the Instagram app decompiled. Feel free to explore it a bit and you will find some files with the extension .smali.

These files are the equivalent of the assembly code of Android, they contain the business logic and the endpoints used to load all the content (DMs, Posts, profiles, stories). In the next step, we will “break” the endpoints that load the reels.

Step 3: Break the endpoints

To get rid of useless feed while maintaining the rest of the functionality we to break the specific endpoints that load the unhealthy feed while maintaining the others.

After some work of reversing and trial and error, these are the endpoints I have been able to identify:

Reverse engineering:

If you decide to further reverse engineer the app and explore more endpoints, beaware that for Instagram, all the endpoints that contain the word reels, actually refer to the stories. The endpoints that load the reels contain the word clips. It took me some time to figure this out:

stories -> reels
reels -> clips

  • discover/topical_explore/ loads the menu of the search button
  • feed/timeline/ loads the main screen feed
  • feed/reels_tray loads the stories feed
  • Loading reels:
    • “clips/discover/”
    • “discover/explore_clips/”
    • “clips/discover/stream/”
    • “clips/”
    • “clips/suggested_template”
    • “clips/trend/”
    • “clips/items/”
    • “discover/discover_similar_clips/”
    • “/suggested_content/”
    • “clips/item/”
    • “clips/home/”
    • “clips/chaining/”
    • “clips/recommended_label/”
    • “clips/stream_clips_pivot_page/”
    • “clips/risu_medias/”
    • “clips_media_ids”
    • “/clips”
    • “/clips_media_feed/”

Replacing the previous endpoints for something else (like an empty string “”), we break the reference and the app will not be able to load those resources.

That’s exactly what the following script is doing, place it in a new directory along with the decompiled app. It automatically searches for all the occurrences of the endpoints we want to break and replaces them with an empty string.

#!/bin/bash

################################################################################
# Description: Replaces Instagram feed endpoints
# Author: breakthescroll.com
################################################################################

# Get the script name
script_name=$(basename "$0")

# Directory of the decompiled app
target_directory="."

# Define the replacements
declare -A replacements

###############################################################################
########### Uncomment / Comment to Add / Remove resources endpoints ###########
###############################################################################

### Search section feed (Does not remove search users funcionality)
replacements["\"discover/topical_explore/\""]="\"\""

### Feed main screen
replacements["feed/timeline/\""]="\""

### Feed stories (CAN still upload stories)
# replacements["\"feed/reels_tray/\""]="\"\""

### Reels
replacements["\"clips/discover/\""]="\"\""
replacements["\"discover/explore_clips/\""]="\"\""
replacements["\"clips/discover/stream/\""]="\"\""
replacements["\"clips/\""]="\"\""
replacements["\"clips/suggested_template\""]="\"\""
replacements["\"clips/trend/\""]="\"\""
replacements["\"clips/items/\""]="\"\""
replacements["\"discover/discover_similar_clips/\""]="\"\""
replacements["\"/suggested_content/\""]="\"\""
replacements["\"clips/item/\""]="\"\""
replacements["\"clips/home/\""]="\"\""
replacements["\"clips/chaining/\""]="\"\""
replacements["\"clips/recommended_label/\""]="\"\""
replacements["\"clips/stream_clips_pivot_page/\""]="\"\""
replacements["\"clips/risu_medias/\""]="\"\""
replacements["\"clips_media_ids\""]="\"\""
replacements["\"/clips\""]="\"\""
replacements["\"/clips_media_feed/\""]="\"\""


###############################################################################
###############################################################################
###############################################################################

echo "Breaking endpoints... This can take few minutes"

# Function to escape special characters for sed
escape_string_for_sed() {
    local string="$1"
    string=$(sed 's/[&/\]/\\&/g' <<< "$string")
    echo "$string"
}

# Loop through the keys and values in the array
for old_endpoint in "${!replacements[@]}"; do
    new_endpoint="${replacements[$old_endpoint]}"
    
    # Escape special characters for use in sed
    old_endpoint_escaped=$(escape_string_for_sed "$old_endpoint")
    new_endpoint_escaped=$(escape_string_for_sed "$new_endpoint")


    # Use find and sed to replace the endpoint in all files (Excluding this script)
    find "$target_directory" -type f ! -name "$script_name" ! -name "*.apk" -exec sed -i "s/$old_endpoint_escaped/$new_endpoint_escaped/g" {} +
done

echo "Success: Endpoints broken!"

Step 4: Recompile the app

Recompile the modified code into a new APK to install on our device.

java -jar ~/apktool_2.7.0.jar b -r -f instagram_patched
mv instagram_patched/dist/instagram_original.apk instagram_patched.apk

Every app must be signed before installing it on a device. Create a new jks file to sign the new app with the command below. You will be asked for some information and a password, put for example, foobar. Remember the password, the rest of the information is not relevant.

keytool -genkeypair -alias key0 -keyalg RSA -keysize 4096 -validity 10000 -keystore patched_instagram_key.jks

Sign the APK using the jks key generated:

echo foobar | apksigner sign --ks ./patched_instagram_key.jks --v1-signing-enabled true --v2-signing-enabled true --v3-signing-enabled false instagram_patched.apk

Step 5: Install the app to your phone

Make sure that you uninstall the original Instagram app from your phone. Then, install the patched APK, either copying it to your phone and installing it manually or with adb:

adb install instagram_patched.apk

TL;DR

  • Get the original Instagram APK from apkpure or get it from your phone with ADB
  • Decompile the APK with apktool
  • Break the endpoints that retrieve the reels
  • Recompile the modified application with apktool and sign it
  • Install the recompiled APK on your phone.