Page 1 of 1
How to check enabled/disabled status for apps?
Posted: 27 Jul 2016 09:28
by viorel.rusu
Hi everybody,
I have an LG G3 Andoid 6 - rooted.
I want to make a flow for Waze to freeze it/unfreeze it (using Execute root comand: pm enable / disable) but I want to check it's status (if is enabled/unfreezed or disabled/freezed in that moment).
It's a method for that?
Thank you!
Re: How to check enabled/disabled status for apps?
Posted: 27 Jul 2016 10:50
by Bushmills
I'd not bother. If you want it disabled, you want it disabled regardless of current state. Therefore just disable it. Disabling an already disabled package is fine, and doesn't produce an error. Same is true for enabling.
if you really need to know, pm dump <package> can produce that information, through a line containing "enabled=1" or "enabled=2" for enabled and disabled.
Re: How to check enabled/disabled status for apps?
Posted: 27 Jul 2016 11:45
by viorel.rusu
Bushmills wrote:I'd not bother. If you want it disabled, you want it disabled regardless of current state. Therefore just disable it. Disabling an already disabled package is fine, and doesn't produce an error. Same is true for enabling.
if you really need to know, pm dump <package> can produce that information, through a line containing "enabled=1" or "enabled=2" for enabled and disabled.
Like your first replay (edited now), your answers are useless. Incomplete, generic, patronizing.
Please don't bother to write in this topic again.
If there are users with knowledge and common sense I will receive an clear answer from them.
Re: How to check enabled/disabled status for apps?
Posted: 27 Jul 2016 13:10
by MURTUMA
Bushmills wrote:Have you considered consulting a doctor who can help you with your affliction?
You might want to reconsider, before giving this kind of comments here from now on. Lets keep things either civilized or out of here.
viorel.rusu wrote:Like your first replay (edited now), your answers are useless. Incomplete, generic, patronizing
How that answer is useless or incomplete? Or what kind of specifics you'd like to have, so the answer wouldn't be generic? That actually is a valid answer, so keep that kind of accusations out of here and use only the report tool instead, if something bothers you.
Are we settled?
Re: How to check enabled/disabled status for apps?
Posted: 27 Jul 2016 14:04
by MURTUMA
I can't lock this topic, because the case can still be considered open and making a new topic won't serve any further purpose, but I will keep deleting any off-topic comments from here.
Re: How to check enabled/disabled status for apps?
Posted: 28 Jul 2016 19:00
by Martin
Hi,
You could use action Init Variable Package Info (options all unchecked) to get some basic information about the app. The structure application_info contains a flag "enabled" that should be true/false depending on the state of the app.
A flow could look like this:
-...
-action Init Variable Package Info: your.app
-condition Expression: package_info["your.app"]["application_info"]["enabled"]
--> true: -actions ...
--> false: -actions ...
If you're interested to see the output stored in the variable package_info, I recommend following procedure:
-action Init Variable Package Info: your.app
-action Script: text = toJSON(package_info);
-condition Debug Dialog
Click the line with the variable text in the debug dialog and use Show value in text editor to see the JSON representation of the result.
Maybe I'll include an option like Show as JSON in the debug dialog in a future version, since this would simplify debugging such stuff quite a lot.
Regards,
Martin
Re: How to check enabled/disabled status for apps?
Posted: 29 Jul 2016 07:26
by viorel.rusu
Martin wrote:Hi,
You could use action Init Variable Package Info (options all unchecked) to get some basic information about the app. The structure application_info contains a flag "enabled" that should be true/false depending on the state of the app.
A flow could look like this:
-...
-action Init Variable Package Info: your.app
-condition Expression: package_info["your.app"]["application_info"]["enabled"]
--> true: -actions ...
--> false: -actions ...
If you're interested to see the output stored in the variable package_info, I recommend following procedure:
-action Init Variable Package Info: your.app
-action Script: text = toJSON(package_info);
-condition Debug Dialog
Click the line with the variable text in the debug dialog and use Show value in text editor to see the JSON representation of the result.
Maybe I'll include an option like Show as JSON in the debug dialog in a future version, since this would simplify debugging such stuff quite a lot.
Regards,
Martin
Thank you, Martin!