linux - Rooted android device throw EACCES: permission denied exception when I try to get CPU's temperature -
i try android devices' cpu temperature, , after little search found files store data of temperature, thing need read files. specifically, found device contain temperature in path "/sys/class/thermal/thermal_zone1/temp".
i have added permission in manifest file.
however, found in devices app running fine (4.1, 4.4, 5.1 version), in 2 devices, not work, printed log, shows eacces: permission denied
i found both 2 devices have been rooted before. used adb shell su command , file exist , contain temperature data.
it failed on selinux enforced device (i.e. device running android 5.0 , later).
you need custom rom, special policies access file app, or call
adb shell setenforce 0
to disable until next boot (on rooted phone only)
Comments
Post a Comment