mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 18:03:55 +01:00
Compare commits
9 Commits
v2.196.0-d
...
v2.196.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47f96563a9 | ||
|
|
2e9be4ea8f | ||
|
|
d76d96c1aa | ||
|
|
d5e226b449 | ||
|
|
340dc59f74 | ||
|
|
a75014b390 | ||
|
|
3740494f1b | ||
|
|
7529d9d3ed | ||
|
|
98483ba1e8 |
29
CHANGELOG.md
29
CHANGELOG.md
@@ -1,3 +1,32 @@
|
||||
# [2.196.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.7...v2.196.0-dev.8) (2023-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ID Austria:** Constrain compatibility to last working version ([#3196](https://github.com/ReVanced/revanced-patches/issues/3196)) ([79a2416](https://github.com/ReVanced/revanced-patches/commit/79a24164193460acf1b7bac43abdfa2604b02679))
|
||||
|
||||
# [2.196.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.6...v2.196.0-dev.7) (2023-10-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube:** Add `Disable fullscreen ambient mode` patch ([2a5514a](https://github.com/ReVanced/revanced-patches/commit/2a5514a6b3df076d5bc2cdc4459df30bca18f396))
|
||||
* **YouTube:** Add `Disable suggested video end screen` patch ([09f1684](https://github.com/ReVanced/revanced-patches/commit/09f168406c36fb71e12c6c1875a765a86ec2b4f9))
|
||||
|
||||
# [2.196.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.5...v2.196.0-dev.6) (2023-10-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - ReturnYouTubeDislike:** Fix RYD prefetching home feed Shorts ([#3195](https://github.com/ReVanced/revanced-patches/issues/3195)) ([f3726fe](https://github.com/ReVanced/revanced-patches/commit/f3726fefb9a80cccbf12f3ec455d1720b385782e))
|
||||
|
||||
# [2.196.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.4...v2.196.0-dev.5) (2023-10-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Theme:** Fix patch error ([e6fe646](https://github.com/ReVanced/revanced-patches/commit/e6fe646a7f2ade5f24c0142ad44032ccaf2cc9d0))
|
||||
|
||||
# [2.196.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.3...v2.196.0-dev.4) (2023-10-23)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 2.196.0-dev.4
|
||||
version = 2.196.0-dev.8
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ import app.revanced.patches.idaustria.detection.root.fingerprints.RootDetectionF
|
||||
@Patch(
|
||||
name = "Remove root detection",
|
||||
description = "Removes the check for root permissions and unlocked bootloader.",
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app")]
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app", ["2.7.1"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object RootDetectionPatch : BytecodePatch(
|
||||
|
||||
@@ -10,7 +10,7 @@ import app.revanced.patches.idaustria.detection.signature.fingerprints.SpoofSign
|
||||
@Patch(
|
||||
name = "Spoof signature",
|
||||
description = "Spoofs the signature of the app.",
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app")]
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app", ["2.7.1"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object SpoofSignaturePatch : BytecodePatch(
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package app.revanced.patches.youtube.layout.hide.fullscreenambientmode
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.fullscreenambientmode.fingerprints.InitializeAmbientModeFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
name = "Disable fullscreen ambient mode",
|
||||
description = "Disables the ambient mode when in fullscreen.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, IntegrationsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DisableFullscreenAmbientModePatch : BytecodePatch(
|
||||
setOf(InitializeAmbientModeFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/DisableFullscreenAmbientModePatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_fullscreen_ambient_mode",
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_title",
|
||||
"Disable ambient mode in fullscreen"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_summary_on",
|
||||
"Ambient mode disabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_summary_off",
|
||||
"Ambient mode enabled"
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
InitializeAmbientModeFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val moveIsEnabledIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
addInstruction(
|
||||
moveIsEnabledIndex,
|
||||
"invoke-static { }, " +
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->enableFullScreenAmbientMode()Z"
|
||||
)
|
||||
}
|
||||
} ?: throw InitializeAmbientModeFingerprint.exception
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.hide.fullscreenambientmode.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object InitializeAmbientModeFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.CONSTRUCTOR or AccessFlags.PUBLIC,
|
||||
opcodes = listOf(Opcode.MOVE_RESULT),
|
||||
literalSupplier = { 45389368 }
|
||||
)
|
||||
@@ -0,0 +1,48 @@
|
||||
package app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen.fingerprints.CreateEndScreenViewFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Disable suggested video end screen",
|
||||
description = "Disables the suggested video end screen at the end of a video.",
|
||||
dependencies = [IntegrationsPatch::class, DisableSuggestedVideoEndScreenResourcePatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DisableSuggestedVideoEndScreenPatch : BytecodePatch(
|
||||
setOf(CreateEndScreenViewFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
CreateEndScreenViewFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val addOnClickEventListenerIndex = it.scanResult.patternScanResult!!.endIndex - 1
|
||||
val viewRegister = getInstruction<FiveRegisterInstruction>(addOnClickEventListenerIndex).registerC
|
||||
|
||||
addInstruction(
|
||||
addOnClickEventListenerIndex + 1,
|
||||
"invoke-static {v$viewRegister}, " +
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->closeEndScreen(Landroid/widget/ImageView;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw CreateEndScreenViewFingerprint.exception
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
],
|
||||
)
|
||||
object DisableSuggestedVideoEndScreenResourcePatch : ResourcePatch() {
|
||||
internal var sizeAdjustableLiteAutoNavOverlay: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_suggested_video_end_screen",
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_title",
|
||||
"Disable suggested video end screen"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_summary_on",
|
||||
"Suggested videos will be disabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_summary_off",
|
||||
"Suggested videos will be shown"
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
sizeAdjustableLiteAutoNavOverlay = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "layout" && it.name == "size_adjustable_lite_autonav_overlay"
|
||||
}.id
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen.DisableSuggestedVideoEndScreenResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object CreateEndScreenViewFingerprint : LiteralValueFingerprint(
|
||||
returnType= "Landroid/view/View;",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("Landroid/content/Context;"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.CONST
|
||||
),
|
||||
literalSupplier = { DisableSuggestedVideoEndScreenResourcePatch.sizeAdjustableLiteAutoNavOverlay }
|
||||
)
|
||||
@@ -58,7 +58,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
VideoIdPatch.hookVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
|
||||
|
||||
// Hook the player response video id, to start loading RYD sooner in the background.
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->preloadVideoId(Ljava/lang/String;)V")
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->preloadVideoId(Ljava/lang/String;Z)V")
|
||||
|
||||
// endregion
|
||||
|
||||
@@ -184,7 +184,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
// Player response video id is needed to search for the video ids in Shorts litho components.
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$FILTER_CLASS_DESCRIPTOR->newPlayerResponseVideoId(Ljava/lang/String;)V")
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$FILTER_CLASS_DESCRIPTOR->newPlayerResponseVideoId(Ljava/lang/String;Z)V")
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@ object ThemeBytecodePatch : BytecodePatch(
|
||||
|
||||
internal const val GRADIENT_LOADING_SCREEN_AB_CONSTANT = 45412406L
|
||||
|
||||
private const val AMOLED_BLACK_COLOR = "#@android:color/black"
|
||||
private const val WHITE_COLOR = "#@android:color/white"
|
||||
private const val AMOLED_BLACK_COLOR = "@android:color/black"
|
||||
private const val WHITE_COLOR = "@android:color/white"
|
||||
|
||||
internal val darkThemeBackgroundColor by stringPatchOption(
|
||||
key = "darkThemeBackgroundColor",
|
||||
|
||||
@@ -114,7 +114,7 @@ object VideoInformationPatch : BytecodePatch(
|
||||
VideoIdPatch.hookVideoId(videoIdMethodDescriptor)
|
||||
VideoIdPatch.hookBackgroundPlayVideoId(videoIdMethodDescriptor)
|
||||
VideoIdPatch.hookPlayerResponseVideoId(
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->setPlayerResponseVideoId(Ljava/lang/String;)V")
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->setPlayerResponseVideoId(Ljava/lang/String;Z)V")
|
||||
|
||||
/*
|
||||
* Set the video time method
|
||||
|
||||
@@ -19,6 +19,7 @@ object PlayerResponseMethodHookPatch :
|
||||
Closeable,
|
||||
MutableSet<PlayerResponseMethodHookPatch.Hook> by mutableSetOf() {
|
||||
private const val VIDEO_ID_PARAMETER = 1
|
||||
private const val VIDEO_IS_OPENING_OR_PLAYING_PARAMETER = 11
|
||||
private const val PROTO_BUFFER_PARAMETER_PARAMETER = 3
|
||||
|
||||
private lateinit var playerResponseMethod: MutableMethod
|
||||
@@ -30,7 +31,7 @@ object PlayerResponseMethodHookPatch :
|
||||
|
||||
override fun close() {
|
||||
fun hookVideoId(hook: Hook) = playerResponseMethod.addInstruction(
|
||||
0, "invoke-static {p$VIDEO_ID_PARAMETER}, $hook"
|
||||
0, "invoke-static {p$VIDEO_ID_PARAMETER, p$VIDEO_IS_OPENING_OR_PLAYING_PARAMETER}, $hook"
|
||||
)
|
||||
|
||||
fun hookProtoBufferParameter(hook: Hook) = playerResponseMethod.addInstructions(
|
||||
|
||||
@@ -18,7 +18,7 @@ object PlayerParameterBuilderFingerprint : MethodFingerprint(
|
||||
"Ljava/lang/String;",
|
||||
"Ljava/lang/String;",
|
||||
"L",
|
||||
"Z",
|
||||
"Z", // Appears to indicate if the video id is being opened or is currently playing.
|
||||
"Z",
|
||||
"Z"
|
||||
)
|
||||
|
||||
@@ -103,6 +103,9 @@ object VideoIdPatch : BytecodePatch(
|
||||
* Hooks the video id of every video when loaded.
|
||||
* Supports all videos and functions in all situations.
|
||||
*
|
||||
* First parameter is the video id.
|
||||
* Second parameter is if the video is being opened or is currently playing.
|
||||
*
|
||||
* Hook is always called off the main thread.
|
||||
*
|
||||
* This hook is called as soon as the player response is parsed,
|
||||
@@ -117,7 +120,7 @@ object VideoIdPatch : BytecodePatch(
|
||||
*
|
||||
* Be aware, this can be called multiple times for the same video id.
|
||||
*
|
||||
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
||||
* @param methodDescriptor which method to call. Params must be `Ljava/lang/String;Z`
|
||||
*/
|
||||
fun hookPlayerResponseVideoId(methodDescriptor: String) {
|
||||
PlayerResponseMethodHookPatch += PlayerResponseMethodHookPatch.Hook.VideoId(
|
||||
|
||||
Reference in New Issue
Block a user