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

Commit

Permalink
rootless: fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Lessica committed Aug 8, 2023
1 parent 6ec016f commit 533fdab
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ _
obj
.theos
.DS_Store
layout
packages
27 changes: 22 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@ TARGET := iphone:clang:latest:13.0
ARCHS := arm64 arm64e
INSTALL_TARGET_PROCESSES = SpringBoard MobileGestaltHelper rocketd _rocketd_reenable

ifeq ($(ROOTLESS),1)
export THEOS_PACKAGE_SCHEME := rootless
endif

LIBRARY_NAME := librocketbootstrap
librocketbootstrap_FILES += Tweak.x Shims.x
librocketbootstrap_LIBRARIES += substrate
ifeq ($(THEOS_PACKAGE_SCHEME),rootless)
librocketbootstrap_LDFLAGS += -install_name @rpath/librocketbootstrap.dylib
librocketbootstrap_WEAK_LIBRARIES += libs/rootless/TweakInject.tbd
else
librocketbootstrap_WEAK_LIBRARIES += libs/TweakInject.tbd
endif
librocketbootstrap_LIBRARIES += substrate
librocketbootstrap_FRAMEWORKS += Foundation
librocketbootstrap_USE_MODULES += 0

Expand All @@ -29,8 +38,16 @@ include $(THEOS)/makefiles/common.mk
include $(THEOS_MAKE_PATH)/library.mk
include $(THEOS_MAKE_PATH)/tool.mk

before-all::
@rm -rf layout
@mkdir -p layout
@[ "$$ROOTLESS" = "1" ] && cp -rP defaultlayout/DEBIAN defaultlayout/var layout/ || true
@[ "$$ROOTLESS" = "" ] && cp -rP defaultlayout/DEBIAN defaultlayout/Library layout/ || true

stage::
mkdir -p "$(THEOS_STAGING_DIR)/usr/include"
cp -a rocketbootstrap.h rocketbootstrap_dynamic.h "$(THEOS_STAGING_DIR)/usr/include"
plutil -convert binary1 "$(THEOS_STAGING_DIR)/Library/MobileSubstrate/DynamicLibraries/RocketBootstrap.plist"
plutil -convert binary1 "$(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.rpetrich.rocketbootstrapd.plist"
@mkdir -p "$(THEOS_STAGING_DIR)/usr/include"
@cp -a rocketbootstrap.h rocketbootstrap_dynamic.h "$(THEOS_STAGING_DIR)/usr/include"
@plutil -convert binary1 "$(THEOS_STAGING_DIR)/Library/MobileSubstrate/DynamicLibraries/RocketBootstrap.plist" || true
@plutil -convert binary1 "$(THEOS_STAGING_DIR)/Library/LaunchDaemons/com.rpetrich.rocketbootstrapd.plist" || true
@plutil -convert binary1 "$(THEOS_STAGING_DIR)/var/jb/Library/MobileSubstrate/DynamicLibraries/RocketBootstrap.plist" || true
@plutil -convert binary1 "$(THEOS_STAGING_DIR)/var/jb/Library/LaunchDaemons/com.rpetrich.rocketbootstrapd.plist" || true
File renamed without changes.
7 changes: 0 additions & 7 deletions layout/DEBIAN/postinst → defaultlayout/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/sh

declare -a cydia
cydia=($CYDIA)

JB_PREFIX=""
if [ -e /var/jb ]; then
JB_PREFIX="/var/jb"
Expand All @@ -16,8 +13,4 @@ launchctl load -w /System/Library/LaunchDaemons/com.apple.mobilegestalt.xpc.plis
chown root:wheel "$JB_PREFIX/usr/libexec/_rocketd_reenable" > /dev/null 2>&1 || true
chmod +s "$JB_PREFIX/usr/libexec/_rocketd_reenable" > /dev/null 2>&1 || true

if [[ ${CYDIA+@} ]]; then
eval "echo 'finish:restart' >&${cydia[0]}"
fi

exit 0
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ProgramArguments</key>
<array>
<string>/var/jb/usr/libexec/rocketd</string>
</array>
<key>OnDemand</key>
<true/>
<key>UserName</key>
<string>mobile</string>
<key>MachServices</key>
<dict>
<key>com.rpetrich.rocketbootstrapd</key>
<true/>
</dict>
<key>Label</key>
<string>com.rpetrich.rocketbootstrapd</string>
<key>JetsamProperties</key>
<dict>
<key>JetsamPriority</key>
<integer>18</integer>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Filter</key>
<dict>
<key>Bundles</key>
<array>
<string>com.apple.springboard</string>
</array>
<key>Executables</key>
<array>
<string>MobileGestaltHelper</string>
</array>
<key>CoreFoundationVersion</key>
<array>
<real>800</real>
</array>
</dict>
</dict>
</plist>
20 changes: 20 additions & 0 deletions libs/rootless/TweakInject.tbd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
archs: [ arm64, arm64e ]
platform: ios
install-name: '@rpath/TweakInject.dylib'
current-version: 0.0
compatibility-version: 0.0
exports:
- archs: [ arm64, arm64e ]
symbols: [ _LHPatchMemory, _SpringBoardSigHandler, _calljailbreakd,
_calljailbreakdforexec, _callpaccrypto_fixup_hook,
_close_xpc_client, _closejailbreakfd, _connection,
_file_exist, _fixfont, _hook, _hookPacket, _hook_loader,
_jailbreakd_sock, _launch_root, _log_file, _new_getLoader,
_old_getLoader, _open_xpc_client, _opensocket, _paccrypto_sock,
_parseMacho, _pathFromProcessID, _processName, _rpath_to_var,
_safeMode, _sbinjectGenerateDylibList, _usr_to_var,
_xpc_attchme, _xpc_fixProc, _xpc_fixProcAndRoot,
_xpc_fix_dylib, _xpc_ldrestart, _xpc_platform, _xpc_sbrelaod,
_xpc_sig, _xpcrelease ]
...

0 comments on commit 533fdab

Please sign in to comment.