From 90faaecd8339f6e01aa63784d05615b07f63a1d8 Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:58:22 +0100 Subject: [PATCH] fix: disable metrics --- .../core/features/impl/global/DisableMetrics.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/global/DisableMetrics.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/global/DisableMetrics.kt index 23cd1a30c..7beeeb738 100644 --- a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/global/DisableMetrics.kt +++ b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/global/DisableMetrics.kt @@ -1,6 +1,8 @@ package me.rhunk.snapenhance.core.features.impl.global +import me.rhunk.snapenhance.common.util.protobuf.ProtoReader import me.rhunk.snapenhance.core.event.events.impl.NetworkApiRequestEvent +import me.rhunk.snapenhance.core.event.events.impl.UnaryCallEvent import me.rhunk.snapenhance.core.features.Feature import me.rhunk.snapenhance.core.features.FeatureLoadParams @@ -14,5 +16,15 @@ class DisableMetrics : Feature("DisableMetrics", loadParams = FeatureLoadParams. param.canceled = true } } + + context.event.subscribe(UnaryCallEvent::class) { event -> + if (event.uri.startsWith("/snap.security.IntegritySyncService/")) { + event.canceled = true + } + if (event.uri.startsWith("/snapchat.cdp.cof.CircumstancesService/")) { + if (ProtoReader(event.buffer).getVarInt(21) == 1L) return@subscribe + event.canceled = true + } + } } }