FORUMS

[SCRIPT] Disable Tracking Services, version 1.6

256 posts
Thanks Meter: 81
 
By steveglowplunk, Senior Member on 14th May 2020, 05:48 PM
Post Reply Email Thread
Disable Tracking Services
This is a set of scripts that disables privacy invasive tracking components in all user installed apps (service/broadcast receiver/activity/content provider).
Root permission is required to run the scripts.

How it works:
UpdateExodus.sh downloads tracker names from Exodus Privacy.
DisableTracking.sh dumps a list of components of all installed apps, compare it against the list of trackers name, and disable those components (using the 'pm disable' command) if they match.

Download: Google Drive link
Check instructions.txt for details on how to use the scripts.
The latest version is 1.6.
You are recommended to backup your apps before running the scripts.
You are also recommended to do a full nandroid backup before running the scripts.

I hope you will find this useful

The script was originally based on the one here: https://forum.xda-developers.com/and...-apps-t4074427
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20200416-162747_Terminal_Emulator.png
Views:	298
Size:	244.8 KB
ID:	5018775   Click image for larger version

Name:	Screenshot_20200416-141604_Terminal_Emulator.png
Views:	290
Size:	185.8 KB
ID:	5018777  
The Following 3 Users Say Thank You to steveglowplunk For This Useful Post: [ View ] Gift steveglowplunk Ad-Free
14th May 2020, 05:48 PM |#2  
OP Senior Member
Thanks Meter: 81
 
More
Instructions

