Unofficial 20.45.32

This commit is contained in:
LisoUseInAIKyrios
2025-11-07 09:00:28 +02:00
parent 03ce5711de
commit 88352d8774
6 changed files with 61 additions and 35 deletions

View File

@@ -1660,6 +1660,7 @@ public final class app/revanced/patches/youtube/misc/playservice/VersionCheckPat
public static final fun is_20_37_or_greater ()Z
public static final fun is_20_39_or_greater ()Z
public static final fun is_20_41_or_greater ()Z
public static final fun is_20_45_or_greater ()Z
}
public final class app/revanced/patches/youtube/misc/privacy/SanitizeSharingLinksPatchKt {

View File

@@ -10,20 +10,6 @@ import app.revanced.patches.shared.misc.mapping.resourceLiteral
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val legacyRenderBottomNavigationBarParentFingerprint by fingerprint {
parameters(
"I",
"I",
"L",
"L",
"J",
"L",
)
instructions(
string("aa")
)
}
internal val shortsBottomBarContainerFingerprint by fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("V")
@@ -36,28 +22,49 @@ internal val shortsBottomBarContainerFingerprint by fingerprint {
)
}
/**
* 19.41 to 20.44.
*/
internal val renderBottomNavigationBarFingerprint by fingerprint {
returns("V")
parameters("Ljava/lang/String;")
opcodes(
Opcode.IGET_OBJECT,
Opcode.MONITOR_ENTER,
Opcode.IGET_OBJECT,
Opcode.IF_EQZ,
Opcode.INVOKE_INTERFACE,
Opcode.MONITOR_EXIT,
Opcode.RETURN_VOID,
Opcode.MOVE_EXCEPTION,
Opcode.MONITOR_EXIT,
Opcode.THROW,
instructions(
opcode(Opcode.IGET_OBJECT, maxAfter = 0),
opcode(Opcode.MONITOR_ENTER, maxAfter = 0),
opcode(Opcode.IGET_OBJECT, maxAfter = 0),
opcode(Opcode.IF_EQZ, maxAfter = 0),
opcode(Opcode.INVOKE_INTERFACE, maxAfter = 0),
opcode(Opcode.MONITOR_EXIT),
opcode(Opcode.RETURN_VOID, maxAfter = 0),
opcode(Opcode.MOVE_EXCEPTION, maxAfter = 0),
opcode(Opcode.MONITOR_EXIT, maxAfter = 0),
opcode(Opcode.THROW, maxAfter = 0),
)
}
/**
* Identical to [legacyRenderBottomNavigationBarParentFingerprint]
* Less than 19.41.
*/
internal val legacyRenderBottomNavigationBarLegacyParentFingerprint by fingerprint {
parameters(
"I",
"I",
"L",
"L",
"J",
"L",
)
instructions(
string("aa")
)
}
/**
* Identical to [legacyRenderBottomNavigationBarLegacyParentFingerprint]
* except this has an extra parameter.
*/
internal val renderBottomNavigationBarParentFingerprint by fingerprint {
internal val renderBottomNavigationBarLegacy1941ParentFingerprint by fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
parameters(
"I",
@@ -73,6 +80,19 @@ internal val renderBottomNavigationBarParentFingerprint by fingerprint {
)
}
internal val renderBottomNavigationBarParentFingerprint by fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("[Ljava/lang/Class;")
parameters(
"Ljava/lang/Class;",
"Ljava/lang/Object;",
"I"
)
instructions(
string("RPCAC")
)
}
internal val setPivotBarVisibilityFingerprint by fingerprint {
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
returns("V")

View File

@@ -20,6 +20,7 @@ import app.revanced.patches.youtube.misc.navigation.navigationBarHookPatch
import app.revanced.patches.youtube.misc.playservice.is_19_41_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_07_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_22_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_45_or_greater
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@@ -27,7 +28,6 @@ import app.revanced.util.findElementByAttributeValueOrThrow
import app.revanced.util.forEachLiteralValueInstruction
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstructionOrThrow
import app.revanced.util.indexOfFirstLiteralInstruction
import app.revanced.util.removeFromParent
import app.revanced.util.returnLate
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@@ -224,11 +224,13 @@ val hideShortsComponentsPatch = bytecodePatch(
// Hook to hide the shared navigation bar when the Shorts player is opened.
renderBottomNavigationBarFingerprint.match(
if (is_19_41_or_greater) {
(if (is_20_45_or_greater) {
renderBottomNavigationBarParentFingerprint
} else if (is_19_41_or_greater) {
renderBottomNavigationBarLegacy1941ParentFingerprint
} else {
legacyRenderBottomNavigationBarParentFingerprint
}.originalClassDef,
legacyRenderBottomNavigationBarLegacyParentFingerprint
}).originalClassDef
).method.addInstruction(
0,
"invoke-static { p1 }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Ljava/lang/String;)V",

View File

@@ -1,10 +1,8 @@
package app.revanced.patches.youtube.layout.panels.popup
import com.android.tools.smali.dexlib2.AccessFlags
import app.revanced.patcher.fingerprint
internal val engagementPanelControllerFingerprint by fingerprint {
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
returns("L")
strings(
"EngagementPanelController: cannot show EngagementPanel before EngagementPanelController.init() has been called.",

View File

@@ -9,6 +9,8 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisablePlayerPopupPanelsPatch;"
val playerPopupPanelsPatch = bytecodePatch(
name = "Disable player popup panels",
description = "Adds an option to disable panels (such as live chat) from opening automatically.",
@@ -37,7 +39,7 @@ val playerPopupPanelsPatch = bytecodePatch(
engagementPanelControllerFingerprint.method.addInstructionsWithLabels(
0,
"""
invoke-static { }, Lapp/revanced/extension/youtube/patches/DisablePlayerPopupPanelsPatch;->disablePlayerPopupPanels()Z
invoke-static { }, $EXTENSION_CLASS_DESCRIPTOR->disablePlayerPopupPanels()Z
move-result v0
if-eqz v0, :player_popup_panels
if-eqz p4, :player_popup_panels
@@ -45,7 +47,7 @@ val playerPopupPanelsPatch = bytecodePatch(
return-object v0
:player_popup_panels
nop
""",
"""
)
}
}

View File

@@ -93,6 +93,8 @@ var is_20_39_or_greater : Boolean by Delegates.notNull()
private set
var is_20_41_or_greater : Boolean by Delegates.notNull()
private set
var is_20_45_or_greater : Boolean by Delegates.notNull()
private set
val versionCheckPatch = resourcePatch(
description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.",
@@ -139,5 +141,6 @@ val versionCheckPatch = resourcePatch(
is_20_37_or_greater = 253805000 <= playStoreServicesVersion
is_20_39_or_greater = 253980000 <= playStoreServicesVersion
is_20_41_or_greater = 254205000 <= playStoreServicesVersion
is_20_45_or_greater = 254605000 <= playStoreServicesVersion
}
}