mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
✨ Included patches
This commit is contained in:
@@ -180,8 +180,7 @@ By default, script build the version as recommended by Revanced team.
|
|||||||
PATCH_APPS=youtube,twitter,reddit
|
PATCH_APPS=youtube,twitter,reddit
|
||||||
```
|
```
|
||||||
4. If you want to exclude any patch. Set comma separated patch in `.env` file or in `ENVS` in `GitHub secrets`
|
4. If you want to exclude any patch. Set comma separated patch in `.env` file or in `ENVS` in `GitHub secrets`
|
||||||
(Recommended) in
|
(Recommended) in the format
|
||||||
the format
|
|
||||||
```ini
|
```ini
|
||||||
EXCLUDE_PATCH_<REVANCED_APPS_NAME>=<PATCH_TO_EXCLUDE-1,PATCH_TO_EXCLUDE-2>
|
EXCLUDE_PATCH_<REVANCED_APPS_NAME>=<PATCH_TO_EXCLUDE-1,PATCH_TO_EXCLUDE-2>
|
||||||
```
|
```
|
||||||
@@ -196,6 +195,26 @@ By default, script build the version as recommended by Revanced team.
|
|||||||
EXCLUDE_PATCH_YOUTUBE_EXTENDED=custom-branding-red,custom-branding-blue,materialyou
|
EXCLUDE_PATCH_YOUTUBE_EXTENDED=custom-branding-red,custom-branding-blue,materialyou
|
||||||
EXCLUDE_PATCH_YOUTUBE_MUSIC_EXTENDED=custom-branding-music
|
EXCLUDE_PATCH_YOUTUBE_MUSIC_EXTENDED=custom-branding-music
|
||||||
```
|
```
|
||||||
|
**_All the patches for an app are included by default._**.<br><br>If you want to apply a universal patch. You can
|
||||||
|
include it
|
||||||
|
manually. See below for more information.<br>
|
||||||
|
If you want to include any universal patch. Set comma separated patch in `.env` file or in `ENVS` in `GitHub
|
||||||
|
secrets`
|
||||||
|
(Recommended) in the format
|
||||||
|
```ini
|
||||||
|
INCLUDE_PATCH_<REVANCED_APPS_NAME>=<PATCH_TO_EXCLUDE-1,PATCH_TO_EXCLUDE-2>
|
||||||
|
```
|
||||||
|
Example:
|
||||||
|
```dotenv
|
||||||
|
INCLUDE_PATCH_YOUTUBE=remove-screenshot-restriction
|
||||||
|
```
|
||||||
|
If you are using `Revanced Extended.` Add `_EXTENDED` in exclude options.
|
||||||
|
Example:
|
||||||
|
```dotenv
|
||||||
|
INCLUDE_PATCH_YOUTUBE_EXTENDED=remove-screenshot-restriction
|
||||||
|
```
|
||||||
|
**_Remember_** - Revanced patches are provided space separated, make sure you type those **-** separated here. It means a
|
||||||
|
patch named _**Hey There**_ will be entered as **_hey-there_** in the above example.
|
||||||
5. If you want to build a specific version . Add `version` in `.env` file or in `ENVS` in `GitHub secrets` (Recommended)
|
5. If you want to build a specific version . Add `version` in `.env` file or in `ENVS` in `GitHub secrets` (Recommended)
|
||||||
in the format
|
in the format
|
||||||
```ini
|
```ini
|
||||||
|
|||||||
@@ -98,8 +98,14 @@ class Patches(object):
|
|||||||
|
|
||||||
for app_name in (self.revanced_app_ids[x][1] for x in self.revanced_app_ids):
|
for app_name in (self.revanced_app_ids[x][1] for x in self.revanced_app_ids):
|
||||||
setattr(self, app_name, [])
|
setattr(self, app_name, [])
|
||||||
|
setattr(self, "universal_patch", [])
|
||||||
|
|
||||||
for patch in patches:
|
for patch in patches:
|
||||||
|
if not patch["compatiblePackages"]:
|
||||||
|
p = {x: patch[x] for x in ["name", "description"]}
|
||||||
|
p["app"] = "universal"
|
||||||
|
p["version"] = "all"
|
||||||
|
getattr(self, "universal_patch").append(p)
|
||||||
for compatible_package, version in [
|
for compatible_package, version in [
|
||||||
(x["name"], x["versions"]) for x in patch["compatiblePackages"]
|
(x["name"], x["versions"]) for x in patch["compatiblePackages"]
|
||||||
]:
|
]:
|
||||||
@@ -141,6 +147,8 @@ class Patches(object):
|
|||||||
for app_name, app_id in self.revanced_app_ids.values():
|
for app_name, app_id in self.revanced_app_ids.values():
|
||||||
n_patches = len(getattr(self, app_id))
|
n_patches = len(getattr(self, app_id))
|
||||||
logger.debug(f"Total patches in {app_name} are {n_patches}")
|
logger.debug(f"Total patches in {app_name} are {n_patches}")
|
||||||
|
n_patches = len(getattr(self, "universal_patch"))
|
||||||
|
logger.debug(f"Total universal patches are {n_patches}")
|
||||||
|
|
||||||
def __init__(self, config: RevancedConfig) -> None:
|
def __init__(self, config: RevancedConfig) -> None:
|
||||||
self.config = config
|
self.config = config
|
||||||
@@ -186,8 +194,12 @@ class Patches(object):
|
|||||||
excluded_patches = self.config.env.list(
|
excluded_patches = self.config.env.list(
|
||||||
f"EXCLUDE_PATCH_{app}_EXTENDED".upper(), []
|
f"EXCLUDE_PATCH_{app}_EXTENDED".upper(), []
|
||||||
)
|
)
|
||||||
|
included_patches = self.config.env.list(
|
||||||
|
f"INCLUDE_PATCH_{app}_EXTENDED".upper(), []
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
excluded_patches = self.config.env.list(f"EXCLUDE_PATCH_{app}".upper(), [])
|
excluded_patches = self.config.env.list(f"EXCLUDE_PATCH_{app}".upper(), [])
|
||||||
|
included_patches = self.config.env.list(f"INCLUDE_PATCH_{app}".upper(), [])
|
||||||
for patch in patches:
|
for patch in patches:
|
||||||
normalized_patch = patch["name"].lower().replace(" ", "-")
|
normalized_patch = patch["name"].lower().replace(" ", "-")
|
||||||
parser.include(
|
parser.include(
|
||||||
@@ -195,6 +207,10 @@ class Patches(object):
|
|||||||
) if normalized_patch not in excluded_patches else parser.exclude(
|
) if normalized_patch not in excluded_patches else parser.exclude(
|
||||||
normalized_patch
|
normalized_patch
|
||||||
)
|
)
|
||||||
|
for normalized_patch in included_patches:
|
||||||
|
parser.include(normalized_patch) if normalized_patch not in getattr(
|
||||||
|
self, "universal_patch", []
|
||||||
|
) else ()
|
||||||
excluded = parser.get_excluded_patches()
|
excluded = parser.get_excluded_patches()
|
||||||
if excluded:
|
if excluded:
|
||||||
logger.debug(f"Excluded patches {excluded} for {app}")
|
logger.debug(f"Excluded patches {excluded} for {app}")
|
||||||
|
|||||||
Reference in New Issue
Block a user