From 9b15d234e3edcac56bfcf3c027f861af5613d0f1 Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Wed, 6 Dec 2023 13:50:20 +0900 Subject: [PATCH] fix(Custom branding icon): patch options not available --- .../music/general/branding/icon/CustomBrandingIconPatch.kt | 4 ++-- .../youtube/layout/branding/icon/CustomBrandingIconPatch.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt b/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt index 95a39e04b..99d6d1443 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/branding/icon/CustomBrandingIconPatch.kt @@ -61,7 +61,8 @@ object CustomBrandingIconPatch : ResourcePatch() { override fun execute(context: ResourceContext) { AppIcon?.let { appIcon -> - if (!availableIcon.containsKey(appIcon)) { + val appIconValue = appIcon.lowercase().replace(" ","_") + if (!availableIcon.containsValue(appIconValue)) { mipmapDirectories.map { directory -> ResourceGroup( directory, *mipmapIconResourceFileNames @@ -83,7 +84,6 @@ object CustomBrandingIconPatch : ResourcePatch() { } } } else { - val appIconValue = availableIcon[appIcon] + "" val resourcePath = "music/branding/$appIconValue" // change launcher icon. diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt index 170d2ce87..c1208f924 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt @@ -106,7 +106,8 @@ object CustomBrandingIconPatch : ResourcePatch() { override fun execute(context: ResourceContext) { AppIcon?.let { appIcon -> - if (!availableIcon.containsKey(appIcon)) { + val appIconValue = appIcon.lowercase().replace(" ","_") + if (!availableIcon.containsValue(appIconValue)) { mipmapDirectories.map { directory -> ResourceGroup( directory, *mipmapIconResourceFileNames @@ -129,7 +130,6 @@ object CustomBrandingIconPatch : ResourcePatch() { context.updatePatchStatusIcon("custom") } } else { - val appIconValue = availableIcon[appIcon] + "" val resourcePath = "youtube/branding/$appIconValue" // change launcher icon.