mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2025-05-11 21:25:40 +02:00
fix(YouTube - Theme): Fix 19.25 - 19.45 patch error
This commit is contained in:
parent
f4febac128
commit
5b47a5f0f6
5 changed files with 39 additions and 13 deletions
|
@ -1365,6 +1365,7 @@ public final class app/revanced/patches/youtube/misc/playservice/VersionCheckPat
|
||||||
public static final fun is_19_43_or_greater ()Z
|
public static final fun is_19_43_or_greater ()Z
|
||||||
public static final fun is_19_46_or_greater ()Z
|
public static final fun is_19_46_or_greater ()Z
|
||||||
public static final fun is_19_47_or_greater ()Z
|
public static final fun is_19_47_or_greater ()Z
|
||||||
|
public static final fun is_19_49_or_greater ()Z
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatchKt {
|
public final class app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatchKt {
|
||||||
|
|
|
@ -10,8 +10,7 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||||
import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch
|
import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.misc.playservice.is_19_23_or_greater
|
import app.revanced.patches.youtube.misc.playservice.is_19_43_or_greater
|
||||||
import app.revanced.patches.youtube.misc.playservice.is_19_25_or_greater
|
|
||||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||||
import app.revanced.patches.youtube.shared.mainActivityFingerprint
|
import app.revanced.patches.youtube.shared.mainActivityFingerprint
|
||||||
|
@ -30,7 +29,7 @@ private val swipeControlsResourcePatch = resourcePatch {
|
||||||
execute {
|
execute {
|
||||||
addResources("youtube", "interaction.swipecontrols.swipeControlsResourcePatch")
|
addResources("youtube", "interaction.swipecontrols.swipeControlsResourcePatch")
|
||||||
|
|
||||||
if (is_19_25_or_greater) {
|
if (is_19_43_or_greater) {
|
||||||
PreferenceScreen.SWIPE_CONTROLS.addPreferences(
|
PreferenceScreen.SWIPE_CONTROLS.addPreferences(
|
||||||
SwitchPreference("revanced_swipe_change_video")
|
SwitchPreference("revanced_swipe_change_video")
|
||||||
)
|
)
|
||||||
|
@ -114,7 +113,7 @@ val swipeControlsPatch = bytecodePatch(
|
||||||
|
|
||||||
// region patch to enable/disable swipe to change video.
|
// region patch to enable/disable swipe to change video.
|
||||||
|
|
||||||
if (is_19_23_or_greater) {
|
if (is_19_43_or_greater) {
|
||||||
swipeChangeVideoFingerprint.method.insertFeatureFlagBooleanOverride(
|
swipeChangeVideoFingerprint.method.insertFeatureFlagBooleanOverride(
|
||||||
SWIPE_CHANGE_VIDEO_FEATURE_FLAG,
|
SWIPE_CHANGE_VIDEO_FEATURE_FLAG,
|
||||||
"$EXTENSION_CLASS_DESCRIPTOR->allowSwipeChangeVideo(Z)Z"
|
"$EXTENSION_CLASS_DESCRIPTOR->allowSwipeChangeVideo(Z)Z"
|
||||||
|
|
|
@ -41,9 +41,23 @@ internal val lithoLinearGradientFingerprint = fingerprint {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 29.25 - 19.50
|
* 19.49+
|
||||||
*/
|
*/
|
||||||
internal val playerLinearGradientLegacyFingerprint = fingerprint {
|
internal val playerLinearGradientFingerprint = fingerprint {
|
||||||
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
|
||||||
|
parameters("I", "I", "I", "I", "Landroid/content/Context;", "I")
|
||||||
|
returns("Landroid/graphics/LinearGradient;")
|
||||||
|
opcodes(
|
||||||
|
Opcode.FILLED_NEW_ARRAY,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT
|
||||||
|
)
|
||||||
|
literal { ytYoutubeMagentaColorId }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19.46 - 19.47
|
||||||
|
*/
|
||||||
|
internal val playerLinearGradientLegacy1946Fingerprint = fingerprint {
|
||||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||||
parameters("I", "I", "I", "I")
|
parameters("I", "I", "I", "I")
|
||||||
returns("V")
|
returns("V")
|
||||||
|
@ -57,12 +71,11 @@ internal val playerLinearGradientLegacyFingerprint = fingerprint {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 20.03+
|
* 19.25 - 19.45
|
||||||
*/
|
*/
|
||||||
internal val playerLinearGradientFingerprint = fingerprint {
|
internal val playerLinearGradientLegacy1925Fingerprint = fingerprint {
|
||||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
|
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
|
||||||
parameters("I", "I", "I", "I", "Landroid/content/Context;", "I")
|
parameters("Landroid/content/Context;")
|
||||||
returns("Landroid/graphics/LinearGradient;")
|
|
||||||
opcodes(
|
opcodes(
|
||||||
Opcode.FILLED_NEW_ARRAY,
|
Opcode.FILLED_NEW_ARRAY,
|
||||||
Opcode.MOVE_RESULT_OBJECT
|
Opcode.MOVE_RESULT_OBJECT
|
||||||
|
|
|
@ -15,6 +15,7 @@ import app.revanced.patches.youtube.layout.theme.lithoColorOverrideHook
|
||||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||||
import app.revanced.patches.youtube.misc.playservice.is_19_25_or_greater
|
import app.revanced.patches.youtube.misc.playservice.is_19_25_or_greater
|
||||||
import app.revanced.patches.youtube.misc.playservice.is_19_46_or_greater
|
import app.revanced.patches.youtube.misc.playservice.is_19_46_or_greater
|
||||||
|
import app.revanced.patches.youtube.misc.playservice.is_19_49_or_greater
|
||||||
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
|
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||||
import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
|
import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
|
||||||
|
@ -188,6 +189,7 @@ val seekbarColorPatch = bytecodePatch(
|
||||||
sharedExtensionPatch,
|
sharedExtensionPatch,
|
||||||
lithoColorHookPatch,
|
lithoColorHookPatch,
|
||||||
seekbarColorResourcePatch,
|
seekbarColorResourcePatch,
|
||||||
|
versionCheckPatch
|
||||||
)
|
)
|
||||||
|
|
||||||
execute {
|
execute {
|
||||||
|
@ -240,8 +242,16 @@ val seekbarColorPatch = bytecodePatch(
|
||||||
"invoke-static/range { p4 .. p5 }, $EXTENSION_CLASS_DESCRIPTOR->setLinearGradient([I[F)V"
|
"invoke-static/range { p4 .. p5 }, $EXTENSION_CLASS_DESCRIPTOR->setLinearGradient([I[F)V"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: add 20.03 support
|
val playerFingerprint =
|
||||||
playerLinearGradientLegacyFingerprint.let {
|
if (is_19_49_or_greater) {
|
||||||
|
playerLinearGradientFingerprint
|
||||||
|
} else if (is_19_46_or_greater) {
|
||||||
|
playerLinearGradientLegacy1946Fingerprint
|
||||||
|
} else {
|
||||||
|
playerLinearGradientLegacy1925Fingerprint
|
||||||
|
}
|
||||||
|
|
||||||
|
playerFingerprint.let {
|
||||||
it.method.apply {
|
it.method.apply {
|
||||||
val index = it.patternMatch!!.endIndex
|
val index = it.patternMatch!!.endIndex
|
||||||
val register = getInstruction<OneRegisterInstruction>(index).registerA
|
val register = getInstruction<OneRegisterInstruction>(index).registerA
|
||||||
|
|
|
@ -41,6 +41,8 @@ var is_19_46_or_greater = false
|
||||||
private set
|
private set
|
||||||
var is_19_47_or_greater = false
|
var is_19_47_or_greater = false
|
||||||
private set
|
private set
|
||||||
|
var is_19_49_or_greater = false
|
||||||
|
private set
|
||||||
|
|
||||||
val versionCheckPatch = resourcePatch(
|
val versionCheckPatch = resourcePatch(
|
||||||
description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.",
|
description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.",
|
||||||
|
@ -74,5 +76,6 @@ val versionCheckPatch = resourcePatch(
|
||||||
is_19_43_or_greater = 244405000 <= playStoreServicesVersion
|
is_19_43_or_greater = 244405000 <= playStoreServicesVersion
|
||||||
is_19_46_or_greater = 244705000 <= playStoreServicesVersion
|
is_19_46_or_greater = 244705000 <= playStoreServicesVersion
|
||||||
is_19_47_or_greater = 244799000 <= playStoreServicesVersion
|
is_19_47_or_greater = 244799000 <= playStoreServicesVersion
|
||||||
|
is_19_49_or_greater = 245005000 <= playStoreServicesVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue