Compare commits

..

3 Commits

Author SHA1 Message Date
semantic-release-bot
1d7a9ac437 chore(release): 2.25.3 [skip ci]
## [2.25.3](https://github.com/revanced/revanced-patches/compare/v2.25.2...v2.25.3) (2022-07-29)

### Bug Fixes

* actually call `VideoInformation.setCurrentVideoId` first ([51e08fb](51e08fb0b6))
2022-07-29 01:34:59 +00:00
oSumAtrIX
51e08fb0b6 fix: actually call VideoInformation.setCurrentVideoId first 2022-07-29 03:32:28 +02:00
oSumAtrIX
91feea1c50 refactor: do not account for order in VideoIdPatch.injectCall (#246) 2022-07-29 03:20:55 +02:00
3 changed files with 15 additions and 6 deletions

View File

@@ -1,3 +1,10 @@
## [2.25.3](https://github.com/revanced/revanced-patches/compare/v2.25.2...v2.25.3) (2022-07-29)
### Bug Fixes
* actually call `VideoInformation.setCurrentVideoId` first ([5c62d0a](https://github.com/revanced/revanced-patches/commit/5c62d0a2e0217de1b9563a41b4e94ed63230440f))
## [2.25.2](https://github.com/revanced/revanced-patches/compare/v2.25.1...v2.25.2) (2022-07-26)

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.25.2
version = 2.25.3

View File

@@ -35,15 +35,18 @@ class VideoIdPatch : BytecodePatch(
injectCall("Lapp/revanced/integrations/videoplayer/VideoInformation;->setCurrentVideoId(Ljava/lang/String;)V")
offset++ // offset so setCurrentVideoId is called before any injected call
return PatchResultSuccess()
}
companion object {
private lateinit var result: MethodFingerprintResult
private var videoIdRegister: Int = 0
private lateinit var insertMethod: MutableMethod
private var offset = 2
private var videoIdRegister: Int = 0
private lateinit var result: MethodFingerprintResult
private lateinit var insertMethod: MutableMethod
/**
* Adds an invoke-static instruction, called with the new id when the video changes
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
@@ -52,10 +55,9 @@ class VideoIdPatch : BytecodePatch(
methodDescriptor: String
) {
insertMethod.addInstructions(
result.patternScanResult!!.endIndex + offset, // after the move-result-object
result.patternScanResult!!.endIndex + offset, // move-result-object offset
"invoke-static {v$videoIdRegister}, $methodDescriptor"
)
offset++ // so additional instructions get added later
}
}
}