mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-02 07:34:31 +02:00
feat(YouTube/YT - GmsCore support): add patch option Disable GmsService Broker
https://github.com/inotia00/ReVanced_Extended/issues/2442#issuecomment-2424694043
This commit is contained in:
parent
cae2f6cab6
commit
19a8677c73
@ -93,6 +93,7 @@ abstract class BaseGmsCoreSupportPatch(
|
|||||||
|
|
||||||
var gmsCoreVendor = "app.revanced"
|
var gmsCoreVendor = "app.revanced"
|
||||||
var checkGmsCore = true
|
var checkGmsCore = true
|
||||||
|
var disableGmsServiceBroker = false
|
||||||
var packageNameYouTube = "com.google.android.youtube"
|
var packageNameYouTube = "com.google.android.youtube"
|
||||||
var packageNameYouTubeMusic = "com.google.android.apps.youtube.music"
|
var packageNameYouTubeMusic = "com.google.android.apps.youtube.music"
|
||||||
|
|
||||||
@ -131,6 +132,7 @@ abstract class BaseGmsCoreSupportPatch(
|
|||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
gmsCoreVendor = getStringPatchOption("GmsCoreVendorGroupId")
|
gmsCoreVendor = getStringPatchOption("GmsCoreVendorGroupId")
|
||||||
checkGmsCore = getBooleanPatchOption("CheckGmsCore")
|
checkGmsCore = getBooleanPatchOption("CheckGmsCore")
|
||||||
|
disableGmsServiceBroker = getBooleanPatchOption("DisableGmsServiceBroker")
|
||||||
packageNameYouTube = getStringPatchOption("PackageNameYouTube")
|
packageNameYouTube = getStringPatchOption("PackageNameYouTube")
|
||||||
packageNameYouTubeMusic = getStringPatchOption("PackageNameYouTubeMusic")
|
packageNameYouTubeMusic = getStringPatchOption("PackageNameYouTubeMusic")
|
||||||
|
|
||||||
@ -152,12 +154,15 @@ abstract class BaseGmsCoreSupportPatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return these methods early to prevent the app from crashing.
|
// Return these methods early to prevent the app from crashing.
|
||||||
listOf(
|
val returnEarly = mutableListOf(
|
||||||
CastContextFetchFingerprint,
|
CastContextFetchFingerprint,
|
||||||
GmsServiceBrokerFingerprint,
|
|
||||||
GooglePlayUtilityFingerprint,
|
GooglePlayUtilityFingerprint,
|
||||||
ServiceCheckFingerprint
|
ServiceCheckFingerprint
|
||||||
).returnEarly()
|
)
|
||||||
|
if (disableGmsServiceBroker) {
|
||||||
|
returnEarly += GmsServiceBrokerFingerprint
|
||||||
|
}
|
||||||
|
returnEarly.returnEarly()
|
||||||
|
|
||||||
transformPrimeMethod()
|
transformPrimeMethod()
|
||||||
|
|
||||||
|
@ -51,6 +51,19 @@ abstract class BaseGmsCoreSupportResourcePatch(
|
|||||||
""".trimIndentMultiline(),
|
""".trimIndentMultiline(),
|
||||||
required = true,
|
required = true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private val DisableGmsServiceBroker by booleanPatchOption(
|
||||||
|
key = "DisableGmsServiceBroker",
|
||||||
|
default = false,
|
||||||
|
title = "Disable GmsService Broker",
|
||||||
|
description = """
|
||||||
|
Disabling GmsServiceBroker will somewhat improve crashes caused by unimplemented GmsCore services.
|
||||||
|
|
||||||
|
For YouTube, the 'Spoof streaming data' setting is required.
|
||||||
|
""".trimIndentMultiline(),
|
||||||
|
required = true,
|
||||||
|
)
|
||||||
|
|
||||||
internal val PackageNameYouTube = stringPatchOption(
|
internal val PackageNameYouTube = stringPatchOption(
|
||||||
key = "PackageNameYouTube",
|
key = "PackageNameYouTube",
|
||||||
default = DEFAULT_PACKAGE_NAME_YOUTUBE,
|
default = DEFAULT_PACKAGE_NAME_YOUTUBE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user