ActivityManager.forceStopPackage() from Task Manager

前端 未结 1 1715
梦毁少年i
梦毁少年i 2021-01-13 09:06

This is my first time posting here. I\'m not sure if this is the right place to ask this question, but I don\'t seem to find other more appropriate places. Here\'s my questi

1条回答
  •  悲哀的现实
    2021-01-13 09:53

    The "android.permission.FORCE_STOP_PACKAGES" permission is protected by the platform signature.

    If you have Android source code then check the declaration of the permission:

    /frameworks/base/core/res/AndroidManifest.xml

    ...
        

    You can see its protection level is signature, then check the SDK documentation for the explaination:

    "android:protectionLevel"

    http://developer.android.com/guide/topics/manifest/permission-element.html#plevel

    "signature...A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval"

    The permission is declared by the framework-res which is signed by the platform signature, so the application that wants to use the permission shall also be signed with the same signature.

    /frameworks/base/core/res/Android.mk

    ...
         LOCAL_PACKAGE_NAME := framework-res
         LOCAL_CERTIFICATE := platform
    ...
    

    Regards

    Ziteng Chen

    0 讨论(0)
提交回复
热议问题