Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

The prefix's applications registered where they live, so installing a tweak no longer kills Sileo

vcvkkd9f24773e63d
diff --git a/tools/mk-jb.sh b/tools/mk-jb.sh
index 7c27978..ebc6b07 100755
--- a/tools/mk-jb.sh
+++ b/tools/mk-jb.sh
@@ -189,13 +189,22 @@ cat > "$OUT/root/var/jb/prep.sh" <<'PREP'
# Asked again every five seconds, two minutes at most, aside: right after SpringBoard it may be busy.
for app in /var/jb/Applications/*.app; do
[ -d "/Applications/${app##*/}" ] && continue
- real=$(/var/jb/usr/bin/readlink "$app/Info.plist") && app=${real%/Info.plist}
+ # by its own path in the prefix first: that is the one a later uicache -- the trigger of any package
+ # that brings an application -- finds again when it rebuilds the database, and an application
+ # registered under some other path is "uninstalled" by that rebuild, which makes SpringBoard kill it
+ # (a running Sileo died the moment a tweak was installed). The real path, with the grafted prefix a
+ # directory of the boot volume, is only the fallback.
+ real=$(/var/jb/usr/bin/readlink "$app/Info.plist" 2>/dev/null)
+ real=${real%/Info.plist}
(
for try in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24; do
- case "$(/var/jb/usr/bin/uicache -p "$app" 2>&1)" in
- *Error*) sleep 5 ;;
- *) echo "prep.sh: ${app##*/} registered (try $try)"; exit 0 ;;
- esac
+ for path in "$app" ${real:+"$real"}; do
+ case "$(/var/jb/usr/bin/uicache -p "$path" 2>&1)" in
+ *Error*) ;;
+ *) echo "prep.sh: ${app##*/} registered from $path (try $try)"; exit 0 ;;
+ esac
+ done
+ sleep 5
done
echo "prep.sh: ${app##*/} could not be registered"
) &
diff --git a/userland/build.sh b/userland/build.sh
index 946d311..209a361 100755
--- a/userland/build.sh
+++ b/userland/build.sh
@@ -87,6 +87,7 @@ SILEO_BIN="chmod cp mkdir mv rm"
INJECT=${INJECT-"/redwood/lib/libredwood.dylib backboardd containermanagerd containermanagerd_system
/redwood/lib/libredwood-sb.dylib SpringBoard
/redwood/lib/libredwood-media.dylib mediaserverd
+/redwood/lib/libredwood-app.dylib Sileo
/redwood/lib/libredwood-tweaks.dylib Preferences"}
mkdir -p obj
diff --git a/userland/rc.jobs.tweakinstall b/userland/rc.jobs.tweakinstall
new file mode 100644
index 0000000..3e1b1d6
--- /dev/null
+++ b/userland/rc.jobs.tweakinstall
@@ -0,0 +1,17 @@
+# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).
+# Installing a tweak the way Sileo does it (RC_JOBS=rc.jobs.tweakinstall): a package whose trigger
+# runs uicache, which rebuilds the database of applications -- the moment a running Sileo used to be
+# killed ("uninstalling app") instead of offering a respring. Afterwards: is Sileo still registered,
+# and is the tweak where the loader will find it.
+/redwood/bin/sound_test springboard
+/var/jb/bin/sh /var/jb/prep.sh
+/redwood/bin/net_test waitaddr en0 60 resolve apt.procurs.us
+/var/jb/usr/bin/apt-get update
+/redwood/bin/rwtouch wait 25
+/var/jb/usr/bin/uiopen sileo://
+/redwood/bin/rwtouch wait 20
+/var/jb/usr/bin/apt-get install -y preferenceloader
+/redwood/bin/rwtouch wait 15
+/var/jb/usr/bin/uicache -a
+/redwood/bin/rwtouch wait 15
+/bin/ps -A