Is READ_LOGS a normal or dangerous Android permission?

lite-whowantstoknow picture lite-whowantstoknow · Jul 24, 2017 · Viewed 12.1k times · Source

I am getting very conflicting information regarding the use of android.permission.READ_LOGS Android permission. Firstly, the Android Documentation website does not specify the protection level of this permission. It is neither classified as normal, nor dangerous. They do specify the following:

"Not for use by third-party applications, because Log entries can contain the user's private information."

Some websites say not to use it for the same privacy concerns. However I have some issue with that:

  1. When I tested this permission in my app on Android 7.1.1 (Nexus 5X) and Android 4.4.2 (old Samsung 8" tablet), neither of them prompted me that the app required this permission. Both said that the app requested "no special permissions". This only happens if the permission is deemed "normal", in which case it is automatically granted.
  2. Secondly, using this permission, I can only view logs from logcat pertaining to my app, which does not log any personal information. Hence, I don't violate any privacy either. I thought this permission may allow me to see other app's logs, causing privacy issues.

So, if this is the case, then is it deemed safe to use this permission in a production version of the app? It would help me a lot in debugging strange bugs users face if they can send me a logcat by the press of a button.

EDIT: Ok, now I am quite confused. It appears that I don't need to explicitly specify this permission in the manifest either.

Answer

CommonsWare picture CommonsWare · Jul 24, 2017

Is READ_LOGS a normal or dangerous Android permission?

Neither. As of Android 7.1, it is signature|privileged|development. That basically means that apps signed as part of the firmware build or installed on the privileged partition can hold the permission, but nothing else can.

the Android Documentation website does not specify the protection level of this permission

Correct. READ_LOGS is still in the SDK, for backwards-compatibility reasons, but ordinary apps have not been able to hold it since Android 4.1, which came out five years ago.

This only happens if the permission is deemed "normal", in which case it is automatically granted.

No.

I thought this permission may allow me to see other app's logs, causing privacy issues.

It did, on Android 4.0 and earlier.

then is it deemed safe to use this permission in a production version of the app?

Well, bear in mind that there has never been a documented and supported way for apps to access LogCat contents. Most likely, you're using one of the script-kiddie solutions that have been posted, such as running the logcat command and capturing its output. So, it is entirely possible that there are devices, now or in the future, that will not support your particular approach towards accessing LogCat. So, the permission is not your problem; the lack of a supported API for LogCat access is your problem.

Personally, I'd use a logging library to log the content to both a file and to LogCat, using the file for whatever your app needs it for.