From ebd9e817d5ce2458239a1e8160bbfeb461c4e776 Mon Sep 17 00:00:00 2001 From: Linus Henze Date: Mon, 3 Feb 2020 08:06:32 +0100 Subject: [PATCH] Add experimental MobileSubstrate support --- README.md | 10 +++++---- iDownload/iDownload/main.m | 43 ++++++++++++++++++++++++++++++++++++++ install_sileo.py | 28 ++++++++++++++++++++++--- 3 files changed, 74 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4c83951..6de8a9d 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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: @@ -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: diff --git a/iDownload/iDownload/main.m b/iDownload/iDownload/main.m index 9d0c06b..5df7de4 100644 --- a/iDownload/iDownload/main.m +++ b/iDownload/iDownload/main.m @@ -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); @@ -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 diff --git a/install_sileo.py b/install_sileo.py index a8b25e7..082ea29 100644 --- a/install_sileo.py +++ b/install_sileo.py @@ -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...") @@ -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 @@ -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) @@ -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...")