Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfgang Baird committed May 9, 2015
1 parent 22b9bfe commit bee4ba1
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 68 deletions.
2 changes: 1 addition & 1 deletion _resource/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5
3.0
20 changes: 9 additions & 11 deletions _resource/versionInfo.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
------------------------------------------------

Version : 2.5
Version : 3.0
Build date : Apr / 11 / 2015

------------------------------------------------
If auto-updates fail. You can manually download updates here:
https://github.com/w0lfschild/DarkBoot/releases/latest
------------------------------------------------

2.5
3.0

New
- Automatic updates

Fixed
- dBoot failing to launch in some cases
- dBoot failing to apply in some cases
- dBoot Agent not cleaning up and re-setting boot.efi permissions after edit

Changed
- dBoot Agent is now a script
- dBoot Agent does not require password
- dBoot Agent will not require password
- Updated credits

------------------------------------------------
Bugs
- check at log in does not work

If auto-updates fail. You can manually download updates here:
https://github.com/w0lfschild/DarkBoot/releases/latest

------------------------------------------------
------------------------------------------------
9 changes: 4 additions & 5 deletions app/resource/Credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@

<b>Report a bug</b> : <a href="https://github.com/w0lfschild/DarkBoot/issues/new">Click here</a><br><br>

<b>Donations</b> : If you find Dark Boot useful, please consider <a href="http://goo.gl/vF92sf">making a donation</a> to support further development.<br><br>

<b>Donors</b> : <i>Many thanks go to all those who have been kind enough to donate money in support of this project:</i><br><br>
<br>
<b>Donations</b> : If you find Dark Boot useful, please consider <a href="http://goo.gl/k51CZe">making a donation</a> to support further development.<br><br>

<b>Credits</b> :<br>
<a href="http://mstratman.github.io/cocoadialog/">cocoaDialog</a><br>
<a href="http://www.bluem.net/en/mac/pashua/">pashua</a><br>
<a href="http://sveinbjorn.org/platypus">Platypus</a><br>
<a href="http://hasseg.org/trash">Trash Script</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">

</p>
</body>
Expand Down
Binary file added app/resource/Credits_img.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions app/resource/relaunch

This file was deleted.

10 changes: 0 additions & 10 deletions app/updates/wUpdater.app/Contents/MacOS/wUpdater
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ vercomp() {
done
return 0
}

