I need to read sysfs nodes in android directly and I have a rooted Nexus 6 (Anroid 7.1.1) phone and I need some help about possible ways of doing it.
well I can't read them directly from a user app and I got this error
denied { read } for name="" dev="sysfs" scontext=u:r:untrusted_app`
I have seen some approaches like this that copy target file to an available directory but I need more efficient ways:
Runtime.getRuntime().exec("su cp -r /source/ /target/");
but what about better ways? can I grant permission to my app? or can I read them through a system app? actually my main question is that can I read them directly using Android NDK ?