chore: lint code

This commit is contained in:
inotia00
2024-06-11 02:45:13 +09:00
parent b9ef6ea3bf
commit e277843885
4 changed files with 16 additions and 12 deletions

View File

@ -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.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.util.ResourceGroup import app.revanced.util.ResourceGroup
import app.revanced.util.Utils.trimIndentMultiline
import app.revanced.util.copyResources import app.revanced.util.copyResources
import app.revanced.util.patch.BaseResourcePatch import app.revanced.util.patch.BaseResourcePatch
import java.io.File import java.io.File
@ -107,10 +108,7 @@ object CustomBrandingIconPatch : BaseResourcePatch(
Each of these folders must contain the following files: Each of these folders must contain the following files:
${launcherIconResourceFileNames.joinToString("\n") { "- $it" }} ${launcherIconResourceFileNames.joinToString("\n") { "- $it" }}
""" """.trimIndentMultiline(),
.split("\n")
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
.trimIndent(), // Remove the leading newline.
) )
private val ChangeHeader by booleanPatchOption( private val ChangeHeader by booleanPatchOption(

View File

@ -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.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.reference.Reference 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." + * 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." * 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( abstract class BaseOpusCodecsPatch(
private val descriptor: String private val descriptor: String
) : BytecodePatch( ) : BytecodePatch(

View File

@ -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.ResourceUtils.updatePatchStatusIcon
import app.revanced.patches.youtube.utils.settings.SettingsPatch import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.ResourceGroup import app.revanced.util.ResourceGroup
import app.revanced.util.Utils.trimIndentMultiline
import app.revanced.util.copyResources import app.revanced.util.copyResources
import app.revanced.util.copyXmlNode import app.revanced.util.copyXmlNode
import app.revanced.util.patch.BaseResourcePatch import app.revanced.util.patch.BaseResourcePatch
@ -111,10 +112,7 @@ object CustomBrandingIconPatch : BaseResourcePatch(
Each of these folders must contain the following files: Each of these folders must contain the following files:
${launcherIconResourceFileNames.joinToString("\n") { "- $it" }} ${launcherIconResourceFileNames.joinToString("\n") { "- $it" }}
""" """.trimIndentMultiline(),
.split("\n")
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
.trimIndent(), // Remove the leading newline.
) )
private val ChangeHeader by booleanPatchOption( private val ChangeHeader by booleanPatchOption(

View File

@ -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.
}