Prerequisites:
Root permission is required.
You also need these extra binaries installed in a directory of $PATH (such as /system/xbin):
-aapt
-jq
You can download these binaries from the Termux app ( https://play.google.com/store/apps/d...?id=com.termux )
You will also need busybox installed. Search for how to install it.

Method 1 (automatic) (experimental):
Run InstallReq.sh in Termux *as a normal user* (not as root)
i.e. run this command: bash /path/to/script/InstallReq.sh
It will check if aapt, jq, curl or sqlite3 are missing and automatically download them, then copy them to /system/xbin.


Method 2 (manual):
Run these commands in Termux:

pkg install aapt
pkg install jq

Copy them from /data/data/com.termux/files/usr/bin to a directory of $PATH
Then give them execution permission, e.g. "chmod +x /system/xbin/aapt"

To see what directories are in $PATH, run this command: "echo $PATH"

Note: if you've placed the binaries in /sbin, or you have installed Magisk,
the binaries will be deleted every reboot. You'll have to copy them again.

Note: aapt and jq must be downloaded from Termux and the Termux app must remain installed,
since the dependencies are stored in Termux's data folder.

------------------------------------------------------------

Usage:
-All scripts and txt files must be in the same directory as DisableTrackers.sh

You need a terminal emulator to run these scripts.
Personally I use "Terminal Emulator for Android" ( https://play.google.com/store/apps/d...al.androidterm )
This terminal emulator lets you add launcher shortcuts. Quite convenient in my opinion.
Termux may also work, but I haven't tested it.

For first time usage, run UpdateExodus.sh first.
i.e. run this command: su -c sh /path/to/script/UpdateExodus.sh
If the script runs successfully, a MergedTrackers.txt will be created.
Then you can run DisableTrackers.sh AS SU to start disabling trackers. (root permission is required)
i.e. run this command: su -c sh /path/to/script/DisableTrackers.sh
By default, only third party apps are checked.
If you want to check for trackers in system apps as well, add 'sys' as the parameter.
i.e. run this command: su -c sh /path/to/script/DisableTrackers.sh sys
Not really recommended since it could theoretically mess up Google Play Services, though I can't confirm since I don't have it installed on my phone.

Note: if you've used version 1.4 or below and don't want the script to process all apps again, run CreateAppDB.sh.
It will create a ProcessedApps.db with records of all currently installed apps.

------------------------------------------------------------

Explanations:
UpdateExodus.sh will download a tracker list from Exodus Privacy, and merge it with CustomTrackers.txt (if it exists)
You can add your own trackers to CustomTrackers.txt. You may also write comments in this format: #(comment here)

DisableTracking.sh will dump a list of components (service/broadcast receiver/activity/content provider) of all installed apps,
compare it against the list of trackers in MergedTrackers.txt, and disable those components if they match.
It will save a list of already processed apps to a database file in the script's directory,
so they will not be processed twice when you run the script again (like maybe you've installed a new app and you want to disable its trackers by running the script).

Apps with trackers will be logged to AppsWithTrackers.txt.
exodustrackers.json is the raw list downloaded from Exodus Privacy.
MergedTrackers.txt contains the merged results of exodustrackers_extracted.txt and CustomTrackers.txt.
ProcessedApps.db contains a list of already processed apps. They will be skipped in the next run of DisableTrackers.sh.
14th May 2020, 05:48 PM |#3  
OP Senior Member
Thanks Meter: 81
 
More
Update log

Version 1.5:
-DisableTracking.sh now uses a database to store processed app names and versions.
This means if an app was updated, it will check for trackers in the updated app again.
-If there was a deleted app, DisableTracking.sh will now delete its record from ProcessedApps.db automatically. No more manual deletion.
-Note: if you've used version 1.4 or below and don't want the script to process all apps again, run CreateAppDB.sh.
It will create a ProcessedApps.db with records of all currently installed apps.

Version 1.6:
-DisableTracking.sh now supports checking for trackers in system apps. Check the usage section for how to use.
-Improved logic of DisableTracking.sh to reduce problems. Thanks to hyborian for pointing them out.
-Added checks for root permission and presence of extra binaries.
-The new script 'InstallReq.sh' will automatically install missing extra binaries from Termux.
Check the prerequisites section for how to use.
-UpdateExodus.sh will no long generate exodustrackers_extracted.txt. The content is stored in memory instead of a file.
-MergeExodus.sh is no longer needed. The functions are...merged into UpdateExodus.sh.
14th May 2020, 05:50 PM |#4  
OP Senior Member
Thanks Meter: 81
 
More
reserved 3
15th May 2020, 05:12 AM |#5  
Senior Member
Thanks Meter: 307
 
More
Thanks, fantastic tool
15th May 2020, 07:54 AM |#6  
Senior Member
Thanks Meter: 307
 
More
del
20th May 2020, 02:25 PM |#7  
Junior Member
Thanks Meter: 0
 
More
Hello I got a little issue with your tools ( it says to i need to verify my internet connection but I have wifi on. I have tried in mobile data still same ...
(When I open the web site manually it work but during the script execution I have this issue any other method?
20th May 2020, 02:39 PM |#8  
OP Senior Member
Thanks Meter: 81
 
More
Quote:
Originally Posted by Random-Tester

Hello I got a little issue with your tools ( it says to i need to verify my internet connection but I have wifi on. I have tried in mobile data still same ...
(When I open the web site manually it work but during the script execution I have this issue any other method?

Ok try running the script in attachment (remove .txt in the name), copy/screenshot the output and post it here.
Attached Files
File Type: txt UpdateExodus_test.sh.txt - [Click for QR Code] (2.1 KB, 26 views)
20th May 2020, 03:44 PM |#9  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by steveglowplunk

Ok try running the script in attachment (remove .txt in the name), copy/screenshot the output and post it here.


Hi thnx for fast answers !! Unfortunately nothing new

I got this in terminal :

$ su
:/data/data/com.termux/files/home # /system/bin/UpdateExodus.sh
curl not found
wget not found
jq is a tracked alias for /sbin/jq
Checking connection with https://etip.exodus-privacy.eu.org/trackers/export
/system/bin/UpdateExodus.sh[26]: curl: inaccessible or not found

Network check status is empty
Unable to connect with https://etip.exodus-privacy.eu.org/trackers/export. Please check you internet connection.
No changes done.
Script will exit now.
20th May 2020, 04:36 PM |#10  
OP Senior Member
Thanks Meter: 81
 
More
Quote:
Originally Posted by Random-Tester

Hi thnx for fast answers !! Unfortunately nothing new

I got this in terminal :

$ su
:/data/data/com.termux/files/home # /system/bin/UpdateExodus.sh
curl not found
wget not found
jq is a tracked alias for /sbin/jq
Checking connection with https://etip.exodus-privacy.eu.org/trackers/export
/system/bin/UpdateExodus.sh[26]: curl: inaccessible or not found

Network check status is empty
Unable to connect with https://etip.exodus-privacy.eu.org/trackers/export. Please check you internet connection.
No changes done.
Script will exit now.

Yes, the purpose of the script was to find out missing binaries, and it says you're missing curl and wget. This could be because you don't have busybox installed (wget is included in busybox) and you're running stock rom (curl should be included in a custom rom such as LineageOS).
What you can do is download those binaries from Termux. (Use the command 'pkg install curl', same for wget), and copy them to /sbin, just like what you'd do with jq.
curl is used for checking connection status. wget is used for downloading the trackers json file.
21st May 2020, 06:25 AM |#11  
phantom146's Avatar
Senior Member
Flag Malabon
Thanks Meter: 1,130
 
Donate to Me
More
After executing everything perfectly, I ran to a weird instance where everytime it scans an app, a command sqlite3: inaccessible or not found was shown. I was wondering if this shows because I performed disable f*ck services script first then this script? are they supposed to do the same? does that mean the apps I'm scanning right now already have their services/receivers disabled thats why disabletracking.sh can't detect them? thank you!
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes