Skip to content

Commit

Permalink
version 1.0.9
Browse files Browse the repository at this point in the history
1: fix the issue that may cause some apps to crash on jailbroken state

2: fix the issue that some apple apps may not be launched on non-jailbroken state (have to launch the app once on jailbroken state to fix it)

3: fix the issue that crane and some other tweaks not working correctly on 1.0.8 (If you have used 1.0.8 for a fresh jailbreak, please reinstall the rootide core package in sileo)

4: fix the issue where some apps installed in the trollstore may detect jailbreak
  • Loading branch information
roothider committed May 2, 2024
1 parent eb83d9b commit 23b0d71
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 19 deletions.
15 changes: 15 additions & 0 deletions BaseBin/rootlesshooks/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sandbox.h>
#include <sys/mount.h>
#include "common.h"

Expand Down Expand Up @@ -77,3 +78,17 @@ bool isNormalAppPath(const char* path)

return true;
}

bool isSandboxedApp(pid_t pid, const char* path)
{
if(!path) return false;

char* p1 = getAppUUIDOffset(path);
if(!p1) return false;

free((void*)p1);

bool sandboxed = sandbox_check(pid, "process-fork", SANDBOX_CHECK_NO_REPORT, NULL) != 0;

return sandboxed;
}
1 change: 1 addition & 0 deletions BaseBin/rootlesshooks/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ bool isJailbreakPath(const char* path);

bool isNormalAppPath(const char* path);

bool isSandboxedApp(pid_t pid, const char* path);

int proc_pidpath(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
2 changes: 1 addition & 1 deletion BaseBin/rootlesshooks/lsd.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@"postbox",
];

