Cydia Substrate

From The Apple Wiki
(Redirected from Mobile Substrate)
Cydia Substrate
Developer(s)Jay Freeman (saurik)
Initial release11 August 2008; 15 years ago[1]
Final release(s)
Written in
Operating system
Successor
TypeCode injection platform
LicenseFreeware
Websitewww.cydiasubstrate.com

Cydia Substrate (formerly Mobile Substrate, commonly shortened to Substrate) was a platform that made it easier to develop third-party addons for iOS.

Cydia Substrate's initial code grew out of the core hooking functionality of the WinterBoard project. After the value of this code as its own library became clear, it was split into a separate package named Mobile Substrate for others to use. As a demonstration of this new library's versatility, Five Icon Dock was released.

Initial versions of Cydia Substrate were simply a loader for other dynamic libraries, using a manual patch of SpringBoard's LaunchDaemon plist for injection. Later versions inject into launchd, configuring the environment of all spawned processes to inject its loader. A key feature, Safe Mode (internally MobileSafety), was introduced to provide a user-friendly fallback when SpringBoard crashes.

Cydia Substrate provides a set of APIs that can be used to hook Objective-C methods, in addition to function symbols, at runtime. This follows its principle that all modifications should be done using runtime techniques, ensuring safety fallbacks can prevent the device from entering a crash loop or other situation that is difficult to recover from. It later received support for hooking arbitrary memory addresses that may be protected by code signing.

The source code of Cydia Substrate was initially released under the Modified BSD License (3-clause). The project grappled with what was seen as unfair competition based on saurik's work, later being adjusted to the GNU Lesser General Public License, version 3 on 17 August 2010. As this still did not deter Rock Extensions and Mobile Enhancer, source code ceased to be released publicly. The final version with source code released was 0.9.3995.[3]

With the discontinuation of the Telesphoreo repository in the iOS 11 jailbreak cycle, Cydia Substrate eventually was released for iOS 11 on Elucubratus.

There are two "final" releases of Cydia Substrate. The latest version on Telesphoreo is 0.9.6301, released on 12 September 2016, supporting iOS 2.0 through 10.3.4.[1] The latest version on Elucubratus is 0.9.7113, released on 28 April 2021, supporting iOS 11.0 through 14.8.1 (with the exception of A12 and later due to pointer authentication).[2]

Troubleshooting

As always, even with iOS devices, extra code means crashing and Cydia Substrate can solve this too. Should the SpringBoard crash for any reason (which is quite common once let loose on Cydia as there are a large number of SpringBoard extensions) Cydia Substrate will temporarily put the SpringBoard into Safe Mode with SpringBoard extensions disabled, so you can troubleshoot the problem.

If one is trying to troubleshoot a problem that isn't causing Springboard crashes but is suspected of being caused by a Cydia Substrate-using extension, Safe Mode can manually be entered using the SBSettings application available in Cydia by hitting its "Power" button and choosing the "Safe Mode" option.

If you find that your device won't boot, you can force Cydia Substrate to not run by holding down the volume up key while the Apple boot logo is visible. This requires version 0.9.3997 or newer. Devices without a capable version can be forced into Safe Mode from a ramdisk or ssh by typing:

touch /var/mobile/Library/Preferences/com.saurik.mobilesubstrate.dat

Android

Cydia Substrate for Android was released on the Google Play Store on 15 May 2013, alongside WinterBoard.[4][5] It is able to inject into apps and hook native libraries and Java methods in the Dalvik Java virtual machine, on ARMv6/ARMv7 and x86 devices running Android 2.3 through 4.3.1. The device must be rooted for injection to be possible.

Other than WinterBoard, it does not appear that any apps were released on the Google Play Store that made use of Cydia Substrate. In Android 5.0, released on 4 November 2014, Dalvik was replaced with Android Runtime (ART). Cydia Substrate was not updated to support ART. Cydia Substrate and WinterBoard were delisted from the Google Play Store in 2017 or 2018.[6]

See Also

References