2018-05-21 05:28:07 -04:00
It turns out some ad/analytics SDKs used by various proprietary Android apps can be disabled/kneecapped by adding meta-data entries to the apps AndroidManifest
In order for an app to read its meta-data entries from its own AndroidManifest it actually has to go through the getPackageManager() call
This means we can change the system package parser and simply add these variables to every app
This would hopefully make usage of proprietary apps more private, granted they are still proprietary and can very well simply ignore these
A simple app was created to verify the expected
05-21 05:24:44.557 4973 4973 D MDT : firebase_analytics_collection_enabled:false
and it does indeed work!
core/java/android/content/pm/PackageParser.java
parseMetaData()
line 5526 if (data == null) {
2018-05-21 20:29:16 -04:00
src/com/android/settings/SecuritySettings.java
res/xml/security_settings_misc.xml
<SwitchPreference
android:key="hamper_analytics"
android:persistent="false"
android:title="@string/hamper_analytics"
android:summary="@string/hamper_analytics_summary"/>
res/values/strings.xml
<string name="hamper_analytics">Hamper analytics SDKs</string>
<string name="hamper_analytics_summary">Aggressively breaks various proprietary tracking SDKs by unsetting their API keys. May cause low-quality proprietary apps to crash.</string>
2018-05-21 05:28:07 -04:00
2018-05-21 20:29:16 -04:00
Keywords to find keys
"meta-data android:name" analytics
"meta-data android:name" app id
"meta-data android:name" disable
"meta-data android:name" gdpr
"meta-data android:name" location
"meta-data android:name" opt-out
"meta-data android:name" private key
"meta-data android:name" secret key
2021-12-27 17:31:15 -05:00
Documentation
http://docs-en.tnkad.net/analytics-reporting/1-android-integration
https://developer.android.com/guide/webapps/managing-webview
https://developer.clevertap.com/docs/android
https://developer.clevertap.com/docs/android-quickstart-guide
https://developer.clevertap.com/docs/sdk-changes-for-gdpr-compliance
https://developers.facebook.com/docs/app-events/getting-started-app-events-android
2021-12-27 23:24:03 -05:00
https://developers.google.com/admob/ump/android/quick-start
2021-12-27 17:31:15 -05:00
https://dev.followanalytics.com/sdks/android/older-versions/6.1/
https://docs.bugsnag.com/platforms/android/configuration-options/
https://docs.bugsnag.com/platforms/android/legacy/configuration-options/
https://docs.microsoft.com/en-us/dynamics365/customer-insights/engagement-insights/get-started-android
https://docs.netcoresmartech.com/v1.0/docs/android-sdk-v2-advanced
https://docs.pushwoosh.com/platform-docs/v/master/pushwoosh-sdk/cross-platform-frameworks/adobe-air
https://documentation.accengage.com/sdk/android/3.6/migration/
https://firebase.google.com/docs/analytics/configure-data-collection
2021-12-27 23:24:03 -05:00
https://firebase.google.com/docs/crashlytics/customize-crash-reports
2021-12-27 17:31:15 -05:00
https://github.com/mapbox/mapbox-events-android/pull/77/files
https://github.com/mixpanel/mixpanel-android/blob/master/src/main/java/com/mixpanel/android/mpmetrics/MPConfig.java
https://help.batch.com/en/articles/5204072-how-to-integrate-batch-into-my-cmp
https://help.upsight.com/api_sdk_reference/android/
https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/app-experience-analytics/17-3/using/using-apis/android-custom-apis/Supported-Meta-Data-Properties.html
Currently Implemented
data.putString("acc_advertiser_id", "false");
data.putString("acc_no_geoloc", "true");
data.putString("acc_tracking_mode", "Restricted");
2021-09-13 15:27:13 -04:00
data.putString("android.webkit.WebView.MetricsOptOut", "true");
2021-12-27 17:31:15 -05:00
data.putString("AXACollectIp", "false");
2021-09-13 15:27:13 -04:00
data.putString("batch_opted_out_by_default", "true");
2021-12-27 18:16:42 -05:00
data.putString("CLEVERTAP_BACKGROUND_SYNC", "0");
data.putString("CLEVERTAP_USE_GOOGLE_AD_ID", "0");
2021-12-27 17:31:15 -05:00
data.putString("com.ad4screen.advertiser_id", "false");
2021-09-13 15:27:13 -04:00
data.putString("com.ad4screen.no_geoloc", "true");
2018-05-21 05:28:07 -04:00
data.putString("com.ad4screen.tracking_mode", "Restricted");
2021-09-13 15:27:13 -04:00
data.putString("com.bugsnag.android.AUTO_CAPTURE_SESSIONS", "false");
2021-12-27 17:31:15 -05:00
data.putString("com.bugsnag.android.AUTO_DETECT_ERRORS", "false");
data.putString("com.bugsnag.android.AUTO_TRACK_SESSIONS", "false");
data.putString("com.bugsnag.android.DETECT_ANR", "false");
data.putString("com.bugsnag.android.DETECT_NDK_CRASHES", "false");
2021-09-13 15:27:13 -04:00
data.putString("com.bugsnag.android.ENABLE_EXCEPTION_HANDLER", "false");
data.putString("com.bugsnag.android.PERSIST_USER_BETWEEN_SESSIONS", "false");
2021-12-27 17:31:15 -05:00
data.putString("com.bugsnag.android.PERSIST_USER", "false");
data.putString("com.bugsnag.android.SEND_THREADS", "NEVER");
data.putString("com.facebook.sdk.AdvertiserIDCollectionEnabled", "false");
data.putString("com.facebook.sdk.AutoInitEnabled", "false");
data.putString("com.facebook.sdk.AutoLogAppEventsEnabled", "false");
2021-09-13 15:27:13 -04:00
data.putString("com.followanalytics.message.inapp.enable", "false");
data.putString("com.followanalytics.message.push.enable", "false");
2021-12-27 17:31:15 -05:00
data.putString("com.google.android.gms.ads.AD_MANAGER_APP", "false");
2021-12-27 23:24:03 -05:00
data.putString("com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT", "true");
2021-12-27 17:31:15 -05:00
data.putString("com.mapbox.EnableEvents", "false");
data.putString("com.microsoft.engagementinsights.autoCapture", "false");
data.putString("com.mixpanel.android.MPConfig.AutoCheckForSurveys", "false");
2021-09-13 15:27:13 -04:00
data.putString("com.mixpanel.android.MPConfig.AutoShowMixpanelUpdates", "false");
data.putString("com.mixpanel.android.MPConfig.DisableAppOpenEvent", "true");
data.putString("com.mixpanel.android.MPConfig.DisableDecideChecker", "true");
2021-12-27 17:31:15 -05:00
data.putString("com.mixpanel.android.MPConfig.DisableExceptionHandler", "true");
2021-09-13 15:27:13 -04:00
data.putString("com.mixpanel.android.MPConfig.DisableFallback", "true");
data.putString("com.mixpanel.android.MPConfig.DisableViewCrawler", "true");
data.putString("com.mixpanel.android.MPConfig.TestMode", "true");
2021-12-27 17:31:15 -05:00
data.putString("com.mixpanel.android.MPConfig.UseIpAddressForGeolocation", "false");
data.putString("com.sprooki.LOCATION_SERVICES", "disable");
data.putString("com.webengage.sdk.android.location_tracking", "false");
data.putString("firebase_analytics_collection_deactivated", "true");
data.putString("firebase_analytics_collection_enabled", "false");
data.putString("firebase_crash_collection_enabled", "false");
2021-12-27 23:24:03 -05:00
data.putString("firebase_crashlytics_collection_enabled", "false");
2021-12-27 17:31:15 -05:00
data.putString("firebase_performance_collection_deactivated", "true");
data.putString("google_analytics_adid_collection_enabled", "false");
data.putString("google_analytics_automatic_screen_reporting_enabled", "false");
data.putString("google_analytics_default_allow_ad_personalization_signals", "false");
data.putString("google_analytics_ssaid_collection_enabled", "false");
data.putString("SMT_USE_AD_ID", "0");
data.putString("tapjoy.disable_advertising_id_check", "true");
data.putString("tapjoy.disable_android_id_as_analytics_id", "true");
data.putString("tapjoy.disable_automatic_session_tracking", "true");
data.putString("tapjoy.disable_persistent_ids", "true");
data.putString("tapjoy.disable_video_offers", "true");
data.putString("tnkad_tracking", "false");
Settings
2021-09-13 15:27:13 -04:00
data.putString("engagement:adm:register", "false");
2021-12-27 17:31:15 -05:00
data.putString("engagement:connection:delay", "2629800");
2021-09-13 15:27:13 -04:00
data.putString("engagement:locationReport:lazyArea", "false");
data.putString("engagement:locationReport:realTime:background", "false");
data.putString("engagement:locationReport:realTime", "false");
data.putString("engagement:locationReport:realTime:fine", "false");
data.putString("engagement:log:test", "false");
data.putString("engagement:reportCrash", "false");
data.putString("FYBEnableSSLRewardedVideo", "true");
data.putString("mceSessionEnabled", "false");
2021-12-27 17:31:15 -05:00
data.putString("PW_BROADCAST_PUSH", "false");
2018-05-21 05:28:07 -04:00
API Keys
2021-12-27 17:31:15 -05:00
String apiFillerValue = "DO_NOT_TRACK";
2018-05-21 20:29:16 -04:00
data.putString("apptentive_api_key", apiFillerValue);
data.putString("apptentive_key", apiFillerValue);
data.putString("apptentive_signature", apiFillerValue);
2021-12-27 23:24:03 -05:00
data.putString("BUGLY_APPID", apiFillerValue);
2018-05-21 20:29:16 -04:00
data.putString("__ChartboostAir__AppID", apiFillerValue);
data.putString("__ChartboostAir__AppSignature", apiFillerValue);
2021-12-27 17:31:15 -05:00
data.putString("CLEVERTAP_ACCOUNT_ID", apiFillerValue);
data.putString("CLEVERTAP_TOKEN", apiFillerValue);
2018-05-21 20:29:16 -04:00
data.putString("com.a0soft.gphone.aTrackDog.webURL", apiFillerValue);
data.putString("com.ad4screen.facebook_appid", apiFillerValue);
data.putString("com.ad4screen.partnerid", apiFillerValue);
data.putString("com.ad4screen.privatekey", apiFillerValue);
data.putString("com.ad4screen.senderid", apiFillerValue);
data.putString("com.appsee.ApiKey", apiFillerValue);
data.putString("com.blueshift.gcm_sender_id", apiFillerValue);
data.putString("com.bugsnag.android.API_KEY", apiFillerValue);
data.putString("com.crashlytics.ApiKey", apiFillerValue);
data.putString("com.facebook.sdk.ApplicationId", apiFillerValue);
data.putString("com.geouniq.appkey", apiFillerValue);
data.putString("com.google.android.awareness.API_KEY", apiFillerValue);
2021-12-27 17:31:15 -05:00
data.putString("com.google.android.gms.ads.APPLICATION_ID", apiFillerValue);
data.putString("com.huawei.hms.client.appid", apiFillerValue);
data.putString("com.huawei.hms.client.cpid", apiFillerValue);
2018-05-21 20:29:16 -04:00
data.putString("com.indooratlas.android.sdk.API_KEY", apiFillerValue);
data.putString("com.indooratlas.android.sdk.API_SECRET", apiFillerValue);
2021-12-27 17:31:15 -05:00
data.putString("com.microsoft.engagementinsights.ingestionKey", apiFillerValue);
2018-05-21 20:29:16 -04:00
data.putString("com.pushwoosh.appid", apiFillerValue);
data.putString("com.pushwoosh.senderid", apiFillerValue);
2021-12-27 17:31:15 -05:00
data.putString("com.tapjoy.appstore", apiFillerValue);
2018-05-21 20:29:16 -04:00
data.putString("com.upsight.app_token", apiFillerValue);
2021-12-27 17:31:15 -05:00
data.putString("com.upsight.fcm.api.key", apiFillerValue);
data.putString("com.upsight.fcm.application.id", apiFillerValue);
2018-05-21 20:29:16 -04:00
data.putString("com.upsight.public_key", apiFillerValue);
2021-12-27 17:31:15 -05:00
data.putString("com.webengage.sdk.android.key", apiFillerValue);
2018-05-21 20:29:16 -04:00
data.putString("co.paystack.android.PublicKey", apiFillerValue);
data.putString("FAID", apiFillerValue);
data.putString("io.branch.sdk.BranchKey", apiFillerValue);
data.putString("io.emma.SESSION_KEY", apiFillerValue);
data.putString("io.fabric.ApiKey", apiFillerValue);
data.putString("net.hockeyapp.android.appIdentifier", apiFillerValue);
data.putString("net.hockeyapp.android.appSecret", apiFillerValue);
data.putString("pilgrim_sdk_key", apiFillerValue);
data.putString("pilgrim_sdk_secret", apiFillerValue);
data.putString("presage_key", apiFillerValue);
data.putString("tkbl-api-key-0", apiFillerValue);
2021-12-27 17:31:15 -05:00
data.putString("tnkad_app_id", apiFillerValue);