Skip to content

Commit

Permalink
fix(YouTube - Change player flyout panel toggles): Fix for supported …
Browse files Browse the repository at this point in the history
…versions
  • Loading branch information
anddea committed Mar 19, 2024
1 parent 56ad720 commit a9fe961
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
"19.02.39",
"19.03.36",
"19.04.38",
"19.05.35",
"19.05.36"
]
)
Expand All @@ -71,7 +70,7 @@ object ChangeTogglePatch : BytecodePatch(
)
) {
override fun execute(context: BytecodeContext) {
if (SettingsPatch.upward1841) throw PatchException("This version is not supported. Please use YouTube 19.05.36 or earlier.")
if (SettingsPatch.upward1905) throw PatchException("This version is not supported. Please use YouTube 19.05.36 or earlier.")

val additionalSettingsConfigResult = AdditionalSettingsConfigFingerprint.result
?: throw AdditionalSettingsConfigFingerprint.exception
Expand Down Expand Up @@ -113,7 +112,7 @@ object ChangeTogglePatch : BytecodePatch(
it.mutableMethod.apply {
val insertIndex = implementation!!.instructions.indexOfFirst { instruction ->
instruction.opcode == Opcode.INVOKE_VIRTUAL
&& (instruction as ReferenceInstruction).reference.toString().endsWith(descriptor)
&& (instruction as ReferenceInstruction).reference.toString().endsWith(descriptor)
} + 2
val insertRegister =
getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
Expand All @@ -125,6 +124,6 @@ object ChangeTogglePatch : BytecodePatch(
"""
)
}
} ?: throw PatchException("This version is not supported. Please use YouTube 19.05.36 or previous ones.")
} ?: throw exception
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ object SettingsPatch : AbstractSettingsResourcePatch(
upward1841 = 234200000 <= playServicesVersion
upward1843 = 234400000 <= playServicesVersion
upward1904 = 240502000 <= playServicesVersion
upward1905 = 240700000 <= playServicesVersion
upward1909 = 241002000 > playServicesVersion

break
Expand Down Expand Up @@ -198,6 +199,7 @@ object SettingsPatch : AbstractSettingsResourcePatch(
internal var upward1841: Boolean = false
internal var upward1843: Boolean = false
internal var upward1904: Boolean = false
internal var upward1905: Boolean = false
internal var upward1909: Boolean = false

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

0 comments on commit a9fe961

Please sign in to comment.