跳到主要内容

隐根 (roothide) 环境有何特殊?

隐根 (roothide) 是有别于有根 (rootful) 和无根 (rootless) 的第三种越狱环境。


与有根 (rootful) 及无根 (rootless) 的区别

与传统越狱不同,roothide 环境中越狱根 (jbroot)系统根 (rootfs) 是相互隔离的。
越狱根 挂载于 系统根 中的一个随机路径,同时 系统根 也反向挂载于 越狱根/rootfs/ 路径上。

系统根 rootfs

在 roothide 环境中,系统根 即 iOS 系统的原始根目录,未经任何修改,不包含额外路径。

越狱根 jbroot

越狱根 挂载于 系统根 下的一个随机路径,
通常位于 /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.executeio.popen 时,
由于这些函数通过 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 后,XXTouch 后台服务不会自动启动。
需要手动打开 XXTouch App,应用会自动退出并显示 Starting XXTouch Daemon...,约 20 秒后后台服务即可就绪。

无桌面服务

若使用 Bootstrap 但未通过 Serotonin 激活桌面注入服务,XXTouch 脚本中与界面相关的功能将不可用:

  • dialogwebview 等在顶层窗口创建界面的功能会受到影响
  • 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')
remove_sys_app_caches('com.xxtouch.XXTExplorer')

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 将越狱应用安装到了随机路径中,但并未限制这些应用的运行时行为。
因此,越狱应用运行后产生的缓存或其他文件,仍然会写入到系统根的对应位置。

此外,App 还可能检测 SSH 端口。如有必要,可在 Bootstrap 设置界面中关闭 SSH 服务以避免被检测。