Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
- Update El Capitan rootless information
- Verified compatibility with 10.9
- Recreated launch agent
- Fix applescript issue with launch agent
- Miscellaneous improvements
  • Loading branch information
w0lfschild committed Sep 1, 2015
1 parent 4133f97 commit 8cac482
Show file tree
Hide file tree
Showing 33 changed files with 494 additions and 532 deletions.
2 changes: 1 addition & 1 deletion _resource/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4
3.5
1 change: 0 additions & 1 deletion _resource/versionBeta.txt

This file was deleted.

20 changes: 15 additions & 5 deletions _resource/versionInfo.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
------------------------------------------------
Version : 3.4
Build date : Jul / 14 / 2015
Version : 3.5
Build date : Aug / 31 / 2015
------------------------------------------------

3.5

- Update El Capitan rootless information
- Verified compatibility with 10.9
- Recreated launch agent
- Fix applescript issue with launch agent
- Miscellaneous improvements

------------------------------------------------

3.4

- Option to cancel password dialog
- Increase update check interval
- Improve rootless check for 10.11
- Fix issue where app would fail to open if it couldn't detect language
- Fix issue where application would fail to open

------------------------------------------------

3.3.1

Fixed
- Dark Boot thinking older OSX were using rootless
- Dark Boot thinking older OS X were using rootless

------------------------------------------------

3.3

New
- Support for El Capitan (OSX 10.11)
- Support for El Capitan (OS X 10.11)

------------------------------------------------

Expand Down
24 changes: 0 additions & 24 deletions _resource/versionInfoBeta.txt

This file was deleted.

2 changes: 1 addition & 1 deletion app/resource/Credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a href="http://sveinbjorn.org/platypus">Platypus</a><br>
<a href="http://hasseg.org/trash">Trash Script</a><br><br>

<img src="Credits_img.gif" alt="HTML5 Icon" width="200" height="200">
<img src="credits.png" alt="HTML5 Icon" width="200" height="200">

</p>
</body>
Expand Down
Binary file added app/resource/Dark Boot Agent.app/Contents/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#! /bin/bash

