build(revanced-patcher): bump version

This commit is contained in:
oSumAtrIX
2023-06-07 03:46:58 +02:00
parent 59fbe2a1ef
commit 73d3f3a6ac
130 changed files with 555 additions and 530 deletions
@@ -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.removeInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
@@ -13,13 +13,13 @@ import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.autorepeat.annotations.AutoRepeatCompatibility
import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatFingerprint
import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatParentFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
@Patch
@DependsOn([IntegrationsPatch::class])
@@ -79,7 +79,7 @@ class AutoRepeatPatch : BytecodePatch(
//remove last instruction which is return-void
method.removeInstruction(index)
// Add our own instructions there
method.addInstructions(index, instructions)
method.addInstructionsWithLabels(index, instructions)
//Everything worked as expected, return Success
return PatchResultSuccess()
@@ -4,7 +4,7 @@ import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
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.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
@@ -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.addInstruction
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
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
@@ -29,7 +29,7 @@ class ClientSpoofPatch : BytecodePatch(
UserAgentHeaderBuilderFingerprint.result?.let { result ->
val insertIndex = result.scanResult.patternScanResult!!.endIndex
result.mutableMethod.apply {
val packageNameRegister = instruction<FiveRegisterInstruction>(insertIndex).registerD
val packageNameRegister = getInstruction<FiveRegisterInstruction>(insertIndex).registerD
addInstruction(insertIndex, "const-string v$packageNameRegister, \"$ORIGINAL_PACKAGE_NAME\"")
}
@@ -6,8 +6,8 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
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.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -83,7 +83,7 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
it.mutableMethod.apply {
val getHeadersInstructionIndex = it.scanResult.patternScanResult!!.endIndex
val responseCodeRegister =
(instruction(getHeadersInstructionIndex - 2) as OneRegisterInstruction).registerA
(getInstruction(getHeadersInstructionIndex - 2) as OneRegisterInstruction).registerA
addInstructions(
getHeadersInstructionIndex + 1,
@@ -5,7 +5,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
@@ -51,7 +51,8 @@ class OpenLinksExternallyPatch : BytecodePatch(
with(result.mutableMethod) {
val register = (implementation!!.instructions[insertIndex - 1] as Instruction21c).registerA
addInstructions(
insertIndex, """
insertIndex,
"""
invoke-static {v$register}, Lapp/revanced/integrations/patches/OpenLinksExternallyPatch;->enableExternalBrowser(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$register
"""
@@ -4,8 +4,8 @@ import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
@@ -45,11 +45,11 @@ class LithoFilterPatch : BytecodePatch(
result.mutableMethod.apply {
val insertHookIndex = result.scanResult.patternScanResult!!.endIndex
val builderMethodDescriptor = instruction(builderMethodIndex).descriptor
val emptyComponentFieldDescriptor = instruction(emptyComponentFieldIndex).descriptor
val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor
val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor
// Register is overwritten right after it is used in this patch, therefore free to clobber.
val free = instruction<TwoRegisterInstruction>(insertHookIndex - 1).registerA
val free2 = instruction<OneRegisterInstruction>(insertHookIndex).registerA
val free = getInstruction<TwoRegisterInstruction>(insertHookIndex - 1).registerA
val free2 = getInstruction<OneRegisterInstruction>(insertHookIndex).registerA
@Suppress("UnnecessaryVariable")
// The register, this patch clobbers, is previously used for the StringBuilder,
@@ -57,19 +57,19 @@ class LithoFilterPatch : BytecodePatch(
val stringBuilderRegister = free
val identifierRegister =
instruction<OneRegisterInstruction>(ReadComponentIdentifierFingerprint.patternScanEndIndex).registerA
getInstruction<OneRegisterInstruction>(ReadComponentIdentifierFingerprint.patternScanEndIndex).registerA
// Parameter that holds a ref to a type with a field that ref the protobuf buffer object.
val protobufParameterNumber = 3
// Get the field that stores an protobuf buffer required below.
val protobufBufferRefTypeRefFieldDescriptor =
instruction(ProtobufBufferFingerprint.patternScanStartIndex).descriptor
getInstruction(ProtobufBufferFingerprint.patternScanStartIndex).descriptor
val protobufBufferRefTypeDescriptor =
instruction(ProtobufBufferFingerprint.patternScanEndIndex - 1).descriptor
getInstruction(ProtobufBufferFingerprint.patternScanEndIndex - 1).descriptor
val protobufBufferFieldDescriptor = "$protobufBufferRefTypeDescriptor->b:Ljava/nio/ByteBuffer;"
addInstructions(
addInstructionsWithLabels(
insertHookIndex, // right after setting the component.pathBuilder field.
"""
# Get the protobuf buffer object.
@@ -97,7 +97,7 @@ class LithoFilterPatch : BytecodePatch(
iget-object v$free, v$free, $emptyComponentFieldDescriptor
return-object v$free
""",
listOf(ExternalLabel("not_an_ad", instruction(insertHookIndex)))
ExternalLabel("not_an_ad", getInstruction(insertHookIndex))
)
}
} ?: return ComponentContextParserFingerprint.toErrorResult()
@@ -6,8 +6,8 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
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
@@ -50,10 +50,11 @@ class MinimizedPlaybackPatch : BytecodePatch(
MinimizedPlaybackManagerFingerprint.result?.apply {
mutableMethod.addInstructions(
0, """
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->isPlaybackNotShort()Z
move-result v0
return v0
0,
"""
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->isPlaybackNotShort()Z
move-result v0
return v0
"""
)
} ?: return MinimizedPlaybackManagerFingerprint.toErrorResult()
@@ -68,10 +69,11 @@ class MinimizedPlaybackPatch : BytecodePatch(
context.toMethodWalker(method).nextMethod(settingsBooleanIndex, true).getMethod() as MutableMethod
settingsBooleanMethod.addInstructions(
0, """
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideMinimizedPlaybackAvailable()Z
move-result v0
return v0
0,
"""
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideMinimizedPlaybackAvailable()Z
move-result v0
return v0
"""
)
} ?: return MinimizedPlaybackSettingsFingerprint.toErrorResult()
@@ -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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
import app.revanced.patcher.patch.BytecodePatch
@@ -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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
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.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.addInstructions
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
@@ -40,9 +40,10 @@ class PlayerTypeHookPatch : BytecodePatch(
VideoStateFingerprint.result?.let {
it.mutableMethod.apply {
val endIndex = it.scanResult.patternScanResult!!.endIndex
val videoStateFieldName = instruction<ReferenceInstruction>(endIndex).reference
val videoStateFieldName = getInstruction<ReferenceInstruction>(endIndex).reference
addInstructions(
0, """
0,
"""
iget-object v0, p1, $videoStateFieldName # copy VideoState parameter field
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->setVideoState(Ljava/lang/Enum;)V
"""
@@ -5,10 +5,10 @@ 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.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -51,7 +51,7 @@ class SettingsPatch : BytecodePatch(
setThemeMethod.apply {
// This register is returned by the setTheme method.
val register = instruction<OneRegisterInstruction>(returnIndex).registerA
val register = getInstruction<OneRegisterInstruction>(returnIndex).registerA
val setThemeInstruction = getSetThemeInstructionString("v$register")
replaceInstruction(returnIndex, setThemeInstruction)
@@ -75,7 +75,8 @@ class SettingsPatch : BytecodePatch(
// initialize the settings
addInstructions(
1, """
1,
"""
${buildSettingsActivityInvokeString()}
return-void
"""
@@ -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
@@ -39,13 +39,15 @@ class ZoomHapticsPatch : BytecodePatch(
val zoomHapticsFingerprintMethod = ZoomHapticsFingerprint.result!!.mutableMethod
zoomHapticsFingerprintMethod.addInstructions(
0, """
zoomHapticsFingerprintMethod.addInstructionsWithLabels(
0,
"""
invoke-static { }, Lapp/revanced/integrations/patches/ZoomHapticsPatch;->shouldVibrate()Z
move-result v0
if-nez v0, :vibrate
return-void
""", listOf(ExternalLabel("vibrate", zoomHapticsFingerprintMethod.instruction(0)))
""",
ExternalLabel("vibrate", zoomHapticsFingerprintMethod.getInstruction(0))
)
return PatchResultSuccess()