A script to automatically patch the Android YouTube application with a custom selection of latest patches from Morphe.
Find a file
2026-06-21 22:02:00 +02:00
apkmirror-downloader@27a7018a71 Add apkmirror dl submodule 2025-10-26 19:37:06 +01:00
.gitignore Migrate to Morph and imprive err. handling 2026-03-31 20:14:25 +02:00
.gitmodules Migrate to Morph and imprive err. handling 2026-03-31 20:14:25 +02:00
LICENSE Initial commit 2025-10-26 19:32:53 +01:00
options.json Migrate to Morph and imprive err. handling 2026-03-31 20:14:25 +02:00
README.md Update README 2026-06-21 22:02:00 +02:00
yt-morphe-autopatcher.sh Move WD to env file 2026-06-21 21:52:56 +02:00

yt-revanced-autopatcher

A Bash script that makes use of Morphe CLI and APKMD to patch the latest supported YouTube APK with a selection of patches from Morphe Patches.

The latest version of each dependency is retrieved at runtime if necessary (Morphe CLI, Morphe Patches and APKMD).

Use cron to regularly generate a patched APK. The script only patches if necessary (if an APK of the latest supported version patched with the latest ReVanced Patches doesn't already exist at the output).

Note that --options-update is enabled. More information here. Also, the output of the patching operation is suppressed.

Before using the script

  • The script expects a .env file with the path to a working directory as well as credentials and parameters for notifications using Shoutrrr (see below):

    WORKINGDIRECTORY=""
    MAIL_USER=
    MAIL_PASS=
    MAIL_RECIPIENT=
    SHOUTRRRURL=""
    
  • Shoutrrr is used to notify the user when a new patched APK is available. Only e-mail notifications are set up in this script. For other channels, check out the Shoutrrr documentation.

  • The patched apk is compiled in the script directory and also copied to another directory. Make sure to change the path of that directory or disable the copy step altogether.

  • The keystorename variable should the filename of your keystore, exported from Morphe Manager, or retrieved in the working directory after patching once with the Morphe CLI. The keystore file should be stored next to the script.

Ways it could break

(...and therefore improvements to make)

  • Morphe CLI changes release filename
  • APKMD changes release filename
  • Another app supported by Morphe Patches gets a patch named "Copy video link" (the latest supported version of YT is retrieved from the list of available patches)
  • The abovementioned patch changes name
  • APKMD stops working
  • ...