fix(YouTube - Change player flyout panel toggles): Fix for supported versions

This commit is contained in:
Aaron Veil 2024-03-19 13:33:13 +03:00
parent 56ad7205e6
commit a9fe961d9c
2 changed files with 5 additions and 4 deletions

View file

@ -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"
]
)
@ -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
@ -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
@ -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
}
}

View file

@ -105,6 +105,7 @@ object SettingsPatch : AbstractSettingsResourcePatch(
upward1841 = 234200000 <= playServicesVersion
upward1843 = 234400000 <= playServicesVersion
upward1904 = 240502000 <= playServicesVersion
upward1905 = 240700000 <= playServicesVersion
upward1909 = 241002000 > playServicesVersion
break
@ -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>) {