fix(youtube/spoof-signature-verification): remove auto re-enable functionality (#2556)

This commit is contained in:
LisoUseInAIKyrios 2023-07-02 12:25:59 +04:00 committed by GitHub
parent f27a6a4ab6
commit b8df8fb997
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 38 deletions

View file

@ -1,17 +0,0 @@
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
// Resolves to the method CronetDataSource.open
// https://androidx.tech/artifacts/media3/media3-datasource-cronet/1.0.0-alpha03-source/androidx/media3/datasource/cronet/CronetDataSource.java.html
object OpenCronetDataSourceFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.MOVE_RESULT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
),
strings = listOf(
"err_cleartext_not_permitted",
),
)

View file

@ -7,7 +7,6 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
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
@ -15,12 +14,10 @@ import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.OpenCronetDataSourceFingerprint
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("spoof-signature-verification")
@Description("Spoofs a patched client to prevent playback issues.")
@ -33,7 +30,6 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
class SpoofSignatureVerificationPatch : BytecodePatch(
listOf(
ProtobufParameterBuilderFingerprint,
OpenCronetDataSourceFingerprint,
)
) {
override fun execute(context: BytecodeContext): PatchResult {
@ -72,23 +68,6 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
}
} ?: return ProtobufParameterBuilderFingerprint.toErrorResult()
// hook video playback result
OpenCronetDataSourceFingerprint.result?.let {
it.mutableMethod.apply {
val getHeadersInstructionIndex = it.scanResult.patternScanResult!!.endIndex
val responseCodeRegister =
(getInstruction(getHeadersInstructionIndex - 2) as OneRegisterInstruction).registerA
addInstructions(
getHeadersInstructionIndex + 1,
"""
invoke-static {v$responseCodeRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onResponse(I)V
"""
)
}
} ?: return OpenCronetDataSourceFingerprint.toErrorResult()
return PatchResultSuccess()
}