Autoroot V4
Release Notes & Technical Documentation
๐ Key Changes & Improvements
New System Integration Method: Utilizes the Dynamic Library Hijacking vulnerability in BlackBerry 10 (technical write-up).
- Benefit: Ensures persistence across rebootsโrebooting the device before obtaining root access will no longer break the process.
- Important Note: Integration works via
AppWorld. Do not addsys.appworldto theremoveappcommand, or the mechanism will break.
Stability & Code Optimization:
- Completely eliminated the use of
switchzoneas a trigger for launching root-privileged code. - Rewrote
btoolentirely in C, resolving previous issues related to Android Runtime crashes and unexpected device reboots.
- Completely eliminated the use of
Expanded
btoolCapabilities: The C-basedbtoolutility now natively integrates:pathtrustpatcherlauncherpatcher- NVRAM backup tool
Security & System Tweaks:
- Removed most unnecessary
suid/sgidhelpers, retaining only the bare minimum required for privilege escalation. - Unsigned BAR applications can now be installed immediately upon receiving the root confirmation notification.
- Removed most unnecessary
๐ System Patch Installer (Active Development)
Introduced a system patch installer capable of modifying read-only system files, binaries, and dynamic libraries.
Major Achievement(not released yet): Enabled the revival of legacy servicesโincluding BBID, Weather, AppWorld, and BBMโby redirecting them to custom community-driven servers instead of the defunct RIM/BlackBerry infrastructure. (Special thanks to @He11kern for these contributions).
Add Authorized SSH Keys
Default private key stored in id_rsa4x
If you want to use own ssh key(s), place your public SSH key(s) in:
patchdata/var/etc/ssh/authorized_keys2Then uncomment the following line in patch.txt:
push "patchdata/var/etc/ssh/authorized_keys2" "/var/etc/ssh/authorized_keys2"
chmod 644 "/var/etc/ssh/authorized_keys2"
chown 0:0 "/var/etc/ssh/authorized_keys2"This allows the configured SSH keys to be used for authentication.
Persist SSH Host Keys
By default, SSH host keys may change after reflashing, causing clients to display a new host fingerprint warning.
To persist the host keys across firmware flashes, uncomment:
push "patchdata/var/etc/ssh/ssh_host_rsa_key" "/var/etc/ssh/ssh_host_rsa_key"
push "patchdata/var/etc/ssh/ssh_host_rsa_key.pub" "/var/etc/ssh/ssh_host_rsa_key.pub"
chmod 600 "/var/etc/ssh/ssh_host_rsa_key"
chown 0:0 "/var/etc/ssh/ssh_host_rsa_key"
chmod 644 "/var/etc/ssh/ssh_host_rsa_key.pub"
chown 0:0 "/var/etc/ssh/ssh_host_rsa_key.pub"
You can also replace these files with your existing SSH host key pair if you want to preserve the same fingerprint.
๐ฆ Single-Step Custom Firmware Builder (bb10mt)
Added the batch parameter to bb10mt, allowing users to patch and root an autoloader firmware image in a single automated step without manual scripting.
Usage Examples
Windows:
bb10mt.exe batch -i Z30_10.3.03.3216_STA100-1-2-3-4-5-6.exe -s patch.txt -o \tmp\z30rootLinux / macOS:
./bb10mt batch -i Z30_10.3.03.3216_STA100-1-2-3-4-5-6.exe -s patch.txt -o /tmp/z30rootAfter running bb10mt in the directory specified in the -o parameter, youโll find, among other files, those with names ending in _os.exe and _radio.exe. If youโre not a developer, you can safely delete all the other filesโtheyโre just intermediate results. To install, first run _os.exe (it will display an error at the end of the processโthis is normal; please ignore it), then run _radio.exe
๐ ๏ธ User Partition Patch Configuration (patch.txt)
The patch.txt file passed via the -s argument in bb10mt contains flags and configuration directives used to modify the user partition during image assembly or system boot.
Available Directives
touch /var/rootdata/use.root-- Enables base root capability helpers. -- Adds__rootandu_rootSUID/SGID binaries topathtrust, granting elevated privileges when executed.touch /var/rootdata/use.sshd-- Configures automatic execution of thesshddaemon withrootprivileges upon system boot.#touch /var/rootdata/use.berrycore-- Adds the root directory (/) topathtrustto allow applications dependent on BerryCore to execute asroot.Note: In future releases, this directive will be refined to selectively add only explicit BerryCore-related binaries rather than trusting the entire filesystem root.
Example patch.txt File Structure
# Enable base root helpers (__root, u_root)
touch /var/rootdata/use.root
# Auto-start SSH daemon as root
touch /var/rootdata/use.sshd
# BerryCore application execution (disabled by default)
#touch /var/rootdata/use.berrycoreDownload here: autoroot_v4.zip
Upgrade Without Reflashing
Supporters and contributors can request an upgrade script that allows upgrading an existing AutoRoot installation to v4 without reflashing the firmware.
To update, copy the v2tov4.sh or v3tov4.sh file to your device and run it using sh /path/to/file/v2tov4.sh or sh /path/to/file/v3tov4.sh
During the upgrade process, you may be asked whether root access is required and whether sshd is needed. After the script has run successfully, reboot the device to apply the changes.
Important Note for SSH/Root Users: If you are connected via SSH with root access, do not run the script directly as the root user. Instead, run it via the __devuser shell wrapper or add the script to pathtrust:
/proc/boot/pathtrust !/path/to/script/v2tov4.sh
or
/proc/boot/pathtrust !/path/to/script/v3tov4.sh
๐ System Package Specification
Directory Structure
A package contains configuration files, scripts, and target resources structured into execution stages:
pkg.bar # Original BAR package (optional)
MANIFEST # Package manifest file
โโโ data/ # Main installation payload
โ โโโ file1..fileN# Payload files
โ โโโ perms # File permissions configuration for data/
โ โโโ links # Symlinks, copies, PPS objects, and folder creation
โ โโโ patch # Binary byte-patching instructions
โ โโโ trusted # Paths to be added to trustpath
โ
โโโ init/ # Initialization stage (root startup)
โโโ file1..fileN# Required startup files
โโโ start.sh # Executable shell script triggered on root start
โโโ perms # File permissions configuration for init/
โโโ links # Symlinks/copies for the init stage
โโโ patch # Binary patches applied during init
โโโ trusted # Trustpath rules for the init stageConfiguration File Formats
1. links โ File System Operations
Defines operations to execute on target paths:
ln:src:dstโ Create a symbolic link pointingdsttosrccp:src:dstโ Copy file fromsrctodstpps:src:dstโ Create or update a PPS (Persistent Publish/Subscribe) objectmd:dstโ Create a directory atdst
2. perms โ Permission Attributes
Specifies ownership and file access mode (equivalent to chmod/chown):
/path/to/target:UID:GID:MODE- Example:
/accounts/1000/appdata/test:0:0:0755
3. patch โ Binary Byte Modification
Specifies exact byte-level substitutions for target binary files:
/path/to/target_file1
0xADDR1: 0xOLD1 0xNEW1
0xADDR2: 0xOLD2 0xNEW2
/path/to/target_file2
0xADDR1: 0xOLD1 0xNEW1- Syntax:
Address: OldByte NewByte - Example:
0x0001A2F0: 0x89 0x90(Replaces byte89with90at offset0x0001A2F0).
4. trusted โ Trusted Path Whitelist
A plain text file where each newline contains an absolute file path to a binary or library to be added to the system trustpath.