Hamper the ad/analytics libraries!

This commit is contained in:
Tad 2018-05-21 05:28:07 -04:00
parent 041793dd69
commit f9f893a443
6 changed files with 155 additions and 69 deletions

View File

@ -1,69 +0,0 @@
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 from its own AndroidManifest it actuallly 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
core/java/android/content/pm/PackageParser.java
parseMetaData
line 5526
data.putBoolean("batch_opted_out_by_default", true);
data.putBoolean("com.ad4screen.no_geoloc", true);
data.putBoolean("com.bugsnag.android.AUTO_CAPTURE_SESSIONS", false);
data.putBoolean("com.bugsnag.android.ENABLE_EXCEPTION_HANDLER", false);
data.putBoolean("com.bugsnag.android.PERSIST_USER_BETWEEN_SESSIONS", false);
data.putBoolean("com.bugsnag.android.SEND_THREADS", false);
data.putBoolean("com.facebook.sdk.AutoLogAppEventsEnabled", false);
data.putBoolean("com.followanalytics.message.inapp.enable", false);
data.putBoolean("com.followanalytics.message.push.enable", false);
data.putBoolean("com.mixpanel.android.MPConfig.AutoShowMixpanelUpdates", false);
data.putBoolean("com.mixpanel.android.MPConfig.DisableAppOpenEvent", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableDecideChecker", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableFallback", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableGestureBindingUI", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableViewCrawler", true);
data.putBoolean("com.mixpanel.android.MPConfig.TestMode", true);
data.putBoolean("com.mixpanel.android.MPConfig.UseIpAddressForGeolocation", false);
data.putBoolean("com.webengage.sdk.android.location_tracking", false);
data.putBoolean("engagement:adm:register", false);
data.putBoolean("engagement:locationReport:lazyArea", false);
data.putBoolean("engagement:locationReport:realTime:background", false);
data.putBoolean("engagement:locationReport:realTime", false);
data.putBoolean("engagement:locationReport:realTime:fine", false);
data.putBoolean("engagement:log:test", false);
data.putBoolean("engagement:reportCrash", false);
data.putBoolean("firebase_analytics_collection_deactivated", true);
data.putBoolean("firebase_analytics_collection_enabled", false);
data.putBoolean("firebase_crash_collection_enabled", false);
data.putBoolean("firebase_performance_collection_deactivated", true);
data.putBoolean("FYBEnableSSLRewardedVideo", true);
data.putBoolean("google_analytics_adid_collection_enabled", false);
data.putBoolean("mceSessionEnabled", false);
data.putBoolean("tapjoy.disable_video_offers", true);
data.putInteger("CLEVERTAP_USE_GOOGLE_AD_ID", 0)
data.putInteger("engagement:connection:delay", 2629800);
data.putString("apptentive_api_key", "");
data.putString("apptentive_key", "");
data.putString("apptentive_signature", "");
data.putString("__ChartboostAir__AppID", "");
data.putString("__ChartboostAir__AppSignature", "");
data.putString("com.ad4screen.facebook_appid", "");
data.putString("com.ad4screen.partnerid", "");
data.putString("com.ad4screen.privatekey", "");
data.putString("com.ad4screen.senderid", "");
data.putString("com.ad4screen.tracking_mode", "Restricted");
data.putString("com.appsee.ApiKey", "");
data.putString("com.blueshift.gcm_sender_id", "");
data.putString("com.google.android.awareness.API_KEY", "");
data.putString("com.pushwoosh.appid", "");
data.putString("com.pushwoosh.senderid", "");
data.putString("com.sprooki.LOCATION_SERVICES", "disable");
data.putString("com.upsight.app_token", "");
data.putString("com.upsight.public_key", "");
data.putString("FAID", "");
data.putString("io.branch.sdk.BranchKey", "");
data.putString("io.emma.SESSION_KEY", "");
data.putString("net.hockeyapp.android.appIdentifier", "");
data.putString("pilgrim_sdk_key", "");
data.putString("pilgrim_sdk_secret", "");
data.putString("presage_key", "");

View File

