Skip to content

Commit a9fe961

Browse files
committed
fix(YouTube - Change player flyout panel toggles): Fix for supported versions
1 parent 56ad720 commit a9fe961

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/main/kotlin/app/revanced/patches/youtube/flyoutpanel/player/ChangeTogglePatch.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
5454
"19.02.39",
5555
"19.03.36",
5656
"19.04.38",
57-
"19.05.35",
5857
"19.05.36"
5958
]
6059
)
@@ -71,7 +70,7 @@ object ChangeTogglePatch : BytecodePatch(
7170
)
7271
) {
7372
override fun execute(context: BytecodeContext) {
74-
if (SettingsPatch.upward1841) throw PatchException("This version is not supported. Please use YouTube 19.05.36 or earlier.")
73+
if (SettingsPatch.upward1905) throw PatchException("This version is not supported. Please use YouTube 19.05.36 or earlier.")
7574

7675
val additionalSettingsConfigResult = AdditionalSettingsConfigFingerprint.result
7776
?: throw AdditionalSettingsConfigFingerprint.exception
@@ -113,7 +112,7 @@ object ChangeTogglePatch : BytecodePatch(
113112
it.mutableMethod.apply {
114113
val insertIndex = implementation!!.instructions.indexOfFirst { instruction ->
115114
instruction.opcode == Opcode.INVOKE_VIRTUAL
116-
&& (instruction as ReferenceInstruction).reference.toString().endsWith(descriptor)
115+
&& (instruction as ReferenceInstruction).reference.toString().endsWith(descriptor)
117116
} + 2
118117
val insertRegister =
119118
getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
@@ -125,6 +124,6 @@ object ChangeTogglePatch : BytecodePatch(
125124
"""
126125
)
127126
}
128-
} ?: throw PatchException("This version is not supported. Please use YouTube 19.05.36 or previous ones.")
127+
} ?: throw exception
129128
}
130129
}

src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ object SettingsPatch : AbstractSettingsResourcePatch(
105105
upward1841 = 234200000 <= playServicesVersion
106106
upward1843 = 234400000 <= playServicesVersion
107107
upward1904 = 240502000 <= playServicesVersion
108+
upward1905 = 240700000 <= playServicesVersion
108109
upward1909 = 241002000 > playServicesVersion
109110

110111
break
@@ -198,6 +199,7 @@ object SettingsPatch : AbstractSettingsResourcePatch(
198199
internal var upward1841: Boolean = false
199200
internal var upward1843: Boolean = false
200201
internal var upward1904: Boolean = false
202+
internal var upward1905: Boolean = false
201203
internal var upward1909: Boolean = false
202204

203205
internal fun addPreference(settingArray: Array<String>) {

0 commit comments

Comments
 (0)