XPrivacy icon indicating copy to clipboard operation
XPrivacy copied to clipboard

General discussion about on demand restricting

Open jpeg729 opened this issue 12 years ago • 28 comments

If the service kept track of modified apps for 15 secs, and provided a quick function allowing apps to check - they could invalidate their restriction caches, and ask for the new data.

jpeg729 avatar Jan 31 '14 23:01 jpeg729

The problem is that there is no quick check, since the service can only be reached by a relative expensive inter process call.

I also like to avoid too much logic in the service, only what really needs to be done. Where possible the client side should do the processing.

M66B avatar Feb 01 '14 07:02 M66B

I think it is a good idea to have an issue for discussion on on demand restricting, else I am afraid idea's on XDA might get lost, so I have changed the title of this issue.

M66B avatar Feb 01 '14 07:02 M66B

From Mekanikz @ XDA:

"Just installed 1.99.23 and while I like the idea of the new pop up option, selecting allow enables everything under the category. Can you please make it to be more specific and list the specific info the app is trying to access and allow us to allow or deny just that one option under the category?"

http://forum.xda-developers.com/showpost.php?p=49940547&postcount=6485

M66B avatar Feb 01 '14 07:02 M66B

From banderos101 @ XDA:

"how about a reboot, instead of restricting a whole category, or even all restrictions, what do you think about, starting with a limited number of restrictions "on demand" will listen for, say 20 of the communities most wanted individual restrictions, or the ones that can be implemented, programing wise, start off small, focus on user apps first, to limit any conflicts with system, until you get to know the on demand feature better, code and implementation wise, hopefully bugs for on demand will be better to manage with only 20 monitored restrictions, narrows down the possible issues maybe, the idea being, is to get a stable version a base version of on demand, that you can then step back and see where you could expand, without issue or performance, your special sauce

(i restrict many "ENTIRE" categories, the old fashioned xprivacy way(check/blank), for a very large majority of my user/system apps, so in essence, i reduce considerably the amount of restrictions that need to be monitored, and there are quite a few categories that i can restrict in many apps and have no major issues i.e. bookmarks, calendar, calling, contacts, email, media etc etc)

maybe the community can help you here on xda, by listing the ones they most want, ones that can actually be implemeted offcourse, and if we end up getting certain restrictions being mentioned over and over, then it makes the list of restrictions, on demand will monitor and ask for.....assuming xprivacy is setup to do this without headache, which i fear we are giving you marcel

so for example, my top nominations would be, as an example, i know some of these probably cant be "on demanded" 1.su

2.location (temporary allow true location, when using navigation app)

3.internet/network (this can actually be the entire category i think) (temporary allow when you want to use an apps built in update feature, but deny when you just want check an apps offline feature, or those times when you might download a game, that requires internet the first time you open it, in order to download the rest of the game, you allow temporary, let the game download the files, and the next time you open it, if it asks for internet, assuming you have all the files, you can then go ahead and permanetly deny)

4.getinstalledapplications and getIntalledPackages (these get used often, i believe this is the one that allows apps to view which apps you have intalled, when you try to open a txt file, music file, movie, photo, you then get the option of which app to choose to open that file, if its denied, you get a blank list)

5.query.intent.activities (cant rember what this one was for, i might be mixing it with the above)

6.getrunningAppProcess and getRunningServices (this is more a selfish choice, as i can see, it looks like greenify relies on these restrictions, and i have a feeling that many future apps, the ones im interested in, will have the same need for these)

