ActivityManager.forceStopPackage () from task manager

This is my first post here. I'm not sure if this is the right place to ask this question, but I don't seem to have found any other suitable places. Here is my question anyway.

I understand that the API ActivityManager.forceStopPackage()is internal and can only be called from a system process. However, I am puzzled that the built-in task manager application (with the package name com.motorola.PerformanceManager) on my Motorola atrix phone can directly call it without a system process. There are two things that I checked.

Firstly, this is a non-system process from the command ps:

app_64 13681 1379 170788 29820 ffffffff 00000000 S com.motorola.PerformanceManager

Secondly, it really calls the API ActivityManager.forceStopPackage()from its odex file (decompiled into smali, then to dex, and then to java). From the smali code, it is already clear that it calls this API.

I also checked its file AndroidManifest.xml, which is nothing special for me (the forum mistakenly recognizes the contents as URLs and prevents me from publishing them).

The manifest file includes a resolution android.permission.FORCE_STOP_PACKAGESthat must be systemic. A non-system application will still receive a permission denial error even with that permission. I tried using reflection to access this API using permission android.permission.FORCE_STOP_PACKAGES, but still get a runtime error.

, API . , . , . , .

, - . .

+5
1

"android.permission.FORCE_STOP_PACKAGES" .

Android, :

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

...
    <permission android:name="android.permission.FORCE_STOP_PACKAGES"
        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
        android:protectionLevel="signature"
...

, , SDK :

": ProtectionLevel"

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

"... , , , , . , "

-res, , , , .

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

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

Ziteng Chen

+13

All Articles