chore: lint code

This commit is contained in:
inotia00 2024-10-13 22:45:01 +09:00
parent bc48f2b1a6
commit 20389d549a
12 changed files with 23 additions and 15 deletions

View File

@ -376,7 +376,9 @@ object ToolBarComponentsPatch : BaseBytecodePatch(
opcode == Opcode.INVOKE_VIRTUAL opcode == Opcode.INVOKE_VIRTUAL
&& getReference<MethodReference>()?.name == "setImageDrawable" && getReference<MethodReference>()?.name == "setImageDrawable"
}.forEach { insertIndex -> }.forEach { insertIndex ->
val (viewRegister, drawableRegister) = getInstruction<FiveRegisterInstruction>(insertIndex).let { val (viewRegister, drawableRegister) = getInstruction<FiveRegisterInstruction>(
insertIndex
).let {
Pair(it.registerC, it.registerD) Pair(it.registerC, it.registerD)
} }
replaceInstruction( replaceInstruction(

View File

@ -93,8 +93,10 @@ object PlayerFlyoutMenuPatch : BaseBytecodePatch(
// region patch for hide '1080p Premium' label // region patch for hide '1080p Premium' label
VideoQualityArrayFingerprint.resultOrThrow().mutableMethod.apply { VideoQualityArrayFingerprint.resultOrThrow().mutableMethod.apply {
val qualityLabelIndex = VideoQualityArrayFingerprint.indexOfQualityLabelInstruction(this) + 1 val qualityLabelIndex =
val qualityLabelRegister = getInstruction<OneRegisterInstruction>(qualityLabelIndex).registerA VideoQualityArrayFingerprint.indexOfQualityLabelInstruction(this) + 1
val qualityLabelRegister =
getInstruction<OneRegisterInstruction>(qualityLabelIndex).registerA
val jumpIndex = indexOfFirstInstructionReversedOrThrow(qualityLabelIndex) { val jumpIndex = indexOfFirstInstructionReversedOrThrow(qualityLabelIndex) {
opcode == Opcode.INVOKE_INTERFACE && opcode == Opcode.INVOKE_INTERFACE &&
getReference<MethodReference>()?.name == "hasNext" getReference<MethodReference>()?.name == "hasNext"

View File

@ -68,7 +68,10 @@ object ReturnYouTubeDislikeShortsPatch : BytecodePatch(
} }
if (SettingsPatch.upward1834) { if (SettingsPatch.upward1834) {
TextComponentPatch.hookSpannableString(INTEGRATIONS_RYD_CLASS_DESCRIPTOR, "onCharSequenceLoaded") TextComponentPatch.hookSpannableString(
INTEGRATIONS_RYD_CLASS_DESCRIPTOR,
"onCharSequenceLoaded"
)
} }
} }
} }

View File

@ -32,7 +32,8 @@ internal object VideoIdFingerprint : MethodFingerprint(
return@custom false return@custom false
} }
val reference = (instructions.elementAt(instructionCount - 2) as? ReferenceInstruction)?.reference.toString() val reference =
(instructions.elementAt(instructionCount - 2) as? ReferenceInstruction)?.reference.toString()
if (reference != "Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") { if (reference != "Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") {
return@custom false return@custom false
} }