Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot
ef37b78b45 chore: Release v5.0.1-dev.3 [skip ci]
## [5.0.1-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.0.1-dev.2...v5.0.1-dev.3) (2024-11-11)

### Bug Fixes

* **YouTube - Playback speed:** Remember playback speed when using non 1.0x default speed ([d881d8b](d881d8bc44)), closes [#3810](https://github.com/ReVanced/revanced-patches/issues/3810)
2024-11-11 06:32:25 +00:00
LisoUseInAIKyrios
d881d8bc44 fix(YouTube - Playback speed): Remember playback speed when using non 1.0x default speed
This code was previously present with PR #3810 but was accidentally left out during the DSL migration.
2024-11-11 10:29:15 +04:00
semantic-release-bot
0cb993d6ea chore: Release v5.0.1-dev.2 [skip ci]
## [5.0.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.0.1-dev.1...v5.0.1-dev.2) (2024-11-11)

### Bug Fixes

* **Twitter:** Fix patches by matching fingerprint using correct class ([3793b21](3793b2103c))
2024-11-11 01:53:03 +00:00
oSumAtrIX
3793b2103c fix(Twitter): Fix patches by matching fingerprint using correct class 2024-11-11 02:50:21 +01:00
4 changed files with 33 additions and 9 deletions

View File

@@ -1,3 +1,17 @@
## [5.0.1-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.0.1-dev.2...v5.0.1-dev.3) (2024-11-11)
### Bug Fixes
* **YouTube - Playback speed:** Remember playback speed when using non 1.0x default speed ([05b9f87](https://github.com/ReVanced/revanced-patches/commit/05b9f8709895dae67e8cc12e8b7bdb87ff401997)), closes [#3810](https://github.com/ReVanced/revanced-patches/issues/3810)
## [5.0.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.0.1-dev.1...v5.0.1-dev.2) (2024-11-11)
### Bug Fixes
* **Twitter:** Fix patches by matching fingerprint using correct class ([6ae0d12](https://github.com/ReVanced/revanced-patches/commit/6ae0d124e1f27faecd20e4008951b08353572d98))
## [5.0.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.0.0...v5.0.1-dev.1) (2024-11-11)

View File

@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
version = 5.0.1-dev.1
version = 5.0.1-dev.3

View File

@@ -47,18 +47,22 @@ val jsonHookPatch = bytecodePatch(
dependsOn(sharedExtensionPatch)
execute {
val jsonFactoryClassDef = jsonHookPatchFingerprint.apply {
jsonHookPatchFingerprint.apply {
// Make sure the extension is present.
val jsonHookPatch = classBy { classDef -> classDef.type == JSON_HOOK_PATCH_CLASS_DESCRIPTOR }
?: throw PatchException("Could not find the extension.")
matchOrNull(jsonHookPatch.immutableClass)
?: throw PatchException("Unexpected extension.")
}.originalClassDef // Conveniently find the type to hook a method in, via a named field.
.fields
.firstOrNull { it.name == "JSON_FACTORY" }
?.type
.let { type -> classes.find { it.type == type } } ?: throw PatchException("Could not find required class.")
}
val jsonFactoryClassDef =
loganSquareFingerprint.originalClassDef // Conveniently find the type to hook a method in, via a named field.
.fields
.firstOrNull { it.name == "JSON_FACTORY" }
?.type
.let { type -> classes.find { it.type == type } }
?: throw PatchException("Could not find required class.")
// Hook the methods first parameter.
jsonInputStreamFingerprint.match(jsonFactoryClassDef).method.addInstructions(

View File

@@ -302,8 +302,14 @@ private fun getReference(instructions: List<BuilderInstruction>, offset: Int, op
/**
* Hook the video speed selected by the user.
*/
fun userSelectedPlaybackSpeedHook(targetMethodClass: String, targetMethodName: String) =
fun userSelectedPlaybackSpeedHook(targetMethodClass: String, targetMethodName: String) {
legacySpeedSelectionInsertMethod.addInstruction(
legacySpeedSelectionInsertIndex++,
"invoke-static { v$legacySpeedSelectionValueRegister }, $targetMethodClass->$targetMethodName(F)V"
)
speedSelectionInsertMethod.addInstruction(
speedSelectionInsertIndex++,
"invoke-static {v$speedSelectionValueRegister}, $targetMethodClass->$targetMethodName(F)V",
"invoke-static { v$speedSelectionValueRegister }, $targetMethodClass->$targetMethodName(F)V",
)
}