mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 13:47:42 +02:00
fix(YouTube/Hide feed flyout panel): not working in some versions
This commit is contained in:
@ -9,6 +9,7 @@ import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.flyoutpanel.feed.fingerprints.BottomSheetMenuItemBuilderFingerprint
|
||||
import app.revanced.patches.youtube.flyoutpanel.feed.fingerprints.BottomSheetMenuItemBuilderLegacyFingerprint
|
||||
import app.revanced.patches.youtube.flyoutpanel.feed.fingerprints.ContextualMenuItemBuilderFingerprint
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.FLYOUT_PANEL
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
@ -60,6 +61,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
object FeedFlyoutPanelPatch : BytecodePatch(
|
||||
setOf(
|
||||
BottomSheetMenuItemBuilderFingerprint,
|
||||
BottomSheetMenuItemBuilderLegacyFingerprint,
|
||||
ContextualMenuItemBuilderFingerprint
|
||||
)
|
||||
) {
|
||||
@ -68,7 +70,11 @@ object FeedFlyoutPanelPatch : BytecodePatch(
|
||||
/**
|
||||
* Phone
|
||||
*/
|
||||
BottomSheetMenuItemBuilderFingerprint.result?.let {
|
||||
val bottomSheetMenuItemBuilderResult = BottomSheetMenuItemBuilderLegacyFingerprint.result
|
||||
?: BottomSheetMenuItemBuilderFingerprint.result
|
||||
?: throw BottomSheetMenuItemBuilderFingerprint.exception
|
||||
|
||||
bottomSheetMenuItemBuilderResult.let {
|
||||
it.mutableMethod.apply {
|
||||
val targetIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||
@ -85,7 +91,7 @@ object FeedFlyoutPanelPatch : BytecodePatch(
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: throw BottomSheetMenuItemBuilderFingerprint.exception
|
||||
}
|
||||
|
||||
/**
|
||||
* Tablet
|
||||
|
@ -5,6 +5,9 @@ import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
/**
|
||||
* Compatible with YouTube v19.11.43~
|
||||
*/
|
||||
object BottomSheetMenuItemBuilderFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
returnType = "L",
|
||||
|
@ -0,0 +1,19 @@
|
||||
package app.revanced.patches.youtube.flyoutpanel.feed.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
/**
|
||||
* Compatible with ~YouTube v19.10.39
|
||||
*/
|
||||
object BottomSheetMenuItemBuilderLegacyFingerprint : MethodFingerprint(
|
||||
returnType = "L",
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
),
|
||||
strings = listOf("ElementTransformer, ElementPresenter and InteractionLogger cannot be null")
|
||||
)
|
Reference in New Issue
Block a user