tweaselORG / appstraction

An abstraction layer for common instrumentation functions (e.g. installing and starting apps, setting preferences, etc.) on Android and iOS.
MIT License
5 stars 1 forks source link

Android: Don't grant runtime permissions in `installApp()` #14

Closed baltpeter closed 1 year ago

baltpeter commented 1 year ago

Currently, we're passing the -g flag when installing apps:

https://github.com/tweaselORG/appstraction/blob/13f67a7f294c81addbd2c15a9cb46a58376f18e3/src/android.ts#L94

This grants all runtime permissions. But that is inconsistent with iOS, where we don't grant any permissions when installing an app.

That should instead be done in setAppPermissions(). We may also need to change that function on Android. Iirc, the -d only returns dangerous permissions (i.e. no runtime permissions):

https://github.com/tweaselORG/appstraction/blob/13f67a7f294c81addbd2c15a9cb46a58376f18e3/src/android.ts#L105

baltpeter commented 1 year ago

As expected, the current setAppPermissions() implementation doesn't set runtime permissions: https://github.com/tweaselORG/appstraction/issues/15#issuecomment-1420747129

Discussion continued in #15.

baltpeter commented 1 year ago

Never mind, the current implementation does actually grant runtime permissions because of the -g: https://github.com/tweaselORG/appstraction/issues/15#issuecomment-1420771931