JohnyTex
JohnyTex

Reputation: 3481

How can I use android.permission.SHUTDOWN on a rooted phone?

How can I send Intent to shutdown the phone if I have a rooted phone? I put the app in system/app but this was not good enough. What more do I have to do?

It says in docs about public static final String ACTION_SHUTDOWN:
This is a protected intent that can only be sent by the system.

What does it mean only sent by the system? If I get my app to get correct UID, can I do it then? Or can it absolutely never be done even on a rooted phone?

Upvotes: 0

Views: 1776

Answers (2)

Ramesh Joshi
Ramesh Joshi

Reputation: 11

You can run an adb shell command as root to shutdown the device.

Upvotes: 0

Rupert Rawnsley
Rupert Rawnsley

Reputation: 2669

The Android source in GrepCode suggests that before Android 4.0 this was a signature-only permission, but is now signature or system. This means that you either have to be signed with the key that was used to sign the platform (usually OEM apps only) or be in the /system/app folder. In more recent versions of Android this folder is /system/priv-app to allow vendors to distribute built-in applications with different levels of trust.

Upvotes: 1

Related Questions