Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am not (aware of) using ro.serialno, yet the app crashes because of it

My app doesn't use the device serial number (at least not intentionally), and yet sometimes it unexpectedly crashes and I am getting the error:

E/libc: Access denied finding property "ro.serialno"

It occurs with random frequency, but consistently in two activities, sometimes shortly after starting them, sometimes later, sometimes not at all. Looking at the code, it can only have something to do with those two activities using Intent.ACTION_GET_CONTENT and/or copying text from a TextView to the clipboard with CLIPBOARD_SERVICE.

Project min sdk is 23, compile/target is 29. Also, that wasn't been happening before updating Android Studio to 4.1, and the issue doesn't seem to occur on a physical device with Android 8. From what I read here, Android 10 restricts access to both the clipboard and the serial number, but it doesn't really answer my question.

In case it's not clear, the QUESTION is: Could it be that some system services (like the clipboard) access the serial number without me knowing and does it mean I need to request some special permissions?

like image 720
Serge Avatar asked Oct 21 '20 08:10

Serge


Video Answer


1 Answers

I recreated the emulators and it appears to have solved the issue completely. No crashes, no errors whatsoever.

like image 59
Serge Avatar answered Oct 19 '22 04:10

Serge