How to grant priv-app (pre-build) APK permissions by default

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to grant priv-app (pre-build) APK permissions by default

Riccardo Bruè
Hi, I have a prebuild APK  which I've added in my AOSP system by adding its name on the PRODUCT_PACKAGES variable. I can successfully see my app under "/system/priv-app" folder and I've added all its permissions in the "privapp-permissions-platform.xml" file.  Now I was thinking that all the permissions (microphone access, location and external storage writing) were already granted, but I still have to grant them manually from Android settings. What can I do to fix this? Thank you.

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/daee65a6-9989-41f7-872e-deb21b230ca0n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

How to grant priv-app (pre-build) APK permissions by default

Trần Kha
Hello Riccardo,

Please set PRODUCT_PROPERTY_OVERRIDES += control_privapp_permissions=enforce to your current makefile of your product.

To check missing permission and other information related to Privileged permission,  please refer this reference:

https://source.android.com/devices/tech/config/perms-whitelist

Regards,
Kha Tran

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/dabb6685-9ac9-4a8c-9d96-18ddcab4ecc1o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to grant priv-app (pre-build) APK permissions by default

Riccardo Bruè
Thank you I'll try this ASAP. One question, which is the difference between your solution "control_privapp_permissions=enforce" and this other solution "ro.control_privapp_permissions=enforce" (if any or not a typo).

On Wednesday, August 5, 2020 at 9:49:02 PM UTC+2 [hidden email] wrote:
Hello Riccardo,

Please set PRODUCT_PROPERTY_OVERRIDES += control_privapp_permissions=enforce to your current makefile of your product.

To check missing permission and other information related to Privileged permission, please refer this reference:

https://source.android.com/devices/tech/config/perms-whitelist

Regards,
Kha Tran

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/509cf7d5-342c-4242-bf0a-2c1b68b0e5c8n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to grant priv-app (pre-build) APK permissions by default

Riccardo Bruè
In reply to this post by Trần Kha
Tried your solution, stil lhave to manually grant microphone, location and external storage writings. These are the permissions in both Android manifest and in the privapp-permissions-platform.xml file:

<permission name="android.permission.RECORD_AUDIO" />
<permission name="android.permission.MODIFY_AUDIO_SETTINGS" />
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission name="android.permission.READ_EXTERNAL_STORAGE" />
<permission name="android.permission.ACCESS_COARSE_LOCATION" />
<permission name="android.permission.ACCESS_NETWORK_STATE" />
<permission name="android.permission.ACCESS_FINE_LOCATION" />

What am I missing here?
On Wednesday, August 5, 2020 at 9:49:02 PM UTC+2 [hidden email] wrote:
Hello Riccardo,

Please set PRODUCT_PROPERTY_OVERRIDES += control_privapp_permissions=enforce to your current makefile of your product.

To check missing permission and other information related to Privileged permission, please refer this reference:

https://source.android.com/devices/tech/config/perms-whitelist

Regards,
Kha Tran

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/2172ea90-b114-4dab-ace7-3c53f272abfan%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to grant priv-app (pre-build) APK permissions by default

semw-2
In reply to this post by Riccardo Bruè
Hi ricardo ,
How did you added the apk as system app ?
Can you tell me what code you wrote in your make file ?
and in which file you added its package name ?

On Wednesday, August 5, 2020 at 9:56:05 PM UTC+5, Riccardo Bruè wrote:
Hi, I have a prebuild APK  which I've added in my AOSP system by adding its name on the PRODUCT_PACKAGES variable. I can successfully see my app under "/system/priv-app" folder and I've added all its permissions in the "privapp-permissions-platform.xml" file.  Now I was thinking that all the permissions (microphone access, location and external storage writing) were already granted, but I still have to grant them manually from Android settings. What can I do to fix this? Thank you.

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/4ed1c03b-6077-4ca0-a477-b820f83fc147o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to grant priv-app (pre-build) APK permissions by default

Riccardo Bruè
Hi, in my app Android.mk I have the following content:

   LOCAL_PATH := $(call my-dir)
   include $(CLEAR_VARS)

   LOCAL_MODULE_TAGS := optional
   LOCAL_MODULE := MyApp
   LOCAL_CERTIFICATE := PRESIGNED
   LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
   LOCAL_MODULE_CLASS := APPS
   LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
   LOCAL_PRIVILEGED_MODULE := true
   TARGET_OUT_DATA_APPS_PRIVILEGED := $(TARGET_OUT_DATA)/priv-app/

   include $(BUILD_PREBUILT)

I have added the app in the build output by adding this in my board mk (android_build/device/variscite/imx8m/dart_mx8mm/dart_mx8mm.mk):

PRODUCT_PACKAGES += \
    MyApp\



On Wednesday, August 12, 2020 at 3:45:41 PM UTC+2 semw wrote:
Hi ricardo ,
How did you added the apk as system app ?
Can you tell me what code you wrote in your make file ?
and in which file you added its package name ?


On Wednesday, August 5, 2020 at 9:56:05 PM UTC+5, Riccardo Bruè wrote:
Hi, I have a prebuild APK  which I've added in my AOSP system by adding its name on the PRODUCT_PACKAGES variable. I can successfully see my app under "/system/priv-app" folder and I've added all its permissions in the "privapp-permissions-platform.xml" file.  Now I was thinking that all the permissions (microphone access, location and external storage writing) were already granted, but I still have to grant them manually from Android settings. What can I do to fix this? Thank you.

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/181bf6ab-b8ff-418a-8757-b88f70eda244n%40googlegroups.com.