XPrivacy icon indicating copy to clipboard operation
XPrivacy copied to clipboard

Flush privacy service cache

Open psyoptix opened this issue 12 years ago • 36 comments

Such a functionality would permit a much more fine grained access control model since a user could then enable capabilities for an app(s) not just in terms of absolute Yes or No but also conditioned on a huge variety of run-time conditions being met. For example this could allow revoking permissions needed by an app unless a run-time condition is met explicitly indicating that the user now intends to make use of those capabilities.

Example use cases:

  • Create a toggle to enter and leave "Navigation Mode" entailing turning on/off GPS, fine grained location service, and switching location relevant privacy restrictions on relevant navigation apps in one clean action. The first two are possible with Tasker alone but the third part would require the requested extension of XPrivacy.
  • Enable location access for google play service (and maps) only when Maps is open.
  • Automatically enable location access only when connected to home wifi to benefit from location specific search but avoid having movements tracked.
  • Enable NFC capabilities only when myNFCapp running in foreground.
  • Turn sending SMS and outgoing Phone Calls permissions off globally while screen off (or even unless dialler or SMSapp running in foreground).

psyoptix avatar May 22 '14 22:05 psyoptix

Yes!! These are exactly the scenarios I had in mind. Especially hiding one's location from Google except when Maps is active, so that they can't build a file on your whereabouts 24/7 but you can still use Maps, Google's best application.

I think something like this was mentioned earlier, and it would not be easy to implement because of security, but this would definitely be my number 1 feature request for Xprivacy!! I would donate extra for this!

Cerberus-tm avatar May 23 '14 02:05 Cerberus-tm

-1. Sorry. But giving 3rd party apps access to the restrictions db via an intent is a major security concern for me. Also you can already achieve any combination you can come up with using Tasker by running sql updates on the restriction db in a shell command (root required). For more info see here https://github.com/M66B/XPrivacy/blob/master/DATABASE.md

an0n981 avatar May 23 '14 05:05 an0n981

The problem with this request is security, see also #1630 We haven't found a workable solution for this.

M66B avatar May 23 '14 06:05 M66B

To be clear the feature request now includes protecting the intent via a special XPrivacy specific restriction. So I think an0n981's security concern doesn't apply any more.

psyoptix avatar May 26 '14 13:05 psyoptix

+2

an0n981 avatar May 26 '14 15:05 an0n981

I'm okay with this, if we have a clear way to know wich app will or will not be able to use this feature as doing it wrongly may kill the whole purpose of XPrivacy.

Magissia avatar May 26 '14 20:05 Magissia

Perfect examples of the kind of things i envisioned with tasker integration, with the maps app,all the way too screen off = security fort knox clamp down.......restriction automation based on cofigurable events

Take my money.....ahem.....i mean, heres my +1

+2 if plugin is possible but assuming its not

banderos101 avatar May 26 '14 20:05 banderos101

@banderos: plugin would be awesome :) Would settle for indents though. +1

voidling42 avatar May 26 '14 20:05 voidling42

After some thinking, I am going to veto this. I simply don't want external control over XPrivacy restrictions. The potential security disadvantages do not out-weight the advantages, which are probably only for just a few people. I also do not want to support this feature, because it will inevitable result in all kinds of questions.

I recognize that more advanced users have a use for this. Those users can manipulate the privacy database and for that purpose I will provide a way to clear the XPrivacy service cache. This goes with the note that the database structure might change in the future. I will try to keep the database backward compatibly, but this will not be the highest priority. At this moment I don't see a reason to change the database, but that could change in the future.

M66B avatar May 26 '14 20:05 M66B

IMHO clearing the cache is really all that is needed anyways, everything else can already be done via shell scripts that can be automated via Tasker

an0n981 avatar May 26 '14 20:05 an0n981

That is my idea too and since there is now decent documentation, this is within reach of more advanced users without putting a lot of (research) time into it.

M66B avatar May 26 '14 20:05 M66B

