Skip to content
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

Automatically disable tracking components on app install #40

Open
Atrate opened this issue Jul 17, 2020 · 10 comments
Open

Automatically disable tracking components on app install #40

Atrate opened this issue Jul 17, 2020 · 10 comments

Comments

@Atrate
Copy link
Contributor

Atrate commented Jul 17, 2020

Related to: #28, #35, #39

AppManager could utilize the android.intent.action.PACKAGE_ADDED broadcast receiver to automatically disable tracker components in apps the moment they are installed.

@MuntashirAkon
Copy link
Owner

But doesn't this mean that it needs to run a service all the time?

@MuntashirAkon MuntashirAkon changed the title Automatically disable tracking components Automatically disable tracking components on app install Jul 17, 2020
@MuntashirAkon MuntashirAkon added the Feature New feature or request label Jul 17, 2020
@Atrate
Copy link
Contributor Author

Atrate commented Jul 17, 2020

Can't an app be woken up by a broadcast without having a persistent bg service?

@MuntashirAkon
Copy link
Owner

MuntashirAkon commented Jul 17, 2020

So, I will provide an option in the settings which will be disabled by default. It will block trackers only if it's enabled.

Detecting new package installation is not heard but detecting the package itself is a bit difficult. So, what I'll do is fetch all the packages and sort it using the date installed updated and only apply the blocking in the last one.

@MuntashirAkon MuntashirAkon added this to the v2.5.9 milestone Jul 17, 2020
@MuntashirAkon
Copy link
Owner

MuntashirAkon commented Jul 20, 2020

Can't an app be woken up by a broadcast without having a persistent bg service?

Unfortunately, no. After API 26, most of the system broadcasts has been hidden (I can detect package uninstalls though as it's not yet hidden). So, a background service is required. The alternative is to mark the last app launch time and find the newly installed/updated apps between that time and apply the action, which I think is better than running persistent services.

@MuntashirAkon MuntashirAkon modified the milestones: v2.5.9, v2.5.10 Jul 21, 2020
@MuntashirAkon MuntashirAkon removed this from the v2.5.10 milestone Jul 29, 2020
@MuntashirAkon
Copy link
Owner

Related to #61

@MuntashirAkon MuntashirAkon added the Priority: 5 Lowest priority label Aug 18, 2020
@Atrate
Copy link
Contributor Author

Atrate commented Aug 26, 2020

Now that AM can install APKs directly from file managers, this feature could be implemented more easily, at least only for apps installed through AM.

The alternative is to mark the last app launch time and find the newly installed/updated apps between that time and apply the action, which I think is better than running persistent services.

Since AM is going to have a firewall function, running an installation watchdog could be coupled with the FW service.

@MuntashirAkon
Copy link
Owner

Now that AM can install APKs directly from file managers, this feature could be implemented more easily, at least only for apps installed through AM.

Yes, this could be possible.

Since AM is going to have a firewall function, running an installation watchdog could be coupled with the FW service.

Firewall won't use any service for root users, at least, for now. I do not intend to make it a complicated firewall system like AFWall+ or Netguard. It will have the basic internet blocking features, import/export (like any other rules) and, probably, hosts blocking and will be available throughout the app as batch ops and routine ops (the ecosystem is already very complicated in the backend). I may also add logging capabilities in future. Most users should be satisfied with only these features. Besides, merging root/no-root firewall is going to be a difficult job.

@MuntashirAkon
Copy link
Owner

Since App Manager uses server-client mechanism and server (which doesn't have any impact on battery) runs in the background all the time, this can be achieved more easily (since it's only specific to root users) in the following way:

  1. Run AM server on boot instead of only when AM is running
  2. Register a broadcast receiver for PACKAGE_ADDED.
  3. When an app is installed ie. PACKAGE_ADDED is called, another explicit broadcast will be sent to AM (which will wake up AM for a few seconds).
  4. AM will run a job to block the tracking components and a notification will be displayed.

@MuntashirAkon
Copy link
Owner

Now that AM can install APKs directly from file managers, this feature could be implemented more easily, at least only for apps installed through AM.

This feature has been implemented in fb69160.

@EkriirkE
Copy link

I looked and poked around but could not find anything on this aspect - can arbitrary components also be added to auto revoke on install (eg I want to automatically disable anything with the word "lytic" or "metric" in it), and other permissions like network; defaulting anything new to POLICY_REJECT_ALL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants