diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt index f583bd10f..083d5c372 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt @@ -53,8 +53,6 @@ class CustomBrandingPatch : ResourcePatch() { } // Name branding - val appName: String by options[keyAppName] - val manifest = data["AndroidManifest.xml"] manifest.writeText( manifest.readText() @@ -67,24 +65,7 @@ class CustomBrandingPatch : ResourcePatch() { return PatchResultSuccess() } - override val options = PatchOptions( - PatchOption.StringOption( - key = keyAppName, - default = "YouTube ReVanced", - title = "Application Name", - description = "The name of the application it will show on your home screen.", - required = true - ), - PatchOption.StringOption( - key = keyAppIconPath, - default = null, - title = "Application Icon Path", - description = "A path to the icon of the application." - ) - ) - private fun getIconStream(iconPath: String): InputStream? { - val appIconPath: String? by options[keyAppIconPath] if (appIconPath == null) { return this.javaClass.classLoader.getResourceAsStream(iconPath) } @@ -93,8 +74,24 @@ class CustomBrandingPatch : ResourcePatch() { return FileInputStream(file) } - private companion object { - private const val keyAppName = "appName" - private const val keyAppIconPath = "appIconPath" + companion object : OptionsContainer() { + private var appName: String by option( + PatchOption.StringOption( + key = "appName", + default = "YouTube ReVanced", + title = "Application Name", + description = "The name of the application it will show on your home screen.", + required = true + ) + ) + + private var appIconPath: String? by option( + PatchOption.StringOption( + key = "appIconPath", + default = null, + title = "Application Icon Path", + description = "A path to the icon of the application." + ) + ) } }