build(revanced-patcher): bump version
This commit is contained in:
@@ -4,8 +4,8 @@ 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.extensions.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.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -31,7 +31,7 @@ class AudioAdsPatch : BytecodePatch(
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// Block playAds call
|
||||
with(AudioAdsPresenterPlayFingerprint.result!!) {
|
||||
mutableMethod.addInstructions(
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
invoke-static { }, Lapp/revanced/twitch/patches/AudioAdsPatch;->shouldBlockAudioAds()Z
|
||||
@@ -39,7 +39,7 @@ class AudioAdsPatch : BytecodePatch(
|
||||
if-eqz v0, :show_audio_ads
|
||||
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.data.BytecodeContext
|
||||
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.PatchResultError
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package app.revanced.patches.twitch.ad.shared.util
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.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.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
@@ -27,7 +27,7 @@ abstract class AbstractAdPatch(
|
||||
this ?: return false
|
||||
|
||||
this.methods.filter { methodNames.contains(it.name) }.forEach {
|
||||
val retIntructions = when(returnMethod.returnType) {
|
||||
val retInstruction = when (returnMethod.returnType) {
|
||||
'V' -> "return-void"
|
||||
'Z' -> """
|
||||
const/4 v0, ${returnMethod.value}
|
||||
@@ -35,13 +35,13 @@ abstract class AbstractAdPatch(
|
||||
"""
|
||||
else -> throw NotImplementedError()
|
||||
}
|
||||
it.addInstructions(
|
||||
it.addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
${createConditionInstructions("v0")}
|
||||
$retIntructions
|
||||
$retInstruction
|
||||
""",
|
||||
listOf(ExternalLabel(skipLabelName, it.instruction(0)))
|
||||
ExternalLabel(skipLabelName, it.getInstruction(0))
|
||||
)
|
||||
}
|
||||
true
|
||||
|
||||
@@ -4,8 +4,9 @@ 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.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
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.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
@@ -86,7 +87,7 @@ class VideoAdsPatch : AbstractAdPatch(
|
||||
|
||||
// Pretend our player is ineligible for all ads
|
||||
with(CheckAdEligibilityLambdaFingerprint.result!!) {
|
||||
mutableMethod.addInstructions(
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
${createConditionInstructions()}
|
||||
@@ -95,13 +96,13 @@ class VideoAdsPatch : AbstractAdPatch(
|
||||
move-result-object p0
|
||||
return-object p0
|
||||
""",
|
||||
listOf(ExternalLabel(skipLabelName, mutableMethod.instruction(0)))
|
||||
ExternalLabel(skipLabelName, mutableMethod.getInstruction(0))
|
||||
)
|
||||
}
|
||||
|
||||
with(GetReadyToShowAdFingerprint.result!!) {
|
||||
val adFormatDeclined = "Ltv/twitch/android/shared/display/ads/theatre/StreamDisplayAdsPresenter\$Action\$AdFormatDeclined;"
|
||||
mutableMethod.addInstructions(
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
${createConditionInstructions()}
|
||||
@@ -110,7 +111,7 @@ class VideoAdsPatch : AbstractAdPatch(
|
||||
move-result-object p1
|
||||
return-object p1
|
||||
""",
|
||||
listOf(ExternalLabel(skipLabelName, mutableMethod.instruction(0)))
|
||||
ExternalLabel(skipLabelName, mutableMethod.getInstruction(0))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+11
-12
@@ -4,9 +4,9 @@ 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.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -44,26 +44,25 @@ class ShowDeletedMessagesPatch : BytecodePatch(
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// Spoiler mode: Force set hasModAccess member to true in constructor
|
||||
with(DeletedMessageClickableSpanCtorFingerprint.result!!.mutableMethod) {
|
||||
addInstructions(
|
||||
DeletedMessageClickableSpanCtorFingerprint.result!!.mutableMethod.apply {
|
||||
addInstructionsWithLabels(
|
||||
implementation!!.instructions.lastIndex, /* place in front of return-void */
|
||||
"""
|
||||
${createSpoilerConditionInstructions()}
|
||||
const/4 v0, 1
|
||||
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
|
||||
with(SetHasModAccessFingerprint.result!!) {
|
||||
mutableMethod.addInstruction(0, "return-void")
|
||||
}
|
||||
SetHasModAccessFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
|
||||
|
||||
|
||||
// Cross-out mode: Reformat span of deleted message
|
||||
with(ChatUtilCreateDeletedSpanFingerprint.result!!) {
|
||||
mutableMethod.addInstructions(
|
||||
ChatUtilCreateDeletedSpanFingerprint.result!!.mutableMethod.apply {
|
||||
addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
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
|
||||
return-object v0
|
||||
""",
|
||||
listOf(ExternalLabel("no_reformat", mutableMethod.instruction(0)))
|
||||
ExternalLabel("no_reformat", getInstruction(0))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -5,8 +5,8 @@ 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.extensions.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.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -50,7 +50,7 @@ class AutoClaimChannelPointPatch : BytecodePatch(
|
||||
|
||||
CommunityPointsButtonViewDelegateFingerprint.result?.mutableMethod?.apply {
|
||||
val lastIndex = implementation!!.instructions.lastIndex
|
||||
addInstructions(
|
||||
addInstructionsWithLabels(
|
||||
lastIndex, // place in front of return-void
|
||||
"""
|
||||
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;
|
||||
invoke-virtual { v0 }, Landroid/view/View;->callOnClick()Z
|
||||
""",
|
||||
listOf(ExternalLabel("auto_claim", instruction(lastIndex)))
|
||||
ExternalLabel("auto_claim", getInstruction(lastIndex))
|
||||
)
|
||||
} ?: return CommunityPointsButtonViewDelegateFingerprint.toErrorResult()
|
||||
return PatchResultSuccess()
|
||||
|
||||
@@ -4,7 +4,7 @@ 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.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.PatchResultSuccess
|
||||
|
||||
+11
-10
@@ -4,8 +4,9 @@ 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.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
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.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
@@ -46,15 +47,15 @@ class SettingsPatch : BytecodePatch(
|
||||
// Hook onCreate to handle fragment creation
|
||||
with(SettingsActivityOnCreateFingerprint.result!!) {
|
||||
val insertIndex = mutableMethod.implementation!!.instructions.size - 2
|
||||
mutableMethod.addInstructions(
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
insertIndex,
|
||||
"""
|
||||
invoke-static {p0}, $SETTINGS_HOOKS_CLASS->handleSettingsCreation(Landroidx/appcompat/app/AppCompatActivity;)Z
|
||||
move-result v0
|
||||
if-eqz v0, :no_rv_settings_init
|
||||
return-void
|
||||
invoke-static {p0}, $SETTINGS_HOOKS_CLASS->handleSettingsCreation(Landroidx/appcompat/app/AppCompatActivity;)Z
|
||||
move-result v0
|
||||
if-eqz v0, :no_rv_settings_init
|
||||
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
|
||||
with(MenuGroupsOnClickFingerprint.result!!) {
|
||||
val insertIndex = 0
|
||||
mutableMethod.addInstructions(
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
insertIndex,
|
||||
"""
|
||||
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
|
||||
return-void
|
||||
""",
|
||||
listOf(ExternalLabel("no_rv_settings_onclick", mutableMethod.instruction(insertIndex)))
|
||||
ExternalLabel("no_rv_settings_onclick", mutableMethod.getInstruction(insertIndex))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user