问题描述:
我需要让 droidmon 使用预定义的参数处理特定的 android 图像。Xposed 框架在安装时显示错误,它需要 root 访问权限。
环境:
Google Android Emulator 运行自定义的根 Android 4.4.2 x86 映像,内核版本为 3.4.67+(但我对 3.10+ 有同样的问题)使用的参数(+ 与 android itslef 无关的额外参数):
- -avd
- -核心
- -ramdisk
- -无缓存
- -selinux 许可
- -无快照存储
- -详细
- -显示内核
SDK-工具-版本:25.2.2
SDK-平台-工具:24.0.3
Android 配置为允许 apk 的未知来源
已经尝试过:
- 重新安装 /system RW
- 禁用 -selinux(但 xposed 需要 -selinux 许可)
- 从 xposed 中提取更新二进制文件并使用 su 运行脚本
当前状态:
如果我尝试安装 Xposed,我会从模拟器中收到以下日志消息:
[ 355.372965] type=1400 audit(1477138733.355:23): avc: denied { execute } for pid=2796 comm="posed.installer" name="app_process" dev="mtdblock1" ino=7847 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=1
[ 355.372984] type=1400 audit(1477138733.355:24): avc: denied { execute_no_trans } for pid=2796 comm="posed.installer" path="/data/data/de.robv.android.xposed.installer/cache/app_process" dev="mtdblock1" ino=7847 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=1
[ 355.440354] type=1400 audit(1477138733.415:25): avc: denied { read } for pid=2769 comm="posed.installer" name="app_process" dev="mtdblock0" ino=96 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:zygote_exec:s0 tclass=file permissive=1
[ 355.440410] type=1400 audit(1477138733.415:26): avc: denied { open } for pid=2769 comm="posed.installer" name="app_process" dev="mtdblock0" ino=96 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:zygote_exec:s0 tclass=file permissive=1
[ 355.440450] type=1400 audit(1477138733.415:27): avc: denied { getattr } for pid=2769 comm="posed.installer" path="/system/bin/app_process" dev="mtdblock0" ino=96 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:zygote_exec:s0 tclass=file permissive=1
[ 365.476143] type=1400 audit(1477138743.455:28): avc: denied { execute } for pid=2805 comm="Thread-110" name="su" dev="mtdblock0" ino=972 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:su_exec:s0 tclass=file permissive=1
[ 365.476280] type=1400 audit(1477138743.455:29): avc: denied { read open } for pid=2805 comm="Thread-110" name="su" dev="mtdblock0" ino=972 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:su_exec:s0 tclass=file permissive=1
[ 365.476371] type=1400 audit(1477138743.455:30): avc: denied { execute_no_trans } for pid=2805 comm="Thread-110" path="/system/xbin/su" dev="mtdblock0" ino=972 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:su_exec:s0 tclass=file permissive=1
状态更新:
据我所知,图像没有正确植根。我使用 SuperSU-2.78 中打包的 su 二进制文件重新启动了图像。我通过将 system.img 挂载到我的 linux 机器上的文件夹来操作它,并将 su 和 daemonsu(基本上是 su 复制并重命名)添加到 /system/xbin/ 并将这两个文件的权限更改为 6755。另外现在我在 /etc/init.goldfish.sh 的末尾添加了 2 行
#remount /system rw
mount -o rw,remount /system
#start daemonsu as auto-daemon
/system/xbin/daemonsu --auto-daemon
从 SuperSU 安装 Superuser.apk 和合适的 Xposed-Version 后,Xposed 最初会安装,但重启后会导致 libdvm.so 中的段错误