From b93b8a915d8b678c748d227fab2047e96b43150a Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Sat, 5 Aug 2023 17:49:40 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Per=20app=20arch=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++-- src/app.py | 3 +++ src/config.py | 2 +- src/parser.py | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b6bf901..e6ab75f 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,7 @@ By default, script build the version as recommended by Revanced team. YOUTUBE_MUSIC_PATCHES_DL=https://github.com/inotia00/revanced-patches/releases/latest YOUTUBE_MUSIC_CLI_DL=https://github.com/inotia00/revanced-cli/releases/latest YOUTUBE_MUSIC_KEYSTORE_FILE_NAME=key.store + YOUTUBE_MUSIC_ARCHS_TO_BUILD=arm64-v8a,armeabi-v7a ``` These link if not from GitHub must be direct download links. 7. You can also provide a default resources which will be used when per app config is missing. @@ -280,10 +281,10 @@ By default, script build the version as recommended by Revanced team. 12. 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 `ENVS` in `GitHub secrets` (Recommended) in the format. ```dotenv - ARCHS_TO_BUILD=arm64-v8a,armeabi-v7a + GLOABAL_ARCHS_TO_BUILD=arm64-v8a,armeabi-v7a ``` Possible values for `ARCHS_TO_BUILD` are: `armeabi-v7a`,`x86`,`x86_64`,`arm64-v8a` - Make sure you are using `revanced-extended` as `revanced` doesn't support this. + Make sure the patching resource support this. 13. You can scan your built apks files with VirusTotal. For that, Add `VT_API_KEY` in `GitHub secrets`. 14. 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 diff --git a/src/app.py b/src/app.py index 5a1ac5f..9572cb7 100644 --- a/src/app.py +++ b/src/app.py @@ -32,6 +32,9 @@ class APP(object): self.keystore_name = config.env.str( f"{app_name}_KEYSTORE_FILE_NAME".upper(), config.global_keystore_name ) + self.archs_to_build = config.env.list( + f"{app_name}_ARCHS_TO_BUILD".upper(), config.global_archs_to_build + ) self.download_patch_resources(config) def get_output_file_name(self) -> str: diff --git a/src/config.py b/src/config.py index acd272a..f61521e 100644 --- a/src/config.py +++ b/src/config.py @@ -75,7 +75,7 @@ class RevancedConfig(object): key: value + value.split("/")[-2] for key, value in self.apk_mirror_urls.items() } - self.archs_to_build = env.list("ARCHS_TO_BUILD", []) + self.global_archs_to_build = env.list("GLOBAL_ARCHS_TO_BUILD", []) self.alternative_youtube_patches = env.list("ALTERNATIVE_YOUTUBE_PATCHES", []) self.alternative_youtube_music_patches = env.list( "ALTERNATIVE_YOUTUBE_MUSIC_PATCHES", [] diff --git a/src/parser.py b/src/parser.py index 2a62080..2e1d647 100644 --- a/src/parser.py +++ b/src/parser.py @@ -102,7 +102,7 @@ class Parser(object): if self._PATCHES: args.extend(self._PATCHES) if app.app_name in self.config.rip_libs_apps: - excluded = set(possible_archs) - set(self.config.archs_to_build) + excluded = set(possible_archs) - set(app.archs_to_build) for arch in excluded: args.append("--rip-lib") args.append(arch)