mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-18 03:47:32 +01:00
fix: disable cast modules in YouTube Music (#337)
This commit is contained in:
parent
945ce7490a
commit
86eaba8248
@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-context-fetch-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lvvz;", "a"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastContextFetchFingerprint : MethodFingerprint(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("Error fetching CastContext.")
|
||||||
|
)
|
@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-module-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Llqh;", "c"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastDynamiteModuleFingerprint : MethodFingerprint(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
||||||
|
)
|
@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-context-fetch-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lmcf;", "c"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("Failed to load module via V2: ")
|
||||||
|
)
|
@ -36,6 +36,9 @@ class MusicMicroGBytecodePatch : BytecodePatch(
|
|||||||
listOf(
|
listOf(
|
||||||
ServiceCheckFingerprint,
|
ServiceCheckFingerprint,
|
||||||
GooglePlayUtilityFingerprint,
|
GooglePlayUtilityFingerprint,
|
||||||
|
CastDynamiteModuleFingerprint,
|
||||||
|
CastDynamiteModuleV2Fingerprint,
|
||||||
|
CastContextFetchFingerprint,
|
||||||
PrimeFingerprint,
|
PrimeFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@ -122,9 +125,17 @@ class MusicMicroGBytecodePatch : BytecodePatch(
|
|||||||
listOf(
|
listOf(
|
||||||
ServiceCheckFingerprint,
|
ServiceCheckFingerprint,
|
||||||
GooglePlayUtilityFingerprint,
|
GooglePlayUtilityFingerprint,
|
||||||
|
CastDynamiteModuleFingerprint,
|
||||||
|
CastDynamiteModuleV2Fingerprint,
|
||||||
|
CastContextFetchFingerprint,
|
||||||
).forEach { fingerprint ->
|
).forEach { fingerprint ->
|
||||||
val result = fingerprint.result!!
|
val result = fingerprint.result!!
|
||||||
val stringInstructions = when (result.method.returnType.first()) {
|
val stringInstructions = when (result.method.returnType.first()) {
|
||||||
|
'L' -> """
|
||||||
|
const/4 v0, 0x0
|
||||||
|
return-object v0
|
||||||
|
"""
|
||||||
|
|
||||||
'V' -> "return-void"
|
'V' -> "return-void"
|
||||||
'I' -> """
|
'I' -> """
|
||||||
const/4 v0, 0x0
|
const/4 v0, 0x0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user