Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot
3a25dc4fa2 chore(release): 2.80.0 [skip ci]
# [2.80.0](https://github.com/revanced/revanced-patches/compare/v2.79.2...v2.80.0) (2022-10-04)

### Features

* **youtube/remember-video-quality:** remember current quality option ([038041f](7f1a918649))
2022-10-04 05:53:56 +00:00
oSumAtrIX
7f1a918649 feat(youtube/remember-video-quality): remember current quality option 2022-10-04 07:51:47 +02:00
semantic-release-bot
c26de68a27 chore(release): 2.79.2 [skip ci]
## [2.79.2](https://github.com/revanced/revanced-patches/compare/v2.79.1...v2.79.2) (2022-10-04)

### Bug Fixes

* **youtube/disable-startup-shorts-player:** don't affect functionality of navigation bar  ([#716](https://github.com/revanced/revanced-patches/issues/716)) ([f344603](9381508678))
2022-10-04 05:44:44 +00:00
OxrxL
9381508678 fix(youtube/disable-startup-shorts-player): don't affect functionality of navigation bar (#716) 2022-10-04 07:43:01 +02:00
6 changed files with 51 additions and 9 deletions

View File

@@ -1,3 +1,17 @@
# [2.80.0](https://github.com/revanced/revanced-patches/compare/v2.79.2...v2.80.0) (2022-10-04)
### Features
* **youtube/remember-video-quality:** remember current quality option ([9c510d4](https://github.com/revanced/revanced-patches/commit/9c510d472048f5bce127eb0329e53aaf259e9b1b))
## [2.79.2](https://github.com/revanced/revanced-patches/compare/v2.79.1...v2.79.2) (2022-10-04)
### Bug Fixes
* **youtube/disable-startup-shorts-player:** don't affect functionality of navigation bar ([#716](https://github.com/revanced/revanced-patches/issues/716)) ([05f5cc1](https://github.com/revanced/revanced-patches/commit/05f5cc17e3fcbf255c6fe5b503c9fd20c218f5a1))
## [2.79.1](https://github.com/revanced/revanced-patches/compare/v2.79.0...v2.79.1) (2022-10-03)

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.79.1
version = 2.80.0

File diff suppressed because one or more lines are too long

View File

@@ -3,6 +3,7 @@ package app.revanced.patches.youtube.layout.startupshortsreset.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.startupshortsreset.annotations.StartupShortsResetCompatibility
@@ -11,9 +12,20 @@ import org.jf.dexlib2.Opcode
@Name("user-was-in-shorts-fingerprint")
@MatchingMethod("Lkzb;", "e")
@FuzzyPatternScanMethod(3)
@StartupShortsResetCompatibility
@Version("0.0.1")
object UserWasInShortsFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"),
opcodes = listOf(
Opcode.IGET_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT,
),
strings = listOf("Failed to read user_was_in_shorts proto after successful warmup"),
)

View File

@@ -16,6 +16,7 @@ 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.framework.components.impl.StringResource
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@@ -39,15 +40,17 @@ class DisableShortsOnStartupPatch : BytecodePatch(
)
)
val userWasInShortsMethod = UserWasInShortsFingerprint.result!!.mutableMethod
val userWasInShortsResult = UserWasInShortsFingerprint.result!!
val userWasInShortsMethod = userWasInShortsResult.mutableMethod
val moveResultIndex = userWasInShortsResult.scanResult.patternScanResult!!.endIndex
userWasInShortsMethod.addInstructions(
0, """
moveResultIndex + 1, """
invoke-static { }, Lapp/revanced/integrations/patches/DisableStartupShortsPlayerPatch;->disableStartupShortsPlayer()Z
move-result v0
if-eqz v0, :cond_startup_shorts_reset
move-result v5
if-eqz v5, :disable_shorts_player
return-void
:cond_startup_shorts_reset
:disable_shorts_player
nop
"""
)

View File

@@ -17,12 +17,17 @@ import app.revanced.patches.youtube.misc.quality.annotations.DefaultVideoQuality
import app.revanced.patches.youtube.misc.quality.fingerprints.VideoQualityReferenceFingerprint
import app.revanced.patches.youtube.misc.quality.fingerprints.VideoQualitySetterFingerprint
import app.revanced.patches.youtube.misc.quality.fingerprints.VideoUserQualityChangeFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourcePatch
import app.revanced.patches.youtube.misc.videoid.patch.VideoIdPatch
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.instruction.SwitchPayload
import org.jf.dexlib2.iface.reference.FieldReference
@Patch
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class])
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class, SettingsPatch::class])
@Name("remember-video-quality")
@Description("Adds the ability to remember the video quality you chose in the video quality flyout.")
@DefaultVideoQualityCompatibility
@@ -33,7 +38,15 @@ class RememberVideoQualityPatch : BytecodePatch(
)
) {
override fun execute(data: BytecodeData): PatchResult {
//TODO: include setting to skip remembering the new quality
SettingsPatch.PreferenceScreen.MISC.addPreferences(
SwitchPreference(
"revanced_remember_video_quality_selection",
StringResource("revanced_remember_video_quality_selection_title", "Remember current video quality"),
true,
StringResource("revanced_remember_video_quality_selection_summary_on", "The current video quality will not change"),
StringResource("revanced_remember_video_quality_selection_summary_off", "Video quality will be remembered until a new quality is chosen")
)
)
val setterMethod = VideoQualitySetterFingerprint.result!!