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.

Rubanraj Ravichandran
  • 1,213
  • 2
  • 17
  • 26
  • "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. – CommonsWare May 09 '15 at 11:08

1 Answers1

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
        }
    ...
}
PaulR
  • 3,223
  • 1
  • 21
  • 32
  • I´m trying to set animation with this https://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? – Daniel Gomez Rico Sep 24 '15 at 16:06
  • Are you on Android M Preview? – PaulR Sep 24 '15 at 16:26
  • Specifically, is your device running the preview? – PaulR Sep 24 '15 at 16:52
  • The bug report: https://code.google.com/p/android-developer-preview/issues/detail?id=2557 – ballzak Oct 13 '15 at 23:48