2016-07-27 5 views
0

이 같은 SELinux를 사용 사용SEAndroid 권한

SELinux.restoreconRecursive(new File("/data/data/com.my.app")); 

나는이 실패 가지고 :

drwxrwx--x u0_a126 u0_a126   u:object_r:app_data_file:s0 cache 

및 I :이 작업을하기 전에

07-27 19:21:11.890 W/SELinux (5182): SELinux: Could not look up information for package com.my.app, cannot restorecon . 
07-27 19:21:11.890 E/SELinux (5182): SELinux: Could not set context for /data/data/com.my.app: Socket operation on non-socket 
07-27 19:21:11.890 E/SELinux (5182): SELinux: Could not read /data/data/com.my.app: Permission denied. 

을, 파일을 같이한다 adb를 사용하여 기본값을 복원하려면 다음과 같아야합니다.

drwxrwx--x u0_a126 u0_a126   u:object_r:app_data_file:s0:c512,c768 cache 

내 코드에서 restorecon을 사용하는 이유입니다. plz이 예외에 대해 도움을주십시오.

답변

0

나는 이미이 문제를 해결했습니다. 다른 SELinux 권한 때문에 :

allow backuprestore selinuxfs:file { write }; 
allow backuprestore kernel:security { check_context }; 
allow backuprestore app_data_file:dir { relabelfrom relabelto}; 
allow backuprestore app_data_file:file { relabelfrom relabelto};