我有一个扎根的设备。我想保护我的主机文件从被删除,也许是密码或类似的东西。这可能吗?
我有一个扎根的设备。我想保护我的主机文件从被删除,也许是密码或类似的东西。这可能吗?
I have a rooted device. I would like to protect my hosts file from being deleted, maybe with a password or something like that. Is this possible?
当前说(修订版4 ),答案是 no 。
主机文件位于 /system/etc/hosts
,在(可能)ext4的文件系统中。由于ext4使用常规UNIX权限和Android执行And 支持ACL,因此您没有机会这样做。
/system
默认情况下被安装为只读。只要您不向恶意应用程序授予root访问权限,就不会删除您的主机文件。 而且,还有替代的肮脏方法,但我认为他们并不是很有帮助,所以我没有在这里发布他们。 As is currently stated (revision 4), the answer is No.
Your hosts file is located at /system/etc/hosts
, in a filesystem of (probably) ext4. Since ext4 uses regular Unix permissions and Android does not support ACL, you have no chance to do so.
However, I don't think you really should protect it as it's protected by default, because /system
is mounted as read-only by default. As long as you don't grant your root access to malicious apps, no one will delete your hosts file.
Moreover, there are alternative dirty approaches but I don't think they're much helpful so I'm not posting them here.
© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有