Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Add experimental MobileSubstrate support
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusHenze committed Feb 3, 2020
1 parent 3bd9572 commit ebd9e81
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 7 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Fugu is the first open source jailbreak tool based on the checkm8 exploit.

__UPDATE:__ NewTerm and other Apps that do not rely on tweak injection should work now.
__IMPORTANT:__ This jailbreak is currently in development and only meant to be used by developers. While it is possible to install Sileo (or Cydia), tweaks (and probably other stuff) won't work. Additionally, although the root filesystem is mounted read/write, __rebooting into non-jailbroken mode will reset the root filesystem back to stock!__
__UPDATE2:__ Experimental MobileSubstrate support has been added. Tested with Bloard and PreferenceLoader.
__IMPORTANT:__ This jailbreak is currently in development and only meant to be used by developers. While it is possible to install Sileo (or Cydia), most tweaks (and probably other stuff) won't work. Additionally, although the root filesystem is mounted read/write, __rebooting into non-jailbroken mode will reset the root filesystem back to stock!__

# Supported Devices
Currently, the iPad Pro (2017) and iPhone 7 are the only officially supported devices (on iOS 13 - 13.3.1).
Expand All @@ -27,8 +28,8 @@ _You may need to run this command multiple times. If it won't work after the 4th

This will send iStrap (the kernel bootstrapper) to your iDevice together with iDownload (small application that can be used to upload files to the iDevice or execute commands). See _Components_ for more information.

# Installing Sileo (and SSH)
__IMPORTANT:__ While Sileo will work (including updating Sileo), most things you can install do not work or even break dpkg!
# Installing Sileo, SSH and MobileSubstrate
__IMPORTANT:__ All of this is highly experimental. Expect things to be broken.

Make sure you have `libusbmuxd` installed.
You can install it through Homebrew:
Expand All @@ -43,7 +44,8 @@ python install_sileo.py
```
This will download all the necessary files to install Sileo and install it.
After the installation is done, you should see the Sileo Icon on your Homescreen.
Aditionally, SSH will be running now. __Make sure to change the root/mobile passwords!__
Aditionally, SSH will be running now. __Make sure to change the root/mobile passwords!__
MobileSubstrate will be installed as well.

# Components
Fugu consists of the following components:
Expand Down
43 changes: 43 additions & 0 deletions iDownload/iDownload/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,32 @@ void handleConnection(int socket) {
char *args[] = { "/usr/bin/dpkg", "-i", "/sileo.deb", "/cydia.deb", "/swift.deb", NULL };
runCommand(f, args);

// Create /var/lib/dpkg/available
char *args_touch[] = { "/usr/bin/touch", "/var/lib/dpkg/available", NULL };
runCommand(f, args_touch);

fd = open("/MobileSubstrate.deb", O_RDONLY);
if (fd != -1) {
close(fd);

fd = open("/SafeMode.deb", O_RDONLY);
if (fd != -1) {
close(fd);

fprintf(f, "Removing Substrate Compatibility Layer...\r\n");
fflush(f);

char *args[] = { "/usr/bin/apt-get", "remove", "-y", "mobilesubstrate", "com.saurik.substrate.safemode", NULL };
runCommand(f, args);

fprintf(f, "Installing MobileSubstrate...\r\n");
fflush(f);

char *args2[] = { "/usr/bin/dpkg", "-i", "/MobileSubstrate.deb", "/SafeMode.deb", NULL };
runCommand(f, args2);
}
}

fprintf(f, "Adding chimera repo...\r\n");
fflush(f);

Expand Down Expand Up @@ -698,6 +724,23 @@ int main(int argc, char **argv) {
// Parent
waitpid(pid, NULL, 0);
}

// If MobileSubstrate is installed, run it!
fd = open("/usr/libexec/substrate", O_RDONLY);
if (fd != -1) {
close(fd);

pid_t pid = fork();
if (pid == 0) {
// Child
char *args[] = { "/usr/libexec/substrate", NULL };
execve("/usr/libexec/substrate", args, environ);
exit(-1);
}

// Parent
waitpid(pid, NULL, 0);
}
}
#endif

Expand Down
28 changes: 25 additions & 3 deletions install_sileo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def download(file):
print("Downloading bootstrap.tar.gz...")
download("bootstrap.tar.gz")

if not os.path.exists("org.coolstar.sileo_1.1.5_iphoneos-arm.deb"):
if not os.path.exists("org.coolstar.sileo_1.6.0_iphoneos-arm.deb"):
print("Downloading Sileo...")
download("org.coolstar.sileo_1.1.5_iphoneos-arm.deb")
download("org.coolstar.sileo_1.6.0_iphoneos-arm.deb")

if not os.path.exists("org.swift.libswift_5.0-electra2_iphoneos-arm.deb"):
print("Downloading Swift...")
Expand All @@ -52,6 +52,14 @@ def download(file):
print("Downloading Cydia Compatibility Package...")
download("cydia_2.3_iphoneos-arm.deb")

if not os.path.exists("mobilesubstrate_0.9.7100~b4_iphoneos-arm.deb"):
print("Downloading MobileSubstrate...")
download("mobilesubstrate_0.9.7100~b4_iphoneos-arm.deb")

if not os.path.exists("com.saurik.substrate.safemode_0.9.6003_iphoneos-arm.deb"):
print("Downloading Substrate Safemode...")
download("com.saurik.substrate.safemode_0.9.6003_iphoneos-arm.deb")

print("Launching iproxy")

# Run iproxy
Expand Down Expand Up @@ -86,7 +94,7 @@ def download(file):

print("Uploading Sileo...")

with open("org.coolstar.sileo_1.1.5_iphoneos-arm.deb", "rb") as f:
with open("org.coolstar.sileo_1.6.0_iphoneos-arm.deb", "rb") as f:
data = f.read()

upload(r, "/sileo.deb", data)
Expand All @@ -105,6 +113,20 @@ def download(file):

upload(r, "/cydia.deb", data)

print("Uploading MobileSubstrate...")

with open("mobilesubstrate_0.9.7100~b4_iphoneos-arm.deb", "rb") as f:
data = f.read()

upload(r, "/MobileSubstrate.deb", data)

print("Uploading Substrate Safemode...")

with open("com.saurik.substrate.safemode_0.9.6003_iphoneos-arm.deb", "rb") as f:
data = f.read()

upload(r, "/SafeMode.deb", data)

print("Done uploading!")

print("Bootstrapping...")
Expand Down

0 comments on commit ebd9e81

Please sign in to comment.