mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
🎨 Added support for revanced-extend
This commit is contained in:
@@ -30,9 +30,19 @@ supported_apps = [
|
|||||||
"warnwetter",
|
"warnwetter",
|
||||||
]
|
]
|
||||||
apps = env.list("PATCH_APPS", supported_apps)
|
apps = env.list("PATCH_APPS", supported_apps)
|
||||||
|
build_extended = env.bool("BUILD_EXTENDED", False)
|
||||||
|
extended_apps = ["youtube", "youtube_music"]
|
||||||
keystore_name = env.str("KEYSTORE_FILE_NAME", "revanced.keystore")
|
keystore_name = env.str("KEYSTORE_FILE_NAME", "revanced.keystore")
|
||||||
apk_mirror = "https://www.apkmirror.com"
|
apk_mirror = "https://www.apkmirror.com"
|
||||||
github = "https://www.github.com"
|
github = "https://www.github.com"
|
||||||
|
normal_cli_jar = "revanced-cli.jar"
|
||||||
|
normal_patches_jar = "revanced-patches.jar"
|
||||||
|
normal_integrations_apk = "revanced-integrations.apk"
|
||||||
|
cli_jar = f"inotia00-{normal_cli_jar}" if build_extended else normal_cli_jar
|
||||||
|
patches_jar = f"inotia00-{normal_patches_jar}" if build_extended else normal_patches_jar
|
||||||
|
integrations_apk = (
|
||||||
|
f"inotia00-{normal_integrations_apk}" if build_extended else normal_integrations_apk
|
||||||
|
)
|
||||||
apk_mirror_urls = {
|
apk_mirror_urls = {
|
||||||
"reddit": f"{apk_mirror}/apk/redditinc/reddit/",
|
"reddit": f"{apk_mirror}/apk/redditinc/reddit/",
|
||||||
"twitter": f"{apk_mirror}/apk/twitter-inc/twitter/",
|
"twitter": f"{apk_mirror}/apk/twitter-inc/twitter/",
|
||||||
@@ -201,9 +211,12 @@ class Patches(object):
|
|||||||
p["version"] = version[-1] if version else "all"
|
p["version"] = version[-1] if version else "all"
|
||||||
getattr(self, app_name).append(p)
|
getattr(self, app_name).append(p)
|
||||||
|
|
||||||
resp_extended = session.get(
|
if build_extended:
|
||||||
"https://raw.githubusercontent.com/inotia00/revanced-patches/revanced-extended/patches.json"
|
url = "https://raw.githubusercontent.com/inotia00/revanced-patches/revanced-extended/patches.json"
|
||||||
)
|
else:
|
||||||
|
url = "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json"
|
||||||
|
|
||||||
|
resp_extended = session.get(url)
|
||||||
extended_patches = resp_extended.json()
|
extended_patches = resp_extended.json()
|
||||||
revanced_extended_app_ids = {
|
revanced_extended_app_ids = {
|
||||||
"com.google.android.youtube": ("youtube", "_yt"),
|
"com.google.android.youtube": ("youtube", "_yt"),
|
||||||
@@ -272,13 +285,13 @@ class ArgParser(object):
|
|||||||
|
|
||||||
def run(self, app: str, version: str, is_experimental: bool = False) -> None:
|
def run(self, app: str, version: str, is_experimental: bool = False) -> None:
|
||||||
logger.debug(f"Sending request to revanced cli for building {app} revanced")
|
logger.debug(f"Sending request to revanced cli for building {app} revanced")
|
||||||
cli = "revanced-cli.jar"
|
cli = normal_cli_jar
|
||||||
patches = "revanced-patches.jar"
|
patches = normal_patches_jar
|
||||||
integrations = "revanced-integrations.apk"
|
integrations = normal_integrations_apk
|
||||||
if app in ("youtube", "youtube_music"):
|
if build_extended and app in extended_apps:
|
||||||
cli = f"inotia00-{cli}"
|
cli = cli_jar
|
||||||
patches = f"inotia00-{patches}"
|
patches = patches_jar
|
||||||
integrations = f"inotia00-{integrations}"
|
integrations = integrations_apk
|
||||||
args = [
|
args = [
|
||||||
"-jar",
|
"-jar",
|
||||||
cli,
|
cli,
|
||||||
@@ -341,13 +354,16 @@ def pre_requisite():
|
|||||||
|
|
||||||
def download_revanced(downloader: Type[Downloader]) -> None:
|
def download_revanced(downloader: Type[Downloader]) -> None:
|
||||||
assets = (
|
assets = (
|
||||||
("revanced", "revanced-cli", "revanced-cli.jar"),
|
("revanced", "revanced-cli", normal_cli_jar),
|
||||||
("revanced", "revanced-integrations", "revanced-integrations.apk"),
|
("revanced", "revanced-integrations", normal_integrations_apk),
|
||||||
("revanced", "revanced-patches", "revanced-patches.jar"),
|
("revanced", "revanced-patches", normal_patches_jar),
|
||||||
("inotia00", "VancedMicroG", "VancedMicroG.apk"),
|
("inotia00", "VancedMicroG", "VancedMicroG.apk"),
|
||||||
("inotia00", "revanced-cli", "inotia00-revanced-cli.jar"),
|
)
|
||||||
("inotia00", "revanced-integrations", "inotia00-revanced-integrations.apk"),
|
if build_extended:
|
||||||
("inotia00", "revanced-patches", "inotia00-revanced-patches.jar"),
|
assets += (
|
||||||
|
("inotia00", "revanced-cli", cli_jar),
|
||||||
|
("inotia00", "revanced-integrations", integrations_apk),
|
||||||
|
("inotia00", "revanced-patches", patches_jar),
|
||||||
)
|
)
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
executor.map(lambda repo: downloader.repository(*repo), assets)
|
executor.map(lambda repo: downloader.repository(*repo), assets)
|
||||||
@@ -370,6 +386,9 @@ def main() -> None:
|
|||||||
|
|
||||||
def get_patches() -> None:
|
def get_patches() -> None:
|
||||||
logger.debug(f"Excluding patches for app {app}")
|
logger.debug(f"Excluding patches for app {app}")
|
||||||
|
if build_extended and app in extended_apps:
|
||||||
|
excluded_patches = env.list(f"EXCLUDE_PATCH_{app}_EXTENDED".upper(), [])
|
||||||
|
else:
|
||||||
excluded_patches = env.list(f"EXCLUDE_PATCH_{app}".upper(), [])
|
excluded_patches = env.list(f"EXCLUDE_PATCH_{app}".upper(), [])
|
||||||
for patch in app_patches:
|
for patch in app_patches:
|
||||||
arg_parser.include(patch["name"]) if patch[
|
arg_parser.include(patch["name"]) if patch[
|
||||||
|
|||||||
Reference in New Issue
Block a user