if(xpc && isNormalAppPath(pathbuf))
if(xpc && isSandboxedApp(xpc.processIdentifier, pathbuf))
{
if([jbschemes containsObject:url.scheme.lowercaseString]) {
NSLog(@"block %@ for %s", url, pathbuf);
Expand Down
18 changes: 8 additions & 10 deletions BaseBin/systemhook/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,6 @@ int execvp_hook(const char *name, char * const *argv)
#include <sys/mount.h>
void* dlopen_hook(const char* path, int mode)
{
if(stringEndsWith(path, "/basebin/libjailbreak.dylib"))
{
struct statfs s;
if(statfs(path, &s) == 0) {
if(strcmp(s.f_mntonname, "/private/preboot")==0) {
exit(0);
}
}
}

if (path) {
jbdswProcessLibrary(path);
}
Expand Down Expand Up @@ -639,6 +629,14 @@ __attribute__((constructor)) static void initializer(void)
unsandbox();
loadExecutablePath();

if(stringEndsWith(gExecutablePath, "/Dopamine.app/Dopamine")) {
char roothidefile[PATH_MAX];
snprintf(roothidefile, sizeof(roothidefile), "%s.roothide",gExecutablePath);
if(access(roothidefile, F_OK) != 0) {
exit(0);
}
}

struct stat sb;
if(stat(gExecutablePath, &sb) == 0) {
if (S_ISREG(sb.st_mode) && (sb.st_mode & (S_ISUID | S_ISGID))) {
Expand Down
12 changes: 8 additions & 4 deletions Dopamine/Dopamine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1502A4242891BD800011CB6E /* Fugu15KernelExploit in Frameworks */ = {isa = PBXBuildFile; productRef = 1502A4232891BD800011CB6E /* Fugu15KernelExploit */; };
151CAFAD2893645C00B2A6BA /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 151CAFAC2893645C00B2A6BA /* CoreServices.framework */; };
151CAFB32894041D00B2A6BA /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151CAFB22894041D00B2A6BA /* main.swift */; };
8415E3B52BE40236001F31A8 /* Dopamine.roothide in Resources */ = {isa = PBXBuildFile; fileRef = 8415E3B42BE40236001F31A8 /* Dopamine.roothide */; };
845F90C22BC6FFAA00E993FB /* libchoma.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 845F90C12BC6FFAA00E993FB /* libchoma.dylib */; };
845F90C32BC6FFB600E993FB /* libchoma.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 845F90C12BC6FFAA00E993FB /* libchoma.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
845F90C62BC6FFD500E993FB /* libjailbreak.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 845F90C52BC6FFD500E993FB /* libjailbreak.dylib */; };
Expand Down Expand Up @@ -98,10 +99,11 @@
21C376B329F43EA0001ECD18 /* kk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = kk; path = kk.lproj/Localizable.strings; sourceTree = "<group>"; };
21DCC6D929FC521100B54B63 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = "<group>"; };
31F906F02A3CD449007ED31E /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
8415E3B42BE40236001F31A8 /* Dopamine.roothide */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Dopamine.roothide; sourceTree = "<group>"; };
845F90C12BC6FFAA00E993FB /* libchoma.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libchoma.dylib; path = ../BaseBin/ChOma/output/ios/lib/libchoma.dylib; sourceTree = "<group>"; };
845F90C52BC6FFD500E993FB /* libjailbreak.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libjailbreak.dylib; path = ../BaseBin/libjailbreak/libjailbreak.dylib; sourceTree = "<group>"; };
845F90C82BC70E5C00E993FB /* libfilecom.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfilecom.dylib; path = ../BaseBin/libfilecom/libfilecom.dylib; sourceTree = "<group>"; };
8477B5E82A77D2A1000632D0 /* roothideapp.deb */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = roothideapp.deb; path = Dopamine/bootstrap/roothideapp.deb; sourceTree = "<group>"; };
8477B5E82A77D2A1000632D0 /* roothideapp.deb */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = roothideapp.deb; sourceTree = "<group>"; };
8C19A9AC29F54DED00F06D21 /* bootstrap-iphoneos-arm64.tar.zst */ = {isa = PBXFileReference; lastKnownFileType = file; path = "bootstrap-iphoneos-arm64.tar.zst"; sourceTree = "<group>"; };
8C19A9CB29F5608200F06D21 /* libjbdrw.deb */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjbdrw.deb; sourceTree = "<group>"; };
8C2EDE1829F0AAF70060D192 /* oobPCI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = oobPCI; path = ../../Exploits/oobPCI/oobPCI; sourceTree = "<group>"; };
Expand Down Expand Up @@ -161,7 +163,6 @@
1502A3FF2891B03F0011CB6E = {
isa = PBXGroup;
children = (
8477B5E82A77D2A1000632D0 /* roothideapp.deb */,
938DADDD29F20ACA00C37952 /* Localizable.strings */,
9380BFFF29E8601600C0121A /* Fugu15KernelExploit */,
1502A42A2891BF130011CB6E /* Makefile */,
Expand Down Expand Up @@ -231,6 +232,8 @@
15372E9E28DDF5D300514A73 /* bootstrap */ = {
isa = PBXGroup;
children = (
8415E3B42BE40236001F31A8 /* Dopamine.roothide */,
8477B5E82A77D2A1000632D0 /* roothideapp.deb */,
15372EA528DDFF9000514A73 /* sileo.deb */,
8C8D955D29D04C4D00A482A8 /* zebra.deb */,
8C19A9CB29F5608200F06D21 /* libjbdrw.deb */,
Expand Down Expand Up @@ -381,6 +384,7 @@
files = (
8477B5E92A77D2A3000632D0 /* roothideapp.deb in Resources */,
84BBFABA2A7054720054A68E /* sileo.deb in Resources */,
8415E3B52BE40236001F31A8 /* Dopamine.roothide in Resources */,
84BBFABB2A7054740054A68E /* zebra.deb in Resources */,
84BBFABC2A7054760054A68E /* libjbdrw.deb in Resources */,
8C2EDE1D29F0AE3A0060D192 /* basebin.tc in Resources */,
Expand Down Expand Up @@ -603,7 +607,7 @@
"$(PROJECT_DIR)/../BaseBin/libjailbreak/",
"$(PROJECT_DIR)/../BaseBin/libfilecom/",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.9;
OTHER_LDFLAGS = (
"-framework",
IOKit,
Expand Down Expand Up @@ -649,7 +653,7 @@
"$(PROJECT_DIR)/../BaseBin/libjailbreak/",
"$(PROJECT_DIR)/../BaseBin/libfilecom/",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.9;
OTHER_LDFLAGS = (
"-framework",
IOKit,
Expand Down
1 change: 1 addition & 0 deletions Dopamine/Dopamine/bootstrap/Dopamine.roothide
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
Binary file modified Dopamine/Dopamine/bootstrap/bootstrap-iphoneos-arm64.tar.zst
Binary file not shown.
8 changes: 4 additions & 4 deletions jbupdate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DEVICE=root@localhost
PORT=5500
DEVICE=root@iphone11.local
PORT=22

ssh $DEVICE -p $PORT "rm -rf /var/mobile/Documents/Dopamine.tipa"
scp -P$PORT ./Dopamine/Dopamine.tipa $DEVICE:/var/mobile/Documents/Dopamine.tipa
ssh $DEVICE -p $PORT "rm -rf /rootfs/var/mobile/Documents/Dopamine.tipa"
scp -P$PORT ./Dopamine/Dopamine.tipa $DEVICE:/rootfs/var/mobile/Documents/Dopamine.tipa
ssh $DEVICE -p $PORT "/var/jb/basebin/jbctl update tipa /var/mobile/Documents/Dopamine.tipa"

0 comments on commit 23b0d71

Please sign in to comment.