7.mic (temporariry allow recorder app or music recognition app, doubling as a "warning system" for when these apps might be trying to access without the app being user initiated, plus your not blankly allowing access always, literary, "on demand".......shoot, i just got it

8.camera (temporary allow camera app, or social app, also "warning system")

9.Storage (i think this is one of those you cant, but i put it here, in hopes to better get my meaning accross......temp allow storage when you want to use an import/export feature of an app, but in general dont want the app to have storage access unless you have started that app specifically for that use), not implying anything, just the one that came to mind, in order to try and explain my thinking

10.a mention for shell restriction (limited knowledge on these, not enough to give example, but i get the feeling these are very powerfull control restrictions)

11.copy and paste access (instead of automatic allow if unchecked as with older versions of xprivacy, how about only when needed by temp allow using on demand)

12.contact/data (this one because i would like to be informed if an app i just downloaded that i didnt expect to be asking for this, a warning system)

ive just realised, that we all probably have different needs, it probably would be better if you just gave folks the opportunity to pick themselves which 20 apps, an ask option next to all restrictions that you deem safe and and feasable, having a counter limit of 20, or another number, higher/lower, although i suspect that will negate the whole idea of limiting the amount of restrictions to 20 to narrow down bugs, as you now would have potentially a multitude of different users restricting 20 different things.......maybe writing code in xprivacy to "submit list of on demand restrictions" might help here

anyway, sorry marcel, i cant help but feel i write to much, no expectations here, if i can help with suggestions, cool, if i am writing nonsense, then i "on demand" you to ignore

Hell, you might have already fixed/streamlined things, or have your own ideas, if so, then they should take precedent

edit im not sure if the "15 sec" deny restriction was from what i said, or if im just being egotistical, if i am not, then i probably should clarify, The idea was to put a timer, like the one "superSu" uses, that when a "on demand" pop appears, so does a 15 second timer with it, and if no user input is made by that time, the "on demand" will automatically deny, but the "on demand" monitor will reset itself when app is forced closed and ask again upon restart of app

Anyway, i should probably shut it now, i really gotta bleeming update already, this thread is preventing me from doing a nand backup, cant tear myself away"

"I chose a random app "streamables" on the playstore to quickly test "on demand", but when i open streamables, it ends up force closing, and there is no popup, i double checked to see, what some one here mentioned, that on demand was enabled for new installed apps, and confirmed there is a tick. I have sneaky suspicion i might be restricting something, ill have to look at somepoint. One other thing about streamables, normally, when i install a new app, i have xprivacy settings restrict everything, and then start that app, in order to straightaway populate that apps data usage, see what i can see, but thats beside the point, .......normally, in previous versions of xprivacy, when this happens, when the app force crashes, thats it, it doesnt start, now, i dont know if this is a bug, or whether xprivacy doesnt have this restriction capability, but when i start streamables, it force crashes within 5-9 seconds, heres the thing, a couple of seconds after that, i get a notification on the, well, notification, even though notification category for streamables is restricted, but thats not my main concern, is the fact that streamables gives a notification "streamables in service", my question would be does xprivacy have the capability to deny services an app might initiatr, and if not, is it technically possible"

M66B avatar Feb 01 '14 07:02 M66B

Here's my 2c I think the prompt should give ...

  • The choice between the function & the category
  • The choice of duration: once, 10 mins, always
  • The choice to Allow or Deny

That should cover pretty much all use cases that people could think up & I don't think we can simplify the available choices without getting complaints.

jpeg729 avatar Feb 01 '14 07:02 jpeg729

It also came to my mind that when on demand is enabled, the template shouldn't be applied.

M66B avatar Feb 01 '14 08:02 M66B

I'm just wondering about inet, SERIAL, media & sdcard... Should we show a prompt with checkboxes for the relevant ones when an app starts?

jpeg729 avatar Feb 01 '14 08:02 jpeg729

Actually there will be an on demand dialog in these cases, I have tested it.

M66B avatar Feb 01 '14 08:02 M66B

"The choice between the function & the category"

To restrict a function, the category needs to be restricted. Actually there are no function restrictions, but function exceptions.

The logic could be:

  • category restricted: enable function exception
  • category not restricted: restrict category, make exceptions for all other functions (taking dangerous functions into account)

M66B avatar Feb 01 '14 08:02 M66B

I was thinking of something like

if (category == ?)
    check the function
    nothing -> ask
    x -> deny
    _ -> allow
else if (category == x)
    check for an exception
else if (category == _)
    deny

That should cover what I suggested

jpeg729 avatar Feb 01 '14 08:02 jpeg729

There is one other thing that should be taken into account, which is quite important: checking for on demand or not should be limited as far as possible, because it will affect performance. That is why I let on demand only kick in when there wasn't a restriction.

M66B avatar Feb 01 '14 08:02 M66B

Maybe make two modes for the pop-up.

  1. Default one where pop-up show Category access and block/allow/block once per Category.
  2. Expert mode which shows in pop-up the function name and block/allow/block once per function.

Perhaps look into using multi-select to select Category's that the prompt should show up on (regardless of existing restrictions). And then identify these category's by a highlight or icon.

killjoy2505 avatar Feb 01 '14 10:02 killjoy2505

Did you try to restrict Google Play Services like this:

  • getAllCellInfo
  • getNeighboringCellInfo
  • getCellLocation
  • getScanResults

I have just tried and this works fine.

M66B avatar Feb 01 '14 10:02 M66B

"Here's my 2c I think the prompt should give ...

The choice between the function & the category
The choice of duration: once, 10 mins, always
The choice to Allow or Deny

That should cover pretty much all use cases that people could think up & I don't think we can simplify the available choices without getting complaints."

Yep, this is pretty much my line of thought, dont want to make it difficult for new users, yet give some flexibility for how on demand behaves, options like the above, although, if possible and not a pain

"The choice of duration: once, 10 mins, always"

I'd also add a session option, i.e. force close and restart........this would give us a quick way to reset on demand, for situations where this might be convinient, one example i can think off, is accidently clicking the wrong option on demand, and not having to wait 10 minutes to have on demand re-ask me, or having to go into xprivacy, i have my android back button setup to force close on long press, so if i accidently choose a wrong selection or am testing things, i can quickly long press back, which usually takes me back to homescreen and imediatly start again

Sorry if i keep repeating myself about the timer, but is it technically funtionally possible to put a timer on the on demand set to "session" deny, so you'd have to force close/open to reset that restriction call.......one of the features of lbe that really compliments this, was a log of the restrictions, specifically, what its popup allowed/denied, where this comes in handy, say for instance......i start an app, im suddenly called away, i come back, and that app isnt working, one thing i could quickly check with lbe, was whether its popup had denied something while i was away, and generally, it was nice to have a log specifically for what the popup allowed/denied with what app, if you maybe decide to attempt this, no rush, lets get the basics down first

banderos101 avatar Feb 01 '14 13:02 banderos101

"It also came to my mind that when on demand is enabled, the template shouldn't be applied."

What about, using the same method you use to restrict dangerous funtions for user defined restrictions, where template is applied, except these funtions

You could add another one for on demand, long press a restriction to add it to on demand, use a different colour then red highlight, any restriction you select in whichever app you happen to be in will apply to all apps that ask for this restriction, this way, we can apply a template that blocks the most common restrictions a user will always want blocked as before, AND, have a selection of user defined on demand requests, plus, if my thinking is right, it might give on demand less to do, if like me, you happen to always restrict several non conflict categories on all apps by default in my template (deny and forget, only having to tinker if you come into conflicts, which is VERY rare withe the restrictions i choose, either apps dont ask for those persmissions or xprivacy does its job very well

Plus, the added benefit to this, is the ability to be informed of any specific restriction a user might want monitored, a sort of warning feature, something i kinda consider a whole new feature in and of itself, the way i see it, in this situation, if a popup comes up, it means its definatly a restriction i specifically chose to be informed about

edit i think some of my suggestions are a bit premature, the more i read about the on demands behaviour and user interface, the more i suspect its not doing things in the way i originally thought(based mostly on user comments, and not experience, so far), thats my bad, basing suggestings on my assumptions, i need to stop jumping the gun like this, but on demand is such a brilliant feature i cant help myself

banderos101 avatar Feb 01 '14 13:02 banderos101

Can ask a question out of curiosity

Typically, do apps ask for persmission all at once, or do they ask them in a process, i.e. if i pick a random app, and want a restriction to ask for permission in the internet, storag and system categories, knowing that app definatly needs certain permssions fom those catogories, so i know ill be getting three popups, my question, do these permissions get asked at the same time when i start the app (not in xprivacy, i mean in android internals), or does the first one get called, and the next persmission only gets asked once the app has recieved a response from the first permission, if its neither, if its something else entirely, or just genaraly a little more complicated then that, that would actually be helpful too, trial and error, ruling things out, a simple no would suffice :) if your to busy

banderos101 avatar Feb 01 '14 14:02 banderos101

@banderos101 it is on demand restricting, so at the moment an application uses a function that is not yet restricted, there will be a popup (if enabled).

M66B avatar Feb 01 '14 14:02 M66B

yeah some of my ideas were based on assumptions rather then on hand experience of how on demand worked, it might be a while before i get a proper grasp of the new features , this may take while

banderos101 avatar Feb 01 '14 16:02 banderos101

You are not the only one, we are still exploring this new feature.

M66B avatar Feb 01 '14 16:02 M66B

What is left of the wishes after the today releases?

M66B avatar Feb 02 '14 19:02 M66B