-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat: Add Disable analytics and telemetry
patches
#3448
base: dev
Are you sure you want to change the base?
feat: Add Disable analytics and telemetry
patches
#3448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on first sight. Once the couple style/refactor issues are addressed it lgtm. I do not know if each patch works here as expected, were they all been tested? The readme of the repository should be changed in this pr as well to include privacy patches as a feature, given this pr introduces pretty much all the common ones.
What other apps has this been tested on? I wonder if it would be simpler if all of these were bundled together into a single universal patch. Since not all sub patches will work for every app, it could not throw ugly exceptions and instead print to the console what patches succeeded and what did not. Something like:
(See the remove share targets patch for how to log) And add patch options to turn off each sub patch if someone wanted (but I think most users would want everything included by default if they chose this patch). |
That sounds like a good idea indeed. |
To make simpler logs, could be instead of
|
src/main/kotlin/app/revanced/patches/all/analytics/facebook/DisableFacebookAnalytics.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/all/analytics/UniversalPrivacyPatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/all/analytics/UniversalPrivacyPatch.kt
Outdated
Show resolved
Hide resolved
...kotlin/app/revanced/patches/all/analytics/appsflyer/fingerprints/AppsFlyerInitFingerprint.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/all/privacy/UniversalResourcePrivacyPatch.kt
Outdated
Show resolved
Hide resolved
…e root level initializer rather than at the wrapper level
Are there any todo's left for this PR? Just for reference, what apps has this been tested on and it works? |
I am locally refactoring this PR. I'll push it soon |
Disable analytics and telemetry
patches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test the refactoring changes & my review. Otherwise LGTM
val applicationNode = getNode("application") as Element | ||
applicationNode.getElementsByTagName(META_DATA_TAG) | ||
.asSequence() | ||
.first { it.attributes.getNamedItem(NAME_ATTRIBUTE).nodeValue == nodeName } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced firstOrNull with first here when refactoring. Correct this if it should be firstOrNull. If it should, then the try captch block above isn't necessary which was present before I refactored.
object DisableAnalyticsAndTelemetryThroughManifestPatch : ResourcePatch() { | ||
private val logger = Logger.getLogger(this::class.java.name) | ||
|
||
private val disableFirebaseTelemetry by option("Firebase telemetry") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged the two firebase patches to one.
private val disableFirebaseTelemetry by option("Firebase telemetry") | ||
private val disableFacebookSdk by option("Facebook SDK") | ||
private val disableGoogleAnalytics by option("Google Analytics") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GAnalytics patch also exists in the bytecode patch, why is it present here as well? Also, can't the firebase & facebook patches be converted to bytecode?
feefb56
to
a371631
Compare
c0cd9d2
to
2ace07d
Compare
Added generic patches to disable multiple analytics and telemetry SDKs: ComScore, AppsFlyer, MoEngage, Segment, Statsig, Facebook SDK, Google Analytics, Firebase Crashlytics, Firebase Logging
Those are all the SDKs included in the SoundCloud app, and the patches were developed and tested on it but should work for any app.
This greatly increases privacy but also performance, more specifically regarding the startup time. SoundCloud initializes and opens up noticeably faster using those patches.