From efb6d4c2be515185fc9bd29c40ce202f0d684cee Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 15 Jun 2022 11:07:10 +0200 Subject: [PATCH] fix: `custom-branding` patch failing to get resources --- .../annotations/CustomBrandingCompatibility.kt | 2 +- .../{icon => branding}/patch/CustomBrandingPatch.kt | 6 +++--- ...adaptiveproduct_youtube_background_color_108.png | Bin ...adaptiveproduct_youtube_foreground_color_108.png | Bin .../{icon => branding}/144/ic_launcher.png | Bin .../{icon => branding}/144/ic_launcher_round.png | Bin ...adaptiveproduct_youtube_background_color_108.png | Bin ...adaptiveproduct_youtube_foreground_color_108.png | Bin .../{icon => branding}/192/ic_launcher.png | Bin .../{icon => branding}/192/ic_launcher_round.png | Bin ...adaptiveproduct_youtube_background_color_108.png | Bin ...adaptiveproduct_youtube_foreground_color_108.png | Bin .../resources/{icon => branding}/72/ic_launcher.png | Bin .../{icon => branding}/72/ic_launcher_round.png | Bin ...adaptiveproduct_youtube_background_color_108.png | Bin ...adaptiveproduct_youtube_foreground_color_108.png | Bin .../resources/{icon => branding}/96/ic_launcher.png | Bin .../{icon => branding}/96/ic_launcher_round.png | Bin 18 files changed, 4 insertions(+), 4 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/layout/{icon => branding}/annotations/CustomBrandingCompatibility.kt (82%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{icon => branding}/patch/CustomBrandingPatch.kt (91%) rename src/main/resources/{icon => branding}/144/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/{icon => branding}/144/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/{icon => branding}/144/ic_launcher.png (100%) rename src/main/resources/{icon => branding}/144/ic_launcher_round.png (100%) rename src/main/resources/{icon => branding}/192/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/{icon => branding}/192/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/{icon => branding}/192/ic_launcher.png (100%) rename src/main/resources/{icon => branding}/192/ic_launcher_round.png (100%) rename src/main/resources/{icon => branding}/72/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/{icon => branding}/72/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/{icon => branding}/72/ic_launcher.png (100%) rename src/main/resources/{icon => branding}/72/ic_launcher_round.png (100%) rename src/main/resources/{icon => branding}/96/adaptiveproduct_youtube_background_color_108.png (100%) rename src/main/resources/{icon => branding}/96/adaptiveproduct_youtube_foreground_color_108.png (100%) rename src/main/resources/{icon => branding}/96/ic_launcher.png (100%) rename src/main/resources/{icon => branding}/96/ic_launcher_round.png (100%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/icon/annotations/CustomBrandingCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/annotations/CustomBrandingCompatibility.kt similarity index 82% rename from src/main/kotlin/app/revanced/patches/youtube/layout/icon/annotations/CustomBrandingCompatibility.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/branding/annotations/CustomBrandingCompatibility.kt index d46b6f1fd..bc427cbb7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/icon/annotations/CustomBrandingCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/annotations/CustomBrandingCompatibility.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.icon.annotations +package app.revanced.patches.youtube.layout.branding.annotations import app.revanced.patcher.annotation.Compatibility import app.revanced.patcher.annotation.Package diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/icon/patch/CustomBrandingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/patch/CustomBrandingPatch.kt similarity index 91% rename from src/main/kotlin/app/revanced/patches/youtube/layout/icon/patch/CustomBrandingPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/branding/patch/CustomBrandingPatch.kt index d7938e56d..33ae280d0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/icon/patch/CustomBrandingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/patch/CustomBrandingPatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.icon.patch +package app.revanced.patches.youtube.layout.branding.patch import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name @@ -10,7 +10,7 @@ import app.revanced.patcher.patch.implementation.ResourcePatch import app.revanced.patcher.patch.implementation.misc.PatchResult import app.revanced.patcher.patch.implementation.misc.PatchResultError import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess -import app.revanced.patches.youtube.layout.icon.annotations.CustomBrandingCompatibility +import app.revanced.patches.youtube.layout.branding.annotations.CustomBrandingCompatibility import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import java.nio.file.Files @@ -42,7 +42,7 @@ class CustomBrandingPatch : ResourcePatch() { "mipmap-mdpi" to 48 ).forEach { (iconDirectory, size) -> iconNames.forEach iconLoop@{ iconName -> - val iconFile = this.javaClass.classLoader.getResourceAsStream("$size/$iconName.png") + val iconFile = this.javaClass.classLoader.getResourceAsStream("branding/$size/$iconName.png") ?: return PatchResultError("The icon $iconName can not be found.") Files.write( diff --git a/src/main/resources/icon/144/adaptiveproduct_youtube_background_color_108.png b/src/main/resources/branding/144/adaptiveproduct_youtube_background_color_108.png similarity index 100% rename from src/main/resources/icon/144/adaptiveproduct_youtube_background_color_108.png rename to src/main/resources/branding/144/adaptiveproduct_youtube_background_color_108.png diff --git a/src/main/resources/icon/144/adaptiveproduct_youtube_foreground_color_108.png b/src/main/resources/branding/144/adaptiveproduct_youtube_foreground_color_108.png similarity index 100% rename from src/main/resources/icon/144/adaptiveproduct_youtube_foreground_color_108.png rename to src/main/resources/branding/144/adaptiveproduct_youtube_foreground_color_108.png diff --git a/src/main/resources/icon/144/ic_launcher.png b/src/main/resources/branding/144/ic_launcher.png similarity index 100% rename from src/main/resources/icon/144/ic_launcher.png rename to src/main/resources/branding/144/ic_launcher.png diff --git a/src/main/resources/icon/144/ic_launcher_round.png b/src/main/resources/branding/144/ic_launcher_round.png similarity index 100% rename from src/main/resources/icon/144/ic_launcher_round.png rename to src/main/resources/branding/144/ic_launcher_round.png diff --git a/src/main/resources/icon/192/adaptiveproduct_youtube_background_color_108.png b/src/main/resources/branding/192/adaptiveproduct_youtube_background_color_108.png similarity index 100% rename from src/main/resources/icon/192/adaptiveproduct_youtube_background_color_108.png rename to src/main/resources/branding/192/adaptiveproduct_youtube_background_color_108.png diff --git a/src/main/resources/icon/192/adaptiveproduct_youtube_foreground_color_108.png b/src/main/resources/branding/192/adaptiveproduct_youtube_foreground_color_108.png similarity index 100% rename from src/main/resources/icon/192/adaptiveproduct_youtube_foreground_color_108.png rename to src/main/resources/branding/192/adaptiveproduct_youtube_foreground_color_108.png diff --git a/src/main/resources/icon/192/ic_launcher.png b/src/main/resources/branding/192/ic_launcher.png similarity index 100% rename from src/main/resources/icon/192/ic_launcher.png rename to src/main/resources/branding/192/ic_launcher.png diff --git a/src/main/resources/icon/192/ic_launcher_round.png b/src/main/resources/branding/192/ic_launcher_round.png similarity index 100% rename from src/main/resources/icon/192/ic_launcher_round.png rename to src/main/resources/branding/192/ic_launcher_round.png diff --git a/src/main/resources/icon/72/adaptiveproduct_youtube_background_color_108.png b/src/main/resources/branding/72/adaptiveproduct_youtube_background_color_108.png similarity index 100% rename from src/main/resources/icon/72/adaptiveproduct_youtube_background_color_108.png rename to src/main/resources/branding/72/adaptiveproduct_youtube_background_color_108.png diff --git a/src/main/resources/icon/72/adaptiveproduct_youtube_foreground_color_108.png b/src/main/resources/branding/72/adaptiveproduct_youtube_foreground_color_108.png similarity index 100% rename from src/main/resources/icon/72/adaptiveproduct_youtube_foreground_color_108.png rename to src/main/resources/branding/72/adaptiveproduct_youtube_foreground_color_108.png diff --git a/src/main/resources/icon/72/ic_launcher.png b/src/main/resources/branding/72/ic_launcher.png similarity index 100% rename from src/main/resources/icon/72/ic_launcher.png rename to src/main/resources/branding/72/ic_launcher.png diff --git a/src/main/resources/icon/72/ic_launcher_round.png b/src/main/resources/branding/72/ic_launcher_round.png similarity index 100% rename from src/main/resources/icon/72/ic_launcher_round.png rename to src/main/resources/branding/72/ic_launcher_round.png diff --git a/src/main/resources/icon/96/adaptiveproduct_youtube_background_color_108.png b/src/main/resources/branding/96/adaptiveproduct_youtube_background_color_108.png similarity index 100% rename from src/main/resources/icon/96/adaptiveproduct_youtube_background_color_108.png rename to src/main/resources/branding/96/adaptiveproduct_youtube_background_color_108.png diff --git a/src/main/resources/icon/96/adaptiveproduct_youtube_foreground_color_108.png b/src/main/resources/branding/96/adaptiveproduct_youtube_foreground_color_108.png similarity index 100% rename from src/main/resources/icon/96/adaptiveproduct_youtube_foreground_color_108.png rename to src/main/resources/branding/96/adaptiveproduct_youtube_foreground_color_108.png diff --git a/src/main/resources/icon/96/ic_launcher.png b/src/main/resources/branding/96/ic_launcher.png similarity index 100% rename from src/main/resources/icon/96/ic_launcher.png rename to src/main/resources/branding/96/ic_launcher.png diff --git a/src/main/resources/icon/96/ic_launcher_round.png b/src/main/resources/branding/96/ic_launcher_round.png similarity index 100% rename from src/main/resources/icon/96/ic_launcher_round.png rename to src/main/resources/branding/96/ic_launcher_round.png