chore: lint code

This commit is contained in:
inotia00 2024-07-05 15:31:48 +09:00
parent 81ba1d3dbf
commit b3aa0161c2
4 changed files with 13 additions and 6 deletions

View File

@ -194,7 +194,8 @@ object MiniplayerPatch : BaseBytecodePatch(
// endregion // endregion
val miniplayerModernViewParentClassDef = MiniplayerModernViewParentFingerprint.resultOrThrow().classDef val miniplayerModernViewParentClassDef =
MiniplayerModernViewParentFingerprint.resultOrThrow().classDef
// region Fix 19.16 using mixed up drawables for tablet modern. // region Fix 19.16 using mixed up drawables for tablet modern.
// YT fixed this mistake in 19.17. // YT fixed this mistake in 19.17.
@ -266,11 +267,13 @@ object MiniplayerPatch : BaseBytecodePatch(
) )
}.resultOrThrow().mutableMethod.apply { }.resultOrThrow().mutableMethod.apply {
addInstructionsWithLabels( addInstructionsWithLabels(
0, """ 0,
"""
invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->hideMiniplayerSubTexts(Landroid/view/View;)Z invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->hideMiniplayerSubTexts(Landroid/view/View;)Z
move-result v0 move-result v0
if-nez v0, :hidden if-nez v0, :hidden
""", ExternalLabel("hidden", getInstruction(implementation!!.instructions.lastIndex)) """,
ExternalLabel("hidden", getInstruction(implementation!!.instructions.lastIndex))
) )
} }

View File

@ -94,7 +94,8 @@ object OverlayButtonsBytecodePatch : BytecodePatch(
val moveObjectIndex = indexOfFirstInstructionOrThrow { val moveObjectIndex = indexOfFirstInstructionOrThrow {
(this as? TwoRegisterInstruction)?.registerB == registerResolver (this as? TwoRegisterInstruction)?.registerB == registerResolver
} }
val moveObjectRegister = getInstruction<TwoRegisterInstruction>(moveObjectIndex).registerA val moveObjectRegister =
getInstruction<TwoRegisterInstruction>(moveObjectIndex).registerA
invokerObjectIndex = indexOfFirstInstructionOrThrow(moveObjectIndex) { invokerObjectIndex = indexOfFirstInstructionOrThrow(moveObjectIndex) {
opcode == Opcode.IPUT_OBJECT opcode == Opcode.IPUT_OBJECT
&& getReference<FieldReference>()?.definingClass == definingClass && getReference<FieldReference>()?.definingClass == definingClass

View File

@ -5,7 +5,10 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.Patch 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.getTargetIndexOrThrow
import app.revanced.util.getWideLiteralInstructionIndex import app.revanced.util.getWideLiteralInstructionIndex
import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.Opcode

View File

@ -35,6 +35,6 @@ object LottieAnimationViewHookPatch : BytecodePatch(
?.addInstruction( ?.addInstruction(
0, 0,
setAnimationCall setAnimationCall
)?: throw PatchException("Could not find setAnimation method") ) ?: throw PatchException("Could not find setAnimation method")
} }
} }