fix: disable metrics

This commit is contained in:
rhunk 2024-03-13 16:58:22 +01:00
parent bea8e796dc
commit 90faaecd83

View File

@ -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
}
}
}
}