Skip to content

Latest commit

 

History

History
336 lines (295 loc) · 23 KB

customize-patches.md

File metadata and controls

336 lines (295 loc) · 23 KB

Customizing Patches

Here's the sample env to help you. Reminder to check if you have workflow permissions.

Note - If you want to use or will be using Automated method to patch, please do not define anything inside ENVS. You are free to use .env file to do so.

Default

If you don't define anything in .env file or ENVS in GitHub Secrets, these configurations will be used:

  • YouTube & YouTube Music apps will be patched
  • With latest versions recommended by ReVanced
  • Using latest resources provided by ReVanced
  • With all patches included except for universal patches

Note that MicroG won't be released by default and you've to use EXTRA_FILES config for that to happen.

Configurations

Global Config

Env Name Description Default
PATCH_APPS Apps to patch/build youtube
EXISTING_DOWNLOADED_APKS Already downloaded clean apks []
PERSONAL_ACCESS_TOKEN Github Token to be used None
DRY_RUN Do a dry run False
EXTRA_FILES Extra files apk to upload in GitHub upload. None
GLOBAL_CLI_DL* DL for CLI to be used for patching apps. Revanced CLI
GLOBAL_PATCHES_DL* DL for Patches to be used for patching apps. Revanced Patches
GLOBAL_SPACE_FORMATTED_PATCHES* Whether patches are space formatted. True
GLOBAL_PATCHES_JSON_DL* DL for Patches Json to be used for patching apps. Revanced Patches
GLOBAL_INTEGRATIONS_DL* DL for Integrations to be used for patching apps. Revanced Integrations
GLOBAL_KEYSTORE_FILE_NAME* Key file to be used for signing apps Builder's own key
GLOBAL_OLD_KEY* Whether key was generated with cli v4(new) or not False [Builder's own key (v3)]
GLOBAL_OPTIONS_FILE* Options file to be used Builder's options.json
GLOBAL_ARCHS_TO_BUILD* Arch to keep in the patched apk. All
REDDIT_CLIENT_ID Reddit Client ID to patch reddit apps None
VT_API_KEY Virus Total Key to scan APKs None
TELEGRAM_CHAT_ID Receiver in Telegram upload None
TELEGRAM_BOT_TOKEN APKs Sender for Telegram upload None
TELEGRAM_API_ID Used for telegram Authentication None
TELEGRAM_API_HASH Used for telegram Authentication None
APPRISE_URL Apprise URL . None
APPRISE_NOTIFICATION_TITLE Apprise Notification Title . None
APPRISE_NOTIFICATION_BODY Apprise Notification Body . None

* - Can be overridden for individual app.

App Level Config

Env Name Description Default
APP_NAME_CLI_DL DL for CLI to be used for patching APP_NAME. GLOBAL_CLI_DL
APP_NAME_PATCHES_DL DL for Patches to be used for patching APP_NAME. GLOBAL_PATCHES_DL
APP_NAME_PATCHES_JSON_DL DL for Patches Json to be used for patching APP_NAME. GLOBAL_PATCHES_JSON_DL
APP_NAME_INTEGRATIONS_DL DL for Integrations to be used for patching APP_NAME. GLOBAL_INTEGRATIONS_DL
APP_NAME_KEYSTORE_FILE_NAME Key file to be used for signing APP_NAME. GLOBAL_KEYSTORE_FILE_NAME
APP_NAME_OLD_KEY Whether key used was generated with cli v4 (new) or not. GLOBAL_OLD_KEY
APP_NAME_OPTIONS_FILE Options file to be used APP_NAME. GLOBAL_OPTIONS_FILE
APP_NAME_ARCHS_TO_BUILD Arch to keep in the patched APP_NAME. GLOBAL_ARCHS_TO_BUILD
APP_NAME_SPACE_FORMATTED_PATCHES Whether patches are space formatted for APP_NAME. GLOBAL_SPACE_FORMATTED_PATCHES
APP_NAME_EXCLUDE_PATCH* Patches to exclude while patching APP_NAME. []
APP_NAME_INCLUDE_PATCH** Patches to include while patching APP_NAME. []
APP_NAME_VERSION Version to use for download for patching. Recommended by patch resources
APP_NAME_PACKAGE_NAME*** Package name of the app to be patched None
APP_NAME_DL_SOURCE*** Download source of any of the supported scrapper None
APP_NAME_DL*** Direct download Link for clean apk None

* - By default all patches for a given app are included.
** - Can be used to included universal patch.
*** - Can be used for unavailable apps in the repository (unofficial apps).

Customization

  1. Officially Supported values for APP_NAME* are listed under Code column here.
    Note that the page syncs itself with the usage of PATCHES_JSON_DL resources in the .env file.
    The sources of original APKs are from one of these apkmirror, apkpure, uptodown & apksos sites. I'm not responsible for any damaged caused. If you know any better/safe source to download clean. Open a discussion.


    * - You can also patch any other app which is not supported officially.To do so, you need to provide few more inputs to the tool which are mentioned below. These config will override the sources config from the tool.

    <APP_NAME>_DL_SOURCE=<apk-link-to-any-of-the-suppored-scraper-sites>
    <APP_NAME>_PACKAGE_NAME=<package-name-of-the-application>

    You can also provide DL to the clean apk instead of providing DL_SOURCES as mentioned in this note.

    <APP_NAME>_DL=<direct-download-apk-link-to-any-site>
    <APP_NAME>_PACKAGE_NAME=<package-name-of-the-application>


    Supported Scrappers are:

    1. APKMIRROR - Supports downloading any available version
      1. Link Format - https://www.apkmirror.com/apk/<organisation-name>/app-name/
      2. Example Link - https://www.apkmirror.com/apk/google-inc/youtube/
    2. UPTODOWN - Supports downloading any available version
      1. Link Format - https://<app-name>.en.uptodown.com/android
      2. Example Link - https://spotify.en.uptodown.com/android
    3. APKSOS - Supports downloading any available version
      1. Link Format - https://apksos.com/download-app/<package-name>
      2. Example Link - https://apksos.com/download-app/com.expensemanager
    4. APKPURE - Supports downloading any available version
      1. Link Format - https://apkpure.net/-/<package-name>
      2. Example Link - https://apkpure.net/-/com.google.android.youtube
    5. APKMonk - Supports downloading any available version
      1. Link Format - https://www.apkmonk.com/app/<package-name>/
      2. Example Link - https://www.apkmonk.com/app/com.duolingo/
    6. Google Drive - Supports downloading from Google Drive
      1. Link Format - https://drive.google.com/uc?<id>
      2. Example Link - https://drive.google.com/uc?id=1ad44UTghbDty8o36Nrp3ZMyUzkPckIqY


    Please verify the source of original APKs yourself with links provided. I'm not responsible for any damage caused.If you know any better/safe source to download clean. Open a discussion.

  2. By default, script build the latest version mentioned in patches.json file.

  3. Remember to download the Microg. Otherwise, you may not be able to open YouTube/YouTube Music.

  4. By default, tool will build only youtube,youtube_music. To build other apps supported by patching resources.Add the apps you want to build in .env file or in ENVS in GitHub secrets in the format

    PATCH_APPS=<APP_NAME>

    Example:

    PATCH_APPS=youtube,twitter,reddit
  5. If APKMirror or other apk sources are blocked in your region or script somehow is unable to download from apkmirror. You can download apk manually from any source. Place them in /apks directory and provide environment variable in .env file or in ENVS in GitHub secrets in the format.

     EXISTING_DOWNLOADED_APKS=<Comma,Seperate,App,Name>

    Example:

     EXISTING_DOWNLOADED_APKS=youtube,youtube_music

    If you add above. Script will not download the YouTube & YouTube Music apks from internet and expects an apk in /apks folder with names youtube.apk & youtube_music.apk (apk naming format - <APP_NAME>.apk) respectively.

  6. If you run script again & again. You might hit GitHub API limit. In that case you can provide your Personal GitHub Access Token by adding a secret PERSONAL_ACCESS_TOKEN in GitHub secrets.

  7. You can provide Direct download to the resource to used for patching apps .env file or in ENVS in GitHub secrets in the format -

     GLOBAL_CLI_DL=https://github.com/revanced/revanced-cli
     GLOBAL_PATCHES_DL=https://github.com/revanced/revanced-patches/releases/latest
     GLOBAL_PATCHES_JSON_DL=https://github.com/revanced/revanced-patches/releases/tag/v2.190.0
     GLOBAL_INTEGRATIONS_DL=local://integrations.apk

    Resources downloaded from envs and will be used for patching for any APP_NAME. Unless provided different resource for the individual app.

    Tool also support resource config at app level. You can patch A app with X resources while patching B with Y resources. This can be done by providing Direct download link for resources for app.
    Example:

     YOUTUBE_CLI_DL=https://github.com/inotia00/revanced-cli
     YOUTUBE_PATCHES_DL=https://github.com/inotia00/revanced-patches/releases/latest
     YOUTUBE_PATCHES_JSON_DL=https://github.com/inotia00/revanced-patches/releases/tag/v2.187.1
     YOUTUBE_INTEGRATIONS_DL=local://inotia00-integrations.apk

    With the config tool will try to patch YouTube with resources from inotia00 while other global resource will used for patching other apps.
    If you have want to provide resource locally in the apks folder. You can specify that by mentioning filename prefixed with local://.
    Note - The link provided must be direct DLs, unless they are from GitHub. Note - Some of the patch sources (like inotia00) may provide - seperated patches while some (ReVanced) shifted to Space formatted patches. Use SPACE_FORMATTED_PATCHES to define the type of patches.

  8. If you don't want to use default keystore. You can provide your own by placing it inside /apks folder. And adding the filename of keystore-file in .env file or in ENVS in GitHub secrets in the format -

     GLOBAL_KEYSTORE_FILE_NAME=revanced.keystore

    Tool also support providing secret key at app level. You can sign A app with X key while signing B with Y key.
    Example:

     YOUTUBE_KEYSTORE_FILE_NAME=youtube.keystore

    Note - If you are using your own keystore and it was generated with cli v4, add Example:

     GLOBAL_OLD_KEY=False

    If you are using different key for different apps. You need to specify at app level.

    YOUTUBE_OLD_KEY=False
  9. If you don't want to use default apks/options.json file. You can provide your own by placing it inside apks folder and adding the name of options-file in .env file or in ENVS in GitHub secrets in the format.

     GLOBAL_OPTIONS_FILE=my_options.json

    Tool also support configuring at app level.

    Example:

     YOUTUBE_OPTIONS_FILE=my_cool_yt_options.json

    Note that this customization isn't available in the RVX-Builds tasker project. For now, use the Universal option for Patch Options to include options.json entries from all patch resources being used.

  10. You can build only for a particular arch in order to get smaller apk files. This can be done with by adding comma separated ARCHS_TO_BUILD in .env file or ENVS in GitHub secrets in the format.

     GLOABAL_ARCHS_TO_BUILD=arm64-v8a,x86_64

    Tool also support configuring at app level.

    Example:

     YOUTUBE_ARCHS_TO_BUILD=arm64-v8a,armeabi-v7a

    Note -

    1. Possible values are: arm64-v8a,armeabi-v7a,x86_64,x86.
    2. Make sure the patching resource (CLI) support this feature.
  11. If you want to include any extra file (apks only) to the Github upload (releases). Set comma arguments in .env file or in ENVS in GitHub secrets in the format -

    EXTRA_FILES=<url>@<appName>.apk

    Example:

     EXTRA_FILES=https://github.com/inotia00/mMicroG/releases/[email protected],https://github.com/inotia00/VancedMicroG/releases/tag/[email protected],https://github.com/revanced/[email protected]
  12. If you want to exclude any patch. Set comma separated patch in .env file or in ENVS in GitHub secrets in the format -

    <APP_NAME>_EXCLUDE_PATCH=<PATCH_TO_EXCLUDE-1,PATCH_TO_EXCLUDE-2,...>

    Example:

     YOUTUBE_EXCLUDE_PATCH=custom-branding,hide-get-premium
     YOUTUBE_MUSIC_EXCLUDE_PATCH=yt-music-is-shit

    Note -

    1. All the patches for an app are included by default.
    2. Some of the patch sources (like inotia00) may provide - seperated patches while some (ReVanced) shifted to Space formatted patches. Use <APP_NAME>_SPACE_FORMATTED_PATCHES to define the type of patches at app level, if varies from global.
    3. Some patches are provided as space separated, make sure you type those in lowercase and - (hyphen or dash) separated here. It means a patch named Hey There must be entered as hey-there in the above example.
  13. If you want to include any universal patch. Set comma separated patch in .env file or in ENVS in GitHub secrets in the format -

    <APP_NAME>_INCLUDE_PATCH=<PATCH_TO_EXCLUDE-1,PATCH_TO_EXCLUDE-2>

    Example:

     YOUTUBE_INCLUDE_PATCH=remove-screenshot-restriction

    Note -

    1. Some of the patch sources (like inotia00) may provide - seperated patches while some (ReVanced) shifted to Space formatted patches. Use <APP_NAME>_SPACE_FORMATTED_PATCHES to define the type of patches at app level, if varies from global.
    2. Some patches are provided as space separated, make sure you type those in lowercase and - (hyphen or dash) separated here. It means a patch named Hey There must be entered as hey-there in the above example.
    3. Not all patch sources provide universal patches.
    4. Go with EXCLUDE_PATCH if you didn't understand INCLUDE_PATCH purpose as that requires only regular patches.
  14. If you want to build a specific version or latest version. Add version in .env file or in ENVS in GitHub secrets in the format -

    <APP_NAME>_VERSION=<VERSION>

    Example:

    YOUTUBE_VERSION=17.31.36
    YOUTUBE_MUSIC_VERSION=X.X.X
    TWITTER_VERSION=latest # whatever latest is available (including beta)
  15. If you have your personal source for apk to be downloaded. You can also provide that and tool will not scrape links from apk sources. Add dl in .env file or in ENVS in GitHub secrets in the format -

    <APP_NAME>_DL=<direct-app-download>

    Example:

    YOUTUBE_DL=https://d.apkpure.com/b/APK/com.google.android.youtube?version=latest

    Note that they are supposed to be direct DLs.

  16. For Telegram Upload.

    1. Set up a telegram channel, send a message to it and forward the message to this telegram bot
    2. Copy id and save it to TELEGRAM_CHAT_ID

    3. TELEGRAM_BOT_TOKEN - Telegram provides BOT_TOKEN. It works as sender. Open bot and create one copy api key

    4. TELEGRAM_API_ID - Telegram API_ID is provided by telegram here

    5. TELEGRAM_API_HASH - Telegram API_HASH is provided by telegram here

    6. After Everything done successfully a part of the actions secrets of the repository may look like
  17. Configuration defined in ENVS in GitHub secrets will override the configuration in .env file. You can use this fact to define your normal configurations in .env file and sometimes if you want to build something different just once, add it in GitHub secrets.
    Or you can ignore what I wrote in above configs and always use GitHub secrets.

    Note - If you want to use or will be using Automated method to patch, please do not define anything inside ENVS.

  18. You can scan your built apks files with VirusTotal. For that, Add VT_API_KEY in GitHub secrets.

  19. If you want to patch reddit apps using your own Client ID. You can provide your Client ID as secret REDDIT_CLIENT_ID in GitHub secrets.

  20. Apprise
    We also have apprise support to upload built apk anywhere. To use apprise, add below envs in GitHub secrets.

    APPRISE_URL=tgram://bot-token/chat-id
    APPRISE_NOTIFICATION_BODY=What a great Body
    APPRISE_NOTIFICATION_TITLE=What a great title
  21. Sample Envs

    Here's the another sample in file format.
    # are used to comment out lines. For example, # APP_NAME_VERSION=latest_supported is simply used to depict the latest supported the patch version.

  22. Make your Action has write access. If not click here: https://github.com/OWNER/REPO/settings/actions. In the bottom give read and write access to Actions.

    You may also require to enable scheduled workflows for the first time.