generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 437
feat: Add Disable analytics and telemetry
patches
#3448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
patchink0
wants to merge
21
commits into
ReVanced:dev
Choose a base branch
from
patchink0:feat/disable-multiple-telemetry
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b137a21
Initial commit
bd5c925
Disabled patches by default
f3c3706
Updated README.md with privacy aspect
patchink0 63801d3
Removed resource patches as not accepted by maintainers
patchink0 313e2b5
First draft of universal privacy patch
patchink0 96fe5d0
Combined all patches in a single patch
patchink0 a8b6b82
Made fingerprints internal
patchink0 be63a06
Changed the emoji used to represent privacy
patchink0 1d4b437
Committed api file
patchink0 bf5a1f3
Added appsflyer plugin patching
patchink0 e5bda0d
Updated MoEngage fingerprint to better match different integrations
patchink0 e38d437
Updated skipping message
patchink0 d396637
Added back resource patches in a new separate patch
patchink0 2885981
Added Amplitude SDK patching
patchink0 6926e07
Updated MoEngage signature to resist obfuscation
patchink0 84d7c64
Updated MoEngage patch to handle more cases
patchink0 574017c
Apply suggestions from code review
oSumAtrIX a592e7c
Updated Crashlytics patch to resist obfuscation
patchink0 a02dd18
Updated FirebaseTransport patch to resist obfuscation
patchink0 6b80eb8
Updated AppsFlyer patch to increase compatibility. Now patching at th…
patchink0 e36b41d
refactor
oSumAtrIX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/main/kotlin/app/revanced/patches/all/analytics/UniversalPrivacyPatch.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package app.revanced.patches.all.analytics | ||
|
||
import app.revanced.patcher.data.BytecodeContext | ||
import app.revanced.patcher.patch.BytecodePatch | ||
import app.revanced.patcher.patch.annotation.Patch | ||
import app.revanced.patcher.patch.options.PatchOption | ||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPatchOption | ||
import app.revanced.patches.all.analytics.google.DisableGoogleAnalytics | ||
import app.revanced.patches.all.analytics.statsig.DisableStatsig | ||
import java.util.logging.Logger | ||
|
||
@Patch( | ||
name = "Disable privacy invasive components", | ||
description = "Disables multiple analytics and telemetry SDKs embedded in the app", | ||
) | ||
@Suppress("unused") | ||
object UniversalPrivacyPatch : BytecodePatch( | ||
setOf() | ||
) { | ||
|
||
// We have to create a copy of the map as a MutableMapIterator does not exist | ||
private val subPatchesOptionsEvaluated = mutableMapOf<Pair<String, BytecodePatch>, PatchOption<Boolean?>>() | ||
|
||
private val subPatchesOptions = mapOf( | ||
Pair("Google Analytics", DisableGoogleAnalytics) to false, | ||
Pair("Statsig", DisableStatsig) to true, | ||
).forEach { | ||
subPatchesOptionsEvaluated[it.key] = booleanPatchOption( | ||
key = it.key.first, | ||
default = it.value, | ||
values = mapOf( | ||
), | ||
title = "Enabled patches", | ||
description = "Which SDK to target", | ||
required = true | ||
) | ||
} | ||
|
||
|
||
override fun execute(context: BytecodeContext) { | ||
subPatchesOptionsEvaluated.forEach { | ||
if (it.value.value == true){ | ||
Logger.getLogger(this::class.java.name).warning("Applying patch to disable ${it.key.first}") | ||
LisoUseInAIKyrios marked this conversation as resolved.
Show resolved
Hide resolved
|
||
it.key.second.execute(context) | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.