mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-22 10:23:55 +00:00
feat: Add Disable Sentry telemetry patch (#6416)
This commit is contained in:
@@ -944,6 +944,10 @@ public final class app/revanced/patches/shared/misc/pairip/license/DisableLicens
|
|||||||
public static final fun getDisableLicenseCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getDisableLicenseCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/shared/misc/privacy/DisableSentryTelemetryKt {
|
||||||
|
public static final fun getDisableSentryTelemetryPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/shared/misc/settings/SettingsPatchKt {
|
public final class app/revanced/patches/shared/misc/settings/SettingsPatchKt {
|
||||||
public static final fun overrideThemeColors (Ljava/lang/String;Ljava/lang/String;)V
|
public static final fun overrideThemeColors (Ljava/lang/String;Ljava/lang/String;)V
|
||||||
public static final fun settingsPatch (Ljava/util/List;Ljava/util/Set;)Lapp/revanced/patcher/patch/ResourcePatch;
|
public static final fun settingsPatch (Ljava/util/List;Ljava/util/Set;)Lapp/revanced/patcher/patch/ResourcePatch;
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package app.revanced.patches.shared.misc.privacy
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.resourcePatch
|
||||||
|
import app.revanced.util.asSequence
|
||||||
|
import app.revanced.util.getNode
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val disableSentryTelemetryPatch = resourcePatch(
|
||||||
|
name = "Disable Sentry telemetry",
|
||||||
|
description = "Disables Sentry telemetry. See https://sentry.io/for/android/ for more information.",
|
||||||
|
use = false,
|
||||||
|
) {
|
||||||
|
execute {
|
||||||
|
fun Element.replaceOrCreate(tagName: String, attributeName: String, attributeValue: String) {
|
||||||
|
val childElements = getElementsByTagName(tagName).asSequence().filterIsInstance<Element>()
|
||||||
|
val targetChild = childElements.find { childElement ->
|
||||||
|
childElement.getAttribute("android:name") == attributeName
|
||||||
|
}
|
||||||
|
if (targetChild != null) {
|
||||||
|
targetChild.setAttribute("android:value", attributeValue)
|
||||||
|
} else {
|
||||||
|
appendChild(ownerDocument.createElement(tagName).apply {
|
||||||
|
setAttribute("android:name", attributeName)
|
||||||
|
setAttribute("android:value", attributeValue)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document("AndroidManifest.xml").use { document ->
|
||||||
|
val application = document.getNode("application") as Element
|
||||||
|
application.replaceOrCreate("meta-data", "io.sentry.enabled", "false")
|
||||||
|
application.replaceOrCreate("meta-data", "io.sentry.dsn", "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user