Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is READ_LOGS a normal or dangerous Android permission?

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.

like image 909
lite-whowantstoknow Avatar asked Jul 23 '17 22:07

lite-whowantstoknow


People also ask

Which permission is dangerous?

It's the “dangerous” permissions that Android requires your permission to use. These “dangerous” permissions include access to your calling history, private messages, location, camera, microphone, and more. These permissions are not inherently dangerous, but have the potential for misuse.

What are protection levels in Android permissions?

The three permission protection levels in Android are as follows: Normal Permissions. Signature Permissions. Dangerous Permissions.

Are permissions poisonous?

Is it poisonous? A. There is nothing poisonous about a persimmon (Diospyros kaki), a fruit that originated in China. About 500 varieties are grown in the United States, but the plump, deep-orange, acorn-shaped Hachiya is cultivated most abundantly.


1 Answers

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.

like image 135
CommonsWare Avatar answered Sep 24 '22 13:09

CommonsWare