How to grant permission for application which is downloaded from play store?
Asked Answered
M

1

10

Already I know google denied this dump permission except system applications from version 4.1 and more.

But still I can able to grant this dump permission using following command for debuggable applications.,

command :

adb shell pm grant "com.packageName" android.permission.DUMP

But i cannot do the same for the applications which is downloaded from play store,

command :

adb shell pm grant "com.playStoreApp" android.permission.DUMP

error :

Operation not allowed: java.lang.SecurityException: Package com.playStoreApp has not requested permission android.permission.DUMP

Is there is any hack or work around to grant permission for play store apps?

Thanks in advance.

Mylo answered 9/5, 2015 at 10:55 Comment(1)
"Is there is any hack or work around to grant permission for play store apps?" -- not on an ordinary device. On a rooted device, perhaps. DUMP is a signature|system|development permission, in terms of protectionLevel. development is what's allowing you to adjust the value of the debuggable app. system means the app is installed on the system partition, which is possible if you root your device and move the app there.Danuloff
B
4

There is not a workaround. android.permission.Dump is protected by system, signature, and development permission protection levels. Line 1993 of the source shows you this. If your APK is signed with the framework cert, is in the priv-app directory, or debuggable (see below) you can use the pm service to grant the permission, but otherwise the code specifically prevents what you're asking for (line 2624 of source).

Debuggable APKs can be created through setting the debuggable attribute on a buildType via build.gradle. Sample Android DSL:

android {
    ...
    buildTypes {
        debug {
            debuggable true
            ...
        }
        quality_assurance {
            debuggable true
        }
    ...
}
Biquadratic answered 16/9, 2015 at 22:40 Comment(4)
I´m trying to set animation with this gist.github.com/danielgomezrico/9371a79a7222a156ddad but I´m getting Operation not allowed: java.lang.SecurityException: Permission android.permission.SET_ANIMATION_SCALE is not a changeable permission type why?Loewe
Are you on Android M Preview?Biquadratic
Specifically, is your device running the preview?Biquadratic
The bug report: code.google.com/p/android-developer-preview/issues/…Fourteenth

© 2022 - 2024 — McMap. All rights reserved.