Skip to content

Commit

Permalink
chore: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Jun 10, 2024
1 parent b9ef6ea commit e277843
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/app/revanced/util/Utils.kt
Original file line number Diff line number Diff line change
@@ -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.
}

0 comments on commit e277843

Please sign in to comment.