Skip to content

Commit

Permalink
fix: disable metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
rhunk committed Mar 13, 2024
1 parent bea8e79 commit 90faaec
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

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

0 comments on commit 90faaec

Please sign in to comment.