chore: merge branch dev to main (#2553)

This commit is contained in:
oSumAtrIX 2023-07-03 23:35:19 +02:00 committed by GitHub
commit 6065d6d1fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 97 additions and 122 deletions

View file

@ -1,3 +1,52 @@
# [2.181.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.181.0-dev.6...v2.181.0-dev.7) (2023-07-03)
### Bug Fixes
* **reddit/sanitize-sharing-links:** update patch to support latest app version ([#2575](https://github.com/revanced/revanced-patches/issues/2575)) ([737be98](https://github.com/revanced/revanced-patches/commit/737be9815bad985328bbbead4d32f9398241eef2))
# [2.181.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.181.0-dev.5...v2.181.0-dev.6) (2023-07-02)
### Bug Fixes
* **reddit/hide-comment-ads:** do not require integrations ([c2211d4](https://github.com/revanced/revanced-patches/commit/c2211d458d5cab030999e604a87cc1d02805b7ef))
# [2.181.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.181.0-dev.4...v2.181.0-dev.5) (2023-07-02)
### Bug Fixes
* **infinityforreddit/change-oauth-client-id:** patch correct method ([#2564](https://github.com/revanced/revanced-patches/issues/2564)) ([f1ba16e](https://github.com/revanced/revanced-patches/commit/f1ba16ebfe2fda86af96d094481ed472eebcb4f9))
# [2.181.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.181.0-dev.3...v2.181.0-dev.4) (2023-07-02)
### Bug Fixes
* **youtube-music/bypass-certificate-checks:** fix fingerprint for the latest target app ([#2567](https://github.com/revanced/revanced-patches/issues/2567)) ([8eacb5b](https://github.com/revanced/revanced-patches/commit/8eacb5b5ace816da4d98b990eff0ea208691660c))
# [2.181.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.181.0-dev.2...v2.181.0-dev.3) (2023-07-02)
### Bug Fixes
* **youtube/spoof-signature-verification:** remove auto re-enable functionality ([#2556](https://github.com/revanced/revanced-patches/issues/2556)) ([b8df8fb](https://github.com/revanced/revanced-patches/commit/b8df8fb99707fdac32e272fee8469dfeb940504d))
# [2.181.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.181.0-dev.1...v2.181.0-dev.2) (2023-07-01)
### Bug Fixes
* **trakt:** bump compatibility to newer version ([#2554](https://github.com/revanced/revanced-patches/issues/2554)) ([2a2897d](https://github.com/revanced/revanced-patches/commit/2a2897dc9e81799a3318875122fc7b49692e3764))
# [2.181.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.180.0...v2.181.0-dev.1) (2023-07-01)
### Features
* **baconreader/change-oauth-client-id:** add compatibility for premium package ([#2550](https://github.com/revanced/revanced-patches/issues/2550)) ([4d1b0b4](https://github.com/revanced/revanced-patches/commit/4d1b0b442768be4f7a12de63d8b973b2ca113f23))
# [2.180.0](https://github.com/revanced/revanced-patches/compare/v2.179.0...v2.180.0) (2023-07-01) # [2.180.0](https://github.com/revanced/revanced-patches/compare/v2.179.0...v2.180.0) (2023-07-01)

View file

@ -229,14 +229,6 @@ The official ReVanced Patches.
| `change-oauth-client-id` | Changes the OAuth client ID. The OAuth application type has to be "Installed app" and the redirect URI has to be set to "dbrady://relay". | all | | `change-oauth-client-id` | Changes the OAuth client ID. The OAuth application type has to be "Installed app" and the redirect URI has to be set to "dbrady://relay". | all |
</details> </details>
### [📦 `com.onelouder.baconreader`](https://play.google.com/store/apps/details?id=com.onelouder.baconreader)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `change-oauth-client-id` | Changes the OAuth client ID. The OAuth application type has to be "Installed app" and the redirect URI has to be set to "http://baconreader.com/auth". | all |
</details>
### [📦 `com.rubenmayayo.reddit`](https://play.google.com/store/apps/details?id=com.rubenmayayo.reddit) ### [📦 `com.rubenmayayo.reddit`](https://play.google.com/store/apps/details?id=com.rubenmayayo.reddit)
<details> <details>

View file

@ -1,2 +1,2 @@
kotlin.code.style = official kotlin.code.style = official
version = 2.180.0 version = 2.181.0-dev.7

File diff suppressed because one or more lines are too long

View file

@ -1,9 +1,12 @@
package app.revanced.patches.music.misc.androidauto.fingerprints package app.revanced.patches.music.misc.androidauto.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object CheckCertificateFingerprint : MethodFingerprint( object CheckCertificateFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "Z", returnType = "Z",
parameters = listOf("Ljava/lang/String;"), parameters = listOf("Ljava/lang/String;"),
strings = listOf("X509", "Failed to get public key.", "Failed to get certificate.") strings = listOf("X509", "Failed to get certificate.")
) )

View file

@ -5,8 +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.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
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,15 +22,13 @@ class BypassCertificateChecksPatch : BytecodePatch(
listOf(CheckCertificateFingerprint) listOf(CheckCertificateFingerprint)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
CheckCertificateFingerprint.result?.let { result -> CheckCertificateFingerprint.result?.apply {
val noMatchIndex = result.scanResult.stringsScanResult!!.matches.first().index mutableMethod.addInstructions(
0, """
result.mutableMethod.apply { const/4 v0, 0x1
val isPartnerIndex = noMatchIndex + 2 return v0
"""
replaceInstruction(isPartnerIndex, "const/4 p1, 0x1") )
addInstruction(isPartnerIndex + 1, "return p1")
}
} ?: return CheckCertificateFingerprint.toErrorResult() } ?: return CheckCertificateFingerprint.toErrorResult()
return PatchResultSuccess() return PatchResultSuccess()

View file

@ -8,12 +8,10 @@ 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
import app.revanced.patcher.patch.annotations.RequiresIntegrations
import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFingerprint import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFingerprint
@Name("hide-comment-ads") @Name("hide-comment-ads")
@Description("Removes all comment ads.") @Description("Removes all comment ads.")
@RequiresIntegrations
@Version("0.0.1") @Version("0.0.1")
class HideCommentAdsPatch : BytecodePatch( class HideCommentAdsPatch : BytecodePatch(
listOf(HideCommentAdsFingerprint) listOf(HideCommentAdsFingerprint)

View file

@ -20,7 +20,12 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Description("Changes the OAuth client ID. " + @Description("Changes the OAuth client ID. " +
"The OAuth application type has to be \"Installed app\" " + "The OAuth application type has to be \"Installed app\" " +
"and the redirect URI has to be set to \"http://baconreader.com/auth\".") "and the redirect URI has to be set to \"http://baconreader.com/auth\".")
@Compatibility([Package("com.onelouder.baconreader")]) @Compatibility(
[
Package("com.onelouder.baconreader"),
Package("com.onelouder.baconreader.premium")
]
)
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch( class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
"http://baconreader.com/auth", Options, listOf(GetAuthorizationUrlFingerprint, RequestTokenFingerprint) "http://baconreader.com/auth", Options, listOf(GetAuthorizationUrlFingerprint, RequestTokenFingerprint)
) { ) {

View file

@ -1,6 +1,6 @@
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
object GetHTTPBasicAuthHeaderFingerprint : AbstractClientIdFingerprint( object GetHttpBasicAuthHeaderFingerprint : AbstractClientIdFingerprint(
"APIUtils;", "APIUtils;",
"getHTTPBasicAuthHeader" "getHttpBasicAuthHeader"
) )

View file

@ -11,7 +11,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.GetHTTPBasicAuthHeaderFingerprint import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.GetHttpBasicAuthHeaderFingerprint
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.LoginActivityOnCreateFingerprint import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.LoginActivityOnCreateFingerprint
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -23,7 +23,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch( class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
"infinity://localhost", "infinity://localhost",
Options, Options,
listOf(GetHTTPBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint) listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint)
) { ) {
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult { override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
forEach { forEach {

View file

@ -1,22 +0,0 @@
package app.revanced.patches.reddit.misc.tracking.url.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
object ShareLinkFactoryFingerprint : MethodFingerprint(
returnType = "L",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
opcodes = listOf(
Opcode.CONST_STRING,
Opcode.CONST_STRING,
Opcode.INVOKE_DIRECT,
Opcode.APUT_OBJECT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC, // Returns the URL.
Opcode.MOVE_RESULT_OBJECT
),
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("ShareLinkFactory;") }
)

View file

@ -0,0 +1,9 @@
package app.revanced.patches.reddit.misc.tracking.url.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object ShareLinkFormatterFingerprint : MethodFingerprint(
returnType = "Ljava/lang/String;",
parameters = listOf("Ljava/lang/String;", "Ljava/util/Map;"),
strings = listOf("uri.getQueryParameters(name)", "uri.queryParameterNames", "newUriBuilder.build().toString()"),
)

View file

@ -6,47 +6,29 @@ 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.addInstructions 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.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
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.annotations.RequiresIntegrations
import app.revanced.patches.reddit.misc.tracking.url.annotations.SanitizeUrlQueryCompatibility import app.revanced.patches.reddit.misc.tracking.url.annotations.SanitizeUrlQueryCompatibility
import app.revanced.patches.reddit.misc.tracking.url.fingerprints.ShareLinkFactoryFingerprint import app.revanced.patches.reddit.misc.tracking.url.fingerprints.ShareLinkFormatterFingerprint
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch @Patch
@Name("sanitize-sharing-links") @Name("sanitize-sharing-links")
@Description("Removes (tracking) query parameters from the URLs when sharing links.") @Description("Removes (tracking) query parameters from the URLs when sharing links.")
@SanitizeUrlQueryCompatibility @SanitizeUrlQueryCompatibility
@Version("0.0.1") @Version("0.0.1")
@RequiresIntegrations
class SanitizeUrlQueryPatch : BytecodePatch( class SanitizeUrlQueryPatch : BytecodePatch(
listOf(ShareLinkFactoryFingerprint) listOf(ShareLinkFormatterFingerprint)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
ShareLinkFactoryFingerprint.result?.let { result ->
result.mutableMethod.apply {
val insertIndex = result.scanResult.patternScanResult!!.endIndex + 1
val urlRegister = getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
addInstructions( ShareLinkFormatterFingerprint.result?.mutableMethod?.addInstructions(
insertIndex, 0,
""" "return-object p0"
invoke-static {v$urlRegister}, $SANITIZE_METHOD_DESCRIPTOR ) ?: return ShareLinkFormatterFingerprint.toErrorResult()
move-result-object v$urlRegister
"""
)
}
} ?: return ShareLinkFactoryFingerprint.toErrorResult()
return PatchResultSuccess() return PatchResultSuccess()
} }
private companion object {
private const val SANITIZE_METHOD_DESCRIPTOR =
"Lapp/revanced/reddit/patches/SanitizeUrlQueryPatch;" +
"->stripQueryParameters(Ljava/lang/String;)Ljava/lang/String;"
}
} }

View file

@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object IsVIPEPFingerprint : MethodFingerprint( object IsVIPEPFingerprint : MethodFingerprint(
customFingerprint = custom@{ methodDef, _ -> customFingerprint = custom@{ methodDef, _ ->
if (!methodDef.definingClass.endsWith("RealmUserSettings;")) return@custom false if (!methodDef.definingClass.endsWith("RemoteUser;")) return@custom false
methodDef.name == "isVIPEP" methodDef.name == "isVIPEP"
} }

View file

@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object IsVIPFingerprint : MethodFingerprint( object IsVIPFingerprint : MethodFingerprint(
customFingerprint = custom@{ methodDef, _ -> customFingerprint = custom@{ methodDef, _ ->
if (!methodDef.definingClass.endsWith("RealmUserSettings;")) return@custom false if (!methodDef.definingClass.endsWith("RemoteUser;")) return@custom false
methodDef.name == "isVIP" methodDef.name == "isVIP"
} }

View file

@ -2,8 +2,8 @@ package app.revanced.patches.trakt.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object RealmUserSettingsFingerprint : MethodFingerprint( object RemoteUserFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("RealmUserSettings;") methodDef.definingClass.endsWith("RemoteUser;")
} }
) )

View file

@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.trakt.annotations.UnlockProCompatibility import app.revanced.patches.trakt.annotations.UnlockProCompatibility
import app.revanced.patches.trakt.fingerprints.IsVIPEPFingerprint import app.revanced.patches.trakt.fingerprints.IsVIPEPFingerprint
import app.revanced.patches.trakt.fingerprints.IsVIPFingerprint import app.revanced.patches.trakt.fingerprints.IsVIPFingerprint
import app.revanced.patches.trakt.fingerprints.RealmUserSettingsFingerprint import app.revanced.patches.trakt.fingerprints.RemoteUserFingerprint
@Patch @Patch
@Name("unlock-pro") @Name("unlock-pro")
@ -22,20 +22,20 @@ import app.revanced.patches.trakt.fingerprints.RealmUserSettingsFingerprint
@UnlockProCompatibility @UnlockProCompatibility
@Version("0.0.1") @Version("0.0.1")
class UnlockProPatch : BytecodePatch( class UnlockProPatch : BytecodePatch(
listOf(RealmUserSettingsFingerprint) listOf(RemoteUserFingerprint)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
RealmUserSettingsFingerprint.result?.classDef?.let { realUserSettingsClass -> RemoteUserFingerprint.result?.classDef?.let { remoteUserClass ->
arrayOf(IsVIPFingerprint, IsVIPEPFingerprint).onEach { fingerprint -> arrayOf(IsVIPFingerprint, IsVIPEPFingerprint).onEach { fingerprint ->
// Resolve both fingerprints on the same class. // Resolve both fingerprints on the same class.
if (!fingerprint.resolve(context, realUserSettingsClass)) if (!fingerprint.resolve(context, remoteUserClass))
throw fingerprint.toErrorResult() throw fingerprint.toErrorResult()
}.forEach { fingerprint -> }.forEach { fingerprint ->
// Return true for both VIP check methods. // Return true for both VIP check methods.
fingerprint.result?.mutableMethod?.addInstructions(0, RETURN_TRUE_INSTRUCTIONS) fingerprint.result?.mutableMethod?.addInstructions(0, RETURN_TRUE_INSTRUCTIONS)
?: return fingerprint.toErrorResult() ?: return fingerprint.toErrorResult()
} }
} ?: return RealmUserSettingsFingerprint.toErrorResult() } ?: return RemoteUserFingerprint.toErrorResult()
return PatchResultSuccess() return PatchResultSuccess()
} }

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.BytecodeContext
import app.revanced.patcher.data.toMethodWalker import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions 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.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,12 +14,10 @@ import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod 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.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference 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.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("spoof-signature-verification") @Name("spoof-signature-verification")
@Description("Spoofs a patched client to prevent playback issues.") @Description("Spoofs a patched client to prevent playback issues.")
@ -33,7 +30,6 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
class SpoofSignatureVerificationPatch : BytecodePatch( class SpoofSignatureVerificationPatch : BytecodePatch(
listOf( listOf(
ProtobufParameterBuilderFingerprint, ProtobufParameterBuilderFingerprint,
OpenCronetDataSourceFingerprint,
) )
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
@ -72,23 +68,6 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
} }
} ?: return ProtobufParameterBuilderFingerprint.toErrorResult() } ?: 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() return PatchResultSuccess()
} }