A single Python script that automatically downloads dependencies and applies ReVanced patches to Facebook Messenger (com.facebook.orca) on Windows, Linux, and macOS.
- Validates environment (Java version, disk space, platform)
- Auto-detects and renames APKMirror APK filenames — no manual renaming needed
- Automatically selects the highest available Messenger version in the folder
- Checks for updates to ReVanced CLI and Patches on every run
- Downloads missing dependencies automatically (first run)
- Applies ReVanced patches with background watcher for Messenger's broken resource table
- Outputs a timestamped patched APK (e.g.
2026-03-06_05-13-53_AM-messenger.apk)
| Patch | Description |
|---|---|
| Hide inbox ads | Removes ads from the inbox |
| Hide inbox subtabs | Hides subtabs in the inbox |
| Remove Meta AI | Removes Meta AI button |
| Hide Facebook button | Hides the Facebook shortcut button |
| Disable Pairip license check | Bypasses Pairip license verification |
| Disable Play Integrity | Bypasses Play Integrity API checks |
| Prevent screenshot detection | Disables screenshot detection flag |
- Python 3.x
- Java JDK 11+ — https://adoptium.net
- Internet connection (first run only, for dependency downloads)
APKMirror blocks automated downloads, so this must be done manually.
- Go to: https://www.apkmirror.com/apk/facebook-2/messenger/
- Download the nodpi single APK variant (not bundle)
- Place it in the same folder as the script — no renaming needed
The script auto-detects APKMirror filenames like:
com.facebook.orca_551.0.0.48.62-340211317_minAPI28(arm64-v8a)(nodpi)_apkmirror.com.apk
And renames them to short format automatically:
com.facebook.orca_551.0.0.48.62.com.apk
If multiple versions are present, the highest version is always selected.
python revanced_only.pyOn first run, the script downloads all required tools automatically. On subsequent runs, existing files are detected and ReVanced CLI/Patches are updated if a newer version is available.
Output: 2026-03-06_05-13-53_AM-messenger.apk
| Tool | Source |
|---|---|
| ReVanced CLI | https://github.com/ReVanced/revanced-cli/releases |
| ReVanced Patches | https://github.com/ReVanced/revanced-patches/releases |
| Apktool | https://github.com/iBotPeaches/Apktool/releases |
| uber-apk-signer | https://github.com/patrickfav/uber-apk-signer/releases |
| aapt2 | https://maven.google.com/web/index.html#com.android.tools.build:aapt2 |
ReVanced CLI and Patches are checked for updates on every run. Other tools are downloaded once and reused.
messenger-rebuild/
├── revanced_only.py
├── Manager.keystore ← your signing keystore
└── com.facebook.orca_551.0.0.48.62-..._apkmirror.com.apk ← base APK from APKMirror
After first run, downloaded tools and the renamed APK will appear alongside the script.
Generate a signing keystore using ReVanced CLI:
java -jar revanced-cli-*.jar utility keystore --keystore Manager.keystore --keystore-entry-alias "ReVanced Key" --keystore-password ReVanced --keystore-entry-password ReVancedKeep Manager.keystore safe — you need the same keystore every time you repatch. Android will reject updates signed with a different key.
After patching, the APK cannot be installed directly due to a permission conflict. Fix it using MT Manager on Android:
This method is recommended over the full apktool decode/rebuild pipeline — it is significantly faster and less resource intensive.
- Copy the output APK to your Android device
- Open MT Manager → navigate to the APK
- Tap the APK → View → open
AndroidManifest.xmlas String Pool - Find and replace:
com.facebook.permission.prod.FB_APP_COMMUNICATION→app.facebook.permission.prod.FB_APP_COMMUNICATION
- Find and replace:
com.facebook.receiver.permission.Access→app.facebook.receiver.permission.Access
- Save and exit
- Sign the APK using MT Manager's built-in signing (use your keystore)
- Install
Facebook Messenger declares custom permissions using its own package name (com.facebook.*). When a patched APK tries to declare the same permissions under a different signer, Android rejects the install. Renaming the permission strings avoids this conflict.
- Patching does not require an internet connection after first setup
- The background watcher thread continuously removes invalid
.2resource directories andAPKTOOL_DUMMYVALfiles that cause aapt2 to fail during patching APKTOOL_DUMMYVALfiles are a known apktool limitation with Messenger's split resource table- Corrupt or incomplete
.jar/.rvpfiles are automatically detected and redownloaded
- MT Manager manifest fix method — originally documented by @reisxd in the ReVanced patches issue tracker
- @kazimmt
MIT License — see LICENSE