mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-04 08:34:27 +02:00
feat(YouTube/Hide shorts components): apply fingerprint compatible with the wider version
This commit is contained in:
parent
f50d2e7d0f
commit
3a37ce604f
@ -1,25 +1,21 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent
|
||||
package app.revanced.patches.youtube.shorts.components
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
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.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsCommentFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsDislikeFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsInfoPanelFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsLikeFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsPaidPromotionFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsPivotFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsPivotLegacyFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsRemixFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsShareFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsButtonFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsInfoPanelFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsPaidPromotionFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsPivotFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsPivotLegacyFingerprint
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
@ -86,15 +82,11 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@Suppress("unused")
|
||||
object ShortsComponentPatch : BytecodePatch(
|
||||
setOf(
|
||||
ShortsCommentFingerprint,
|
||||
ShortsDislikeFingerprint,
|
||||
ShortsButtonFingerprint,
|
||||
ShortsInfoPanelFingerprint,
|
||||
ShortsLikeFingerprint,
|
||||
ShortsPaidPromotionFingerprint,
|
||||
ShortsPivotFingerprint,
|
||||
ShortsPivotLegacyFingerprint,
|
||||
ShortsRemixFingerprint,
|
||||
ShortsShareFingerprint,
|
||||
ShortsPivotLegacyFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
@ -102,59 +94,41 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
/**
|
||||
* Comment button
|
||||
*/
|
||||
ShortsCommentFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = getWideLiteralInstructionIndex(RightComment) + 3
|
||||
|
||||
hideButton(insertIndex, 1, "hideShortsPlayerCommentsButton")
|
||||
}
|
||||
} ?: throw ShortsCommentFingerprint.exception
|
||||
ShortsButtonFingerprint.hideButton(RightComment, "hideShortsPlayerCommentsButton", false)
|
||||
|
||||
/**
|
||||
* Dislike button
|
||||
*/
|
||||
ShortsDislikeFingerprint.result?.let {
|
||||
ShortsButtonFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = getWideLiteralInstructionIndex(ReelRightDislikeIcon)
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
val constIndex = getWideLiteralInstructionIndex(ReelRightDislikeIcon)
|
||||
val constRegister = getInstruction<OneRegisterInstruction>(constIndex).registerA
|
||||
|
||||
val jumpIndex = getTargetIndex(insertIndex, Opcode.CONST_CLASS) + 2
|
||||
val jumpIndex = getTargetIndex(constIndex, Opcode.CONST_CLASS) + 2
|
||||
|
||||
addInstructionsWithLabels(
|
||||
insertIndex + 1, """
|
||||
constIndex + 1, """
|
||||
invoke-static {}, $SHORTS->hideShortsPlayerDislikeButton()Z
|
||||
move-result v$insertRegister
|
||||
if-nez v$insertRegister, :hide
|
||||
const v$insertRegister, $ReelRightDislikeIcon
|
||||
move-result v$constRegister
|
||||
if-nez v$constRegister, :hide
|
||||
const v$constRegister, $ReelRightDislikeIcon
|
||||
""", ExternalLabel("hide", getInstruction(jumpIndex))
|
||||
)
|
||||
}
|
||||
} ?: throw ShortsDislikeFingerprint.exception
|
||||
} ?: throw ShortsButtonFingerprint.exception
|
||||
|
||||
/**
|
||||
* Info panel
|
||||
*/
|
||||
ShortsInfoPanelFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = getWideLiteralInstructionIndex(ReelPlayerInfoPanel) + 3
|
||||
|
||||
hideButtons(
|
||||
insertIndex,
|
||||
1,
|
||||
"hideShortsPlayerInfoPanel(Landroid/view/ViewGroup;)Landroid/view/ViewGroup;"
|
||||
)
|
||||
}
|
||||
} ?: throw ShortsInfoPanelFingerprint.exception
|
||||
ShortsInfoPanelFingerprint.hideButtons(ReelPlayerInfoPanel, "hideShortsPlayerInfoPanel(Landroid/view/ViewGroup;)Landroid/view/ViewGroup;")
|
||||
|
||||
/**
|
||||
* Like button
|
||||
*/
|
||||
ShortsLikeFingerprint.result?.let {
|
||||
ShortsButtonFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = getWideLiteralInstructionIndex(ReelRightLikeIcon)
|
||||
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
val jumpIndex = getTargetIndex(insertIndex, Opcode.CONST_CLASS) + 2
|
||||
|
||||
addInstructionsWithLabels(
|
||||
@ -166,41 +140,13 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
""", ExternalLabel("hide", getInstruction(jumpIndex))
|
||||
)
|
||||
}
|
||||
} ?: throw ShortsLikeFingerprint.exception
|
||||
} ?: throw ShortsButtonFingerprint.exception
|
||||
|
||||
/**
|
||||
* Paid promotion
|
||||
*/
|
||||
ShortsPaidPromotionFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val primaryIndex = getWideLiteralInstructionIndex(ReelPlayerBadge) + 3
|
||||
val secondaryIndex = getWideLiteralInstructionIndex(ReelPlayerBadge2) + 3
|
||||
|
||||
if (primaryIndex > secondaryIndex) {
|
||||
hideButtons(
|
||||
primaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
hideButtons(
|
||||
secondaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
} else {
|
||||
hideButtons(
|
||||
secondaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
hideButtons(
|
||||
primaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
}
|
||||
}
|
||||
} ?: throw ShortsPaidPromotionFingerprint.exception
|
||||
ShortsPaidPromotionFingerprint.hideButtons(ReelPlayerBadge, "hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;")
|
||||
ShortsPaidPromotionFingerprint.hideButtons(ReelPlayerBadge2, "hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;")
|
||||
|
||||
/**
|
||||
* Pivot button
|
||||
@ -224,37 +170,21 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
} ?: ShortsPivotFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val targetIndex = getWideLiteralInstructionIndex(ReelPivotButton)
|
||||
val insertIndex = getTargetIndexReversed(targetIndex, Opcode.INVOKE_STATIC) + 2
|
||||
val insertIndex = getTargetIndexReversed(targetIndex, Opcode.INVOKE_STATIC) + 1
|
||||
|
||||
hideButtons(
|
||||
insertIndex,
|
||||
0,
|
||||
"hideShortsPlayerPivotButton(Ljava/lang/Object;)Ljava/lang/Object;"
|
||||
)
|
||||
hideButtons(insertIndex, "hideShortsPlayerPivotButton(Ljava/lang/Object;)Ljava/lang/Object;")
|
||||
}
|
||||
} ?: throw ShortsPivotFingerprint.exception
|
||||
|
||||
/**
|
||||
* Remix button
|
||||
*/
|
||||
ShortsRemixFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = getWideLiteralInstructionIndex(ReelDynRemix) - 2
|
||||
|
||||
hideButton(insertIndex, 0, "hideShortsPlayerRemixButton")
|
||||
}
|
||||
} ?: throw ShortsRemixFingerprint.exception
|
||||
ShortsButtonFingerprint.hideButton(ReelDynRemix, "hideShortsPlayerRemixButton", true)
|
||||
|
||||
/**
|
||||
* Share button
|
||||
*/
|
||||
ShortsShareFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = getWideLiteralInstructionIndex(ReelDynShare) - 2
|
||||
|
||||
hideButton(insertIndex, 0, "hideShortsPlayerShareButton")
|
||||
}
|
||||
} ?: throw ShortsShareFingerprint.exception
|
||||
ShortsButtonFingerprint.hideButton(ReelDynShare, "hideShortsPlayerShareButton", true)
|
||||
|
||||
LithoFilterPatch.addFilter("$COMPONENTS_PATH/ShortsFilter;")
|
||||
|
||||
@ -274,28 +204,50 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
|
||||
}
|
||||
|
||||
private fun MutableMethod.hideButton(
|
||||
insertIndex: Int,
|
||||
offset: Int,
|
||||
private fun MethodFingerprint.hideButton(
|
||||
id: Long,
|
||||
descriptor: String,
|
||||
reversed: Boolean
|
||||
) {
|
||||
result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val constIndex = getWideLiteralInstructionIndex(id)
|
||||
val insertIndex = if (reversed)
|
||||
getTargetIndexReversed(constIndex, Opcode.CHECK_CAST)
|
||||
else
|
||||
getTargetIndex(constIndex, Opcode.CHECK_CAST)
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
addInstruction(
|
||||
insertIndex,
|
||||
"invoke-static {v$insertRegister}, $SHORTS->$descriptor(Landroid/view/View;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw exception
|
||||
}
|
||||
|
||||
private fun MethodFingerprint.hideButtons(
|
||||
id: Long,
|
||||
descriptor: String
|
||||
) {
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val constIndex = getWideLiteralInstructionIndex(id)
|
||||
val insertIndex = getTargetIndex(constIndex, Opcode.CHECK_CAST)
|
||||
|
||||
addInstruction(
|
||||
insertIndex + offset,
|
||||
"invoke-static {v$insertRegister}, $SHORTS->$descriptor(Landroid/view/View;)V"
|
||||
)
|
||||
hideButtons(insertIndex, descriptor)
|
||||
}
|
||||
} ?: throw exception
|
||||
}
|
||||
|
||||
private fun MutableMethod.hideButtons(
|
||||
insertIndex: Int,
|
||||
offset: Int,
|
||||
descriptor: String
|
||||
) {
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
addInstructions(
|
||||
insertIndex + offset, """
|
||||
insertIndex + 1, """
|
||||
invoke-static {v$insertRegister}, $SHORTS->$descriptor
|
||||
move-result-object v$insertRegister
|
||||
"""
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent
|
||||
package app.revanced.patches.youtube.shorts.components
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
@ -6,19 +6,17 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.BottomNavigationBarAlternativeFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.BottomNavigationBarFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.RenderBottomNavigationBarFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.SetPivotBarFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.BottomNavigationBarFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.RenderBottomNavigationBarFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.SetPivotBarFingerprint
|
||||
import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import app.revanced.util.getTargetIndexWithMethodReferenceName
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
object ShortsNavigationBarPatch : BytecodePatch(
|
||||
setOf(
|
||||
BottomNavigationBarAlternativeFingerprint,
|
||||
BottomNavigationBarFingerprint,
|
||||
PivotBarCreateButtonViewFingerprint,
|
||||
RenderBottomNavigationBarFingerprint
|
||||
@ -41,42 +39,24 @@ object ShortsNavigationBarPatch : BytecodePatch(
|
||||
} ?: throw PivotBarCreateButtonViewFingerprint.exception
|
||||
|
||||
RenderBottomNavigationBarFingerprint.result?.let {
|
||||
(context
|
||||
val targetMethod = context
|
||||
.toMethodWalker(it.method)
|
||||
.nextMethod(it.scanResult.patternScanResult!!.endIndex, true)
|
||||
.nextMethod(it.scanResult.patternScanResult!!.startIndex + 1, true)
|
||||
.getMethod() as MutableMethod
|
||||
).apply {
|
||||
addInstruction(
|
||||
0,
|
||||
"invoke-static {}, $SHORTS->hideShortsPlayerNavigationBar()V"
|
||||
)
|
||||
}
|
||||
|
||||
targetMethod.addInstruction(
|
||||
0,
|
||||
"invoke-static {}, $SHORTS->hideShortsPlayerNavigationBar()V"
|
||||
)
|
||||
} ?: throw RenderBottomNavigationBarFingerprint.exception
|
||||
|
||||
BottomNavigationBarFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
val targetIndex = getTargetIndexWithMethodReferenceName("findViewById") + 1
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||
|
||||
addInstructions(
|
||||
insertIndex, """
|
||||
invoke-static {v$insertRegister}, $SHORTS->hideShortsPlayerNavigationBar(Landroid/view/View;)Landroid/view/View;
|
||||
move-result-object v$insertRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: BottomNavigationBarAlternativeFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val targetIndex = it.scanResult.patternScanResult!!.endIndex + 3
|
||||
val insertIndex =
|
||||
if (getInstruction(targetIndex).opcode == Opcode.IF_EQZ)
|
||||
targetIndex
|
||||
else
|
||||
targetIndex + 1
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
addInstructions(
|
||||
insertIndex, """
|
||||
targetIndex + 1, """
|
||||
invoke-static {v$insertRegister}, $SHORTS->hideShortsPlayerNavigationBar(Landroid/view/View;)Landroid/view/View;
|
||||
move-result-object v$insertRegister
|
||||
"""
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent
|
||||
package app.revanced.patches.youtube.shorts.components
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
@ -6,9 +6,9 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsSubscriptionsFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsSubscriptionsTabletFingerprint
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ShortsSubscriptionsTabletParentFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsSubscriptionsFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsSubscriptionsTabletFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsSubscriptionsTabletParentFingerprint
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerFooter
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerPausedStateButton
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent
|
||||
package app.revanced.patches.youtube.shorts.components
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
@ -7,7 +7,7 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.shorts.shortscomponent.fingerprints.ToolBarBannerFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ToolBarBannerFingerprint
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS
|
||||
import app.revanced.patches.youtube.utils.toolbar.ToolBarHookPatch
|
||||
import app.revanced.util.exception
|
@ -1,19 +1,12 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object BottomNavigationBarAlternativeFingerprint : MethodFingerprint(
|
||||
object BottomNavigationBarFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"),
|
||||
opcodes = listOf(
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
),
|
||||
strings = listOf("r_pfvc", "ReelWatchPaneFragmentViewModelKey")
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
@ -6,10 +6,11 @@ import com.android.tools.smali.dexlib2.Opcode
|
||||
object RenderBottomNavigationBarFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
opcodes = listOf(
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CONST_STRING,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ
|
||||
),
|
||||
strings = listOf("r_as")
|
||||
strings = listOf("r_ipl")
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
@ -0,0 +1,20 @@
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynRemix
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynShare
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelRightDislikeIcon
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelRightLikeIcon
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.RightComment
|
||||
import app.revanced.util.containsWideLiteralInstructionIndex
|
||||
|
||||
object ShortsButtonFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.containsWideLiteralInstructionIndex(ReelDynRemix)
|
||||
&& methodDef.containsWideLiteralInstructionIndex(ReelDynShare)
|
||||
&& methodDef.containsWideLiteralInstructionIndex(ReelRightDislikeIcon)
|
||||
&& methodDef.containsWideLiteralInstructionIndex(ReelRightLikeIcon)
|
||||
&& methodDef.containsWideLiteralInstructionIndex(RightComment)
|
||||
},
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerInfoPanel
|
@ -0,0 +1,17 @@
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerBadge
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerBadge2
|
||||
import app.revanced.util.containsWideLiteralInstructionIndex
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsPaidPromotionFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.containsWideLiteralInstructionIndex(ReelPlayerBadge)
|
||||
&& methodDef.containsWideLiteralInstructionIndex(ReelPlayerBadge2)
|
||||
},
|
||||
)
|
@ -1,13 +1,9 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPivotButton
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsPivotFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
parameters = listOf("Z", "Z", "L"),
|
||||
literalSupplier = { ReelPivotButton }
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelForcedMuteButton
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerPausedStateButton
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerFooter
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
@ -1,18 +0,0 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object BottomNavigationBarFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
opcodes = listOf(
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IF_EQZ
|
||||
),
|
||||
strings = listOf("r_pfvc", "navigation_endpoint_interaction_logging_extension")
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.RightComment
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsCommentFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
parameters = listOf("Z", "Z", "L"),
|
||||
literalSupplier = { RightComment }
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelRightDislikeIcon
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsDislikeFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
parameters = listOf("Z", "Z", "L"),
|
||||
literalSupplier = { ReelRightDislikeIcon }
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelRightLikeIcon
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsLikeFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
parameters = listOf("Z", "Z", "L"),
|
||||
literalSupplier = { ReelRightLikeIcon }
|
||||
)
|
@ -1,12 +0,0 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelPlayerBadge
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsPaidPromotionFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
literalSupplier = { ReelPlayerBadge }
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynRemix
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsRemixFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
parameters = listOf("Z", "Z", "L"),
|
||||
literalSupplier = { ReelDynRemix }
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
package app.revanced.patches.youtube.shorts.shortscomponent.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynShare
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object ShortsShareFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
parameters = listOf("Z", "Z", "L"),
|
||||
literalSupplier = { ReelDynShare }
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user