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

Use the LauncherApps API to view work profile apps in no-root mode #935

Closed
2 of 3 tasks
cohesive-flight opened this issue Nov 21, 2022 · 4 comments
Closed
2 of 3 tasks
Labels
Feature New feature or request Priority: 1

Comments

@cohesive-flight
Copy link

cohesive-flight commented Nov 21, 2022

Please check before submitting an issue

  • I am using the latest version of App Manager
  • I have searched the issues and haven't found anything relevant
  • I have read the docs

Describe a description of the new feature

This would allow App Manager to view apps installed within the work profile without the use of ADB or root.

Describe the solution you'd like

I'd like for App Manager to use the LauncherApps API to view apps installed within the work profile. It currently uses the MATCH_UNINSTALLED_PACKAGES flag, which only reveals the work profile's package list. This results in the user not being able to view or configure any package installed within the work profile through App Manager, unless ADB or root is granted.

Furthermore, this flag relies on a hack implemented since 2016 for compatibility purposes between old third-party launchers and the work profile, as discussed here. It has been removed from Graphene OS upon this reveal, and most likely from AOSP eventually.

Additional context

I'm creating a separate issue for this request, as #910 is closed and not concise. This would also make it easier to address in the future, in case you might've forgotten about the previous issue.

@cohesive-flight cohesive-flight added the Feature New feature or request label Nov 21, 2022
@cohesive-flight cohesive-flight changed the title Use LauncherApps API to view/configure work profile apps in no-root mode Use the LauncherApps API to view work profile apps in no-root mode Nov 21, 2022
@MuntashirAkon MuntashirAkon added this to the v3.1.0-alpha02 milestone Nov 26, 2022
@MuntashirAkon
Copy link
Owner

MuntashirAkon commented Nov 27, 2022

I'd like for App Manager to use the LauncherApps API to view apps installed within the work profile. It currently uses the MATCH_UNINSTALLED_PACKAGES flag, which only reveals the work profile's package list.

Launcher API is incredibly limited. It will never be possible to get the entire list of apps as there are too many restrictions with it.

  • It does not list apps without launcher activities (some utility apps do not contain a launcher activity)
  • It also does not list disabled apps or those apps whose launcher activity is disabled
  • It does not list system apps.

Also, the information returned by LauncherApps is not sufficient for us.

  • We need PackageInfo, not ApplicationInfo. This means that all apps have to be queried individually again to fetch PackageInfo making the entire process quite complicated in terms of time.
  • System apps are not returned. That means, we have to query them individually to see if they are actually installed in the work profile which only works in Android Oreo and later (but to what extent has never been documented).

This results in the user not being able to view or configure any package installed within the work profile through App Manager, unless ADB or root is granted.

You still cannot configure anything in App Manager (seems to be only possible via Delegation API #411) if you haven't got root or ADB. You can, at best, open the app from App Manager or view it in the app settings.

@cohesive-flight
Copy link
Author

I see. I only suggested this API since a developer said it was an alternative to the flag, but looks like it's not as powerful. And my mistake, I only meant to say view, not view and configure.

Since #910 is fixed now, that means App Manager is able to view work profile apps while in no-root mode, correct? If so, then it's probably best to close this as not planned.

@MuntashirAkon
Copy link
Owner

I see. I only suggested this API since a developer said it was an alternative to the flag, but looks like it's not as powerful. And my mistake, I only meant to say view, not view and configure.

Since #910 is fixed now, that means App Manager is able to view work profile apps while in no-root mode, correct? If so, then it's probably best to close this as not planned.

I believe so, yes. If this fix is widely adopted, then we may need to consider this again. But for now, I will not work on this as I have more important things at hand. However, if you ask me, an app without explicitly set as the default launcher and/or declaring some dangerous permission should not be able to access the apps of the work profiles nor should it be able to query the amount of managed profiles the user has. That is, LauncherApps functionalities aren't backed by any permissions whatsoever, thereby, allowing any non-launcher apps to query the amount of managed profiles or the apps installed in them. This is, to me, a serious breach of privacy.

@MuntashirAkon MuntashirAkon closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2022
@MuntashirAkon MuntashirAkon removed the Status: Accepted Accepted or approved feature/issue label Nov 28, 2022
@MuntashirAkon MuntashirAkon removed this from the v3.1.0-alpha02 milestone Nov 28, 2022
@cohesive-flight
Copy link
Author

cohesive-flight commented Nov 30, 2022

That is, LauncherApps functionalities aren't backed by any permissions whatsoever, thereby, allowing any non-launcher apps to query the amount of managed profiles or the apps installed in them. This is, to me, a serious breach of privacy.

I fully agree! I would prefer if APIs such as this are blocked unless the app itself is set as the default launcher, or have obtained some dangerous permission. I think I'll try to request this to the developers of Graphene OS later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request Priority: 1
Projects
None yet
Development

No branches or pull requests

2 participants