chore: lint code

This commit is contained in:
inotia00
2024-06-23 14:09:48 +09:00
parent b99c6218f7
commit 8186e9c8b2
28 changed files with 123 additions and 43 deletions

View File

@ -125,7 +125,8 @@ object PlayerButtonsPatch : BaseBytecodePatch(
TitleAnchorFingerprint.resultOrThrow().mutableMethod.apply {
val titleAnchorConstIndex = getWideLiteralInstructionIndex(TitleAnchor)
val titleAnchorIndex = getTargetIndexOrThrow(titleAnchorConstIndex, Opcode.MOVE_RESULT_OBJECT)
val titleAnchorIndex =
getTargetIndexOrThrow(titleAnchorConstIndex, Opcode.MOVE_RESULT_OBJECT)
val titleAnchorRegister =
getInstruction<OneRegisterInstruction>(titleAnchorIndex).registerA

View File

@ -203,7 +203,8 @@ object PlayerComponentsPatch : BaseBytecodePatch(
it.mutableMethod.apply {
val constIndex = getWideLiteralInstructionIndex(FadeDurationFast)
val constRegister = getInstruction<OneRegisterInstruction>(constIndex).registerA
val insertIndex = getTargetIndexReversedOrThrow(constIndex, Opcode.INVOKE_VIRTUAL) + 1
val insertIndex =
getTargetIndexReversedOrThrow(constIndex, Opcode.INVOKE_VIRTUAL) + 1
val jumpIndex = implementation!!.instructions.let { instruction ->
insertIndex + instruction.subList(insertIndex, instruction.size - 1)
.indexOfFirst { instructions ->

View File

@ -94,7 +94,8 @@ object DescriptionComponentsPatch : BaseBytecodePatch(
if (SettingsPatch.upward1902) {
TextViewComponentFingerprint.resultOrThrow().let {
it.mutableMethod.apply {
val insertIndex = getTargetIndexWithMethodReferenceNameOrThrow("setTextIsSelectable")
val insertIndex =
getTargetIndexWithMethodReferenceNameOrThrow("setTextIsSelectable")
val insertInstruction = getInstruction<FiveRegisterInstruction>(insertIndex)
replaceInstruction(

View File

@ -144,7 +144,8 @@ object ChangeTogglePatch : BaseBytecodePatch(
val checkCastIndex = getTargetIndexReversedOrThrow(stringIndex, Opcode.CHECK_CAST)
val iGetObjectPrimaryIndex =
getTargetIndexReversedOrThrow(checkCastIndex, Opcode.IGET_OBJECT)
val iGetObjectSecondaryIndex = getTargetIndexOrThrow(checkCastIndex, Opcode.IGET_OBJECT)
val iGetObjectSecondaryIndex =
getTargetIndexOrThrow(checkCastIndex, Opcode.IGET_OBJECT)
val checkCastReference =
getInstruction<ReferenceInstruction>(checkCastIndex).reference

View File

@ -182,7 +182,8 @@ object FullscreenComponentsPatch : BaseBytecodePatch(
YouTubeControlsOverlayFingerprint.resultOrThrow().let {
it.mutableMethod.apply {
val targetIndex = getTargetIndexWithMethodReferenceNameOrThrow("setFocusableInTouchMode")
val targetIndex =
getTargetIndexWithMethodReferenceNameOrThrow("setFocusableInTouchMode")
val walkerIndex = getTargetIndexOrThrow(targetIndex, Opcode.INVOKE_STATIC)
val walkerMethod = getWalkerMethod(context, walkerIndex)

View File

@ -179,7 +179,8 @@ object SpeedOverlayPatch : BytecodePatch(
) + 1
insertRegister =
getInstruction<FiveRegisterInstruction>(insertIndex - 1).registerC
jumpIndex = getTargetIndexOrThrow(speedOverlayValueIndex, Opcode.RETURN_VOID) + 1
jumpIndex =
getTargetIndexOrThrow(speedOverlayValueIndex, Opcode.RETURN_VOID) + 1
hook(insertIndex, insertRegister, jumpIndex)
}
}