Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top