verres() {
vercomp "$1" "$2"
case $? in
Expand All @@ -48,7 +47,6 @@ verres() {
esac
echo $output
}

pashua_run() {

# Write config file
Expand Down Expand Up @@ -106,7 +104,6 @@ pashua_run() {
done

}

install_app() {

# result_value=0
Expand Down Expand Up @@ -141,7 +138,6 @@ install_app() {
sleep 1
open -a "$oldDirectory"
}

ping_test() {
# Ping www.google.com to check internet connection
myurl=www.google.com
Expand All @@ -157,7 +153,6 @@ ping_test() {
kill $KILLME
fi
}

ping_success() {
# Get latest version
latestVersion=$(curl -\# -L "$versionURL")
Expand All @@ -180,7 +175,6 @@ ping_success() {
echo "No new updates available"
fi
}

update_prompt() {
# Get change log and prompt for user response
curl -\# -L -o /tmp/wUpdater_log.txt "$logURL" 2> /dev/null
Expand Down Expand Up @@ -262,7 +256,6 @@ update_prompt() {
fi
fi
}

update_confimed() {
echo "Downloading update..."
if [ -e /tmp/"$applicationName".zip ]; then rm /tmp/"$applicationName".zip; fi
Expand All @@ -279,7 +272,6 @@ update_confimed() {
echo "Launching installer..."
exec /tmp/"$applicationName".app/Contents/Resources/updates/wUpdater.app/Contents/MacOS/wUpdater "i" "$oldDirectory" &
}

download_wprogress() {
curl -\# -L -o /tmp/"$applicationName".zip "$downloadURL" 2> /tmp/updateTracker &
pids="$pids $!"
Expand All @@ -288,7 +280,6 @@ download_wprogress() {
exec 7>&-
rm -f /tmp/upipe
}

wait_for_process() {
rm -f /tmp/upipe
mkfifo /tmp/upipe
Expand Down Expand Up @@ -339,7 +330,6 @@ wait_for_process() {
rm -f /tmp/upipe
rm -f /tmp/updateTracker
}

debug() {
echo "DEBUG: $*" >/dev/null
}
Expand Down
4 changes: 4 additions & 0 deletions app/windows/TRANSLATE_ME.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dBoot strings:

If you translate these strings into another language please email me the translations @ [email protected]

Empty file added app/windows/en/donors.txt
Empty file.
23 changes: 23 additions & 0 deletions app/windows/text_substitute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# replace eng with translation
# required arg = lang

scriptDirectory=$(cd "${0%/*}" && echo $PWD)
lang_="$1"
fold_="$scriptDirectory"/"$lang_"
file_=("$fold_"/donors.txt "$fold_"/main.txt "$fold_"/settings.txt "$fold_"/welcome.txt)

for i in "${file_[@]}"
do
:
while read p; do
if [[ $p != "" ]]; then
#echo $p
text_tag=$(echo "$p" | cut -d= -f1)
#echo $text_tag
sed -i.bak s/"$text_tag.*"/"$p"/g "$i"
fi
done <"$fold_"/"$lang_"_strings.txt
done

118 changes: 79 additions & 39 deletions main.sh → dBoot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,62 @@
# Functions

ask_pass() {
sudo_status=$(sudo echo null 2>&1)

pass_window="
*.title = Dark Boot - $curver
*.floating = 1
*.transparency = 1.00
*.autosavekey = dBoot
pw0.type = password
pw0.label = Enter your password to continue
pw0.mandatory = 1
pw0.width = 100
pw0.x = -10
pw0.y = 4"
*.title = dBoot
*.floating = 1
*.transparency = 1.00
*.autosavekey = dBoot_pass0
pw0.type = password
pw0.label = Password required to continue...
pw0.mandatory = 1
pw0.width = 100
pw0.x = -10
pw0.y = 4"

pass_fail_window="
*.title = dBoot
*.floating = 1
*.transparency = 1.00
*.autosavekey = dBoot_pass1
pw1.type = password
pw1.label = Incorrect password, try again...
pw1.mandatory = 1
pw1.width = 100
pw1.x = -10
pw1.y = 4"

if [[ $sudo_status != "null" ]]; then
pashua_run "$pass_window" 'utf8' "$scriptDirectory"
pass_window=""
echo "$pw0" | sudo -Sv
echo ""
if [[ $pw0 = "" ]]; then echo -e "No password entered"; else pw0=""; fi
else
sudo -v
pass_attempt=0
pass_success=0
while [[ $pass_attempt -lt 5 ]]; do
sudo_status=$(sudo echo null 2>&1)
if [[ $sudo_status != "null" ]]; then
if [[ $pass_attempt > 0 ]]; then
pashua_run "$pass_fail_window" 'utf8' "$scriptDirectory"
else
pashua_run "$pass_window" 'utf8' "$scriptDirectory"
fi
echo "$pw0" | sudo -Sv
sudo_status=$(sudo echo null 2>&1)
echo ""
echo "Password attempt : "$pass_attempt
echo "Sudo status : "$sudo_status
if [[ $sudo_status = "null" ]]; then
pass_attempt=5
pass_success=1
else
pass_attempt=$(( $pass_attempt + 1 ))
echo -e "Incorrect or no password entered"
fi
pw0=""
else
pass_attempt=5
pass_success=1
sudo -v
fi
done

if [[ $pass_success = 1 ]]; then
echo "_success"
fi
}
check_bless() {
Expand Down Expand Up @@ -128,7 +162,8 @@ fi

if [[ $(sudo cat /etc/sudoers | grep dBoot) = "" ]]; then
sudo touch /etc/sudoers
sudo echo "%sudo ALL=NOPASSWD: /Library/Scripts/dBoot/dBoot.sh" >> /etc/sudoers
# sudo echo "%sudo ALL=NOPASSWD: /Library/Scripts/dBoot/dBoot.sh" >> /etc/sudoers
echo "%sudo ALL=NOPASSWD: /Library/Scripts/dBoot/dBoot.sh" | sudo tee -a /etc/sudoers
fi

osascript <<EOD
Expand Down Expand Up @@ -216,35 +251,38 @@ pashua_run() {

}
update_check() {
cur_date=$(date "+%y%m%d")
curver=0
cur_date=$(date "+%y%m%d")
cur_date=0
lastupdateCheck=$($PlistBuddy "Print lastupdateCheck:" "$app_plist" 2>/dev/null || defaults write org.w0lf.dBoot "lastupdateCheck" 0 2>/dev/null)
lastupdateCheck=1

# If we haven't already checked for updates today
if [[ "$lastupdateCheck" != "$cur_date" ]]; then
results=$(ping -c 1 -t 5 "http://www.sourceforge.net" 2>/dev/null || echo "Unable to connect to internet")
results=$(ping -c 1 -t 5 "https://www.github.com" 2>/dev/null || echo "Unable to connect to internet")
if [[ $results = *"Unable to"* ]]; then
echo "ping failed : $results"
else
echo "ping success"
beta_updates=$($PlistBuddy "Print betaUpdates:" "$app_plist" 2>/dev/null || echo -n 0)
update_auto_install=$($PlistBuddy "Print autoInstall:" "$app_plist" 2>/dev/null || { defaults write org.w0lf.dBoot "autoInstall" 0; echo -n 0; } )

update_auto_install=0

# Stable urls
dlurl="http://sourceforge.net/projects/cdock/files/latest"
verurl="http://sourceforge.net/projects/cdock/files/version.txt"
logurl="http://sourceforge.net/projects/cdock/files/versionInfo.txt"
dlurl=$(curl -s https://api.github.com/repos/w0lfschild/DarkBoot/releases/latest | grep 'browser_' | cut -d\" -f4)
verurl="https://raw.githubusercontent.com/w0lfschild/DarkBoot/master/_resource/version.txt"
logurl="https://raw.githubusercontent.com/w0lfschild/DarkBoot/master/_resource/versionInfo.txt"

# Beta or Stable updates
if [[ $beta_updates -eq 1 ]]; then
stable_version=$(verres $(curl -\# -L "http://sourceforge.net/projects/cdock/files/version.txt") $(curl -\# -L "http://sourceforge.net/projects/cdock/files/cDock%20Beta/versionBeta.txt"))

if [[ $stable_version = "<" ]]; then
# Beta urls
dlurl="http://sourceforge.net/projects/cdock/files/cDock%20Beta/current.zip"
verurl="http://sourceforge.net/projects/cdock/files/cDock%20Beta/versionBeta.txt"
logurl="http://sourceforge.net/projects/cdock/files/cDock%20Beta/versionInfoBeta.txt"
fi
fi
# if [[ $beta_updates -eq 1 ]]; then
# stable_version=$(verres $(curl -\# -L "http://sourceforge.net/projects/cdock/files/version.txt") $(curl -\# -L "http://sourceforge.net/projects/cdock/files/cDock%20Beta/versionBeta.txt"))
# if [[ $stable_version = "<" ]]; then
# # Beta urls
# dlurl="http://sourceforge.net/projects/cdock/files/cDock%20Beta/current.zip"
# verurl="http://sourceforge.net/projects/cdock/files/cDock%20Beta/versionBeta.txt"
# logurl="http://sourceforge.net/projects/cdock/files/cDock%20Beta/versionInfoBeta.txt"
# fi
# fi

defaults write org.w0lf.dBoot "lastupdateCheck" "${cur_date}"
./updates/wUpdater.app/Contents/MacOS/wUpdater c "$app_directory" org.w0lf.dBoot $curver $verurl $logurl $dlurl $update_auto_install &
Expand Down Expand Up @@ -296,7 +334,8 @@ verres() {
main_method() {
my_color=$(efi_check)
login_items=$(osascript -e 'tell application "System Events" to get the name of every login item')
if [[ "$login_items" = *"dBoot Agent"* ]]; then login_enabled=1; else login_enabled=0; fi
if [[ "$login_items" = *"dBoot.sh"* ]]; then login_enabled=1; else login_enabled=0; fi


app_info=$(tr -d '\n' < "$app_windows"/info.txt)
main_window=$(cat "$app_windows"/main.txt)
Expand Down Expand Up @@ -362,7 +401,7 @@ fi

# Files
dboot_efi="$scriptDirectory"/boot.efi
helper_1="$app_directory"/Contents/Resources/"dBoot Agent".sh
helper_1="$scriptDirectory"/"dBoot Agent".sh
helper_2=/Library/Scripts/dBoot/dBoot.sh

# Variables
Expand All @@ -376,6 +415,7 @@ board_HEX=""

# Run
logging
update_check
main_method

# End
File renamed without changes.

0 comments on commit bee4ba1

Please sign in to comment.