功能:selinux_android_load_priority [0],没有sepolicy文件

时间:2014-04-11 18:48:06

标签: android logcat

我在logcat中有2个错误。

Function: selinux_android_load_priority [0], There is no sepolicy file 

04-11 10:58:13.837: E/SELinux(10101): Function: selinux_android_load_priority , loading version is VE=SEPF_SGH-I337M_4.3_0022

这不是致命的,我的应用似乎很好。

知道原因是什么,我该如何解决?只是可以在我的应用程序中有错误日志!

1 个答案:

答案 0 :(得分:2)

我不知道如何摆脱这些消息。但它们确实阻止了Android NDK ndk-gdb脚本的运行。我在找到一种方法让调试器在收到此错误后工作时发现了这个问题:

ERROR: Could not setup network redirection to gdbserver?
       Maybe using --port=<port> to use a different TCP port might help?

这似乎是一些手机的问题 - 可能是三星手机,或者至少我使用的是三星Galaxy Note 2.某些命令(例如run-as)附带这些selinux警告stderr输出中的消息。

ndk-gdb脚本解析在设备上运行的shell命令的输出,以确定事实,例如它正在调试的程序包的数据目录的路径。 selinux消息会干扰该集合。要解决该问题,请修改$NDK_HOME/ndk-gdb并进行此更改:

diff --git a/ndk-gdb b/ndk-gdb
index 537808e..c8561e5 100755
--- a/ndk-gdb
+++ b/ndk-gdb
@@ -620,7 +620,7 @@ else
 fi

 # Find the <dataDir> of the package on the device
-adb_var_shell2 DATA_DIR run-as $PACKAGE_NAME /system/bin/sh -c pwd
+adb_var_shell DATA_DIR "run-as $PACKAGE_NAME /system/bin/sh -c pwd 2>/dev/null"
 if [ $? != 0 -o -z "$DATA_DIR" ] ; then
     echo "ERROR: Could not extract package's data directory. Are you sure that"
     echo "       your installed application is debuggable?"