mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-26 17:07:34 +01:00
build(revanced-patcher): bump version
This commit is contained in:
parent
f5224c4980
commit
144ae5a787
@ -27,7 +27,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("app.revanced:revanced-patcher:10.0.0")
|
implementation("app.revanced:revanced-patcher:11.0.0")
|
||||||
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
|
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
|
||||||
// Required for meta
|
// Required for meta
|
||||||
implementation("com.google.code.gson:gson:2.10.1")
|
implementation("com.google.code.gson:gson:2.10.1")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package app.revanced.extensions
|
package app.revanced.extensions
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -28,8 +28,8 @@ class ProUnlockPatch : BytecodePatch(
|
|||||||
val registerIndex = result.scanResult.patternScanResult!!.endIndex - 1
|
val registerIndex = result.scanResult.patternScanResult!!.endIndex - 1
|
||||||
|
|
||||||
result.mutableMethod.apply {
|
result.mutableMethod.apply {
|
||||||
val register = instruction<OneRegisterInstruction>(registerIndex).registerA
|
val register = getInstruction<OneRegisterInstruction>(registerIndex).registerA
|
||||||
addInstructions(
|
addInstruction(
|
||||||
result.scanResult.patternScanResult!!.endIndex,
|
result.scanResult.patternScanResult!!.endIndex,
|
||||||
"""
|
"""
|
||||||
const/4 v$register, 0x1
|
const/4 v$register, 0x1
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -22,15 +22,13 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
listOf(IsPremiumPurchasedFingerprint)
|
listOf(IsPremiumPurchasedFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
IsPremiumPurchasedFingerprint.result?.let {
|
IsPremiumPurchasedFingerprint.result?.mutableMethod?.addInstructions(
|
||||||
it.mutableMethod.addInstructions(
|
0,
|
||||||
0,
|
"""
|
||||||
"""
|
const/4 v0, 0x1
|
||||||
const/4 v0, 0x1
|
return v0
|
||||||
return v0
|
"""
|
||||||
"""
|
) ?: return IsPremiumPurchasedFingerprint.toErrorResult()
|
||||||
)
|
|
||||||
} ?: return IsPremiumPurchasedFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,14 @@ package app.revanced.patches.citra.misc.premium.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.citra.misc.premium.annotations.PremiumUnlockCompatbility
|
import app.revanced.patches.citra.misc.premium.annotations.PremiumUnlockCompatbility
|
||||||
import app.revanced.patches.citra.misc.premium.fingerprints.PremiumUnlockFingerprint
|
import app.revanced.patches.citra.misc.premium.fingerprints.PremiumUnlockFingerprint
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,8 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package app.revanced.patches.idaustria.detection.root.patch
|
package app.revanced.patches.idaustria.detection.root.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -19,7 +21,7 @@ class RootDetectionPatch : BytecodePatch(
|
|||||||
listOf(RootDetectionFingerprint)
|
listOf(RootDetectionFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
RootDetectionFingerprint.result!!.mutableMethod.addInstructions(0, "return-void")
|
RootDetectionFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package app.revanced.patches.idaustria.detection.signature.patch
|
package app.revanced.patches.idaustria.detection.signature.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -3,9 +3,9 @@ package app.revanced.patches.instagram.patches.ads.timeline.patch
|
|||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -55,8 +55,8 @@ class HideTimelineAdsPatch : BytecodePatch(
|
|||||||
val scanStart = scanResult.patternScanResult!!.startIndex
|
val scanStart = scanResult.patternScanResult!!.startIndex
|
||||||
val jumpIndex = scanStart - 1
|
val jumpIndex = scanStart - 1
|
||||||
|
|
||||||
val mediaInstanceRegister = mutableMethod.instruction<FiveRegisterInstruction>(scanStart).registerC
|
val mediaInstanceRegister = mutableMethod.getInstruction<FiveRegisterInstruction>(scanStart).registerC
|
||||||
val freeRegister = mutableMethod.instruction<OneRegisterInstruction>(jumpIndex).registerA
|
val freeRegister = mutableMethod.getInstruction<OneRegisterInstruction>(jumpIndex).registerA
|
||||||
|
|
||||||
val returnFalseLabel = "an_ad"
|
val returnFalseLabel = "an_ad"
|
||||||
|
|
||||||
@ -77,14 +77,12 @@ class HideTimelineAdsPatch : BytecodePatch(
|
|||||||
|
|
||||||
val insertIndex = scanStart + 3
|
val insertIndex = scanStart + 3
|
||||||
|
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructionsWithLabels(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
checkForAdInstructions,
|
checkForAdInstructions,
|
||||||
listOf(
|
ExternalLabel(
|
||||||
ExternalLabel(
|
returnFalseLabel,
|
||||||
returnFalseLabel,
|
mutableMethod.getInstruction(mutableMethod.implementation!!.instructions.size - 2 /* return false = ad */)
|
||||||
mutableMethod.instruction(mutableMethod.implementation!!.instructions.size - 2 /* return false = ad */)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -93,10 +91,10 @@ class HideTimelineAdsPatch : BytecodePatch(
|
|||||||
// region Jump to checks for ads from previous patch.
|
// region Jump to checks for ads from previous patch.
|
||||||
|
|
||||||
mutableMethod.apply {
|
mutableMethod.apply {
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
jumpIndex + 1,
|
jumpIndex + 1,
|
||||||
"if-nez v$freeRegister, :start_check",
|
"if-nez v$freeRegister, :start_check",
|
||||||
listOf(ExternalLabel("start_check", instruction(insertIndex)))
|
ExternalLabel("start_check", getInstruction(insertIndex))
|
||||||
)
|
)
|
||||||
}.removeInstruction(jumpIndex)
|
}.removeInstruction(jumpIndex)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.extensions.toErrorResult
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.extensions.toErrorResult
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -3,7 +3,7 @@ package app.revanced.patches.messenger.ads.inbox.patch
|
|||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -3,8 +3,8 @@ package app.revanced.patches.messenger.inputfield.patch
|
|||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -23,7 +23,7 @@ class DisableSwitchingEmojiToStickerInMessageInputField : BytecodePatch(listOf(S
|
|||||||
val setStringIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
val setStringIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
||||||
|
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val targetRegister = instruction<OneRegisterInstruction>(setStringIndex).registerA
|
val targetRegister = getInstruction<OneRegisterInstruction>(setStringIndex).registerA
|
||||||
|
|
||||||
replaceInstruction(
|
replaceInstruction(
|
||||||
setStringIndex,
|
setStringIndex,
|
||||||
|
@ -7,7 +7,7 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -24,10 +24,9 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
UnlockProFingerprint.result!!.mutableMethod.addInstructions(
|
UnlockProFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
return v0
|
"""
|
||||||
"""
|
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -29,8 +29,9 @@ class MusicVideoAdsPatch : BytecodePatch(
|
|||||||
|
|
||||||
val result = ShowMusicVideoAdsFingerprint.result!!
|
val result = ShowMusicVideoAdsFingerprint.result!!
|
||||||
|
|
||||||
result.mutableMethod.addInstructions(
|
result.mutableMethod.addInstruction(
|
||||||
result.scanResult.patternScanResult!!.startIndex, """
|
result.scanResult.patternScanResult!!.startIndex,
|
||||||
|
"""
|
||||||
const/4 p1, 0x0
|
const/4 p1, 0x0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -23,10 +23,11 @@ class MinimizedPlaybackPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
|
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstruction(
|
||||||
0, """
|
0,
|
||||||
|
"""
|
||||||
return-void
|
return-void
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -40,10 +40,11 @@ class HideGetPremiumPatch : BytecodePatch(
|
|||||||
|
|
||||||
val result = HideGetPremiumFingerprint.result!!
|
val result = HideGetPremiumFingerprint.result!!
|
||||||
val method = result.mutableMethod
|
val method = result.mutableMethod
|
||||||
method.addInstructions(
|
method.addInstruction(
|
||||||
startIndex, """
|
startIndex,
|
||||||
const/16 v0, 0x8
|
"""
|
||||||
"""
|
const/16 v0, 0x8
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -30,7 +30,8 @@ class RemoveTasteBuilderPatch : BytecodePatch(
|
|||||||
val insertIndex = result.scanResult.patternScanResult!!.endIndex - 8
|
val insertIndex = result.scanResult.patternScanResult!!.endIndex - 8
|
||||||
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
insertIndex, """
|
insertIndex,
|
||||||
|
"""
|
||||||
const/16 v1, 0x8
|
const/16 v1, 0x8
|
||||||
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
||||||
"""
|
"""
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,8 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -43,7 +43,7 @@ class UnlockPrimePatch : BytecodePatch(
|
|||||||
const/16 v$primeStatusRegister, $PRIME_STATUS
|
const/16 v$primeStatusRegister, $PRIME_STATUS
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: UnlockPrimeFingerprint.toErrorResult()
|
} ?: return UnlockPrimeFingerprint.toErrorResult()
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.extensions.toErrorResult
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -21,7 +21,7 @@ class SignatureDetectionPatch : BytecodePatch(
|
|||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
CheckSignatureFingerprint.result?.apply {
|
CheckSignatureFingerprint.result?.apply {
|
||||||
val signatureCheckInstruction = mutableMethod.instruction(scanResult.patternScanResult!!.endIndex)
|
val signatureCheckInstruction = mutableMethod.getInstruction(scanResult.patternScanResult!!.endIndex)
|
||||||
val checkRegister = (signatureCheckInstruction as OneRegisterInstruction).registerA
|
val checkRegister = (signatureCheckInstruction as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
mutableMethod.replaceInstruction(signatureCheckInstruction.location.index, "const/4 v$checkRegister, 0x1")
|
mutableMethod.replaceInstruction(signatureCheckInstruction.location.index, "const/4 v$checkRegister, 0x1")
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -31,9 +31,9 @@ class UnlockPlusPatch : BytecodePatch(
|
|||||||
addInstructions(
|
addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return IsPlusUnlockedFingerprint.toErrorResult()
|
} ?: return IsPlusUnlockedFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -29,7 +29,7 @@ class SanitizeUrlQueryPatch : BytecodePatch(
|
|||||||
ShareLinkFactoryFingerprint.result?.let { result ->
|
ShareLinkFactoryFingerprint.result?.let { result ->
|
||||||
result.mutableMethod.apply {
|
result.mutableMethod.apply {
|
||||||
val insertIndex = result.scanResult.patternScanResult!!.endIndex + 1
|
val insertIndex = result.scanResult.patternScanResult!!.endIndex + 1
|
||||||
val urlRegister = instruction<OneRegisterInstruction>(insertIndex - 1).registerA
|
val urlRegister = getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package app.revanced.patches.scbeasy.detection.debugging.patch
|
package app.revanced.patches.scbeasy.detection.debugging.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -19,7 +21,7 @@ class RemoveDebuggingDetectionPatch : BytecodePatch(
|
|||||||
listOf(DebuggingDetectionFingerprint)
|
listOf(DebuggingDetectionFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructions(
|
DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, 0x0
|
const/4 v0, 0x0
|
||||||
|
@ -3,7 +3,7 @@ package app.revanced.patches.shared.integrations.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.extensions.toErrorResult
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -23,7 +23,7 @@ class VerticalScrollPatch : BytecodePatch(
|
|||||||
CanScrollVerticallyFingerprint.result?.let {
|
CanScrollVerticallyFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val moveResultIndex = it.scanResult.patternScanResult!!.endIndex
|
val moveResultIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val moveResultRegister = instruction<OneRegisterInstruction>(moveResultIndex).registerA
|
val moveResultRegister = getInstruction<OneRegisterInstruction>(moveResultIndex).registerA
|
||||||
|
|
||||||
val insertIndex = moveResultIndex + 1
|
val insertIndex = moveResultIndex + 1
|
||||||
addInstruction(
|
addInstruction(
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.extensions.toErrorResult
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -15,11 +15,11 @@ import app.revanced.patches.syncforreddit.detection.piracy.fingerprints.PiracyDe
|
|||||||
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
||||||
addInstructions(
|
addInstruction(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
return-void
|
return-void
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return PiracyDetectionFingerprint.toErrorResult()
|
} ?: return PiracyDetectionFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,10 +5,11 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.toMethodWalker
|
import app.revanced.patcher.data.toMethodWalker
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.replaceInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
@ -63,7 +64,7 @@ class DownloadsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
//Download videos without watermark.
|
//Download videos without watermark.
|
||||||
val method3 = ACLCommonShareFingerprint3.result!!.mutableMethod
|
val method3 = ACLCommonShareFingerprint3.result!!.mutableMethod
|
||||||
method3.addInstructions(
|
method3.addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->shouldRemoveWatermark()Z
|
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->shouldRemoveWatermark()Z
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.toMethodWalker
|
import app.revanced.patcher.data.toMethodWalker
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -5,9 +5,9 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
@ -45,7 +45,7 @@ class SettingsPatch : BytecodePatch(
|
|||||||
// Find the indices that need to be patched.
|
// Find the indices that need to be patched.
|
||||||
val copyrightPolicyLabelId = AboutPageFingerprint.result?.let {
|
val copyrightPolicyLabelId = AboutPageFingerprint.result?.let {
|
||||||
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
it.mutableMethod.instruction<WideLiteralInstruction>(startIndex).wideLiteral
|
it.mutableMethod.getInstruction<WideLiteralInstruction>(startIndex).wideLiteral
|
||||||
} ?: return AboutPageFingerprint.toErrorResult()
|
} ?: return AboutPageFingerprint.toErrorResult()
|
||||||
|
|
||||||
val copyrightIndex = instructions.indexOfFirst {
|
val copyrightIndex = instructions.indexOfFirst {
|
||||||
@ -62,7 +62,7 @@ class SettingsPatch : BytecodePatch(
|
|||||||
copyrightIndex,
|
copyrightIndex,
|
||||||
copyrightPolicyIndex
|
copyrightPolicyIndex
|
||||||
).forEach { index ->
|
).forEach { index ->
|
||||||
val instruction = instruction(index)
|
val instruction = getInstruction(index)
|
||||||
if (instruction.opcode != Opcode.MOVE_RESULT_OBJECT)
|
if (instruction.opcode != Opcode.MOVE_RESULT_OBJECT)
|
||||||
return PatchResultError("Hardcoded offset changed.")
|
return PatchResultError("Hardcoded offset changed.")
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class SettingsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Replace the OnClickListener class with a custom one.
|
// Replace the OnClickListener class with a custom one.
|
||||||
val onClickListener = instruction<ReferenceInstruction>(index + 4).reference.toString()
|
val onClickListener = getInstruction<ReferenceInstruction>(index + 4).reference.toString()
|
||||||
|
|
||||||
context.findClass(onClickListener)?.mutableClass?.methods?.first {
|
context.findClass(onClickListener)?.mutableClass?.methods?.first {
|
||||||
it.name == "onClick"
|
it.name == "onClick"
|
||||||
@ -98,7 +98,7 @@ class SettingsPatch : BytecodePatch(
|
|||||||
it.opcode == Opcode.INVOKE_SUPER
|
it.opcode == Opcode.INVOKE_SUPER
|
||||||
} + 1
|
} + 1
|
||||||
|
|
||||||
val thisRegister = instruction<FiveRegisterInstruction>(initializeSettingsIndex - 1).registerC
|
val thisRegister = getInstruction<FiveRegisterInstruction>(initializeSettingsIndex - 1).registerC
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
initializeSettingsIndex,
|
initializeSettingsIndex,
|
||||||
|
@ -5,9 +5,9 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -97,14 +97,14 @@ class SpoofSimPatch : BytecodePatch() {
|
|||||||
|
|
||||||
// Patch Android API and return fake sim information
|
// Patch Android API and return fake sim information
|
||||||
private fun MutableMethod.replaceReference(index: Int, replacement: String) {
|
private fun MutableMethod.replaceReference(index: Int, replacement: String) {
|
||||||
val resultReg = instruction<OneRegisterInstruction>(index + 1).registerA
|
val resultReg = getInstruction<OneRegisterInstruction>(index + 1).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
index + 2,
|
index + 2,
|
||||||
"""
|
"""
|
||||||
invoke-static {v$resultReg}, Lapp/revanced/tiktok/spoof/sim/SpoofSimPatch;->$replacement(Ljava/lang/String;)Ljava/lang/String;
|
invoke-static {v$resultReg}, Lapp/revanced/tiktok/spoof/sim/SpoofSimPatch;->$replacement(Ljava/lang/String;)Ljava/lang/String;
|
||||||
move-result-object v$resultReg
|
move-result-object v$resultReg
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
@ -3,8 +3,8 @@ package app.revanced.patches.twelvewidgets.unlock.patch
|
|||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -40,11 +40,12 @@ class UnlockPaidWidgetsPatch : BytecodePatch(
|
|||||||
method.apply {
|
method.apply {
|
||||||
removeInstructions(4, 3)
|
removeInstructions(4, 3)
|
||||||
addInstructions(
|
addInstructions(
|
||||||
implementation?.instructions?.size!!, """
|
implementation?.instructions?.size!!,
|
||||||
const/4 v1, 0x0
|
"""
|
||||||
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
|
const/4 v1, 0x0
|
||||||
return-object v0
|
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
|
||||||
"""
|
return-object v0
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -31,7 +31,7 @@ class AudioAdsPatch : BytecodePatch(
|
|||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
// Block playAds call
|
// Block playAds call
|
||||||
with(AudioAdsPresenterPlayFingerprint.result!!) {
|
with(AudioAdsPresenterPlayFingerprint.result!!) {
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
invoke-static { }, Lapp/revanced/twitch/patches/AudioAdsPatch;->shouldBlockAudioAds()Z
|
invoke-static { }, Lapp/revanced/twitch/patches/AudioAdsPatch;->shouldBlockAudioAds()Z
|
||||||
@ -39,7 +39,7 @@ class AudioAdsPatch : BytecodePatch(
|
|||||||
if-eqz v0, :show_audio_ads
|
if-eqz v0, :show_audio_ads
|
||||||
return-void
|
return-void
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel("show_audio_ads", mutableMethod.instruction(0)))
|
ExternalLabel("show_audio_ads", mutableMethod.getInstruction(0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.ad.shared.util
|
package app.revanced.patches.twitch.ad.shared.util
|
||||||
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
@ -27,7 +27,7 @@ abstract class AbstractAdPatch(
|
|||||||
this ?: return false
|
this ?: return false
|
||||||
|
|
||||||
this.methods.filter { methodNames.contains(it.name) }.forEach {
|
this.methods.filter { methodNames.contains(it.name) }.forEach {
|
||||||
val retIntructions = when(returnMethod.returnType) {
|
val retInstruction = when (returnMethod.returnType) {
|
||||||
'V' -> "return-void"
|
'V' -> "return-void"
|
||||||
'Z' -> """
|
'Z' -> """
|
||||||
const/4 v0, ${returnMethod.value}
|
const/4 v0, ${returnMethod.value}
|
||||||
@ -35,13 +35,13 @@ abstract class AbstractAdPatch(
|
|||||||
"""
|
"""
|
||||||
else -> throw NotImplementedError()
|
else -> throw NotImplementedError()
|
||||||
}
|
}
|
||||||
it.addInstructions(
|
it.addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
${createConditionInstructions("v0")}
|
${createConditionInstructions("v0")}
|
||||||
$retIntructions
|
$retInstruction
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel(skipLabelName, it.instruction(0)))
|
ExternalLabel(skipLabelName, it.getInstruction(0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
@ -4,8 +4,9 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
@ -86,7 +87,7 @@ class VideoAdsPatch : AbstractAdPatch(
|
|||||||
|
|
||||||
// Pretend our player is ineligible for all ads
|
// Pretend our player is ineligible for all ads
|
||||||
with(CheckAdEligibilityLambdaFingerprint.result!!) {
|
with(CheckAdEligibilityLambdaFingerprint.result!!) {
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
${createConditionInstructions()}
|
${createConditionInstructions()}
|
||||||
@ -95,13 +96,13 @@ class VideoAdsPatch : AbstractAdPatch(
|
|||||||
move-result-object p0
|
move-result-object p0
|
||||||
return-object p0
|
return-object p0
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel(skipLabelName, mutableMethod.instruction(0)))
|
ExternalLabel(skipLabelName, mutableMethod.getInstruction(0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
with(GetReadyToShowAdFingerprint.result!!) {
|
with(GetReadyToShowAdFingerprint.result!!) {
|
||||||
val adFormatDeclined = "Ltv/twitch/android/shared/display/ads/theatre/StreamDisplayAdsPresenter\$Action\$AdFormatDeclined;"
|
val adFormatDeclined = "Ltv/twitch/android/shared/display/ads/theatre/StreamDisplayAdsPresenter\$Action\$AdFormatDeclined;"
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
${createConditionInstructions()}
|
${createConditionInstructions()}
|
||||||
@ -110,7 +111,7 @@ class VideoAdsPatch : AbstractAdPatch(
|
|||||||
move-result-object p1
|
move-result-object p1
|
||||||
return-object p1
|
return-object p1
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel(skipLabelName, mutableMethod.instruction(0)))
|
ExternalLabel(skipLabelName, mutableMethod.getInstruction(0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -44,26 +44,25 @@ class ShowDeletedMessagesPatch : BytecodePatch(
|
|||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
// Spoiler mode: Force set hasModAccess member to true in constructor
|
// Spoiler mode: Force set hasModAccess member to true in constructor
|
||||||
with(DeletedMessageClickableSpanCtorFingerprint.result!!.mutableMethod) {
|
DeletedMessageClickableSpanCtorFingerprint.result!!.mutableMethod.apply {
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
implementation!!.instructions.lastIndex, /* place in front of return-void */
|
implementation!!.instructions.lastIndex, /* place in front of return-void */
|
||||||
"""
|
"""
|
||||||
${createSpoilerConditionInstructions()}
|
${createSpoilerConditionInstructions()}
|
||||||
const/4 v0, 1
|
const/4 v0, 1
|
||||||
iput-boolean v0, p0, $definingClass->hasModAccess:Z
|
iput-boolean v0, p0, $definingClass->hasModAccess:Z
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel("no_spoiler", instruction(implementation!!.instructions.lastIndex)))
|
ExternalLabel("no_spoiler", getInstruction(implementation!!.instructions.lastIndex))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spoiler mode: Disable setHasModAccess setter
|
// Spoiler mode: Disable setHasModAccess setter
|
||||||
with(SetHasModAccessFingerprint.result!!) {
|
SetHasModAccessFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
|
||||||
mutableMethod.addInstruction(0, "return-void")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cross-out mode: Reformat span of deleted message
|
// Cross-out mode: Reformat span of deleted message
|
||||||
with(ChatUtilCreateDeletedSpanFingerprint.result!!) {
|
ChatUtilCreateDeletedSpanFingerprint.result!!.mutableMethod.apply {
|
||||||
mutableMethod.addInstructions(
|
addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
invoke-static {p2}, Lapp/revanced/twitch/patches/ShowDeletedMessagesPatch;->reformatDeletedMessage(Landroid/text/Spanned;)Landroid/text/Spanned;
|
invoke-static {p2}, Lapp/revanced/twitch/patches/ShowDeletedMessagesPatch;->reformatDeletedMessage(Landroid/text/Spanned;)Landroid/text/Spanned;
|
||||||
@ -71,7 +70,7 @@ class ShowDeletedMessagesPatch : BytecodePatch(
|
|||||||
if-eqz v0, :no_reformat
|
if-eqz v0, :no_reformat
|
||||||
return-object v0
|
return-object v0
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel("no_reformat", mutableMethod.instruction(0)))
|
ExternalLabel("no_reformat", getInstruction(0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -50,7 +50,7 @@ class AutoClaimChannelPointPatch : BytecodePatch(
|
|||||||
|
|
||||||
CommunityPointsButtonViewDelegateFingerprint.result?.mutableMethod?.apply {
|
CommunityPointsButtonViewDelegateFingerprint.result?.mutableMethod?.apply {
|
||||||
val lastIndex = implementation!!.instructions.lastIndex
|
val lastIndex = implementation!!.instructions.lastIndex
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
lastIndex, // place in front of return-void
|
lastIndex, // place in front of return-void
|
||||||
"""
|
"""
|
||||||
invoke-static {}, Lapp/revanced/twitch/patches/AutoClaimChannelPointsPatch;->shouldAutoClaim()Z
|
invoke-static {}, Lapp/revanced/twitch/patches/AutoClaimChannelPointsPatch;->shouldAutoClaim()Z
|
||||||
@ -62,7 +62,7 @@ class AutoClaimChannelPointPatch : BytecodePatch(
|
|||||||
iget-object v0, p0, Ltv/twitch/android/shared/community/points/viewdelegate/CommunityPointsButtonViewDelegate;->buttonLayout:Landroid/view/ViewGroup;
|
iget-object v0, p0, Ltv/twitch/android/shared/community/points/viewdelegate/CommunityPointsButtonViewDelegate;->buttonLayout:Landroid/view/ViewGroup;
|
||||||
invoke-virtual { v0 }, Landroid/view/View;->callOnClick()Z
|
invoke-virtual { v0 }, Landroid/view/View;->callOnClick()Z
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel("auto_claim", instruction(lastIndex)))
|
ExternalLabel("auto_claim", getInstruction(lastIndex))
|
||||||
)
|
)
|
||||||
} ?: return CommunityPointsButtonViewDelegateFingerprint.toErrorResult()
|
} ?: return CommunityPointsButtonViewDelegateFingerprint.toErrorResult()
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,8 +4,9 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
@ -46,15 +47,15 @@ class SettingsPatch : BytecodePatch(
|
|||||||
// Hook onCreate to handle fragment creation
|
// Hook onCreate to handle fragment creation
|
||||||
with(SettingsActivityOnCreateFingerprint.result!!) {
|
with(SettingsActivityOnCreateFingerprint.result!!) {
|
||||||
val insertIndex = mutableMethod.implementation!!.instructions.size - 2
|
val insertIndex = mutableMethod.implementation!!.instructions.size - 2
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructionsWithLabels(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"""
|
"""
|
||||||
invoke-static {p0}, $SETTINGS_HOOKS_CLASS->handleSettingsCreation(Landroidx/appcompat/app/AppCompatActivity;)Z
|
invoke-static {p0}, $SETTINGS_HOOKS_CLASS->handleSettingsCreation(Landroidx/appcompat/app/AppCompatActivity;)Z
|
||||||
move-result v0
|
move-result v0
|
||||||
if-eqz v0, :no_rv_settings_init
|
if-eqz v0, :no_rv_settings_init
|
||||||
return-void
|
return-void
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel("no_rv_settings_init", mutableMethod.instruction(insertIndex)))
|
ExternalLabel("no_rv_settings_init", mutableMethod.getInstruction(insertIndex))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ class SettingsPatch : BytecodePatch(
|
|||||||
// Intercept onclick events for the settings menu
|
// Intercept onclick events for the settings menu
|
||||||
with(MenuGroupsOnClickFingerprint.result!!) {
|
with(MenuGroupsOnClickFingerprint.result!!) {
|
||||||
val insertIndex = 0
|
val insertIndex = 0
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructionsWithLabels(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"""
|
"""
|
||||||
invoke-static {p1}, $SETTINGS_HOOKS_CLASS->handleSettingMenuOnClick(Ljava/lang/Enum;)Z
|
invoke-static {p1}, $SETTINGS_HOOKS_CLASS->handleSettingMenuOnClick(Ljava/lang/Enum;)Z
|
||||||
@ -93,7 +94,7 @@ class SettingsPatch : BytecodePatch(
|
|||||||
invoke-virtual {p0, p1}, Ltv/twitch/android/core/mvp/viewdelegate/RxViewDelegate;->pushEvent(Ltv/twitch/android/core/mvp/viewdelegate/ViewDelegateEvent;)V
|
invoke-virtual {p0, p1}, Ltv/twitch/android/core/mvp/viewdelegate/RxViewDelegate;->pushEvent(Ltv/twitch/android/core/mvp/viewdelegate/ViewDelegateEvent;)V
|
||||||
return-void
|
return-void
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel("no_rv_settings_onclick", mutableMethod.instruction(insertIndex)))
|
ExternalLabel("no_rv_settings_onclick", mutableMethod.getInstruction(insertIndex))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package app.revanced.patches.twitter.layout.hideviews.patch
|
package app.revanced.patches.twitter.layout.hideviews.patch
|
||||||
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.extensions.removeInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
@ -3,7 +3,7 @@ package app.revanced.patches.vsco.misc.pro.patch
|
|||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -22,7 +22,7 @@ class UnlockProPatch : BytecodePatch(
|
|||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
RevCatSubscriptionFingerprint.result?.mutableMethod?.apply {
|
RevCatSubscriptionFingerprint.result?.mutableMethod?.apply {
|
||||||
// Set isSubscribed to true.
|
// Set isSubscribed to true.
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const p1, 0x1
|
const p1, 0x1
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,8 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.extensions.toErrorResult
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -45,13 +45,13 @@ class HideGetPremiumPatch : BytecodePatch(listOf(GetPremiumViewFingerprint,)) {
|
|||||||
GetPremiumViewFingerprint.result?.let {
|
GetPremiumViewFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
val measuredWidthRegister = instruction<TwoRegisterInstruction>(startIndex).registerA
|
val measuredWidthRegister = getInstruction<TwoRegisterInstruction>(startIndex).registerA
|
||||||
val measuredHeightInstruction = instruction<TwoRegisterInstruction>(startIndex + 1)
|
val measuredHeightInstruction = getInstruction<TwoRegisterInstruction>(startIndex + 1)
|
||||||
|
|
||||||
val measuredHeightRegister = measuredHeightInstruction.registerA
|
val measuredHeightRegister = measuredHeightInstruction.registerA
|
||||||
val tempRegister = measuredHeightInstruction.registerB
|
val tempRegister = measuredHeightInstruction.registerB
|
||||||
|
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
startIndex + 2,
|
startIndex + 2,
|
||||||
"""
|
"""
|
||||||
# Override the internal measurement of the layout with zero values.
|
# Override the internal measurement of the layout with zero values.
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -42,13 +42,14 @@ class VideoAdsPatch : BytecodePatch(
|
|||||||
|
|
||||||
val loadVideoAdsFingerprintMethod = LoadVideoAdsFingerprint.result!!.mutableMethod
|
val loadVideoAdsFingerprintMethod = LoadVideoAdsFingerprint.result!!.mutableMethod
|
||||||
|
|
||||||
loadVideoAdsFingerprintMethod.addInstructions(
|
loadVideoAdsFingerprintMethod.addInstructionsWithLabels(
|
||||||
0, """
|
0, """
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
if-nez v0, :show_video_ads
|
if-nez v0, :show_video_ads
|
||||||
return-void
|
return-void
|
||||||
""", listOf(ExternalLabel("show_video_ads", loadVideoAdsFingerprintMethod.instruction(0)))
|
""",
|
||||||
|
ExternalLabel("show_video_ads", loadVideoAdsFingerprintMethod.getInstruction(0))
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -65,7 +65,7 @@ class EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex - 1
|
val insertIndex = it.scanResult.patternScanResult!!.endIndex - 1
|
||||||
|
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val thisInstanceRegister = instruction<Instruction35c>(insertIndex - 1).registerC
|
val thisInstanceRegister = getInstruction<Instruction35c>(insertIndex - 1).registerC
|
||||||
|
|
||||||
val freeRegister = 0
|
val freeRegister = 0
|
||||||
val xAxisRegister = 2
|
val xAxisRegister = 2
|
||||||
@ -76,7 +76,7 @@ class EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
fun Method.toInvokeInstructionString() =
|
fun Method.toInvokeInstructionString() =
|
||||||
"invoke-virtual { v$thisInstanceRegister, v$xAxisRegister }, $definingClass->$name(I)V"
|
"invoke-virtual { v$thisInstanceRegister, v$xAxisRegister }, $definingClass->$name(I)V"
|
||||||
|
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"""
|
"""
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/SeekbarTappingPatch;->seekbarTappingEnabled()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/SeekbarTappingPatch;->seekbarTappingEnabled()Z
|
||||||
@ -84,8 +84,8 @@ class EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
if-eqz v$freeRegister, :disabled
|
if-eqz v$freeRegister, :disabled
|
||||||
${oMethod.toInvokeInstructionString()}
|
${oMethod.toInvokeInstructionString()}
|
||||||
${pMethod.toInvokeInstructionString()}
|
${pMethod.toInvokeInstructionString()}
|
||||||
""",
|
""",
|
||||||
listOf(ExternalLabel("disabled", instruction(insertIndex)))
|
ExternalLabel("disabled", getInstruction(insertIndex))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return SeekbarTappingFingerprint.toErrorResult()
|
} ?: return SeekbarTappingFingerprint.toErrorResult()
|
||||||
|
@ -4,7 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -60,7 +61,7 @@ class AutoCaptionsPatch : BytecodePatch(
|
|||||||
|
|
||||||
val subtitleTrackMethod = SubtitleTrackFingerprint.result!!.mutableMethod
|
val subtitleTrackMethod = SubtitleTrackFingerprint.result!!.mutableMethod
|
||||||
|
|
||||||
subtitleTrackMethod.addInstructions(
|
subtitleTrackMethod.addInstructionsWithLabels(
|
||||||
0, """
|
0, """
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z
|
invoke-static {}, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -68,15 +68,16 @@ class HideAutoplayButtonPatch : BytecodePatch(
|
|||||||
val jumpInstruction = layoutGenMethodInstructions[insertIndex + branchIndex] as Instruction
|
val jumpInstruction = layoutGenMethodInstructions[insertIndex + branchIndex] as Instruction
|
||||||
|
|
||||||
// can be clobbered because this register is overwritten after the injected code
|
// can be clobbered because this register is overwritten after the injected code
|
||||||
val clobberRegister = instruction<OneRegisterInstruction>(insertIndex).registerA
|
val clobberRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"""
|
"""
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
|
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
|
||||||
move-result v$clobberRegister
|
move-result v$clobberRegister
|
||||||
if-eqz v$clobberRegister, :hidden
|
if-eqz v$clobberRegister, :hidden
|
||||||
""", listOf(ExternalLabel("hidden", jumpInstruction))
|
""",
|
||||||
|
ExternalLabel("hidden", jumpInstruction)
|
||||||
)
|
)
|
||||||
} ?: return LayoutConstructorFingerprint.toErrorResult()
|
} ?: return LayoutConstructorFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -44,8 +44,9 @@ class HideCaptionsButtonPatch : BytecodePatch(listOf(
|
|||||||
it.opcode == Opcode.IGET_BOOLEAN
|
it.opcode == Opcode.IGET_BOOLEAN
|
||||||
}
|
}
|
||||||
|
|
||||||
subtitleButtonControllerMethod.addInstructions(
|
subtitleButtonControllerMethod.addInstruction(
|
||||||
igetBooleanIndex + 1, """
|
igetBooleanIndex + 1,
|
||||||
|
"""
|
||||||
invoke-static {v0}, Lapp/revanced/integrations/patches/HideCaptionsButtonPatch;->hideCaptionsButton(Landroid/widget/ImageView;)V
|
invoke-static {v0}, Lapp/revanced/integrations/patches/HideCaptionsButtonPatch;->hideCaptionsButton(Landroid/widget/ImageView;)V
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
@ -34,22 +34,18 @@ class HideCastButtonPatch : BytecodePatch() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
with(
|
val buttonClass = context.findClass("MediaRouteButton")
|
||||||
context.findClass("MediaRouteButton")
|
?: return PatchResultError("MediaRouteButton class not found.")
|
||||||
?: return PatchResultError("MediaRouteButton class not found.")
|
|
||||||
) {
|
buttonClass.mutableClass.methods.find { it.name == "setVisibility" }?.apply {
|
||||||
with(
|
addInstructions(
|
||||||
mutableClass.methods.find { it.name == "setVisibility" }
|
0,
|
||||||
?: return PatchResultError("setVisibility method not found.")
|
"""
|
||||||
) {
|
invoke-static {p1}, Lapp/revanced/integrations/patches/HideCastButtonPatch;->getCastButtonOverrideV2(I)I
|
||||||
addInstructions(
|
move-result p1
|
||||||
0, """
|
"""
|
||||||
invoke-static {p1}, Lapp/revanced/integrations/patches/HideCastButtonPatch;->getCastButtonOverrideV2(I)I
|
)
|
||||||
move-result p1
|
} ?: return PatchResultError("setVisibility method not found.")
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -144,7 +144,7 @@ class NavigationButtonsPatch : BytecodePatch(listOf(AddCreateButtonViewFingerpri
|
|||||||
}!!.index
|
}!!.index
|
||||||
|
|
||||||
val conditionalCheckIndex = stringIndex - 1
|
val conditionalCheckIndex = stringIndex - 1
|
||||||
val conditionRegister = instruction<OneRegisterInstruction>(conditionalCheckIndex).registerA
|
val conditionRegister = getInstruction<OneRegisterInstruction>(conditionalCheckIndex).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
conditionalCheckIndex,
|
conditionalCheckIndex,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package app.revanced.patches.youtube.layout.buttons.navigation.utils
|
package app.revanced.patches.youtube.layout.buttons.navigation.utils
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import org.jf.dexlib2.Opcode.MOVE_RESULT_OBJECT
|
import org.jf.dexlib2.Opcode.MOVE_RESULT_OBJECT
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
@ -20,7 +20,7 @@ internal object InjectionUtils {
|
|||||||
|
|
||||||
// Register to pass to the hook
|
// Register to pass to the hook
|
||||||
val registerIndex = insertIndex - 1 // MOVE_RESULT_OBJECT is always the previous instruction
|
val registerIndex = insertIndex - 1 // MOVE_RESULT_OBJECT is always the previous instruction
|
||||||
val register = injectTarget.instruction<OneRegisterInstruction>(registerIndex).registerA
|
val register = injectTarget.getInstruction<OneRegisterInstruction>(registerIndex).registerA
|
||||||
|
|
||||||
injectTarget.addInstruction(
|
injectTarget.addInstruction(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -55,7 +55,7 @@ class HidePlayerButtonsPatch : BytecodePatch(
|
|||||||
|
|
||||||
PlayerControlsVisibilityModelFingerprint.result?.apply {
|
PlayerControlsVisibilityModelFingerprint.result?.apply {
|
||||||
val callIndex = scanResult.patternScanResult!!.endIndex
|
val callIndex = scanResult.patternScanResult!!.endIndex
|
||||||
val callInstruction = mutableMethod.instruction<Instruction3rc>(callIndex)
|
val callInstruction = mutableMethod.getInstruction<Instruction3rc>(callIndex)
|
||||||
|
|
||||||
// overriding this parameter register hides the previous and next buttons
|
// overriding this parameter register hides the previous and next buttons
|
||||||
val hasNextParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_NEXT
|
val hasNextParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_NEXT
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -35,7 +35,7 @@ class AlbumCardsPatch : BytecodePatch(
|
|||||||
val checkCastAnchorIndex = it.scanResult.patternScanResult!!.endIndex
|
val checkCastAnchorIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val insertIndex = checkCastAnchorIndex + 1
|
val insertIndex = checkCastAnchorIndex + 1
|
||||||
|
|
||||||
val albumCardViewRegister = instruction<OneRegisterInstruction>(checkCastAnchorIndex).registerA
|
val albumCardViewRegister = getInstruction<OneRegisterInstruction>(checkCastAnchorIndex).registerA
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -33,7 +33,7 @@ class BreakingNewsPatch : BytecodePatch(
|
|||||||
val moveResultIndex = insertIndex - 1
|
val moveResultIndex = insertIndex - 1
|
||||||
|
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val breakingNewsViewRegister = instruction<OneRegisterInstruction>(moveResultIndex).registerA
|
val breakingNewsViewRegister = getInstruction<OneRegisterInstruction>(moveResultIndex).registerA
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -33,7 +33,7 @@ class CrowdfundingBoxPatch : BytecodePatch(
|
|||||||
CrowdfundingBoxFingerprint.result?.let {
|
CrowdfundingBoxFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val objectRegister = instruction<TwoRegisterInstruction>(insertIndex).registerA
|
val objectRegister = getInstruction<TwoRegisterInstruction>(insertIndex).registerA
|
||||||
|
|
||||||
addInstruction(insertIndex, "invoke-static {v$objectRegister}, $INTEGRATIONS_METHOD_DESCRIPTOR")
|
addInstruction(insertIndex, "invoke-static {v$objectRegister}, $INTEGRATIONS_METHOD_DESCRIPTOR")
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -39,7 +39,7 @@ class HideEndscreenCardsPatch : BytecodePatch(
|
|||||||
val layoutResult = result ?: throw toErrorResult()
|
val layoutResult = result ?: throw toErrorResult()
|
||||||
layoutResult.mutableMethod.apply {
|
layoutResult.mutableMethod.apply {
|
||||||
val insertIndex = layoutResult.scanResult.patternScanResult!!.endIndex + 1
|
val insertIndex = layoutResult.scanResult.patternScanResult!!.endIndex + 1
|
||||||
val viewRegister = instruction<Instruction21c>(insertIndex - 1).registerA
|
val viewRegister = getInstruction<Instruction21c>(insertIndex - 1).registerA
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -78,7 +78,7 @@ class HideFilterBarPatch : BytecodePatch(
|
|||||||
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
|
||||||
val insertIndex = endIndex + insertIndexOffset
|
val insertIndex = endIndex + insertIndexOffset
|
||||||
val register = instruction<RegisterInstruction>(endIndex + hookRegisterOffset).registerA
|
val register = getInstruction<RegisterInstruction>(endIndex + hookRegisterOffset).registerA
|
||||||
|
|
||||||
addInstructions(insertIndex, instructions(register))
|
addInstructions(insertIndex, instructions(register))
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -29,7 +29,7 @@ class HideFloatingMicrophoneButtonPatch : BytecodePatch(
|
|||||||
ShowFloatingMicrophoneButtonFingerprint.result?.let { result ->
|
ShowFloatingMicrophoneButtonFingerprint.result?.let { result ->
|
||||||
with(result.mutableMethod) {
|
with(result.mutableMethod) {
|
||||||
val insertIndex = result.scanResult.patternScanResult!!.startIndex + 1
|
val insertIndex = result.scanResult.patternScanResult!!.startIndex + 1
|
||||||
val showButtonRegister = instruction<TwoRegisterInstruction>(insertIndex - 1).registerA
|
val showButtonRegister = getInstruction<TwoRegisterInstruction>(insertIndex - 1).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
|
@ -4,8 +4,9 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -44,29 +45,28 @@ class HideInfoCardsPatch : BytecodePatch(
|
|||||||
((it as ReferenceInstruction).reference.toString() == "Landroid/view/View;->setVisibility(I)V")
|
((it as ReferenceInstruction).reference.toString() == "Landroid/view/View;->setVisibility(I)V")
|
||||||
}
|
}
|
||||||
|
|
||||||
addInstructions(
|
addInstruction(
|
||||||
invokeInstructionIndex,
|
invokeInstructionIndex,
|
||||||
"invoke-static {v${instruction<FiveRegisterInstruction>(invokeInstructionIndex).registerC}}," +
|
"invoke-static {v${getInstruction<FiveRegisterInstruction>(invokeInstructionIndex).registerC}}," +
|
||||||
" Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsIncognito(Landroid/view/View;)V"
|
" Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsIncognito(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
with(InfocardsMethodCallFingerprint.result!!) {
|
with(InfocardsMethodCallFingerprint.result!!) {
|
||||||
val hideInfocardsCallMethod = mutableMethod
|
val hideInfoCardsCallMethod = mutableMethod
|
||||||
|
|
||||||
val invokeInterfaceIndex = scanResult.patternScanResult!!.endIndex
|
val invokeInterfaceIndex = scanResult.patternScanResult!!.endIndex
|
||||||
val toggleRegister = hideInfocardsCallMethod.implementation!!.registerCount - 1
|
val toggleRegister = hideInfoCardsCallMethod.implementation!!.registerCount - 1
|
||||||
|
|
||||||
hideInfocardsCallMethod.addInstructions(
|
hideInfoCardsCallMethod.addInstructionsWithLabels(
|
||||||
invokeInterfaceIndex, """
|
invokeInterfaceIndex,
|
||||||
|
"""
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsMethodCall()Z
|
invoke-static {}, Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsMethodCall()Z
|
||||||
move-result v$toggleRegister
|
move-result v$toggleRegister
|
||||||
if-nez v$toggleRegister, :hide_info_cards
|
if-nez v$toggleRegister, :hide_info_cards
|
||||||
""",
|
""",
|
||||||
listOf(
|
ExternalLabel(
|
||||||
ExternalLabel(
|
"hide_info_cards", hideInfoCardsCallMethod.getInstruction(invokeInterfaceIndex + 1)
|
||||||
"hide_info_cards", hideInfocardsCallMethod.instruction(invokeInterfaceIndex + 1)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -16,7 +16,6 @@ import app.revanced.patches.youtube.layout.hide.loadmorebutton.bytecode.fingerpr
|
|||||||
import app.revanced.patches.youtube.layout.hide.loadmorebutton.resource.patch.HideLoadMoreButtonResourcePatch
|
import app.revanced.patches.youtube.layout.hide.loadmorebutton.resource.patch.HideLoadMoreButtonResourcePatch
|
||||||
import app.revanced.patches.youtube.layout.hide.loadmorebutton.annotations.HideLoadMoreButtonCompatibility
|
import app.revanced.patches.youtube.layout.hide.loadmorebutton.annotations.HideLoadMoreButtonCompatibility
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("hide-load-more-button")
|
@Name("hide-load-more-button")
|
||||||
@ -29,7 +28,7 @@ class HideLoadMoreButtonPatch : BytecodePatch(listOf(HideLoadMoreButtonFingerpri
|
|||||||
HideLoadMoreButtonFingerprint.result?.let {
|
HideLoadMoreButtonFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val moveRegisterIndex = it.scanResult.patternScanResult!!.endIndex
|
val moveRegisterIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val viewRegister = instruction<OneRegisterInstruction>(moveRegisterIndex).registerA
|
val viewRegister = getInstruction<OneRegisterInstruction>(moveRegisterIndex).registerA
|
||||||
|
|
||||||
val insertIndex = moveRegisterIndex + 1
|
val insertIndex = moveRegisterIndex + 1
|
||||||
addInstruction(
|
addInstruction(
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -35,7 +35,7 @@ class HideEmailAddressPatch : BytecodePatch(
|
|||||||
val setVisibilityConstIndex = it.scanResult.patternScanResult!!.endIndex
|
val setVisibilityConstIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
|
||||||
val setVisibilityConstRegister =
|
val setVisibilityConstRegister =
|
||||||
instruction<OneRegisterInstruction>(setVisibilityConstIndex - 2).registerA
|
getInstruction<OneRegisterInstruction>(setVisibilityConstIndex - 2).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
setVisibilityConstIndex,
|
setVisibilityConstIndex,
|
||||||
|
@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -33,7 +33,7 @@ class HidePlayerOverlayPatch : BytecodePatch(listOf(CreatePlayerOverviewFingerpr
|
|||||||
|
|
||||||
literal == HidePlayerOverlayResourcePatch.scrimOverlayId
|
literal == HidePlayerOverlayResourcePatch.scrimOverlayId
|
||||||
} + 3
|
} + 3
|
||||||
val viewRegister = instruction<OneRegisterInstruction>(viewRegisterIndex).registerA
|
val viewRegister = getInstruction<OneRegisterInstruction>(viewRegisterIndex).registerA
|
||||||
|
|
||||||
val insertIndex = viewRegisterIndex + 1
|
val insertIndex = viewRegisterIndex + 1
|
||||||
addInstruction(
|
addInstruction(
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -55,16 +55,17 @@ class HideSeekbarPatch : BytecodePatch(
|
|||||||
|
|
||||||
SeekbarFingerprint.result!!.let {
|
SeekbarFingerprint.result!!.let {
|
||||||
SeekbarOnDrawFingerprint.apply { resolve(context, it.mutableClass) }
|
SeekbarOnDrawFingerprint.apply { resolve(context, it.mutableClass) }
|
||||||
}.result!!.mutableMethod.addInstructions(
|
}.result!!.mutableMethod.addInstructionsWithLabels(
|
||||||
0, """
|
0,
|
||||||
const/4 v0, 0x0
|
"""
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/HideSeekbarPatch;->hideSeekbar()Z
|
const/4 v0, 0x0
|
||||||
move-result v0
|
invoke-static { }, Lapp/revanced/integrations/patches/HideSeekbarPatch;->hideSeekbar()Z
|
||||||
if-eqz v0, :hide_seekbar
|
move-result v0
|
||||||
return-void
|
if-eqz v0, :hide_seekbar
|
||||||
:hide_seekbar
|
return-void
|
||||||
nop
|
:hide_seekbar
|
||||||
"""
|
nop
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -7,8 +7,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -54,7 +54,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
ReelConstructorFingerprint.result?.let {
|
ReelConstructorFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
||||||
val viewRegister = instruction<TwoRegisterInstruction>(insertIndex).registerA
|
val viewRegister = getInstruction<TwoRegisterInstruction>(insertIndex).registerA
|
||||||
|
|
||||||
injectHideViewCall(
|
injectHideViewCall(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
@ -86,7 +86,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
SetPivotBarVisibilityFingerprint.result!!.let { result ->
|
SetPivotBarVisibilityFingerprint.result!!.let { result ->
|
||||||
result.mutableMethod.apply {
|
result.mutableMethod.apply {
|
||||||
val checkCastIndex = result.scanResult.patternScanResult!!.endIndex
|
val checkCastIndex = result.scanResult.patternScanResult!!.endIndex
|
||||||
val viewRegister = instruction<OneRegisterInstruction>(checkCastIndex).registerA
|
val viewRegister = getInstruction<OneRegisterInstruction>(checkCastIndex).registerA
|
||||||
addInstruction(
|
addInstruction(
|
||||||
checkCastIndex + 1,
|
checkCastIndex + 1,
|
||||||
"sput-object v$viewRegister, $CLASS_DESCRIPTOR->pivotBar:" +
|
"sput-object v$viewRegister, $CLASS_DESCRIPTOR->pivotBar:" +
|
||||||
@ -110,7 +110,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
BottomNavigationBarFingerprint.result?.let {
|
BottomNavigationBarFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val moveResultIndex = it.scanResult.patternScanResult!!.startIndex
|
val moveResultIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
val viewRegister = instruction<OneRegisterInstruction>(moveResultIndex).registerA
|
val viewRegister = getInstruction<OneRegisterInstruction>(moveResultIndex).registerA
|
||||||
val insertIndex = moveResultIndex + 1
|
val insertIndex = moveResultIndex + 1
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
@ -138,7 +138,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
val referencedIndex = method.findIndexForIdResource(resourceName)
|
val referencedIndex = method.findIndexForIdResource(resourceName)
|
||||||
|
|
||||||
val setIdIndex = referencedIndex + 1
|
val setIdIndex = referencedIndex + 1
|
||||||
val viewRegister = method.instruction<FiveRegisterInstruction>(setIdIndex).registerC
|
val viewRegister = method.getInstruction<FiveRegisterInstruction>(setIdIndex).registerC
|
||||||
method.injectHideViewCall(setIdIndex, viewRegister, CLASS_DESCRIPTOR, methodName)
|
method.injectHideViewCall(setIdIndex, viewRegister, CLASS_DESCRIPTOR, methodName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -38,15 +38,16 @@ class HideTimestampPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
TimeCounterFingerprint.result!!.mutableMethod.addInstructions(
|
TimeCounterFingerprint.result!!.mutableMethod.addInstructionsWithLabels(
|
||||||
0, """
|
0,
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/HideTimestampPatch;->hideTimestamp()Z
|
"""
|
||||||
move-result v0
|
invoke-static { }, Lapp/revanced/integrations/patches/HideTimestampPatch;->hideTimestamp()Z
|
||||||
if-eqz v0, :hide_time
|
move-result v0
|
||||||
return-void
|
if-eqz v0, :hide_time
|
||||||
:hide_time
|
return-void
|
||||||
nop
|
:hide_time
|
||||||
"""
|
nop
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -38,14 +38,15 @@ class WatchInVRPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
WatchInVRFingerprint.result!!.mutableMethod.addInstructions(
|
WatchInVRFingerprint.result!!.mutableMethod.addInstructionsWithLabels(
|
||||||
0, """
|
0,
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/HideWatchInVRPatch;->hideWatchInVR()Z
|
"""
|
||||||
move-result v0
|
invoke-static {}, Lapp/revanced/integrations/patches/HideWatchInVRPatch;->hideWatchInVR()Z
|
||||||
if-eqz v0, :shown
|
move-result v0
|
||||||
return-void
|
if-eqz v0, :shown
|
||||||
:shown
|
return-void
|
||||||
nop
|
:shown
|
||||||
|
nop
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -51,10 +51,11 @@ class HideWatermarkPatch : BytecodePatch(
|
|||||||
|
|
||||||
method.removeInstruction(line)
|
method.removeInstruction(line)
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
line, """
|
line,
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/BrandingWaterMarkPatch;->isBrandingWatermarkShown()Z
|
"""
|
||||||
move-result p2
|
invoke-static {}, Lapp/revanced/integrations/patches/BrandingWaterMarkPatch;->isBrandingWatermarkShown()Z
|
||||||
"""
|
move-result p2
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -4,8 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -53,10 +53,11 @@ class FullscreenPanelsRemoverPatch : BytecodePatch(
|
|||||||
|
|
||||||
method.removeInstruction(ifIndex)
|
method.removeInstruction(ifIndex)
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
ifIndex, """
|
ifIndex,
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/FullscreenPanelsRemoverPatch;->getFullscreenPanelsVisibility()I
|
"""
|
||||||
move-result p1
|
invoke-static {}, Lapp/revanced/integrations/patches/FullscreenPanelsRemoverPatch;->getFullscreenPanelsVisibility()I
|
||||||
"""
|
move-result p1
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
@ -42,17 +42,18 @@ class PlayerPopupPanelsPatch : BytecodePatch(
|
|||||||
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
|
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
|
||||||
.result?.mutableMethod ?: return EngagementPanelControllerFingerprint.toErrorResult()
|
.result?.mutableMethod ?: return EngagementPanelControllerFingerprint.toErrorResult()
|
||||||
|
|
||||||
engagementPanelControllerMethod.addInstructions(
|
engagementPanelControllerMethod.addInstructionsWithLabels(
|
||||||
0, """
|
0,
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/DisablePlayerPopupPanelsPatch;->disablePlayerPopupPanels()Z
|
"""
|
||||||
move-result v0
|
invoke-static { }, Lapp/revanced/integrations/patches/DisablePlayerPopupPanelsPatch;->disablePlayerPopupPanels()Z
|
||||||
if-eqz v0, :player_popup_panels
|
move-result v0
|
||||||
if-eqz p4, :player_popup_panels
|
if-eqz v0, :player_popup_panels
|
||||||
const/4 v0, 0x0
|
if-eqz p4, :player_popup_panels
|
||||||
return-object v0
|
const/4 v0, 0x0
|
||||||
:player_popup_panels
|
return-object v0
|
||||||
nop
|
:player_popup_panels
|
||||||
"""
|
nop
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
@ -5,11 +5,12 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
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.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.instruction
|
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
@ -70,8 +71,8 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
addInstructions(
|
addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, ${vote.value}
|
const/4 v0, ${vote.value}
|
||||||
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->sendVote(I)V
|
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->sendVote(I)V
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return PatchResultError("Failed to find ${fingerprint.name} method.")
|
} ?: return PatchResultError("Failed to find ${fingerprint.name} method.")
|
||||||
@ -104,23 +105,24 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
textComponentContextFingerprintResult.mutableMethod.apply {
|
textComponentContextFingerprintResult.mutableMethod.apply {
|
||||||
// Get the conversion context obfuscated field name, and the registers for the AtomicReference and CharSequence
|
// Get the conversion context obfuscated field name, and the registers for the AtomicReference and CharSequence
|
||||||
val conversionContextFieldReference =
|
val conversionContextFieldReference =
|
||||||
instruction<ReferenceInstruction>(conversionContextIndex).reference
|
getInstruction<ReferenceInstruction>(conversionContextIndex).reference
|
||||||
|
|
||||||
// any free register
|
// any free register
|
||||||
val contextRegister =
|
val contextRegister =
|
||||||
instruction<TwoRegisterInstruction>(atomicReferenceStartIndex).registerB
|
getInstruction<TwoRegisterInstruction>(atomicReferenceStartIndex).registerB
|
||||||
|
|
||||||
val atomicReferenceRegister =
|
val atomicReferenceRegister =
|
||||||
instruction<FiveRegisterInstruction>(atomicReferenceStartIndex + 4).registerC
|
getInstruction<FiveRegisterInstruction>(atomicReferenceStartIndex + 4).registerC
|
||||||
|
|
||||||
val moveCharSequenceInstruction = instruction<TwoRegisterInstruction>(insertIndex)
|
val moveCharSequenceInstruction = getInstruction<TwoRegisterInstruction>(insertIndex)
|
||||||
val charSequenceRegister = moveCharSequenceInstruction.registerB
|
val charSequenceRegister = moveCharSequenceInstruction.registerB
|
||||||
|
|
||||||
// Insert as first instructions at the control flow label.
|
// Insert as first instructions at the control flow label.
|
||||||
// Must replace the existing instruction to preserve the label, and then insert the remaining instructions.
|
// Must replace the existing instruction to preserve the label, and then insert the remaining instructions.
|
||||||
replaceInstruction(insertIndex, "move-object/from16 v$contextRegister, p0")
|
replaceInstruction(insertIndex, "move-object/from16 v$contextRegister, p0")
|
||||||
addInstructions(
|
addInstructions(
|
||||||
insertIndex + 1, """
|
insertIndex + 1,
|
||||||
|
"""
|
||||||
iget-object v$contextRegister, v$contextRegister, $conversionContextFieldReference # copy obfuscated context field into free register
|
iget-object v$contextRegister, v$contextRegister, $conversionContextFieldReference # copy obfuscated context field into free register
|
||||||
invoke-static {v$contextRegister, v$atomicReferenceRegister, v$charSequenceRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
invoke-static {v$contextRegister, v$atomicReferenceRegister, v$charSequenceRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
||||||
move-result-object v$charSequenceRegister
|
move-result-object v$charSequenceRegister
|
||||||
@ -139,32 +141,33 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
val patternResult = it.scanResult.patternScanResult!!
|
val patternResult = it.scanResult.patternScanResult!!
|
||||||
|
|
||||||
// If the field is true, the TextView is for a dislike button.
|
// If the field is true, the TextView is for a dislike button.
|
||||||
val isDisLikesBooleanReference = instruction<ReferenceInstruction>(patternResult.endIndex).reference
|
val isDisLikesBooleanReference = getInstruction<ReferenceInstruction>(patternResult.endIndex).reference
|
||||||
|
|
||||||
val textViewFieldReference = // Like/Dislike button TextView field
|
val textViewFieldReference = // Like/Dislike button TextView field
|
||||||
instruction<ReferenceInstruction>(patternResult.endIndex - 2).reference
|
getInstruction<ReferenceInstruction>(patternResult.endIndex - 2).reference
|
||||||
|
|
||||||
// Check if the hooked TextView object is that of the dislike button.
|
// Check if the hooked TextView object is that of the dislike button.
|
||||||
// If RYD is disabled, or the TextView object is not that of the dislike button, the execution flow is not interrupted.
|
// If RYD is disabled, or the TextView object is not that of the dislike button, the execution flow is not interrupted.
|
||||||
// Otherwise, the TextView object is modified, and the execution flow is interrupted to prevent it from being changed afterward.
|
// Otherwise, the TextView object is modified, and the execution flow is interrupted to prevent it from being changed afterward.
|
||||||
val insertIndex = patternResult.startIndex + 6
|
val insertIndex = patternResult.startIndex + 6
|
||||||
addInstructions(
|
addInstructionsWithLabels(
|
||||||
insertIndex, """
|
insertIndex,
|
||||||
# Check, if the TextView is for a dislike button
|
"""
|
||||||
iget-boolean v0, p0, $isDisLikesBooleanReference
|
# Check, if the TextView is for a dislike button
|
||||||
if-eqz v0, :is_like
|
iget-boolean v0, p0, $isDisLikesBooleanReference
|
||||||
|
if-eqz v0, :is_like
|
||||||
# Hook the TextView, if it is for the dislike button
|
|
||||||
iget-object v0, p0, $textViewFieldReference
|
# Hook the TextView, if it is for the dislike button
|
||||||
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->setShortsDislikes(Landroid/view/View;)Z
|
iget-object v0, p0, $textViewFieldReference
|
||||||
move-result v0
|
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->setShortsDislikes(Landroid/view/View;)Z
|
||||||
if-eqz v0, :ryd_disabled
|
move-result v0
|
||||||
return-void
|
if-eqz v0, :ryd_disabled
|
||||||
|
return-void
|
||||||
:is_like
|
|
||||||
:ryd_disabled
|
:is_like
|
||||||
nop
|
:ryd_disabled
|
||||||
"""
|
nop
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return ShortsTextViewFingerprint.toErrorResult()
|
} ?: return ShortsTextViewFingerprint.toErrorResult()
|
||||||
@ -177,8 +180,8 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
|
|
||||||
val resourceIdentifierRegister = instruction<OneRegisterInstruction>(startIndex).registerA
|
val resourceIdentifierRegister = getInstruction<OneRegisterInstruction>(startIndex).registerA
|
||||||
val textViewRegister = instruction<OneRegisterInstruction>(startIndex + 4).registerA
|
val textViewRegister = getInstruction<OneRegisterInstruction>(startIndex + 4).registerA
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
startIndex + 4,
|
startIndex + 4,
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user