diff --git a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/CustomBrandingIconPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/CustomBrandingIconPatch.kt index 21b887c6fc..0531eac4c5 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/CustomBrandingIconPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/branding/icon/CustomBrandingIconPatch.kt @@ -6,6 +6,7 @@ import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPat import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE import app.revanced.util.ResourceGroup +import app.revanced.util.Utils.trimIndentMultiline import app.revanced.util.copyResources import app.revanced.util.patch.BaseResourcePatch import java.io.File @@ -107,10 +108,7 @@ object CustomBrandingIconPatch : BaseResourcePatch( Each of these folders must contain the following files: ${launcherIconResourceFileNames.joinToString("\n") { "- $it" }} - """ - .split("\n") - .joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line. - .trimIndent(), // Remove the leading newline. + """.trimIndentMultiline(), ) private val ChangeHeader by booleanPatchOption( diff --git a/src/main/kotlin/app/revanced/patches/shared/opus/BaseOpusCodecsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/opus/BaseOpusCodecsPatch.kt index 00237270e9..e57e69ebe6 100644 --- a/src/main/kotlin/app/revanced/patches/shared/opus/BaseOpusCodecsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/opus/BaseOpusCodecsPatch.kt @@ -13,10 +13,10 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.Reference -@Deprecated( - "This patch is generally not required for the latest versions of YouTube and YouTube Music." + - "For YouTube Music, if user spoofs the app version to v4.27.53, mp4a codec is still used, this is the patch for some of these users." -) +/** + * This patch is generally not required for the latest versions of YouTube and YouTube Music. + * For YouTube Music, if user spoofs the app version to v4.27.53, mp4a codec is still used, this is the patch for some of these users. + */ abstract class BaseOpusCodecsPatch( private val descriptor: String ) : BytecodePatch( 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 8c9f43a9b9..accc0370ab 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 @@ -8,6 +8,7 @@ import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PAC import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusIcon import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.util.ResourceGroup +import app.revanced.util.Utils.trimIndentMultiline import app.revanced.util.copyResources import app.revanced.util.copyXmlNode import app.revanced.util.patch.BaseResourcePatch @@ -111,10 +112,7 @@ object CustomBrandingIconPatch : BaseResourcePatch( Each of these folders must contain the following files: ${launcherIconResourceFileNames.joinToString("\n") { "- $it" }} - """ - .split("\n") - .joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line. - .trimIndent(), // Remove the leading newline. + """.trimIndentMultiline(), ) private val ChangeHeader by booleanPatchOption( diff --git a/src/main/kotlin/app/revanced/util/Utils.kt b/src/main/kotlin/app/revanced/util/Utils.kt new file mode 100644 index 0000000000..57f0edf03f --- /dev/null +++ b/src/main/kotlin/app/revanced/util/Utils.kt @@ -0,0 +1,8 @@ +package app.revanced.util + +internal object Utils { + internal fun String.trimIndentMultiline() = + this.split("\n") + .joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line. + .trimIndent() // Remove the leading newline. +}