mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-12 04:24:36 +02:00
fix(YouTube/Hide load more button): Hide load more button
hides the expand button in the channel information
This commit is contained in:
parent
8ad7f3c47d
commit
8ea39970f8
@ -5,6 +5,7 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
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.PatchException
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patches.youtube.general.loadmorebutton.fingerprints.LoadMoreButtonFingerprint
|
import app.revanced.patches.youtube.general.loadmorebutton.fingerprints.LoadMoreButtonFingerprint
|
||||||
@ -49,14 +50,21 @@ object LoadMoreButtonPatch : BytecodePatch(
|
|||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
LoadMoreButtonFingerprint.result?.let {
|
LoadMoreButtonFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
val getViewMethod =
|
||||||
val targetIndex = it.scanResult.patternScanResult!!.endIndex
|
it.mutableClass.methods.find { method ->
|
||||||
|
method.parameters.isEmpty() &&
|
||||||
|
method.returnType == "Landroid/view/View;"
|
||||||
|
}
|
||||||
|
|
||||||
|
getViewMethod?.apply {
|
||||||
|
val targetIndex = implementation!!.instructions.size - 1
|
||||||
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
targetIndex + 1,
|
targetIndex,
|
||||||
"invoke-static {v$targetRegister}, $GENERAL->hideLoadMoreButton(Landroid/view/View;)V"
|
"invoke-static {v$targetRegister}, $GENERAL->hideLoadMoreButton(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
}
|
} ?: throw PatchException("Failed to find getView method")
|
||||||
} ?: throw LoadMoreButtonFingerprint.exception
|
} ?: throw LoadMoreButtonFingerprint.exception
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user