Power & Source of Big Ideas

Read data from serial port in android 7.1.2 on NanoPC-3

Moderators: chensy, FATechsupport

Hi ,i wrote the app in android studio 4.2, in that app i want to read data from serial port 'UART 3' but i got a security exception that say selinux setenforce enforced, i use this command in adb to set ecnforced to permitive " adb shell su 0 setenforce 0" and then i can read data, but after restart the device, setenforce restore to ecforced, so how can set it permanently to permitive ? i try to root it but can not found any way to do that. have you any solution can help me ?
The best way to do this is to build your own Android OS and set the SELINUX command line in the build.

You also need to set the tty ports in the init.rc to be accessible from the user space. Setting them to 0666 works for me. I also do this with the I2C and SPI etc.
v8dave wrote:
The best way to do this is to build your own Android OS and set the SELINUX command line in the build.

You also need to set the tty ports in the init.rc to be accessible from the user space. Setting them to 0666 works for me. I also do this with the I2C and SPI etc.


Thank you v8dave,

I know the best solution is, custom the Android OS, my app finally must be a launcher in android and must be custom in there, if you know any way to disable SELINUX that no depended to custom the OS, i ready thank you.

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 5 guests