Installer is not showing all the permissions I request (Android)
This is my section of permissions of my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adelco.ventamovil"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.INSTALL_PACKAGES"></uses-permission>
<uses-permission android:name="android.permission.DELETE_PACKAGES"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
But when I try to install the package, the wizzard only shows the Internet and Write External Storage permissions.
The DDMS perspective throws this warning message when I install the application:
03-28 10:48:36.627: WARN/PackageManager(144): Not granting permission android.permission.INSTALL_PACKAGES to package com.adelco.ventamovil (protectionLevel=3 flags=0xbe44)
03-28 10:48:36.627: WARN/PackageManager(144): Not granting permission android.permission.DELETE_PACKAGES to package com.adelco.ventamovil (protectionLevel=3 flags=0xbe44)
What is happening here....?
Thanks!!
Sorry,
Install, delete packages are system permissions. You won't be able to obtain them unless your app is signed with the device's platform certificate (which is impossible unless you have access to the manufacturer's signing cert).
As you can imagine, that'd be a serious security problem if an arbitrary application could silently install other applications.
The best you can do is send the user to the package install page and let them take action if they wish. Take a look at this action intent you can send to start this process for install,
http://developer.android.com/reference/android/content/Intent.html#ACTION_INSTALL_PACKAGE
and for uninstall,
http://developer.android.com/reference/android/content/Intent.html#ACTION_UNINSTALL_PACKAGE
INSTALL_PACKAGES
and DELETE_PACKAGES
are either in the group signature
or signatureOrSystem
and thus can't be granted to an "ordinary" app:
A permission that the system grants only to applications that are in the Android system image or that are signed with the same certificates as those in the system image
See android:protectionLevel.
你有这样的权限吗?
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.package"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
链接地址: http://www.djcxy.com/p/85336.html