himanshu
2017-04-03 15:00:20 UTC
Android application in java having permission issues when accessing sysfs
entry.
try{
FileOutputStream fos = new FileOutputStream("/sys/class/shift_reg/shift_reg/value");
byte mybyte = 1;
fos.write(mybyte);
fos.close();} catch ( Exception e) {
Log.d(TAG, "Failed in writing to Shift Register"); <------- I am always getting this exception.}
1) Have tried putting 'setenforce 0'. Does't work. Even though enforce
level is permissive.
2) Do I have to access using JNI way: ( android-app -> jni -> driver )
3) I have set file permission as 0777 for the sysfs node file.
Dmesg Error message:
[ 417.176302] type=1400 audit(418.589:63): avc: denied { write } for
pid=3164 comm="com.android.cam" name="value" dev="sysfs" ino=9749
scontext=u:r:untrusted_app:s0 tcontext=u:object_r:sysfs:s0 tclass=file
permissive=1
ps -Z
u:r:untrusted_app:s0 u0_a67 4360 333
com.android.cam
entry.
try{
FileOutputStream fos = new FileOutputStream("/sys/class/shift_reg/shift_reg/value");
byte mybyte = 1;
fos.write(mybyte);
fos.close();} catch ( Exception e) {
Log.d(TAG, "Failed in writing to Shift Register"); <------- I am always getting this exception.}
1) Have tried putting 'setenforce 0'. Does't work. Even though enforce
level is permissive.
2) Do I have to access using JNI way: ( android-app -> jni -> driver )
3) I have set file permission as 0777 for the sysfs node file.
Dmesg Error message:
[ 417.176302] type=1400 audit(418.589:63): avc: denied { write } for
pid=3164 comm="com.android.cam" name="value" dev="sysfs" ino=9749
scontext=u:r:untrusted_app:s0 tcontext=u:object_r:sysfs:s0 tclass=file
permissive=1
ps -Z
u:r:untrusted_app:s0 u0_a67 4360 333
com.android.cam
--
--
unsubscribe: android-porting+***@googlegroups.com
website: http://groups.google.com/group/android-porting
---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
unsubscribe: android-porting+***@googlegroups.com
website: http://groups.google.com/group/android-porting
---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.