mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-24 11:11:03 +00:00
Compare commits
5 Commits
v2.174.0-d
...
v2.174.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a83e0dc257 | ||
|
|
5ea4d3c2a6 | ||
|
|
f4ae7fd9d7 | ||
|
|
b6539922fe | ||
|
|
a697b16aa3 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- name: Setup JDK
|
- name: Setup JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '17'
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
# [2.174.0-dev.17](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.16...v2.174.0-dev.17) (2023-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/remember-video-quality:** fix default video quality/speed being applied when resuming app. ([#2112](https://github.com/revanced/revanced-patches/issues/2112)) ([f68a41c](https://github.com/revanced/revanced-patches/commit/f68a41ce9f9a78818d3f28b069e70b8c66125f53))
|
||||||
|
|
||||||
|
# [2.174.0-dev.16](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.15...v2.174.0-dev.16) (2023-05-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* check for opcode type `CONST` ([e5bb63c](https://github.com/revanced/revanced-patches/commit/e5bb63c7ab4427b6116de4a999be306e0f3cf12e))
|
||||||
|
|
||||||
# [2.174.0-dev.15](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.14...v2.174.0-dev.15) (2023-05-08)
|
# [2.174.0-dev.15](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.14...v2.174.0-dev.15) (2023-05-08)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.174.0-dev.15
|
version = 2.174.0-dev.17
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -18,7 +18,7 @@ object CreatePlayerOverviewFingerprint : MethodFingerprint(
|
|||||||
),
|
),
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.implementation?.instructions?.any {
|
methodDef.implementation?.instructions?.any {
|
||||||
if (it.opcode != Opcode.INVOKE_VIRTUAL) return@any false
|
if (it.opcode != Opcode.CONST) return@any false
|
||||||
|
|
||||||
val literal = (it as WideLiteralInstruction).wideLiteral
|
val literal = (it as WideLiteralInstruction).wideLiteral
|
||||||
|
|
||||||
|
|||||||
@@ -160,24 +160,32 @@ class VideoInformationPatch : BytecodePatch(
|
|||||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/VideoInformation;"
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/VideoInformation;"
|
||||||
|
|
||||||
private lateinit var playerInitMethod: MutableMethod
|
private lateinit var playerInitMethod: MutableMethod
|
||||||
|
private var playerInitInsertIndex = 4
|
||||||
|
|
||||||
private lateinit var timeMethod: MutableMethod
|
private lateinit var timeMethod: MutableMethod
|
||||||
|
private var timeInitInsertIndex = 2
|
||||||
|
|
||||||
private lateinit var highPrecisionTimeMethod: MutableMethod
|
private lateinit var highPrecisionTimeMethod: MutableMethod
|
||||||
|
private var highPrecisionInsertIndex = 0
|
||||||
|
|
||||||
private fun MutableMethod.insert(insert: InsertIndex, register: String, descriptor: String) =
|
private fun MutableMethod.insert(insertIndex: Int, register: String, descriptor: String) =
|
||||||
addInstruction(insert.index, "invoke-static { $register }, $descriptor")
|
addInstruction(insertIndex, "invoke-static { $register }, $descriptor")
|
||||||
|
|
||||||
private fun MutableMethod.insertTimeHook(insert: InsertIndex, descriptor: String) =
|
private fun MutableMethod.insertTimeHook(insertIndex: Int, descriptor: String) =
|
||||||
insert(insert, "p1, p2", descriptor)
|
insert(insertIndex, "p1, p2", descriptor)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook the player controller.
|
* Hook the player controller. Called when a video is opened or the current video is changed.
|
||||||
|
*
|
||||||
|
* Note: This hook is called very early and is called before the video id, video time, video length,
|
||||||
|
* and many other data fields are set.
|
||||||
*
|
*
|
||||||
* @param targetMethodClass The descriptor for the class to invoke when the player controller is created.
|
* @param targetMethodClass The descriptor for the class to invoke when the player controller is created.
|
||||||
* @param targetMethodName The name of the static method to invoke when the player controller is created.
|
* @param targetMethodName The name of the static method to invoke when the player controller is created.
|
||||||
*/
|
*/
|
||||||
internal fun onCreateHook(targetMethodClass: String, targetMethodName: String) =
|
internal fun onCreateHook(targetMethodClass: String, targetMethodName: String) =
|
||||||
playerInitMethod.insert(
|
playerInitMethod.insert(
|
||||||
InsertIndex.CREATE,
|
playerInitInsertIndex++,
|
||||||
"v0",
|
"v0",
|
||||||
"$targetMethodClass->$targetMethodName(Ljava/lang/Object;)V"
|
"$targetMethodClass->$targetMethodName(Ljava/lang/Object;)V"
|
||||||
)
|
)
|
||||||
@@ -191,7 +199,7 @@ class VideoInformationPatch : BytecodePatch(
|
|||||||
*/
|
*/
|
||||||
internal fun videoTimeHook(targetMethodClass: String, targetMethodName: String) =
|
internal fun videoTimeHook(targetMethodClass: String, targetMethodName: String) =
|
||||||
timeMethod.insertTimeHook(
|
timeMethod.insertTimeHook(
|
||||||
InsertIndex.TIME,
|
timeInitInsertIndex++,
|
||||||
"$targetMethodClass->$targetMethodName(J)V"
|
"$targetMethodClass->$targetMethodName(J)V"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -205,16 +213,10 @@ class VideoInformationPatch : BytecodePatch(
|
|||||||
*/
|
*/
|
||||||
internal fun highPrecisionTimeHook(targetMethodClass: String, targetMethodName: String) =
|
internal fun highPrecisionTimeHook(targetMethodClass: String, targetMethodName: String) =
|
||||||
highPrecisionTimeMethod.insertTimeHook(
|
highPrecisionTimeMethod.insertTimeHook(
|
||||||
InsertIndex.HIGH_PRECISION_TIME,
|
highPrecisionInsertIndex++,
|
||||||
"$targetMethodClass->$targetMethodName(J)V"
|
"$targetMethodClass->$targetMethodName(J)V"
|
||||||
)
|
)
|
||||||
|
|
||||||
enum class InsertIndex(internal val index: Int) {
|
|
||||||
CREATE(4),
|
|
||||||
TIME(2),
|
|
||||||
HIGH_PRECISION_TIME(0),
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getReference(instructions: List<BuilderInstruction>, offset: Int, opcode: Opcode) =
|
private fun getReference(instructions: List<BuilderInstruction>, offset: Int, opcode: Opcode) =
|
||||||
instructions[instructions.indexOfFirst { it.opcode == opcode } + offset].reference
|
instructions[instructions.indexOfFirst { it.opcode == opcode } + offset].reference
|
||||||
|
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ 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.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch
|
||||||
import app.revanced.patches.youtube.misc.video.quality.annotations.RememberVideoQualityCompatibility
|
import app.revanced.patches.youtube.misc.video.quality.annotations.RememberVideoQualityCompatibility
|
||||||
import app.revanced.patches.youtube.misc.video.quality.fingerprints.SetQualityByIndexMethodClassFieldReferenceFingerprint
|
import app.revanced.patches.youtube.misc.video.quality.fingerprints.SetQualityByIndexMethodClassFieldReferenceFingerprint
|
||||||
import app.revanced.patches.youtube.misc.video.quality.fingerprints.VideoQualityItemOnClickParentFingerprint
|
import app.revanced.patches.youtube.misc.video.quality.fingerprints.VideoQualityItemOnClickParentFingerprint
|
||||||
import app.revanced.patches.youtube.misc.video.quality.fingerprints.VideoQualitySetterFingerprint
|
import app.revanced.patches.youtube.misc.video.quality.fingerprints.VideoQualitySetterFingerprint
|
||||||
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
import org.jf.dexlib2.iface.reference.FieldReference
|
import org.jf.dexlib2.iface.reference.FieldReference
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class, SettingsPatch::class])
|
@DependsOn([IntegrationsPatch::class, VideoInformationPatch::class, SettingsPatch::class])
|
||||||
@Name("remember-video-quality")
|
@Name("remember-video-quality")
|
||||||
@Description("Adds the ability to remember the video quality you chose in the video quality flyout.")
|
@Description("Adds the ability to remember the video quality you chose in the video quality flyout.")
|
||||||
@RememberVideoQualityCompatibility
|
@RememberVideoQualityCompatibility
|
||||||
@@ -114,7 +114,7 @@ class RememberVideoQualityPatch : BytecodePatch(
|
|||||||
* Conveniently, at this point the video quality is overridden to the remembered playback speed.
|
* Conveniently, at this point the video quality is overridden to the remembered playback speed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoIdPatch.injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->newVideoStarted(Ljava/lang/String;)V")
|
VideoInformationPatch.onCreateHook(INTEGRATIONS_CLASS_DESCRIPTOR, "newVideoStarted")
|
||||||
|
|
||||||
// Inject a call to set the remembered quality once a video loads.
|
// Inject a call to set the remembered quality once a video loads.
|
||||||
VideoQualitySetterFingerprint.result?.also {
|
VideoQualitySetterFingerprint.result?.also {
|
||||||
|
|||||||
@@ -23,12 +23,11 @@ import app.revanced.patches.youtube.misc.video.information.patch.VideoInformatio
|
|||||||
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch.Companion.reference
|
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch.Companion.reference
|
||||||
import app.revanced.patches.youtube.misc.video.speed.remember.annotation.RememberPlaybackSpeedCompatibility
|
import app.revanced.patches.youtube.misc.video.speed.remember.annotation.RememberPlaybackSpeedCompatibility
|
||||||
import app.revanced.patches.youtube.misc.video.speed.remember.fingerprint.InitializePlaybackSpeedValuesFingerprint
|
import app.revanced.patches.youtube.misc.video.speed.remember.fingerprint.InitializePlaybackSpeedValuesFingerprint
|
||||||
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("remember-playback-speed")
|
@Name("remember-playback-speed")
|
||||||
@Description("Adds the ability to remember the playback speed you chose in the video playback speed flyout.")
|
@Description("Adds the ability to remember the playback speed you chose in the video playback speed flyout.")
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, VideoIdPatch::class, VideoInformationPatch::class])
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, VideoInformationPatch::class])
|
||||||
@RememberPlaybackSpeedCompatibility
|
@RememberPlaybackSpeedCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class RememberPlaybackSpeedPatch : BytecodePatch(
|
class RememberPlaybackSpeedPatch : BytecodePatch(
|
||||||
@@ -77,8 +76,7 @@ class RememberPlaybackSpeedPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
VideoIdPatch.injectCall("${INTEGRATIONS_CLASS_DESCRIPTOR}->newVideoLoaded(Ljava/lang/String;)V")
|
VideoInformationPatch.onCreateHook(INTEGRATIONS_CLASS_DESCRIPTOR, "newVideoStarted")
|
||||||
|
|
||||||
VideoInformationPatch.userSelectedPlaybackSpeedHook(
|
VideoInformationPatch.userSelectedPlaybackSpeedHook(
|
||||||
INTEGRATIONS_CLASS_DESCRIPTOR, "userSelectedPlaybackSpeed")
|
INTEGRATIONS_CLASS_DESCRIPTOR, "userSelectedPlaybackSpeed")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user