简体   繁体   English

非root用户设备上的Android用户空间文件系统驱动程序?

[英]Android userspace filesystem driver on non-rooted device?

Can I write a custom userspace file system that can be run on non-rooted factory devices through the standard available utilities? 我是否可以编写可以通过标准可用实用程序在非root工厂设备上运行的自定义用户空间文件系统?

I am aware of the existence of fuse-android , however as far as I have understood, it requires a rooted device. 我知道fuse-android的存在,但据我所知,它需要一个root设备。 If that is not the case, please do correct me. 如果不是这样,请纠正我。

The goal I am trying to achieve is create a 'fake' FS that actually is mounted to a file. 我想要实现的目标是创建一个实际安装到文件的“假”FS。

I had the same need some time ago and came to the point where I had to admit that's not possible at all (mostly). 前段时间我有同样的需求,并且我不得不承认根本不可能(大多数情况下)。 It shouldn't be a problem to build libfuse for android, also the Java wrapper is no problem. 为android构建libfuse应该不是问题,Java包装器也没问题。

The real problem is that most of the systems I have seen aren't build with fuse support buildin nor do they provide modules which may be loaded (which would require root, but anyway). 真正的问题是,我所看到的大多数系统都没有使用保险丝支持构建,也没有提供可以加载的模块(这需要root,但无论如何)。

You can easily find out if fuse is enabled by reading /proc/filesystems. 您可以通过读取/ proc / filesystems轻松找出是否启用了fuse。 It should list fuse, otherwise you will need root. 它应该列出保险丝,否则你将需要root。 But it's very likely that most android devices are build without fuse support. 但很可能大多数Android设备都是在没有保险丝支持的情况下构建的。

My other ideas were to use another filesystem to "fake" something like fuse. 我的其他想法是使用另一个文件系统“伪造”像保险丝这样的东西。 This may be possible with nfs or some other network filesystem where you can implement the server by yourself. 这可以通过nfs或其他一些网络文件系统实现,您可以自己实现服务器。 This whould enable you to write a fake fuse but I don't think it's worth it. 这可以让你写一个假的保险丝,但我不认为这是值得的。

Edit: And even if many devices would have fuse support buildin chances are high they wouldn't let you mount it as a user, you would need root access as your app wouldn't have the privileges to mount fuse filesystems. 编辑:即使许多设备有保险丝支持构建机会很高,他们也不会让你作为用户安装它,你需要root访问权限,因为你的应用程序将没有安装保险丝文件系统的权限。

Luminger almost has the right idea. Luminger几乎有正确的想法。 Here's what I found on my Galaxy S3 (on Verizon): 这是我在Galaxy S3上发现的(在Verizon上):

The appropriate fuse stuff does exist in /proc/filesystems. / proc / filesystems中确实存在适当的保险丝。 So something must be using it, quite possibly system. 因此必须用它,很可能系统。 However, when I attempt to execute 'fusermount', I get "Cannot execute -- Permission denied." 但是,当我尝试执行'fusermount'时,我得到“无法执行 - 权限被拒绝”。

So it looks like all the FUSE stuff is there, but I've got no idea whether I could actually use it directly (dropbox? sshfs?) without rooting the device. 所以看起来所有的FUSE东西都存在,但是我不知道我是否可以直接使用它(dropbox?sshfs?)而不需要生根设备。

It depends on your implementation. 这取决于您的实施。 What it sounds like to me is you want to have a physical file(s) that represent a full user space file system. 听起来对我来说,你想拥有一个代表完整用户空间文件系统的物理文件。 Perhaps similar to a mounted .iso. 也许类似于挂载的.iso。 If this is the case, I cannot think of any reason for needing root: You simply create/install the file somewhere such as /sdcard/ and "mount" your file system on top of it. 如果是这种情况,我想不出任何需要root的原因:你只需在某个地方创建/安装文件,例如/ sdcard /,并在其上“挂载”你的文件系统。

That said, if you want said file system to be accessible from other applications that you do not control, you'll need root as your application will be running in a Android sandbox otherwise. 也就是说,如果您希望从您无法控制的其他应用程序访问所述文件系统,则需要root,因为您的应用程序将在Android沙箱中运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:在非根目录设备上运行脚本 - Android: run a script on non-rooted device Android : 使用非 root 的 android 设备捕获 HTTP 请求 - Android : Capturing HTTP Requests with non-rooted android device 以编程方式在Android设备上创建Google帐户(非root用户设备) - Creating a google account on android programatically (non-rooted device) 如何重新启动非root用户的设备? - how to restart a non-rooted device? 在非root用户的Android上模拟主机文件 - Emulate hosts file on non-rooted Android 通过Google TV(Android非根设备)从端口查找pid - find pid from port over Google TV (Android non-rooted device) 是否真的有一种方法可以在不使用电缆的情况下将 ADB 命令发送到非 root 的 android 设备? - Is there truly a way to send ADB commands without the usage of a cable to a non-rooted android device? 亚行无线+ Windows +非根目录设备+挂起问题 - ADB Wireless + Windows + Non-rooted Device + Hang Issue 外部指纹扫描仪,用于无根Android平板电脑 - External fingerprint scanner for non-rooted Android tablets 是否可以在非 root 的 android 手机上运行本机 arm 二进制文件? - Is it possible to run a native arm binary on a non-rooted android phone?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM