mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-20 16:27:17 +02:00
revert(GmsCore support): Chimera reference
This commit is contained in:
parent
28aa2cd54a
commit
80b67aecec
@ -33,7 +33,11 @@ fun baseAdsPatch(
|
||||
) {
|
||||
execute {
|
||||
|
||||
videoAdsFingerprint.methodOrThrow().apply {
|
||||
setOf(
|
||||
sslGuardFingerprint,
|
||||
videoAdsFingerprint,
|
||||
).forEach { fingerprint ->
|
||||
fingerprint.methodOrThrow().apply {
|
||||
addInstructionsWithLabels(
|
||||
0, """
|
||||
invoke-static {}, $classDescriptor->$methodDescriptor()Z
|
||||
@ -43,6 +47,7 @@ fun baseAdsPatch(
|
||||
""", ExternalLabel("show_ads", getInstruction(0))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
musicAdsFingerprint.methodOrThrow().apply {
|
||||
val targetIndex = indexOfFirstInstructionOrThrow {
|
||||
@ -62,6 +67,21 @@ fun baseAdsPatch(
|
||||
)
|
||||
}
|
||||
|
||||
advertisingIdFingerprint.matchOrThrow().let {
|
||||
it.method.apply {
|
||||
val insertIndex = it.stringMatches!!.first().index
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, """
|
||||
invoke-static {}, $classDescriptor->$methodDescriptor()Z
|
||||
move-result v$insertRegister
|
||||
if-nez v$insertRegister, :enable_id
|
||||
return-void
|
||||
""", ExternalLabel("enable_id", getInstruction(insertIndex))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,24 @@ import app.revanced.util.fingerprint.legacyFingerprint
|
||||
import app.revanced.util.or
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
|
||||
internal val advertisingIdFingerprint = legacyFingerprint(
|
||||
name = "advertisingIdFingerprint",
|
||||
returnType = "V",
|
||||
strings = listOf("a."),
|
||||
customFingerprint = { method, classDef ->
|
||||
MethodUtil.isConstructor(method) &&
|
||||
classDef.fields.find { it.type == "Ljava/util/Random;" } != null
|
||||
}
|
||||
)
|
||||
|
||||
internal val sslGuardFingerprint = legacyFingerprint(
|
||||
name = "sslGuardFingerprint",
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
strings = listOf("Cannot initialize SslGuardSocketFactory will null"),
|
||||
)
|
||||
|
||||
internal val musicAdsFingerprint = legacyFingerprint(
|
||||
name = "musicAdsFingerprint",
|
||||
|
@ -25,6 +25,15 @@ internal val castContextFetchFingerprint = legacyFingerprint(
|
||||
strings = listOf("Error fetching CastContext.")
|
||||
)
|
||||
|
||||
internal val castDynamiteModuleFingerprint = legacyFingerprint(
|
||||
name = "castDynamiteModuleFingerprint",
|
||||
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
||||
)
|
||||
internal val castDynamiteModuleV2Fingerprint = legacyFingerprint(
|
||||
name = "castDynamiteModuleV2Fingerprint",
|
||||
strings = listOf("Failed to load module via V2: ")
|
||||
)
|
||||
|
||||
internal val googlePlayUtilityFingerprint = legacyFingerprint(
|
||||
name = "castContextFetchFingerprint",
|
||||
returnType = "I",
|
||||
@ -44,12 +53,6 @@ internal val serviceCheckFingerprint = legacyFingerprint(
|
||||
strings = listOf("Google Play Services not available")
|
||||
)
|
||||
|
||||
internal val gmsServiceBrokerFingerprint = legacyFingerprint(
|
||||
name = "gmsServiceBrokerFingerprint",
|
||||
returnType = "V",
|
||||
strings = listOf("mServiceBroker is null, client disconnected")
|
||||
)
|
||||
|
||||
internal val primesApiFingerprint = legacyFingerprint(
|
||||
name = "primesApiFingerprint",
|
||||
returnType = "V",
|
||||
|
@ -104,18 +104,6 @@ fun gmsCoreSupportPatch(
|
||||
required = true,
|
||||
)
|
||||
|
||||
val disableGmsServiceBroker by booleanOption(
|
||||
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,
|
||||
)
|
||||
|
||||
val packageNameYouTubeOption = stringOption(
|
||||
key = "packageNameYouTube",
|
||||
default = DEFAULT_PACKAGE_NAME_YOUTUBE,
|
||||
@ -305,12 +293,11 @@ fun gmsCoreSupportPatch(
|
||||
// Return these methods early to prevent the app from crashing.
|
||||
setOf(
|
||||
castContextFetchFingerprint,
|
||||
castDynamiteModuleFingerprint,
|
||||
castDynamiteModuleV2Fingerprint,
|
||||
googlePlayUtilityFingerprint,
|
||||
serviceCheckFingerprint,
|
||||
).forEach { it.methodOrThrow().returnEarly() }
|
||||
if (disableGmsServiceBroker == true) {
|
||||
gmsServiceBrokerFingerprint.methodOrThrow().returnEarly()
|
||||
}
|
||||
|
||||
// Specific method that needs to be patched.
|
||||
transformPrimeMethod()
|
||||
@ -365,18 +352,10 @@ fun gmsCoreSupportPatch(
|
||||
/**
|
||||
* A collection of permissions, intents and content provider authorities
|
||||
* that are present in GmsCore which need to be transformed.
|
||||
*
|
||||
* NOTE: The following were present, but it seems like they are not needed to be transformed:
|
||||
* - com.google.android.gms.chimera.GmsIntentOperationService
|
||||
* - com.google.android.gms.phenotype.internal.IPhenotypeCallbacks
|
||||
* - com.google.android.gms.phenotype.internal.IPhenotypeService
|
||||
* - com.google.android.gms.phenotype.PACKAGE_NAME
|
||||
* - com.google.android.gms.phenotype.UPDATE
|
||||
* - com.google.android.gms.phenotype
|
||||
*/
|
||||
private object Constants {
|
||||
/**
|
||||
* A list of all permissions.
|
||||
* All permissions.
|
||||
*/
|
||||
val PERMISSIONS = setOf(
|
||||
// C2DM / GCM
|
||||
@ -460,11 +439,9 @@ private object Constants {
|
||||
"com.google.android.gms.feedback.internal.IFeedbackService",
|
||||
|
||||
// cast
|
||||
"com.google.android.gms.cast.firstparty.START",
|
||||
"com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE",
|
||||
|
||||
// chimera
|
||||
"com.google.android.gms.chimera",
|
||||
|
||||
// fonts
|
||||
"com.google.android.gms.fonts",
|
||||
|
||||
@ -504,9 +481,6 @@ private object Constants {
|
||||
// auth
|
||||
"com.google.android.gms.auth.accounts",
|
||||
|
||||
// chimera
|
||||
"com.google.android.gms.chimera",
|
||||
|
||||
// fonts
|
||||
"com.google.android.gms.fonts",
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user