隐根 (roothide) 环境有何特殊?
隐根 (roothide) 是区分于有根 (rootful) 和无根 (rootless) 的一种越狱环境
与有根 (rootful) 环境或无根 (rootless) 的区别
与传统越狱不同,在 roothide 环境中,越狱根(jbroot)
与 系统根(rootfs)
是分开的
越狱根
挂载于 系统根
中的一个随机路径,并且 系统根
也反向挂载于 越狱根/rootfs/
路径上
系统根 rootfs
在 roothide 环境中,系统根
就是指 iOS 系统的根目录,它是没有被修改过的,没有多余的任何路径
越狱根 jbroot
在 roothide 环境中,越狱根
是一个挂载于 系统根
下的随机路径
通常是 /var/containers/Bundle/Application/.jbroot-XXXXXXXXXXXXXXXX/
这个位置(长串 X 为随机值)
使用 jbroot 函数,可以将一个 普通路径
转换成 越狱根中的路径
例如我们要访问 越狱根
中的 /var/mobile/Media/1.txt
那么我们应该使用 jbroot("/var/mobile/Media/1.txt")
在脚本中使用 f = io.open(jbroot("/var/mobile/Media/1.txt"), "r")
实际会打开的文件将会是
/var/containers/Bundle/Application/.jbroot-XXXXXXXXXXXXXXXX/var/mobile/Media/1.txt
Shell 环境
上面已经说过,越狱根是挂载在了系统根的随机路径中
但我们在 Shell 环境中(例如 deb 的安装脚本),是无法得知越狱根在系统根的什么位置的
于是,roothide 将 Shell 脚本的运行时根设在了 越狱根
也就是说,deb 中的 /Applications/XXTExplorer.app
会被安装到
/var/containers/Bundle/Application/.jbroot-XXXXXXXXXXXXXXXX/Applications/XXTExplorer.app
这个位置。这么一来就保证了 deb 安装的越狱插件不会污染到 系统根
但是这么做带来了一个问题,就是使用 XXTouch 中的 os.execute
或 io.popen
等函数时
因为 os.execute
是使用 bash 或 zsh 执行 Shell 脚本
所以在脚本中使用 os.execute("/usr/bin/hidutil list")
时,将会执行的指令实际上是
/var/containers/Bundle/Application/.jbroot-XXXXXXXXXXXXXXXX/usr/bin/hidutil list
这样就导致我们无法直接从 Shell 中访问系统根的路径
于是,roothide 是将 系统根
又反过来挂载到了 越狱根/rootfs/
这个位置
这样一来,当我们脚本中使用 os.execute("/rootfs/usr/bin/hidutil list")
时,将会执行的指令实际上是
/usr/bin/hidutil list
文件及目录镜像
越狱根
中有一些特定的文件/目录路径,我们将其设置为指向原始 系统根
的符号链接
越狱根中的路径 |
---|
/dev |
/private/preboot |
/var/containers |
/var/mobile/Containers |
/usr/share/misc/trace.codes |
/usr/share/zoneinfo |
/etc/hosts.equiv |
/etc/hosts |
/var/run/utmpx |
/var/db/timezone |
/System/Library/CoreServices/SystemVersion.plist |
此外 XXTouch 的 越狱根
中的脚本路径 /var/mobile/Media/1ferver
也会在 系统根
创建符号链接
这些路径,在 越狱根
和 系统根
都是可以直接访问到
参考来源
XXTouch 于 Bootstrap 环境说明
无自动启动
使用 Bootstrap-Roothide 半越狱的设备,在重启设备后再次激活 Bootstrap 环境,XXT 的后台服务不会自动启动
需要打开 XXTouch 的 App ,然后 XXTouch 的 App 会自动退出并显示 Starting XXTouch Daemon...
,最多 20 秒后 XXTouch 后台服务就已经启动
无桌面服务
使用 Bootstrap 但未使用 Serotonin 激活桌面注入服务,则 XXTouch 脚本中与界面相关的部分不可用
dialog、webview 这些在顶层窗口创建界面的功能受影响
alerthelper 处理桌面弹窗的功能无法工作
使用 XXTouch 删除 Bootstrap-Roothide 环境中有可能被 App 检测的文件
local noexecute = require('no_os_execute')
function remove_sys_app_caches(name)
noexecute.rm_rf('/var/root/Library/WebKit/'..name)
noexecute.rm_rf('/var/root/Library/Caches/'..name)
noexecute.rm_rf('/var/root/Library/HTTPStorages/'..name)
noexecute.rm_rf('/var/root/Library/SplashBoard/Snapshots/'..name)
noexecute.rm_rf('/var/root/Library/Saved Application State/'..name..'.savedState')
noexecute.rm_rf('/var/root/Library/Preferences/'..name..'.plist')
noexecute.rm_rf('/var/root/Library/WebKit/'..name)
noexecute.rm_rf('/var/mobile/Library/Caches/'..name)
noexecute.rm_rf('/var/mobile/Library/HTTPStorages/'..name)
noexecute.rm_rf('/var/mobile/Library/SplashBoard/Snapshots/'..name)
noexecute.rm_rf('/var/mobile/Library/Saved Application State/'..name..'.savedState')
noexecute.rm_rf('/var/mobile/Library/Preferences/'..name..'.plist')
end
remove_sys_app_caches('com.opa334.Dopamine')
remove_sys_app_caches('org.coolstar.SileoStore')
remove_sys_app_caches('ws.hbang.Terminal')
remove_sys_app_caches('pisshill.usprebooter')
remove_sys_app_caches('com.samiiau.loader')
remove_sys_app_caches('kr.xsf1re.vnodebypass')
remove_sys_app_caches('com.serena.Antoine')
remove_sys_app_caches('wiki.qaq.TrollFools')
remove_sys_app_caches('com.tigisoftware.Filza')
remove_sys_app_caches('com.tigisoftware.Filza000')
remove_sys_app_caches('com.tigisoftware.ADManager')
remove_sys_app_caches('com.ichitaso.otadisablerts')
remove_sys_app_caches('chaoge.ChargeLimiter')
noexecute.rm_rf('/private/var/mobile/Library/Filza')
noexecute.rm_rf('/private/var/mobile/.ssh')
noexecute.rm_rf('/private/var/root/.ssh')
noexecute.rm_rf('/private/var/mobile/offsets.txt')
noexecute.rm_rf('/private/var/mobile/offsets.txt')
noexecute.rm_rf('/private/var/mobile/Serotonin.jp2')
noexecute.rm_rf('/private/var/mobile/Documents/kfund_offsets.plist')
noexecute.rm_rf('/private/var/iomfb_bics_daemon')
为何会有这些文件呢?
因为 Roothide 虽然将越狱应用 安装
到了随机路径中,但并没有限制这些越狱应用 运行
被禁锢在这些路径中
所以 Roothide 安装的越狱应用 运行
过后,它们产生的缓存或其它文件,还是会写入到系统根的对应位置的
App 还可能会检测 SSH 端口,若有必要,可以在 Bootstrap 的设置界面,关闭 SSH 服务防止被检测