mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-26 04:01:02 +00:00
Compare commits
3 Commits
v4.12.0-de
...
v4.12.0-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4085d1f9dc | ||
|
|
eadbf5f459 | ||
|
|
b12b3a73a6 |
@@ -1,3 +1,10 @@
|
|||||||
|
# [4.12.0-dev.16](https://github.com/ReVanced/revanced-patches/compare/v4.12.0-dev.15...v4.12.0-dev.16) (2024-08-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Spoof client:** Restore livestream audio only playback with iOS spoofing ([#3504](https://github.com/ReVanced/revanced-patches/issues/3504)) ([90d3288](https://github.com/ReVanced/revanced-patches/commit/90d32880906787d82c4b9a7a1099b46dff3a0870))
|
||||||
|
|
||||||
# [4.12.0-dev.15](https://github.com/ReVanced/revanced-patches/compare/v4.12.0-dev.14...v4.12.0-dev.15) (2024-08-02)
|
# [4.12.0-dev.15](https://github.com/ReVanced/revanced-patches/compare/v4.12.0-dev.14...v4.12.0-dev.15) (2024-08-02)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -423,6 +423,12 @@ public final class app/revanced/patches/music/ad/video/HideMusicVideoAds : app/r
|
|||||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/music/ad/video/HideVideoAds : app/revanced/patcher/patch/BytecodePatch {
|
||||||
|
public static final field INSTANCE Lapp/revanced/patches/music/ad/video/HideVideoAds;
|
||||||
|
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/music/ad/video/MusicVideoAdsPatch : app/revanced/patcher/patch/BytecodePatch {
|
public final class app/revanced/patches/music/ad/video/MusicVideoAdsPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||||
public static final field INSTANCE Lapp/revanced/patches/music/ad/video/MusicVideoAdsPatch;
|
public static final field INSTANCE Lapp/revanced/patches/music/ad/video/MusicVideoAdsPatch;
|
||||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 4.12.0-dev.15
|
version = 4.12.0-dev.16
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ import app.revanced.patcher.patch.BytecodePatch
|
|||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsParentFingerprint
|
import app.revanced.patches.music.ad.video.fingerprints.ShowVideoAdsParentFingerprint
|
||||||
import app.revanced.util.exception
|
import app.revanced.util.exception
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Hide music video ads",
|
name = "Hide video ads",
|
||||||
|
description = "Hides ads that appear while listening to or streaming music videos, podcasts, or songs.",
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
"com.google.android.apps.youtube.music",
|
"com.google.android.apps.youtube.music",
|
||||||
@@ -25,24 +26,32 @@ import app.revanced.util.exception
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object HideMusicVideoAds : BytecodePatch(
|
object HideVideoAds : BytecodePatch(
|
||||||
setOf(ShowMusicVideoAdsParentFingerprint),
|
setOf(ShowVideoAdsParentFingerprint),
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
ShowMusicVideoAdsParentFingerprint.result?.let {
|
ShowVideoAdsParentFingerprint.result?.let {
|
||||||
val showMusicVideoAdsMethod = context
|
val showVideoAdsMethod = context
|
||||||
.toMethodWalker(it.mutableMethod)
|
.toMethodWalker(it.mutableMethod)
|
||||||
.nextMethod(it.scanResult.patternScanResult!!.startIndex + 1, true).getMethod() as MutableMethod
|
.nextMethod(it.scanResult.patternScanResult!!.startIndex + 1, true).getMethod() as MutableMethod
|
||||||
|
|
||||||
showMusicVideoAdsMethod.addInstruction(0, "const/4 p1, 0x0")
|
showVideoAdsMethod.addInstruction(0, "const/4 p1, 0x0")
|
||||||
} ?: throw ShowMusicVideoAdsParentFingerprint.exception
|
} ?: throw ShowVideoAdsParentFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated("This patch class has been renamed to HideMusicVideoAds.")
|
@Deprecated("This patch class has been renamed to HideVideoAds.")
|
||||||
|
object HideMusicVideoAds : BytecodePatch(
|
||||||
|
dependencies = setOf(HideVideoAds::class)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated("This patch class has been renamed to HideVideoAds.")
|
||||||
object MusicVideoAdsPatch : BytecodePatch(
|
object MusicVideoAdsPatch : BytecodePatch(
|
||||||
dependencies = setOf(HideMusicVideoAds::class),
|
dependencies = setOf(HideMusicVideoAds::class),
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ package app.revanced.patches.music.ad.video.fingerprints
|
|||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
internal object ShowMusicVideoAdsParentFingerprint : MethodFingerprint(
|
internal object ShowVideoAdsParentFingerprint : MethodFingerprint(
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
@@ -16,7 +16,9 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMu
|
|||||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.backgroundplayback.BackgroundPlaybackPatch
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
||||||
|
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||||
@@ -38,16 +40,21 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
|
|||||||
SettingsPatch::class,
|
SettingsPatch::class,
|
||||||
AddResourcesPatch::class,
|
AddResourcesPatch::class,
|
||||||
UserAgentClientSpoofPatch::class,
|
UserAgentClientSpoofPatch::class,
|
||||||
|
// Required since iOS livestream fix partially enables background playback.
|
||||||
|
BackgroundPlaybackPatch::class,
|
||||||
|
PlayerTypeHookPatch::class,
|
||||||
],
|
],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
"com.google.android.youtube",
|
"com.google.android.youtube",
|
||||||
[
|
[
|
||||||
"18.37.36",
|
// This patch works with these versions,
|
||||||
"18.38.44",
|
// but the dependent background playback patch does not.
|
||||||
"18.43.45",
|
// "18.37.36",
|
||||||
"18.44.41",
|
// "18.38.44",
|
||||||
"18.45.43",
|
// "18.43.45",
|
||||||
|
// "18.44.41",
|
||||||
|
// "18.45.43",
|
||||||
"18.48.39",
|
"18.48.39",
|
||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
@@ -89,9 +96,9 @@ object SpoofClientPatch : BytecodePatch(
|
|||||||
// Video qualities missing.
|
// Video qualities missing.
|
||||||
BuildRequestFingerprint,
|
BuildRequestFingerprint,
|
||||||
|
|
||||||
// Watch history.
|
// Livestream audio only background playback.
|
||||||
GetTrackingUriFingerprint,
|
PlayerResponseModelBackgroundAudioPlaybackFingerprint,
|
||||||
),
|
)
|
||||||
) {
|
) {
|
||||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||||
"Lapp/revanced/integrations/youtube/patches/spoof/SpoofClientPatch;"
|
"Lapp/revanced/integrations/youtube/patches/spoof/SpoofClientPatch;"
|
||||||
@@ -316,6 +323,23 @@ object SpoofClientPatch : BytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
// region Fix livestream audio only background play if spoofing to iOS.
|
||||||
|
// This force enables audio background playback.
|
||||||
|
|
||||||
|
PlayerResponseModelBackgroundAudioPlaybackFingerprint.resultOrThrow().mutableMethod.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideBackgroundAudioPlayback()Z
|
||||||
|
move-result v0
|
||||||
|
if-eqz v0, :do_not_override
|
||||||
|
return v0
|
||||||
|
:do_not_override
|
||||||
|
nop
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
// Fix playback speed menu item if spoofing to iOS.
|
// Fix playback speed menu item if spoofing to iOS.
|
||||||
|
|
||||||
CreatePlaybackSpeedMenuItemFingerprint.resultOrThrow().let {
|
CreatePlaybackSpeedMenuItemFingerprint.resultOrThrow().let {
|
||||||
@@ -340,25 +364,6 @@ object SpoofClientPatch : BytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// Fix watch history if spoofing to iOS.
|
|
||||||
|
|
||||||
GetTrackingUriFingerprint.resultOrThrow().let {
|
|
||||||
it.mutableMethod.apply {
|
|
||||||
val returnUrlIndex = it.scanResult.patternScanResult!!.endIndex
|
|
||||||
val urlRegister = getInstruction<OneRegisterInstruction>(returnUrlIndex).registerA
|
|
||||||
|
|
||||||
addInstructions(
|
|
||||||
returnUrlIndex,
|
|
||||||
"""
|
|
||||||
invoke-static { v$urlRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideTrackingUrl(Landroid/net/Uri;)Landroid/net/Uri;
|
|
||||||
move-result-object v$urlRegister
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// endregion
|
|
||||||
|
|
||||||
// region Fix video qualities missing, if spoofing to iOS by overriding the user agent.
|
// region Fix video qualities missing, if spoofing to iOS by overriding the user agent.
|
||||||
|
|
||||||
BuildRequestFingerprint.resultOrThrow().let { result ->
|
BuildRequestFingerprint.resultOrThrow().let { result ->
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
|
||||||
|
|
||||||
internal object GetTrackingUriFingerprint : MethodFingerprint(
|
|
||||||
returnType = "Landroid/net/Uri;",
|
|
||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
|
||||||
parameters = emptyList(),
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_STATIC,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.RETURN_OBJECT
|
|
||||||
),
|
|
||||||
customFingerprint = { _, classDef ->
|
|
||||||
classDef.endsWith("TrackingUrlModel;")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
internal object PlayerResponseModelBackgroundAudioPlaybackFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.CONST_4,
|
||||||
|
Opcode.IF_EQZ,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.IF_NEZ,
|
||||||
|
Opcode.GOTO,
|
||||||
|
Opcode.RETURN,
|
||||||
|
null, // Opcode.CONST_4 or Opcode.MOVE
|
||||||
|
Opcode.RETURN,
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -32,11 +32,12 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
|
|||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
"com.google.android.youtube",
|
"com.google.android.youtube",
|
||||||
setOf(
|
setOf(
|
||||||
"18.37.36",
|
// Patch supports these versions but ClientSpoof does not.
|
||||||
"18.38.44",
|
// "18.37.36",
|
||||||
"18.43.45",
|
// "18.38.44",
|
||||||
"18.44.41",
|
// "18.43.45",
|
||||||
"18.45.43",
|
// "18.44.41",
|
||||||
|
// "18.45.43",
|
||||||
"18.48.39",
|
"18.48.39",
|
||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
|
|||||||
@@ -1135,7 +1135,7 @@ This is because Crowdin requires temporarily flattening this file and removing t
|
|||||||
<string name="revanced_spoof_client_summary_off">Client is not spoofed\n\nVideo playback may not work</string>
|
<string name="revanced_spoof_client_summary_off">Client is not spoofed\n\nVideo playback may not work</string>
|
||||||
<string name="revanced_spoof_client_user_dialog_message">Turning off this setting may cause video playback issues.</string>
|
<string name="revanced_spoof_client_user_dialog_message">Turning off this setting may cause video playback issues.</string>
|
||||||
<string name="revanced_spoof_client_use_ios_title">Spoof client to iOS</string>
|
<string name="revanced_spoof_client_use_ios_title">Spoof client to iOS</string>
|
||||||
<string name="revanced_spoof_client_use_ios_summary_on">Client is currently spoofed to iOS\n\nSide effects include:\n• No HDR video\n• Higher video qualities may be missing\n• Live streams cannot play as audio only</string>
|
<string name="revanced_spoof_client_use_ios_summary_on">Client is currently spoofed to iOS\n\nSide effects include:\n• HDR video may not be available\n• Watch history may not work</string>
|
||||||
<string name="revanced_spoof_client_use_ios_summary_off">Client is currently spoofed to Android VR\n\nSide effects include:\n• No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden</string>
|
<string name="revanced_spoof_client_use_ios_summary_off">Client is currently spoofed to Android VR\n\nSide effects include:\n• No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden</string>
|
||||||
<string name="revanced_spoof_client_storyboard_timeout">Spoof client thumbnails not available (API timed out)</string>
|
<string name="revanced_spoof_client_storyboard_timeout">Spoof client thumbnails not available (API timed out)</string>
|
||||||
<string name="revanced_spoof_client_storyboard_io_exception">Spoof client thumbnails temporarily not available: %s</string>
|
<string name="revanced_spoof_client_storyboard_io_exception">Spoof client thumbnails temporarily not available: %s</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user