mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-12 04:24:36 +02:00
fix: remove chimera reference and disable advertising id (#97)
* ci: workflow to ping Discord users when patches are released (#72) * init: Workflow to notify discord users of releases * Rename workflow * chore (Background playback): Shorten description * Revert "chore (Background playback): Shorten description" This reverts commit 10661b870f0c9c670c5d522f9b2ca7cc82d32772. * Change message contents * Remove chimera ref * feat: remove patch option `DisableGmsServiceBroker` * feat: revert `Cast service v2 disabler` * feat(Hide ads): disable advertising id --------- Co-authored-by: KobeW50 <84587632+KobeW50@users.noreply.github.com> Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
parent
9982245ff2
commit
787dd5990e
@ -9,7 +9,9 @@ import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
|||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchException
|
import app.revanced.patcher.patch.PatchException
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
|
import app.revanced.patches.shared.ads.fingerprints.AdvertisingIdFingerprint
|
||||||
import app.revanced.patches.shared.ads.fingerprints.MusicAdsFingerprint
|
import app.revanced.patches.shared.ads.fingerprints.MusicAdsFingerprint
|
||||||
|
import app.revanced.patches.shared.ads.fingerprints.SSLGuardFingerprint
|
||||||
import app.revanced.patches.shared.ads.fingerprints.VideoAdsFingerprint
|
import app.revanced.patches.shared.ads.fingerprints.VideoAdsFingerprint
|
||||||
import app.revanced.patches.shared.integrations.Constants.PATCHES_PATH
|
import app.revanced.patches.shared.integrations.Constants.PATCHES_PATH
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
@ -29,7 +31,9 @@ abstract class BaseAdsPatch(
|
|||||||
) : BytecodePatch(
|
) : BytecodePatch(
|
||||||
setOf(
|
setOf(
|
||||||
MusicAdsFingerprint,
|
MusicAdsFingerprint,
|
||||||
VideoAdsFingerprint
|
VideoAdsFingerprint,
|
||||||
|
AdvertisingIdFingerprint,
|
||||||
|
SSLGuardFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
private companion object {
|
private companion object {
|
||||||
@ -58,7 +62,11 @@ abstract class BaseAdsPatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoAdsFingerprint.resultOrThrow().let {
|
setOf(
|
||||||
|
VideoAdsFingerprint,
|
||||||
|
SSLGuardFingerprint,
|
||||||
|
).forEach { fingerprint ->
|
||||||
|
fingerprint.resultOrThrow().let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
0, """
|
0, """
|
||||||
@ -72,6 +80,23 @@ abstract class BaseAdsPatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AdvertisingIdFingerprint.resultOrThrow().let {
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
val insertIndex = it.scanResult.stringsScanResult!!.matches.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))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal fun MethodFingerprintResult.hookNonLithoFullscreenAds(literal: Long) {
|
internal fun MethodFingerprintResult.hookNonLithoFullscreenAds(literal: Long) {
|
||||||
mutableMethod.apply {
|
mutableMethod.apply {
|
||||||
val targetIndex = indexOfFirstWideLiteralInstructionValueOrThrow(literal) + 2
|
val targetIndex = indexOfFirstWideLiteralInstructionValueOrThrow(literal) + 2
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.shared.ads.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||||
|
|
||||||
|
internal object AdvertisingIdFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
strings = listOf("a."),
|
||||||
|
customFingerprint = { methodDef, classDef ->
|
||||||
|
MethodUtil.isConstructor(methodDef) &&
|
||||||
|
classDef.fields.find { it.type == "Lcom/google/android/libraries/youtube/innertube/model/ads/InstreamAd;" } != null
|
||||||
|
}
|
||||||
|
)
|
@ -0,0 +1,11 @@
|
|||||||
|
package app.revanced.patches.shared.ads.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
internal object SSLGuardFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
strings = listOf("Cannot initialize SslGuardSocketFactory will null"),
|
||||||
|
)
|
@ -15,9 +15,10 @@ import app.revanced.patches.shared.gms.BaseGmsCoreSupportPatch.Constants.PERMISS
|
|||||||
import app.revanced.patches.shared.gms.BaseGmsCoreSupportResourcePatch.Companion.ORIGINAL_PACKAGE_NAME_YOUTUBE
|
import app.revanced.patches.shared.gms.BaseGmsCoreSupportResourcePatch.Companion.ORIGINAL_PACKAGE_NAME_YOUTUBE
|
||||||
import app.revanced.patches.shared.gms.BaseGmsCoreSupportResourcePatch.Companion.ORIGINAL_PACKAGE_NAME_YOUTUBE_MUSIC
|
import app.revanced.patches.shared.gms.BaseGmsCoreSupportResourcePatch.Companion.ORIGINAL_PACKAGE_NAME_YOUTUBE_MUSIC
|
||||||
import app.revanced.patches.shared.gms.fingerprints.CastContextFetchFingerprint
|
import app.revanced.patches.shared.gms.fingerprints.CastContextFetchFingerprint
|
||||||
|
import app.revanced.patches.shared.gms.fingerprints.CastDynamiteModuleFingerprint
|
||||||
|
import app.revanced.patches.shared.gms.fingerprints.CastDynamiteModuleV2Fingerprint
|
||||||
import app.revanced.patches.shared.gms.fingerprints.CertificateFingerprint
|
import app.revanced.patches.shared.gms.fingerprints.CertificateFingerprint
|
||||||
import app.revanced.patches.shared.gms.fingerprints.GmsCoreSupportFingerprint
|
import app.revanced.patches.shared.gms.fingerprints.GmsCoreSupportFingerprint
|
||||||
import app.revanced.patches.shared.gms.fingerprints.GmsServiceBrokerFingerprint
|
|
||||||
import app.revanced.patches.shared.gms.fingerprints.GooglePlayUtilityFingerprint
|
import app.revanced.patches.shared.gms.fingerprints.GooglePlayUtilityFingerprint
|
||||||
import app.revanced.patches.shared.gms.fingerprints.PrimesApiFingerprint
|
import app.revanced.patches.shared.gms.fingerprints.PrimesApiFingerprint
|
||||||
import app.revanced.patches.shared.gms.fingerprints.PrimesBackgroundInitializationFingerprint
|
import app.revanced.patches.shared.gms.fingerprints.PrimesBackgroundInitializationFingerprint
|
||||||
@ -71,8 +72,9 @@ abstract class BaseGmsCoreSupportPatch(
|
|||||||
fingerprints = setOf(
|
fingerprints = setOf(
|
||||||
// Google Play Services.
|
// Google Play Services.
|
||||||
CastContextFetchFingerprint,
|
CastContextFetchFingerprint,
|
||||||
|
CastDynamiteModuleFingerprint,
|
||||||
|
CastDynamiteModuleV2Fingerprint,
|
||||||
GmsCoreSupportFingerprint,
|
GmsCoreSupportFingerprint,
|
||||||
GmsServiceBrokerFingerprint,
|
|
||||||
GooglePlayUtilityFingerprint,
|
GooglePlayUtilityFingerprint,
|
||||||
PrimesApiFingerprint,
|
PrimesApiFingerprint,
|
||||||
PrimesBackgroundInitializationFingerprint,
|
PrimesBackgroundInitializationFingerprint,
|
||||||
@ -93,7 +95,6 @@ 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"
|
||||||
|
|
||||||
@ -132,7 +133,6 @@ 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")
|
||||||
|
|
||||||
@ -156,12 +156,11 @@ abstract class BaseGmsCoreSupportPatch(
|
|||||||
// Return these methods early to prevent the app from crashing.
|
// Return these methods early to prevent the app from crashing.
|
||||||
val returnEarly = mutableListOf(
|
val returnEarly = mutableListOf(
|
||||||
CastContextFetchFingerprint,
|
CastContextFetchFingerprint,
|
||||||
|
CastDynamiteModuleFingerprint,
|
||||||
|
CastDynamiteModuleV2Fingerprint,
|
||||||
GooglePlayUtilityFingerprint,
|
GooglePlayUtilityFingerprint,
|
||||||
ServiceCheckFingerprint
|
ServiceCheckFingerprint
|
||||||
)
|
)
|
||||||
if (disableGmsServiceBroker) {
|
|
||||||
returnEarly += GmsServiceBrokerFingerprint
|
|
||||||
}
|
|
||||||
returnEarly.returnEarly()
|
returnEarly.returnEarly()
|
||||||
|
|
||||||
transformPrimeMethod()
|
transformPrimeMethod()
|
||||||
@ -431,11 +430,9 @@ abstract class BaseGmsCoreSupportPatch(
|
|||||||
"com.google.android.gms.feedback.internal.IFeedbackService",
|
"com.google.android.gms.feedback.internal.IFeedbackService",
|
||||||
|
|
||||||
// cast
|
// cast
|
||||||
|
"com.google.android.gms.cast.firstparty.START",
|
||||||
"com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE",
|
"com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE",
|
||||||
|
|
||||||
// chimera
|
|
||||||
"com.google.android.gms.chimera",
|
|
||||||
|
|
||||||
// fonts
|
// fonts
|
||||||
"com.google.android.gms.fonts",
|
"com.google.android.gms.fonts",
|
||||||
|
|
||||||
@ -455,7 +452,6 @@ abstract class BaseGmsCoreSupportPatch(
|
|||||||
"com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE",
|
"com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE",
|
||||||
"com.google.android.gms.icing.INDEX_SERVICE",
|
"com.google.android.gms.icing.INDEX_SERVICE",
|
||||||
"com.google.android.gms.mdm.services.START",
|
"com.google.android.gms.mdm.services.START",
|
||||||
"com.google.android.gms.clearcut.service.START",
|
|
||||||
|
|
||||||
// potoken
|
// potoken
|
||||||
"com.google.android.gms.potokens.service.START",
|
"com.google.android.gms.potokens.service.START",
|
||||||
|
@ -52,18 +52,6 @@ abstract class BaseGmsCoreSupportResourcePatch(
|
|||||||
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,
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.shared.gms.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
|
||||||
|
internal object CastDynamiteModuleFingerprint : MethodFingerprint(
|
||||||
|
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
||||||
|
)
|
@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.shared.gms.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
|
||||||
|
internal object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
||||||
|
strings = listOf("Failed to load module via V2: ")
|
||||||
|
)
|
@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.shared.gms.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
|
||||||
|
|
||||||
internal object GmsServiceBrokerFingerprint : MethodFingerprint(
|
|
||||||
returnType = "V",
|
|
||||||
strings = listOf("mServiceBroker is null, client disconnected")
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user