mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-13 05:37:48 +02:00
fix: metrics
This commit is contained in:
@ -11,7 +11,7 @@ class Global : ConfigContainer() {
|
|||||||
val suspendLocationUpdates = boolean("suspend_location_updates") { requireRestart() }
|
val suspendLocationUpdates = boolean("suspend_location_updates") { requireRestart() }
|
||||||
val snapchatPlus = boolean("snapchat_plus") { requireRestart() }
|
val snapchatPlus = boolean("snapchat_plus") { requireRestart() }
|
||||||
val disableConfirmationDialogs = multiple("disable_confirmation_dialogs", "remove_friend", "block_friend", "ignore_friend", "hide_friend", "hide_conversation", "clear_conversation") { requireRestart() }
|
val disableConfirmationDialogs = multiple("disable_confirmation_dialogs", "remove_friend", "block_friend", "ignore_friend", "hide_friend", "hide_conversation", "clear_conversation") { requireRestart() }
|
||||||
val disableMetrics = boolean("disable_metrics")
|
val disableMetrics = boolean("disable_metrics") { requireRestart() }
|
||||||
val disablePublicStories = boolean("disable_public_stories") { requireRestart(); requireCleanCache() }
|
val disablePublicStories = boolean("disable_public_stories") { requireRestart(); requireCleanCache() }
|
||||||
val blockAds = boolean("block_ads")
|
val blockAds = boolean("block_ads")
|
||||||
val spotlightCommentsUsername = boolean("spotlight_comments_username") { requireRestart() }
|
val spotlightCommentsUsername = boolean("spotlight_comments_username") { requireRestart() }
|
||||||
|
@ -6,9 +6,9 @@ import me.rhunk.snapenhance.core.features.FeatureLoadParams
|
|||||||
|
|
||||||
class DisableMetrics : Feature("DisableMetrics", loadParams = FeatureLoadParams.INIT_SYNC) {
|
class DisableMetrics : Feature("DisableMetrics", loadParams = FeatureLoadParams.INIT_SYNC) {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
val disableMetrics by context.config.global.disableMetrics
|
if (!context.config.global.disableMetrics.get()) return
|
||||||
|
|
||||||
context.event.subscribe(NetworkApiRequestEvent::class, { disableMetrics }) { param ->
|
context.event.subscribe(NetworkApiRequestEvent::class) { param ->
|
||||||
val url = param.url
|
val url = param.url
|
||||||
if (url.contains("app-analytics") || url.endsWith("metrics")) {
|
if (url.contains("app-analytics") || url.endsWith("metrics")) {
|
||||||
param.canceled = true
|
param.canceled = true
|
||||||
|
@ -31,7 +31,7 @@ class NativeLib {
|
|||||||
}.onFailure {
|
}.onFailure {
|
||||||
Log.e("SnapEnhance", "nativeUnaryCallCallback failed", it)
|
Log.e("SnapEnhance", "nativeUnaryCallCallback failed", it)
|
||||||
}
|
}
|
||||||
if (!nativeRequestData.buffer.contentEquals(buffer) || nativeRequestData.canceled) return nativeRequestData
|
if (nativeRequestData.canceled || !nativeRequestData.buffer.contentEquals(buffer)) return nativeRequestData
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user