include $(CLEAR_VARS) LOCAL_MODULE := Launcher LOCAL_SRC_FILES := $(LOCAL_MODULE).apk LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := .apk LOCAL_MODULE_TARGET_ARCH := arm LOCAL_CERTIFICATE := platform LOCAL_VENDOR_MODULE := false LOCAL_PRIVILEGED_MODULE := true include $(BUILD_PREBUILT)
LOCAL_VENDOR_MODULE 对应的路径为 /vendor/priv-app/
应在vendor/etc/permissions/privapp-permissions-xxx.xml 声明权限
LOCAL_PRIVILEGED_MODULE 对应的路径为 /system/priv-app/
应在system/etc/permissions/privapp-permissions-xxx.xml 声明权限
对于一些特权应用需要提前赋予权限
This XML file declares which signature|privileged permissions should be granted to privileged applications on devices. It allows additional grants on top of privapp-permissions-platform.xml -->
格式如下:
<privapp-permissions package="com.example.system.server"> <permission name="android.permission.READ_PHONE_STATE"/> <permission name="android.permission.SET_TIME"/> </privapp-permissions>