From f37815fdf90e6181f6bb82a199b403dbdde0be04 Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Sat, 5 Aug 2023 21:46:19 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Failing=20to=20fetch=20latest=20?= =?UTF-8?q?release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.py | 8 ++++---- src/patches.py | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app.py b/src/app.py index 9572cb7..21521ce 100644 --- a/src/app.py +++ b/src/app.py @@ -51,7 +51,7 @@ class APP(object): return ", ".join("%s: %s" % item for item in attrs.items()) @staticmethod - def download(url: str, config: RevancedConfig, assets_filter: str = None) -> str: # type: ignore + def download(url: str, config: RevancedConfig, assets_filter: str) -> str: """Downloader.""" from src.downloader.download import Downloader @@ -70,14 +70,14 @@ class APP(object): logger.info("Downloading resources for patching.") # Create a list of resource download tasks download_tasks = [ - ("cli", self.cli_dl, config), - ("integrations", self.integrations_dl, config), + ("cli", self.cli_dl, config, ".*jar"), + ("integrations", self.integrations_dl, config, ".*apk"), ("patches", self.patches_dl, config, ".*jar"), ("patches_json", self.patches_dl, config, ".*json"), ] # Using a ThreadPoolExecutor for parallelism - with ThreadPoolExecutor() as executor: + with ThreadPoolExecutor(4) as executor: futures = { resource_name: executor.submit(self.download, *args) for resource_name, *args in download_tasks diff --git a/src/patches.py b/src/patches.py index 48717ab..35217bb 100644 --- a/src/patches.py +++ b/src/patches.py @@ -58,6 +58,11 @@ class Patches(object): key: (value, "_" + value) for key, value in _revanced_app_ids.items() } + @staticmethod + def support_app() -> Dict[str, str]: + """Return supported apps.""" + return Patches._revanced_app_ids + def scrap_patches(self, file_name: str) -> Any: """Scrap Patches.""" if os.path.exists(file_name):