Yup, that would work for me too.

psyoptix avatar May 26 '14 20:05 psyoptix

Aww let my +1 be recorded for posterity!

I am not an advanced user and I have no idea how SQL and databases work, but I would really, really love to have functionality like this. If it can be done outside of Xprivacy with this flushing thing, that would be great; so do you expect someone to make an application or plugin that can do it? If anyone would be willing to write an app or think of an easy way for non-technical people to implement this, I would be willing to donate (a small amount)! And I'm sure there will be many others who would also donate!

Cerberus-tm avatar May 26 '14 23:05 Cerberus-tm

@cerberus-tm Given that there are infinite possibilities that can be achieved using SQL statements, I don't think there is a way to create an app where you can just click your way to the result you want. The best thing to do is learn a little SQL. A documentation of the XPrivacy databases has already been created with a few examples to get you started. https://github.com/M66B/XPrivacy/blob/master/DATABASE.md

an0n981 avatar May 27 '14 05:05 an0n981

@an0n981 Thanks for the tip! I looked at the examples you put in the documentation, and they look interesting. I am not a computer programmer in any way, and I did see various terms that were over my head. I once tried to get Tasker to do something related to SQL; I basically copy-pasted stuff off the Internet hoping that I could modify it and get it to work, but I failed. Maybe I could some day try looking into this when I find the courage to risk messing up my Xprivacy hehe, maybe I could figure it out.

As to those infinite possibilities, the scenarios in the OP would really be 90 % of what I think most people would use Tasker for if this were possible. Perhaps someone with the same needs will make an application that can do only those things.

Or basically a Tasker plugin that would let you allow and deny any permission for any installed app by creating the appropriate SQL command, that would take care of everything, if I understand how this works correctly. As in, you tap the plugin in Tasker as an action; then, inside the plugin, you have an app picker and a permission picker, and deny/allow. Then the plugin converts your picks into the appropriate SQL commands. The pickers could even be very basic textual drop-down lists. Or maybe that is totally not how it could ever work, just thinking out loud.

Either way, thanks for putting things examples in the documentation, good work!

Cerberus-tm avatar May 27 '14 05:05 Cerberus-tm

If the cache intent is implemented, the documentation could be expanded to include things like those above, they just don't make a lot sense without it since you currently have to reboot after every change. Or (with @M66B blessing) we could even start a new XDA thread for XPrivacy SQL related question.

an0n981 avatar May 27 '14 06:05 an0n981

I am counting six +1's (only @an0n981 is currenly allowed to vote +2 for his contributions to the project).

Please note that there is still no good solution for security (except for using an Android permission for the intent). There is no way to identify the sender of an intent, see here for more information about this: http://www.unwesen.de/2011/04/10/android-intent-sender-verification/

M66B avatar May 27 '14 11:05 M66B

It seems the only way out is to protect the intent with a permission. Together with some very brief documentation about the syntax of the intent I think this could open the door for a third party to create a (probably quite simple) plugin for Tasker (and compatible apps) with that permission in it's manifest. (A bit like secure settings has additional permissions over standard Tasker.)

On the one hand this would provide protection to the Intent in XPrivacy, but on the other hand it gets around the issue that the Tasker devs have ruled out adding an XPrivacy specific permission to their own manifest.

psyoptix avatar May 27 '14 12:05 psyoptix

I am not sure, but maybe a plugin can request additional permissions. I will only work on this after the security issue has been resolved. What we could do is write a small helper app that carries the permission and sends the intent.

M66B avatar May 27 '14 12:05 M66B

I just checked and the plugin is a completely separate app from the automation app. In particular the plugin can request it's own permissions.

More info at: http://tasker.dinglisch.net/plugins-intro.html

The small helper app idea would be cool too. Maybe more so really as it is actually a more general solution. In particular Tasker can launch any app (or even a particular activity with-in an app) as an actions so we'd end up with the desired capability.

psyoptix avatar May 27 '14 13:05 psyoptix