[SCRIPT] Disable Tracking Services, version 1.8

Search This thread

steveglowplunk

Senior Member
Sep 15, 2015
307
105
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.8.
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://xdaforums.com/android/development/script-disable-fk-services-trackers-apps-t4074427
 

Attachments

  • Screenshot_20200416-162747_Terminal_Emulator.png
    Screenshot_20200416-162747_Terminal_Emulator.png
    244.8 KB · Views: 3,575
  • Screenshot_20200416-141604_Terminal_Emulator.png
    Screenshot_20200416-141604_Terminal_Emulator.png
    185.8 KB · Views: 3,503
Last edited:

steveglowplunk

Senior Member
Sep 15, 2015
307
105
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/details?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/details?id=jackpal.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.

whitelist.txt is a list of apps that will be skipped.
 
Last edited:
  • Like
Reactions: nilhem

steveglowplunk

Senior Member
Sep 15, 2015
307
105
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.

Version 1.7:
-DisableTracking.sh now shows the app name as seen in the launcher when processing an app (will be empty if the app name is not in Engish)
-DisableTracking.sh will skip apps in whitelist.txt.
-UpdateExodus.sh now shows new tracker names that were not previously present in the old MergedTrackers.txt.

Version 1.8:
-Small fix in DisableTracking.sh that stops it from creating duplicated records in ProcessedApps.db
(in line 165, grep -qx is chnaged to grep -q)
If you've used version 1.6 or above, you are recommended to delete ProcessedApps.db located in the script's directory and run CreateAppDB.sh to regenerate a ProcessedApps.db, although the existing ProcessedApps.db with duplicated records may still work.
 
Last edited:

Random-Tester

Member
Apr 3, 2020
19
0
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?
 

steveglowplunk

Senior Member
Sep 15, 2015
307
105
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.
 

Attachments

  • UpdateExodus_test.sh.txt
    2.1 KB · Views: 163

Random-Tester

Member
Apr 3, 2020
19
0
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.
 
Last edited:

steveglowplunk

Senior Member
Sep 15, 2015
307
105
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.
 
Last edited:

phantom146

Senior Member
Apr 30, 2015
1,081
1,127
Malabon
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!
 

steveglowplunk

Senior Member
Sep 15, 2015
307
105
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!
That means sqlite3 is not installed (I thought it's supposed to be included in Android?). Verify it by running 'type sqlite3' in the terminal.
Maybe you can try downloading sqlite (without the 3) from Termux with the 'pkg install' command, then copy the downloaded binaries to /sbin (similar to what you'd do with jq). Or you can use version 1.4 for now.
sqlite3 is used for writing a database that stores processed apps names and versions, so that they will be skipped in the next run. The script will still disable tracking components that haven't been disabled already.
 
Last edited:

phantom146

Senior Member
Apr 30, 2015
1,081
1,127
Malabon
That means sqlite3 is not installed (I thought it's supposed to be included in Android?). Verify it by running 'type sqlite3' in the terminal.
Maybe you can try downloading sqlite (without the 3) from Termux with the 'pkg install' command, then copy the downloaded binaries to /sbin (similar to what you'd do with jq). Or you can use version 1.4 for now.
sqlite3 is used for writing a database that stores processed apps names and versions, so that they will be skipped in the next run. The script will still disable tracking components that haven't been disabled already.
This worked well. Thank you.

Do you plan on implementing something for sqlite, jq and aapt to stick on sbin for the next update?

Also, some of the apps I'm scanning shows:

Exception occured while executing:
java.lang.illegalArgumentException: component class bugsnag.com etc. Etc. Does not exist in bla bla app.

I assume exodus detected that a certain app has trackers and tries to disable it but since I used disablefohkservice script before this, I guess it was already disabled and disabletracking.sh can't find it now?
 
Last edited:

steveglowplunk

Senior Member
Sep 15, 2015
307
105
This worked well. Thank you.

Do you plan on implementing something for sqlite, jq and aapt to stick on sbin for the next update?

Also, some of the apps I'm scanning shows:

Exception occured while executing:
java.lang.illegalArgumentException: component class bugsnag.com etc. Etc. Does not exist in bla bla app.

I assume exodus detected that a certain app has trackers and tries to disable it but since I used disablefohkservice script before this, I guess it was already disabled and disabletracking.sh can't find it now?
The error you mentioned is normal. That component cannot be toggled.
Also, please try running the script attached in Termux as a normal user (root permission will be required half-way through the script) by running '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. (binaries there should retain across reboots). You are recommended to backup at least your system partition in a recovery. Although tested on my own phone and it shouldn't overwrite anything important in /system, I'm not responsible for any damage caused.

Edit: small change to the script to avoid problems with checking curl
 

Attachments

  • InstallReq.sh.txt
    1,004 bytes · Views: 31
Last edited:

hyborian

Senior Member
Oct 25, 2017
1,188
372
Also, some of the apps I'm scanning shows:

Exception occured while executing:
java.lang.illegalArgumentException: component class bugsnag.com etc. Etc. Does not exist in bla bla app.

I just added a 2> /dev/null to the disable line so I don't see it ...

---------- Post added at 10:10 AM ---------- Previous post was at 10:09 AM ----------

Updated script to version 1.6. Check update log for details.

Great, will try it ...
 

hyborian

Senior Member
Oct 25, 2017
1,188
372
All good :good:, I just added code to delete old app versions from processed db, and to recreate DBFullList variable again after the sqlite changes.
 

steveglowplunk

Senior Member
Sep 15, 2015
307
105
All good :good:, I just added code to delete old app versions from processed db, and to recreate DBFullList variable again after the sqlite changes.
Um... That doesn't sound necessary?
The version field in the database is updated after processing an updated app. There shouldn't be old app versions left behind?
Also, DBFullList doesn't need to be updated after processing an app. If an app's name doesn't exist in DBFullList, then it must be a new app. If it exists in DBFullList and was processed, then it must be an updated app. Not updating the DBFullList variable after processing each apps shouldn't affect the functions.
 
Last edited:

hyborian

Senior Member
Oct 25, 2017
1,188
372
Um... That doesn't sound necessary?
The version field in the database is updated after processing an updated app. There shouldn't be old app versions left behind?
Also, DBFullList doesn't need to be updated after processing an app. If an app's name doesn't exist in DBFullList, then it must be a new app. If it exists in DBFullList and was processed, then it must be an updated app. Not updating the DBFullList variable after processing each apps shouldn't affect the functions.

Lol, you are right, I was looking at my old processed db which had apps with different versions. I should just have erased it and started fresh.

Anyway, it was nice practice for me. learned something while doing it when I couldn't grep the darn version number of Google Play Store (Version: 20.2.09-all [0] [PR] 311811225 (82020900) in DBFullList. I finally realized it had metacharacters [ ] so changed the grep from -qx to -qFx, and all ok now; otherwise, it will get processed again even if it was already done.

Thanks for the script, really great, beats manually doing it using MyAndroidPro or Blocker.
 

steveglowplunk

Senior Member
Sep 15, 2015
307
105
Lol, you are right, I was looking at my old processed db which had apps with different versions. I should just have erased it and started fresh.

Anyway, it was nice practice for me. learned something while doing it when I couldn't grep the darn version number of Google Play Store (Version: 20.2.09-all [0] [PR] 311811225 (82020900) in DBFullList. I finally realized it had metacharacters [ ] so changed the grep from -qx to -qFx, and all ok now; otherwise, it will get processed again even if it was already done.

Thanks for the script, really great, beats manually doing it using MyAndroidPro or Blocker.
Ah I see. I'll add that -F option in the next update.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    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.8.
    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://xdaforums.com/android/development/script-disable-fk-services-trackers-apps-t4074427
    3
    Updated to version 1.7.

    Or probably don't process "com.dv" if the app's package name is com.dv.adm?

    Sent from my Redmi Note 7 Pro using XDA Labs
    I have added a whitelist function that skips processing Advance Download Manager now.
    2
    Updated UpdateExodus.sh in the Version 1.8 folder in Google Drive. Added a quote at line 63 after the 'cat' command to prevent problems with directory names containing spaces.
    2
    Its a bit hard to explain. All packages *.com are going to be disabled.

    Thanks for your help

    Edit: there is space in
    com. hreesixtydialog\.sdk\.
    which should be removed

    Just updated UpdateExodus.sh in the Version 1.8 folder in Google Drive. Delete the old MergedTrackers.txt before using.
    1
    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/details?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/details?id=jackpal.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.

    whitelist.txt is a list of apps that will be skipped.