@ -0,0 +1,78 @@
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) {
Core
data.putBoolean("batch_opted_out_by_default", true);
data.putBoolean("com.ad4screen.no_geoloc", true);
data.putBoolean("com.facebook.sdk.AutoLogAppEventsEnabled", false);
data.putBoolean("com.mixpanel.android.MPConfig.UseIpAddressForGeolocation", false);
data.putBoolean("com.webengage.sdk.android.location_tracking", false);
data.putBoolean("firebase_analytics_collection_deactivated", true);
data.putBoolean("firebase_analytics_collection_enabled", false);
data.putBoolean("firebase_crash_collection_enabled", false);
data.putBoolean("firebase_performance_collection_deactivated", true);
data.putBoolean("google_analytics_adid_collection_enabled", false);
data.putString("com.ad4screen.tracking_mode", "Restricted");
data.putString("com.sprooki.LOCATION_SERVICES", "disable");
Settings
data.putBoolean("com.bugsnag.android.AUTO_CAPTURE_SESSIONS", false);
data.putBoolean("com.bugsnag.android.ENABLE_EXCEPTION_HANDLER", false);
data.putBoolean("com.bugsnag.android.PERSIST_USER_BETWEEN_SESSIONS", false);
data.putBoolean("com.bugsnag.android.SEND_THREADS", false);
data.putBoolean("com.followanalytics.message.inapp.enable", false);
data.putBoolean("com.followanalytics.message.push.enable", false);
data.putBoolean("com.mixpanel.android.MPConfig.AutoShowMixpanelUpdates", false);
data.putBoolean("com.mixpanel.android.MPConfig.DisableAppOpenEvent", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableDecideChecker", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableFallback", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableGestureBindingUI", true);
data.putBoolean("com.mixpanel.android.MPConfig.DisableViewCrawler", true);
data.putBoolean("com.mixpanel.android.MPConfig.TestMode", true);
data.putBoolean("engagement:adm:register", false);
data.putBoolean("engagement:locationReport:lazyArea", false);
data.putBoolean("engagement:locationReport:realTime:background", false);
data.putBoolean("engagement:locationReport:realTime", false);
data.putBoolean("engagement:locationReport:realTime:fine", false);
data.putBoolean("engagement:log:test", false);
data.putBoolean("engagement:reportCrash", false);
data.putBoolean("FYBEnableSSLRewardedVideo", true);
data.putBoolean("mceSessionEnabled", false);
data.putBoolean("tapjoy.disable_video_offers", true);
data.putInteger("CLEVERTAP_USE_GOOGLE_AD_ID", 0)
data.putInteger("engagement:connection:delay", 2629800);
API Keys
data.putString("apptentive_api_key", "");
data.putString("apptentive_key", "");
data.putString("apptentive_signature", "");
data.putString("__ChartboostAir__AppID", "");
data.putString("__ChartboostAir__AppSignature", "");
data.putString("com.ad4screen.facebook_appid", "");
data.putString("com.ad4screen.partnerid", "");
data.putString("com.ad4screen.privatekey", "");
data.putString("com.ad4screen.senderid", "");
data.putString("com.appsee.ApiKey", "");
data.putString("com.blueshift.gcm_sender_id", "");
data.putString("com.google.android.awareness.API_KEY", "");
data.putString("com.pushwoosh.appid", "");
data.putString("com.pushwoosh.senderid", "");
data.putString("com.upsight.app_token", "");
data.putString("com.upsight.public_key", "");
data.putString("FAID", "");
data.putString("io.branch.sdk.BranchKey", "");
data.putString("io.emma.SESSION_KEY", "");
data.putString("net.hockeyapp.android.appIdentifier", "");
data.putString("pilgrim_sdk_key", "");
data.putString("pilgrim_sdk_secret", "");
data.putString("presage_key", "");

View File

@ -0,0 +1,37 @@
From 5b59a2cf8028488847a5cd6ac7d4a14414972438 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Mon, 21 May 2018 04:23:40 -0400
Subject: [PATCH] Disable/reduce functionality of various ad/analytics
libraries
Change-Id: I84303ee26d0232e471f44ae6eff6e41a2210e42e
---
core/java/android/content/pm/PackageParser.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 8c66fb227cf..31368bf74b1 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -5524,6 +5524,18 @@ public class PackageParser {
if (data == null) {
data = new Bundle();
+ data.putBoolean("batch_opted_out_by_default", true);
+ data.putBoolean("com.ad4screen.no_geoloc", true);
+ data.putBoolean("com.facebook.sdk.AutoLogAppEventsEnabled", false);
+ data.putBoolean("com.mixpanel.android.MPConfig.UseIpAddressForGeolocation", false);
+ data.putBoolean("com.webengage.sdk.android.location_tracking", false);
+ data.putBoolean("firebase_analytics_collection_deactivated", true);
+ data.putBoolean("firebase_analytics_collection_enabled", false);
+ data.putBoolean("firebase_crash_collection_enabled", false);
+ data.putBoolean("firebase_performance_collection_deactivated", true);
+ data.putBoolean("google_analytics_adid_collection_enabled", false);
+ data.putString("com.ad4screen.tracking_mode", "Restricted");
+ data.putString("com.sprooki.LOCATION_SERVICES", "disable");
}
String name = sa.getNonConfigurationString(
--
2.17.0

View File

@ -0,0 +1,37 @@
From 5b59a2cf8028488847a5cd6ac7d4a14414972438 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Mon, 21 May 2018 04:23:40 -0400
Subject: [PATCH] Disable/reduce functionality of various ad/analytics
libraries
Change-Id: I84303ee26d0232e471f44ae6eff6e41a2210e42e
---
core/java/android/content/pm/PackageParser.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 8c66fb227cf..31368bf74b1 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -5524,6 +5524,18 @@ public class PackageParser {
if (data == null) {
data = new Bundle();
+ data.putBoolean("batch_opted_out_by_default", true);
+ data.putBoolean("com.ad4screen.no_geoloc", true);
+ data.putBoolean("com.facebook.sdk.AutoLogAppEventsEnabled", false);
+ data.putBoolean("com.mixpanel.android.MPConfig.UseIpAddressForGeolocation", false);
+ data.putBoolean("com.webengage.sdk.android.location_tracking", false);
+ data.putBoolean("firebase_analytics_collection_deactivated", true);
+ data.putBoolean("firebase_analytics_collection_enabled", false);
+ data.putBoolean("firebase_crash_collection_enabled", false);
+ data.putBoolean("firebase_performance_collection_deactivated", true);
+ data.putBoolean("google_analytics_adid_collection_enabled", false);
+ data.putString("com.ad4screen.tracking_mode", "Restricted");
+ data.putString("com.sprooki.LOCATION_SERVICES", "disable");
}
String name = sa.getNonConfigurationString(
--
2.17.0

View File

@ -87,6 +87,7 @@ patch -p1 < $patches"android_frameworks_base/0005-Harden_Sig_Spoofing.patch"; #R
#patch -p1 < $patches"android_frameworks_base/0006-DNS_Cloudflare.patch"; #Switch to Cloudflare DNS
patch -p1 < $patches"android_frameworks_base/0006-DNS_OpenNIC.patch"; #Switch to OpenNIC DNS
#patch -p1 < $patches"android_frameworks_base/0007-Connectivity.patch"; #Change connectivity check URLs to ours
patch -p1 < $patches"android_frameworks_base/0008-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries
rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig;

View File

@ -84,6 +84,7 @@ patch -p1 < $patches"android_frameworks_base/0003-Harden_Sig_Spoofing.patch"; #R
#patch -p1 < $patches"android_frameworks_base/0004-DNS_Cloudflare.patch"; #Switch to Cloudflare DNS
patch -p1 < $patches"android_frameworks_base/0004-DNS_OpenNIC.patch"; #Switch to OpenNIC DNS
#patch -p1 < $patches"android_frameworks_base/0005-Connectivity.patch"; #Change connectivity check URLs to ours
patch -p1 < $patches"android_frameworks_base/0006-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_frameworks_base/Copperhead/0005-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig;
@ -209,6 +210,7 @@ echo "allow wcnss_service block_device:dir search;" >> sepolicy/wcnss_service.te
echo "/dev/block/platform/msm_sdcc\.1/by-name/pad u:object_r:misc_block_device:s0" >> sepolicy/file_contexts; #fix uncrypt denial
enterAndClear "device/lge/mako";
git revert c90006df854e90589bead7aec306e16a605bf265;
cp $patches"android_device_lge_mako/proprietary-blobs.txt" proprietary-blobs.txt; #update that? nah
echo "allow kickstart usbfs:dir search;" >> sepolicy/kickstart.te; #Fix forceencrypt on first boot