Skip to content

Latest commit

 

History

History
68 lines (41 loc) · 2.92 KB

roothide.md

File metadata and controls

68 lines (41 loc) · 2.92 KB

The difference between roothide and rootless

  1. /var/jb

    roothide is also root-less, but it no longer installs the jailbreak to the fixed path of /var/jb,

    it (re)installs the jailbreak to a directory(named jbroot) with a random name each time we jailbreak.

  2. About link and load path

    compared with rootless using /var/jb to link all dependent libraries, roothide uses the dyld variable "@loader_path" to link dependent libraries.

    all dependent libraries should set install_name to @loader_path/.jbroot/absolute_path_to_lib, for example:

    @loader_path/.jbroot/usr/lib/libsubstrate.dylib

    @loader_path/.jbroot/Library/Frameworks/Cephei.framework/Cephei

    in this way we can directly use the more accurate absolute path of the library to link.

    each directory containing a mach-o file will automatically generate a .jbroot symbolic link that pointing to the jailbreak root directory, it's usually generated by dpkg when installing packages, or generated by the jailbreak itself when loading a binary/library, and roothide will automatically remove the related .jbroot symbolic link to keep system clean when dpkg removes a package.

  3. Access jailbreak files in code of jailbreak app/daemon/tweak

    roothide provides a uniquely named API to get the root directory path of the current jailbreak, this API can be used anywhere in c/c++/objc/swift, and theos will automatically make it an empty stub via a macro when you compiling for rootful/rootless.

  4. Interact with bootstrap

    most of the libraries and command line tools automatically installed during jailbreak are bootstrap from procursus, and procursus also provides a large number of useful packages, such as rm/cp/mv/chmod/chown/ldid/ssh/uicache...

    unlike rootless uses the original root file system (rootfs) of iOS as the default root, roothide's bootstrap uses jbroot as the default root, and roothide creates a symbolic link named "rootfs" in jbroot to provide bootstrap access to the iOS original root file system. (see vroot).

    this means that all command line tools in bootstrap will only accept jbroot-based paths, and will only output jbroot-based paths. (and you should also use this path rule in jailbreak plist/config/shell-script files).

    show case:

    # operate files in jbroot
    cp /var/config.plist /etc/config.plist
    
    # copy file from rootfs to jbroot
    cp /rootfs/var/config.plist /etc/config.plist
    
    # copy file from jbroot to rootfs 
    cp /etc/config.plist /rootfs/var/config.plist
    
    # operate files in rootfs 
    cp /rootfs/etc/config.plist /rootfs/var/config.plist
    

    roothide also provides command line tools called jbroot and rootfs to get/convert paths in shell/scripts in some specific cases.

Final

roothide is designed to be kept as simple as possible to provide sustainability and maintainability.