blocker
blocker copied to clipboard
可否加入工作资料支持
对于毒瘤应用,有时我们会倾向于安装在容器中,例如island。blocker有没有可能控制容器中app的行为?
理论上来说 系统没有提供API给我做这种事。如果有的话我会给予支持。
AFAIK, there is no API to do this job.
work profile are just profile created and managed by main user (or maybe deviceadmin app). its data also under /data/user/
so, supporting this probably just means support for controlling other users' app components?
https://github.com/lihenggui/blocker/blob/62a32fc7524d00c92a19c3c6a1bb79313039419b/core/src/main/java/com/merxury/blocker/core/root/RootController.kt#L80
I can confirm manually use pm
or cmd package
works for enable/disable app components.
just use pm disable --user USER_ID PACKAGE_OR_COMPONENT
or cmd package disable --user USER_ID PACKAGE_OR_COMPONENT
am just saying it's possible to do this, IDK how to implement this in Blocker nor why Block only disable app components only for current user currently.
and it's just under Package Manager mode, IFW can't do this cuz it's system-wide so disabling app components already apply for every user.
I think this feature is not really necessary, I just use IFW mode. it does not make much sense to have different component status for different users.
BTW am not Island user but I use Shelter the open source alternative, I just freeze apps which I don't trust and it works without root. and I just leave the whole work profile disabled for the most of time.
work profile are just profile created and managed by main user (or maybe deviceadmin app). its data also under
/data/user/
so, supporting this probably just means support for controlling other users' app components?https://github.com/lihenggui/blocker/blob/62a32fc7524d00c92a19c3c6a1bb79313039419b/core/src/main/java/com/merxury/blocker/core/root/RootController.kt#L80
I can confirm manually use
pm
orcmd package
works for enable/disable app components. just usepm disable --user USER_ID PACKAGE_OR_COMPONENT
orcmd package disable --user USER_ID PACKAGE_OR_COMPONENT
am just saying it's possible to do this, IDK how to implement this in Blocker nor why Block only disable app components only for current user currently.and it's just under Package Manager mode, IFW can't do this cuz it's system-wide so disabling app components already apply for every user.
I think this feature is not really necessary, I just use IFW mode. it does not make much sense to have different component status for different users.
BTW am not Island user but I use Shelter the open source alternative, I just freeze apps which I don't trust and it works without root. and I just leave the whole work profile disabled for the most of time.
Thanks for your reply, and I am agree with your opinion. This feature is not really necessary, it does not make much sense to have different component status for different users in a single device. But it is a good idea, I am considering to implement it if I have time.
- noneed for IFW mode, it take effects to all users.
- indeed do meanings for PM mode.
multi-user support for PM has done like this https://github.com/NewBugger/AppGranter-Android/commit/3ac51c96ee0e5990533e1cce55e23b5b82f79d3b
get Work Profile user (including user and its packages)
based on Shizuku service, and requires that you use only one worker account (it relates to my code). if needed, write Root method yourself (pr welcome lol.)