From b3aa0161c2248215e9b3883011362d5d4023d329 Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Fri, 5 Jul 2024 15:31:48 +0900 Subject: [PATCH] chore: lint code --- .../youtube/general/miniplayer/MiniplayerPatch.kt | 9 ++++++--- .../player/overlaybuttons/OverlayButtonsBytecodePatch.kt | 3 ++- .../youtube/utils/fix/bottomui/CfBottomUIPatch.kt | 5 ++++- .../youtube/utils/lottie/LottieAnimationViewHookPatch.kt | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/miniplayer/MiniplayerPatch.kt index 309a3172e..b5a2529db 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/miniplayer/MiniplayerPatch.kt @@ -194,7 +194,8 @@ object MiniplayerPatch : BaseBytecodePatch( // endregion - val miniplayerModernViewParentClassDef = MiniplayerModernViewParentFingerprint.resultOrThrow().classDef + val miniplayerModernViewParentClassDef = + MiniplayerModernViewParentFingerprint.resultOrThrow().classDef // region Fix 19.16 using mixed up drawables for tablet modern. // YT fixed this mistake in 19.17. @@ -266,11 +267,13 @@ object MiniplayerPatch : BaseBytecodePatch( ) }.resultOrThrow().mutableMethod.apply { addInstructionsWithLabels( - 0, """ + 0, + """ invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->hideMiniplayerSubTexts(Landroid/view/View;)Z move-result v0 if-nez v0, :hidden - """, ExternalLabel("hidden", getInstruction(implementation!!.instructions.lastIndex)) + """, + ExternalLabel("hidden", getInstruction(implementation!!.instructions.lastIndex)) ) } diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/overlaybuttons/OverlayButtonsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/overlaybuttons/OverlayButtonsBytecodePatch.kt index 86bbd52fb..0ee132f45 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/overlaybuttons/OverlayButtonsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/overlaybuttons/OverlayButtonsBytecodePatch.kt @@ -94,7 +94,8 @@ object OverlayButtonsBytecodePatch : BytecodePatch( val moveObjectIndex = indexOfFirstInstructionOrThrow { (this as? TwoRegisterInstruction)?.registerB == registerResolver } - val moveObjectRegister = getInstruction(moveObjectIndex).registerA + val moveObjectRegister = + getInstruction(moveObjectIndex).registerA invokerObjectIndex = indexOfFirstInstructionOrThrow(moveObjectIndex) { opcode == Opcode.IPUT_OBJECT && getReference()?.definingClass == definingClass diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/bottomui/CfBottomUIPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/bottomui/CfBottomUIPatch.kt index ab733d352..98c9114c1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/fix/bottomui/CfBottomUIPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fix/bottomui/CfBottomUIPatch.kt @@ -5,7 +5,10 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.utils.fix.bottomui.fingerprints.* +import app.revanced.patches.youtube.utils.fix.bottomui.fingerprints.BottomUIContainerBooleanFingerprint +import app.revanced.patches.youtube.utils.fix.bottomui.fingerprints.BottomUIContainerIntegerFingerprint +import app.revanced.patches.youtube.utils.fix.bottomui.fingerprints.FullscreenButtonPositionFingerprint +import app.revanced.patches.youtube.utils.fix.bottomui.fingerprints.FullscreenButtonViewStubFingerprint import app.revanced.util.getTargetIndexOrThrow import app.revanced.util.getWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/lottie/LottieAnimationViewHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/lottie/LottieAnimationViewHookPatch.kt index ee6ae1d26..24e436f45 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/lottie/LottieAnimationViewHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/lottie/LottieAnimationViewHookPatch.kt @@ -35,6 +35,6 @@ object LottieAnimationViewHookPatch : BytecodePatch( ?.addInstruction( 0, setAnimationCall - )?: throw PatchException("Could not find setAnimation method") + ) ?: throw PatchException("Could not find setAnimation method") } } \ No newline at end of file