Build Og and Custom Icon

This commit is contained in:
Nikhil Badyal
2022-10-14 19:46:51 +05:30
parent e162068b30
commit a07d852ec4
4 changed files with 38 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
PATCH_APPS=youtube
BUILD_EXTENDED=True
EXCLUDE_PATCH_YOUTUBE=custom-branding,enable-debugging
EXCLUDE_PATCH_YOUTUBE_EXTENDED=custom-branding-red,custom-branding-blue,materialyou,custom-branding-decipher3114,custom-branding-name,custom-package-name,always-autorepeat
EXCLUDE_PATCH_YOUTUBE_MUSIC_EXTENDED=custom-branding-music,custom-branding-music-decipher3114,custom-package-name-music,custom-branding-music-red
CHANGELOG_GITHUB_REPOSITORY=inotia00/revanced-patches
BUILD_OG_BRANDING_YOUTUBE=True
+12
View File
@@ -30,6 +30,18 @@ def main() -> None:
parser.patch_app(app=app, version=version, is_experimental=is_experimental) parser.patch_app(app=app, version=version, is_experimental=is_experimental)
except Exception as e: except Exception as e:
logger.exception(f"Failed to build {app} because of {e}") logger.exception(f"Failed to build {app} because of {e}")
if config.build_og_nd_branding_youtube:
all_patches = parser.get_all_patches()
branding_patch = "custom-branding"
if config.build_extended:
branding_patch = "custom-branding-blue"
branding_index = all_patches.index(branding_patch)
was_og_build = True if all_patches[branding_index - 1] == "-e" else False
app = "youtube-custom-icon" if was_og_build else "youtube"
_, version, is_experimental = patcher.get_app_configs("youtube")
parser.invert_patch(branding_patch)
parser.patch_app(app=app, version=version, is_experimental=is_experimental)
logger.info(parser.get_all_patches())
if __name__ == "__main__": if __name__ == "__main__":
+1
View File
@@ -56,3 +56,4 @@ class RevancedConfig:
"youtube": f"{self.apk_mirror_urls.get('youtube')}youtube", "youtube": f"{self.apk_mirror_urls.get('youtube')}youtube",
"youtube_music": f"{self.apk_mirror_urls.get('youtube_music')}youtube-music", "youtube_music": f"{self.apk_mirror_urls.get('youtube_music')}youtube-music",
} }
self.build_og_nd_branding_youtube = env.bool("BUILD_OG_BRANDING_YOUTUBE", False)
+18
View File
@@ -41,6 +41,24 @@ class Parser(object):
""" """
return self._EXCLUDED return self._EXCLUDED
def get_all_patches(self) -> List[str]:
"""
Getter to get all excluded patches
:return: List of excluded patches
"""
return self._PATCHES
def invert_patch(self, name: str) -> None:
"""
Getter to get all excluded patches
:return: List of excluded patches
"""
patch_index = self._PATCHES.index(name)
if self._PATCHES[patch_index - 1] == "e":
self._PATCHES[patch_index - 1] = "-i"
else:
self._PATCHES[patch_index - 1] = "-e"
def patch_app(self, app: str, version: str, is_experimental: bool = False) -> None: def patch_app(self, app: str, version: str, is_experimental: bool = False) -> None:
"""Revanced APP Patcher. """Revanced APP Patcher.