Android:如何通过ueventd.rc将666特权授予设备 [英] Android: how to grant 666 privs to a device via ueventd.rc

查看:113
本文介绍了Android:如何通过ueventd.rc将666特权授予设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要访问连接到(已拥有根)Android的USB摄像头.我在使用Android 4.2.2的三星Galaxy S4.我想使用普通的应用程序访问它,因此我需要该设备具有全球可读性.

I need to access an USB camera connected to my (rooted) Android. I'm on a Samsung Galaxy S4 with Android 4.2.2. I want to access it with a normal app, so I need the device to be world readable.

我可以通过外壳连接并输入

I can connect via shell and type

root@android:/ # su
root@android:/ # cd /dev
root@android:/dev # chmod 666 video4

,并且有效.但是,每次我断开相机并重新连接时,都必须重新做一次.

and it works. But each time I disconnect the camera, and reconnect it, I have to do it again.

通过shell,我可以重新安装根文件系统r/w

Via shell I can remount the root file system r/w

mount -o rw,remount -t rootfs rootfs /

然后编辑文件/ueventd.rc (实际上是/ueventd.qcom.rc )

and then edit the file /ueventd.rc (actually it's /ueventd.qcom.rc )

并添加

/dev/video*               0666   system     camera

但是即使我放了666我也只能得到

But even if I put 666 I only get

root@android:/dev # ls -la video4                                              
crw-rw---- system   camera    81,  18 2013-08-08 10:14 video4

有没有一种方法可以永久授予666权限?这样,每次我连接相机时,它都会获得正确的文件权限?

Is there a way to grant a 666 permission permanently? So that each time I connect the camera it gets the right file permissions?

谢谢

推荐答案

替换/ueventd.qcom.rc 文件后,必须重新启动/sbin/ueventd 服务.实际上,它会自动重新启动,您只需要找到 ps u 并杀死 pid .

After you replace the /ueventd.qcom.rc file, you must restart /sbin/ueventd service. Actually, it will restart automatically, you only need to find it ps u, and kill the pid.

请注意,三星会在每次重启时恢复 rootfs .我的处理方式是,将更改后的 ueventd.qcom.rc 副本保留在/data/local/tmp 中,然后发出

Note that Samsung restores rootfs on every reboot. The way I handle it, I keep the changed copy of ueventd.qcom.rc in /data/local/tmp, and issue

su -c mount -o remount,rw /
su -c cp /data/local/tmp/ueventd.qcom.rc /
ps ueventd

>

USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
root      198   1     1136   448   ffffffff 00000000 S /sbin/ueventd

kill 198

kill198

这篇关于Android:如何通过ueventd.rc将666特权授予设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