Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(YouTube - Client spoof): Do not record feed videos to history by default #3017

Merged
merged 3 commits into from
Sep 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Simplify naming of classes and keys
oSumAtrIX committed Sep 23, 2023

Verified

This commit was signed with the committer’s verified signature.
commit 9b928eadae3b2ce1d5ca56849bb8e4bb4938e571
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
@Patch(
name = "Client spoof",
description = "Spoofs the client to allow playback.",
dependencies = [SpoofSignatureVerificationPatch::class],
dependencies = [SpoofSignaturePatch::class],
compatiblePackages = [
CompatiblePackage(
"com.google.android.youtube",
Original file line number Diff line number Diff line change
@@ -18,25 +18,24 @@ import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction

@Patch(
description = "Spoofs the client to prevent playback issues.",
description = "Spoofs the signature to prevent playback issues.",
dependencies = [
SpoofSignatureVerificationResourcePatch::class,
SpoofSignatureResourcePatch::class,
IntegrationsPatch::class,
PlayerTypeHookPatch::class
]
)
object SpoofSignatureVerificationPatch : BytecodePatch(
object SpoofSignaturePatch : BytecodePatch(
setOf(
ProtobufParameterBuilderFingerprint,
StoryboardThumbnailParentFingerprint,
ScrubbedPreviewLayoutFingerprint
)
) {
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
"Lapp/revanced/integrations/patches/SpoofSignatureVerificationPatch;"
"Lapp/revanced/integrations/patches/SpoofSignaturePatch;"

override fun execute(context: BytecodeContext) {

// hook parameter
ProtobufParameterBuilderFingerprint.result?.let {
val setParamMethod = context
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.settings.SettingsPatch

@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
object SpoofSignatureVerificationResourcePatch : ResourcePatch() {
object SpoofSignatureResourcePatch : ResourcePatch() {
internal var scrubbedPreviewThumbnailResourceId: Long = -1

override fun execute(context: ResourceContext) {
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.youtube.misc.fix.playback.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patches.youtube.misc.fix.playback.SpoofSignatureVerificationResourcePatch
import app.revanced.patches.youtube.misc.fix.playback.SpoofSignatureResourcePatch
import app.revanced.util.patch.LiteralValueFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
@@ -23,5 +23,5 @@ object ScrubbedPreviewLayoutFingerprint : LiteralValueFingerprint(
Opcode.IPUT_OBJECT, // preview imageview
),
// This resource is used in ~ 40 different locations, but this method has a distinct list of parameters to match to.
literalSupplier = { SpoofSignatureVerificationResourcePatch.scrubbedPreviewThumbnailResourceId }
literalSupplier = { SpoofSignatureResourcePatch.scrubbedPreviewThumbnailResourceId }
)