check_bless() {
blessed=$(bless --info / | grep efi)
blessed='/'${blessed#*/}
if [[ "$blessed" != /System/Library/CoreServices/boot.efi ]]; then
efi_bless /System/Library/CoreServices boot.efi
fi
}
clean_up() {
rm "$app_dir"/*boot.efi*
chmod 644 /System/Library/CoreServices/boot.efi
chown root:wheel /System/Library/CoreServices/boot.efi
chflags uchg /System/Library/CoreServices/boot.efi
}
efi_backup() {
if [[ -e /System/Library/CoreServices/boot_stock.efi ]]; then rm /System/Library/CoreServices/boot_stock.efi; fi
mv /System/Library/CoreServices/boot.efi /System/Library/CoreServices/boot_stock.efi
}
efi_bless() {
printf "$1/$2 blessed\n"
pushd "$1" 1>/dev/null
bless --folder . --file "$2" --labelfile .disk_label
popd 1>/dev/null
}
efi_check() {
res="default"
xxd -p /System/Library/CoreServices/boot.efi | tr -d '\n' > /tmp/_boot.efi
if ! $(grep -qa 4d61632d00000000000000000000000000000000 /tmp/_boot.efi); then
res="default"
elif $(grep -qa 4d61632d7265706c616365207468697320747874 /tmp/_boot.efi); then
res="gray"
else
res="black"
fi
rm /tmp/_boot.efi
printf "$res"
}
efi_install() {
rm /System/Library/CoreServices/boot.efi
if [[ $boot_color = "black" ]]; then
cp "$app_dir"/_boot.efi /System/Library/CoreServices/boot.efi
fi
if [[ $boot_color = "grey" ]]; then
cp "$app_dir"/boot.efi /System/Library/CoreServices/boot.efi
fi
}
efi_patch() {
board_ID=$(ioreg -p IODeviceTree -r -n / -d 1 | grep board-id)
board_ID=${board_ID##*<\"}
board_ID=${board_ID%%\">}
printf "Board-ID : $board_ID\n"

board_HEX=$(printf $board_ID | xxd -ps)
while [[ ${#board_HEX} -lt 40 ]]; do board_HEX=${board_HEX}0; done
printf "Board-ID Hex : $board_HEX\n"

printf "Converting boot.efi to hex\n"
xxd -p "$app_dir"/boot.efi | tr -d '\n' > "$app_dir"/___boot.efi

printf "Adding your board ID\n"
sed -i -e "s|4d61632d7265706c616365207468697320747874|$board_HEX|g" "$app_dir"/___boot.efi

printf "Moving files and cleaning up $app_dir\n"
perl -pe 'chomp if eof' "$app_dir"/___boot.efi > "$app_dir"/__boot.efi
xxd -r -p "$app_dir"/__boot.efi "$app_dir"/_boot.efi
}
efi_restore() {
if [[ -e /System/Library/CoreServices/boot_stock.efi ]]; then
rm /System/Library/CoreServices/boot.efi
mv /System/Library/CoreServices/boot_stock.efi /System/Library/CoreServices/boot.efi
fi
}
logging() {
log_dir="$HOME/Library/Application Support/dBoot/logs"
if [[ ! -e "$log_dir" ]]; then mkdir -pv "$log_dir"; fi
for (( c=1; c<6; c++ )); do if [ ! -e "$log_dir"/${c}.log ]; then touch "$log_dir"/${c}.log; fi; done
for (( c=5; c>1; c-- )); do cat "$log_dir"/$((c - 1)).log > "$log_dir"/${c}.log; done
> "$log_dir"/root.log
exec &>"$log_dir"/root.log
}

logging

PlistBuddy=/usr/libexec/PlistBuddy" -c"
scriptDirectory=$(cd "${0%/*}" && echo $PWD)
app_dir="$HOME/Library/Application Support/dBoot"
my_plist="$HOME/Library/Preferences/org.w0lf.dBoot.plist"
dboot_efi="$scriptDirectory"/boot.efi
boot_color=$($PlistBuddy "Print color" "$my_plist" || printf "default")
cur_efi=$(efi_check)

printf "Current efi : $cur_efi\n"
printf "Selected efi : $boot_color\n"
if [[ $cur_efi != $boot_color ]]; then
chflags nouchg /System/Library/CoreServices/boot.efi
if [[ -e "$app_dir"/boot.efi ]]; then rm "$app_dir"/boot.efi; fi
if [[ -e "$app_dir" ]]; then mkdir -p "$app_dir"; fi
cp "$dboot_efi" "$app_dir"/boot.efi
if [[ $boot_color = "default" ]]; then
if [[ $cur_efi != "default" ]]; then
printf "Restoring stock efi\n"
efi_restore
fi
else
if [[ $cur_efi = "default" ]]; then
printf "Backing up stock efi\n"
efi_backup
fi
printf "Creating patched custom efi\n"
efi_patch
printf "Installing patched custom efi\n"
efi_install
fi
printf "Cleaning up\n"
clean_up
printf "Checking bless\n"
check_bless $boot_color
bless --info / | head -2
printf "Done\n"
fi

# End
Binary file not shown.
41 changes: 41 additions & 0 deletions app/resource/Dark Boot Agent.app/Contents/Resources/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! /bin/bash

efi_check()
{
res="default"
xxd -p /System/Library/CoreServices/boot.efi | tr -d '\n' > /tmp/_boot.efi
if ! $(grep -qa 4d61632d00000000000000000000000000000000 /tmp/_boot.efi); then
res="default"
elif $(grep -qa 4d61632d7265706c616365207468697320747874 /tmp/_boot.efi); then
res="gray"
else
res="black"
fi
rm /tmp/_boot.efi
printf "$res"
}

logging()
{
log_dir="$HOME/Library/Application Support/dBoot/logs"
if [[ ! -e "$log_dir" ]]; then mkdir -pv "$log_dir"; fi
for (( c=1; c<6; c++ )); do if [ ! -e "$log_dir"/${c}.log ]; then touch "$log_dir"/${c}.log; fi; done
for (( c=5; c>1; c-- )); do cat "$log_dir"/$((c - 1)).log > "$log_dir"/${c}.log; done
> "$log_dir"/agent.log
exec &>"$log_dir"/agent.log
}

logging
PlistBuddy=/usr/libexec/PlistBuddy" -c"
scriptDirectory=$(cd "${0%/*}" && echo $PWD)
my_plist="$HOME/Library/Preferences/org.w0lf.dBoot.plist"
boot_color=$($PlistBuddy "Print color" "$my_plist" || printf "default")
cur_efi=$(efi_check)

echo "Current efi : $cur_efi"
echo "Selected efi : $boot_color"
if [[ $cur_efi != $boot_color ]]; then
open "$scriptDirectory"/"Dark Boot Root".app
fi

# End
Binary file added app/resource/Dark Boot Root.app/Contents/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
123 changes: 123 additions & 0 deletions app/resource/Dark Boot Root.app/Contents/Resources/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#! /bin/bash

check_bless() {
blessed=$(bless --info / | grep efi)
blessed='/'${blessed#*/}
if [[ "$blessed" != /System/Library/CoreServices/boot.efi ]]; then
efi_bless /System/Library/CoreServices boot.efi
fi
}
clean_up() {
rm "$app_dir"/*boot.efi*
chmod 644 /System/Library/CoreServices/boot.efi
chown root:wheel /System/Library/CoreServices/boot.efi
chflags uchg /System/Library/CoreServices/boot.efi
}
efi_backup() {
if [[ -e /System/Library/CoreServices/boot_stock.efi ]]; then rm /System/Library/CoreServices/boot_stock.efi; fi
mv /System/Library/CoreServices/boot.efi /System/Library/CoreServices/boot_stock.efi
}
efi_bless() {
printf "$1/$2 blessed\n"
pushd "$1" 1>/dev/null
bless --folder . --file "$2" --labelfile .disk_label
popd 1>/dev/null
}
efi_check() {
res="default"
xxd -p /System/Library/CoreServices/boot.efi | tr -d '\n' > /tmp/_boot.efi
if ! $(grep -qa 4d61632d00000000000000000000000000000000 /tmp/_boot.efi); then
res="default"
elif $(grep -qa 4d61632d7265706c616365207468697320747874 /tmp/_boot.efi); then
res="gray"
else
res="black"
fi
rm /tmp/_boot.efi
printf "$res"
}
efi_install() {
rm /System/Library/CoreServices/boot.efi
if [[ $boot_color = "black" ]]; then
cp "$app_dir"/_boot.efi /System/Library/CoreServices/boot.efi
fi
if [[ $boot_color = "grey" ]]; then
cp "$app_dir"/boot.efi /System/Library/CoreServices/boot.efi
fi
}
efi_patch() {
board_ID=$(ioreg -p IODeviceTree -r -n / -d 1 | grep board-id)
board_ID=${board_ID##*<\"}
board_ID=${board_ID%%\">}
printf "Board-ID : $board_ID\n"

board_HEX=$(printf $board_ID | xxd -ps)
while [[ ${#board_HEX} -lt 40 ]]; do board_HEX=${board_HEX}0; done
printf "Board-ID Hex : $board_HEX\n"

printf "Converting boot.efi to hex\n"
xxd -p "$app_dir"/boot.efi | tr -d '\n' > "$app_dir"/___boot.efi

printf "Adding your board ID\n"
sed -i -e "s|4d61632d7265706c616365207468697320747874|$board_HEX|g" "$app_dir"/___boot.efi

printf "Moving files and cleaning up $app_dir\n"
perl -pe 'chomp if eof' "$app_dir"/___boot.efi > "$app_dir"/__boot.efi
xxd -r -p "$app_dir"/__boot.efi "$app_dir"/_boot.efi
}
efi_restore() {
if [[ -e /System/Library/CoreServices/boot_stock.efi ]]; then
rm /System/Library/CoreServices/boot.efi
mv /System/Library/CoreServices/boot_stock.efi /System/Library/CoreServices/boot.efi
fi
}
logging() {
log_dir="$HOME/Library/Application Support/dBoot/logs"
if [[ ! -e "$log_dir" ]]; then mkdir -pv "$log_dir"; fi
for (( c=1; c<6; c++ )); do if [ ! -e "$log_dir"/${c}.log ]; then touch "$log_dir"/${c}.log; fi; done
for (( c=5; c>1; c-- )); do cat "$log_dir"/$((c - 1)).log > "$log_dir"/${c}.log; done
> "$log_dir"/root.log
exec &>"$log_dir"/root.log
}

logging

PlistBuddy=/usr/libexec/PlistBuddy" -c"
scriptDirectory=$(cd "${0%/*}" && echo $PWD)
app_dir="$HOME/Library/Application Support/dBoot"
my_plist="$HOME/Library/Preferences/org.w0lf.dBoot.plist"
dboot_efi="$scriptDirectory"/boot.efi
boot_color=$($PlistBuddy "Print color" "$my_plist" || printf "default")
cur_efi=$(efi_check)

printf "Current efi : $cur_efi\n"
printf "Selected efi : $boot_color\n"
if [[ $cur_efi != $boot_color ]]; then
chflags nouchg /System/Library/CoreServices/boot.efi
if [[ -e "$app_dir"/boot.efi ]]; then rm "$app_dir"/boot.efi; fi
if [[ -e "$app_dir" ]]; then mkdir -p "$app_dir"; fi
cp "$dboot_efi" "$app_dir"/boot.efi
if [[ $boot_color = "default" ]]; then
if [[ $cur_efi != "default" ]]; then
printf "Restoring stock efi\n"
efi_restore
fi
else
if [[ $cur_efi = "default" ]]; then
printf "Backing up stock efi\n"
efi_backup
fi
printf "Creating patched custom efi\n"
efi_patch
printf "Installing patched custom efi\n"
efi_install
fi
printf "Cleaning up\n"
clean_up
printf "Checking bless\n"
check_bless $boot_color
bless --info / | head -2
printf "Done\n"
fi

# End
File renamed without changes
Loading

0 comments on commit 8cac482

Please sign in to comment.