Compare commits

...

9 Commits

Author SHA1 Message Date
semantic-release-bot
47f96563a9 chore(release): 2.196.0-dev.8 [skip ci]
# [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)) ([2e9be4e](2e9be4ea8f))
2023-10-25 11:17:57 +00:00
fe
2e9be4ea8f feat(ID Austria): Constrain compatibility to last working version (#3196) 2023-10-25 13:15:12 +02:00
semantic-release-bot
d76d96c1aa chore(release): 2.196.0-dev.7 [skip ci]
# [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 ([340dc59](340dc59f74))
* **YouTube:** Add `Disable suggested video end screen` patch ([d5e226b](d5e226b449))
2023-10-24 23:50:08 +00:00
oSumAtrIX
d5e226b449 feat(YouTube): Add Disable suggested video end screen patch 2023-10-25 01:47:23 +02:00
oSumAtrIX
340dc59f74 feat(YouTube): Add Disable fullscreen ambient mode patch 2023-10-25 01:47:22 +02:00
semantic-release-bot
a75014b390 chore(release): 2.196.0-dev.6 [skip ci]
# [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)) ([3740494](3740494f1b))
2023-10-24 20:37:07 +00:00
LisoUseInAIKyrios
3740494f1b fix(YouTube - ReturnYouTubeDislike): Fix RYD prefetching home feed Shorts (#3195) 2023-10-24 23:34:23 +03:00
semantic-release-bot
7529d9d3ed chore(release): 2.196.0-dev.5 [skip ci]
# [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 ([98483ba](98483ba1e8))
2023-10-24 08:46:51 +00:00
LisoUseInAIKyrios
98483ba1e8 fix(YouTube - Theme): Fix patch error 2023-10-24 11:43:15 +03:00
16 changed files with 234 additions and 12 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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(

View File

@@ -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(

View File

@@ -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
}
}

View File

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

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

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

View File

@@ -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

View File

@@ -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",

View File

@@ -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

View File

@@ -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(

View File

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

View File

@@ -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(