Skip to content

Commit

Permalink
v.2.0.1 beta
Browse files Browse the repository at this point in the history
* Fixed: OS X version check typo corrected, which affected execution on
case sensitive file systems
([#97](#97
))
* Fixed: rare ioreg crash issue
([#100](#1
00))
* Fixed: running the script from the command line no longer kills
Terminal when quitting
([#101](#101
))
* Fixed: the ```-f | --forceHack``` command line option now correctly
skips the Wi-Fi card device-id(s) injection check and Bluetooth
blacklist check
* Fixed: CAT utilities are now correctly detected when running the tool
from the command line
* Fixed: disk permissions repair is no longer silently skipped in some
cases when forcing the activation
  • Loading branch information
dokterdok committed Dec 21, 2014
1 parent 2b3c9c8 commit 6b88888
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 34 deletions.
Binary file modified Continuity Activation Tool.app/Contents/Resources/Scripts/main.scpt
Binary file not shown.
50 changes: 19 additions & 31 deletions Continuity Activation Tool.app/Contents/Resources/contitool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#
#

hackVersion="2.0.0"
hackVersion="2.0.1 beta"

#---- PATH VARIABLES ------

#APP PATHS
appDir=$(dirname "$0")
appDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
continuityCheckUtilPath="$appDir/sfDeviceSupportsContinuity"
backupFolderNameBeforePatch="KextsBackupBeforePatch" #kexts backup folder name, where the original untouched kexts should be placed
backupFolderNameAfterPatch="KextsBackupAfterPatch" #kexts backup folder name, where the patched kexts should be placed, after a successful backup
Expand Down Expand Up @@ -56,7 +56,7 @@ hdiutilPath="/usr/bin/hdiutil"
headPath="/usr/bin/head"
hexdumpPath="/usr/bin/hexdump"
ifconfigPath="/sbin/ifconfig"
ioregPath="/usr/sbin/ioreg"
ioregPath="/usr/sbin/ioreg -d 14" #limited to a depth of 14 levels to avoid crashes in rare cases
kextcachePath="/usr/sbin/kextcache"
kextstatPath="/usr/sbin/kextstat"
killallPath="/usr/bin/killall"
Expand Down Expand Up @@ -113,7 +113,6 @@ usbBinaryPatchReplaceWith=$(echo ${usbBinaryPatchReplaceWithEscaped} | $trPath -
#Verifies the presence of the strings binary, necessary to run many checks and patches
#The 'strings' binutil used with the tool comes from the 'Apple Command Line Utilities' package
function verifyStringsUtilPresence() {
#verify if the Brcm4360 binary exists
if [ ! -f "${stringsPath}" ]; then

tput clear
Expand All @@ -133,7 +132,7 @@ function verifyStringsUtilPresence() {
function isMyMacOSCompatible() {
echo -n "Verifying OS X version... "
local osVersion=$(sw_vers -productVersion)
local buildVersion=$(sw_Vers -buildVersion)
local buildVersion=$(sw_vers -buildVersion)
local minVersion=10
local subVersion=$(echo "$osVersion" | $cutPath -d '.' -f 2)

Expand Down Expand Up @@ -655,7 +654,7 @@ function displayBluetoothDonglePrompt(){

echo ""
echo "If you want to activate Continuity using a USB Bluetooth 4.0 dongle,"
echo "then plug-it in now. The script will continue once it's detected."
echo "then unplug it and plug it in now. The script will continue once it's detected."
echo ""

if [ -t 0 ]; then stty -echo -icanon -icrnl time 0 min 0; fi
Expand Down Expand Up @@ -914,7 +913,7 @@ function activateContinuityFeatureFlags(){
}


#Sets the legacy Broadcom BCM94322 device-id, as well as the Brcm43224 device ids, in the AirPortBrcm4360.kext plugin. Those cards are found in older MacBooks for example.
#Injects the legacy Broadcom device-id(s) (declared in the global variable legacyBrcmCardIds) in the AirPortBrcm4360.kext plugin. Those cards are found in older MacBooks for example.
function enableLegacyWifi(){

echo -n "Applying legacy Wi-Fi card patch... "
Expand All @@ -926,7 +925,7 @@ function enableLegacyWifi(){
local output=$("$plistBuddyPath" -c "Print IOKitPersonalities:'Broadcom 802.11 PCI':IONameMatch:0" "$wifiKextPath/Contents/PlugIns/$wifiBrcmKextFilename/Contents/Info.plist") >> /dev/null 2>&1
legacyWifiAlreadyEnabled=$(containsElement "$output" "${legacyBrcmCardIds[@]}"; echo $?;)

if [ "$legacyWifiAlreadyEnabled" == "1" ]; then
if [ "$legacyWifiAlreadyEnabled" == "1" -a "$forceHack" == "0" ]; then

#entry found
echo -e "\rSkipping legacy Wi-Fi cards patch... OK";
Expand Down Expand Up @@ -1295,7 +1294,7 @@ function rebootPrompt(){

#Silently repairs the disk permissions using the Disk Utility. Takes a few minutes.
function repairDiskPermissions(){
sudo $diskutilPath repairpermissions / >> /dev/null 2>&1 & spinner "Fixing disk permissions (~5min wait)... "
$diskutilPath repairpermissions / >> /dev/null 2>&1 & spinner "Fixing disk permissions (~5min wait)... "
echo -e "\rFixing disk permissions... OK"
}

Expand Down Expand Up @@ -1478,7 +1477,6 @@ function verboseCompatibilityCheck(){
isMyMacBoardIdCompatible "verbose"
isMyMacOSCompatible "verbose"
areMyActiveWifiDriversOk "verbose"
#isMyAirPortCardALegacyBroadcom "verbose"
isAwdlActive "verbose"
isABluetoothDongleActive "verbose"
isMyBluetoothVersionCompatible "verbose"
Expand Down Expand Up @@ -1512,6 +1510,7 @@ function checkAndHack(){
compatibilityPrecautions
else
doDonglePatch="1"
myMacIsBlacklisted="1"
fi

echo ""
Expand All @@ -1531,14 +1530,13 @@ function checkAndHack(){

initializeBackupFolders
modifyKextDevMode "enableDevMode"
repairDiskPermissions
#repairDiskPermissions
backupKexts "${backupFolderBeforePatch}"
patchBluetoothKext
patchWifiKext
removeObsoleteWifiDriver
enableLegacyWifi
initiateDonglePatch
applyPermissions
updatePrelinkedKernelCache
updateSystemCache
backupKexts "${backupFolderAfterPatch}"
Expand Down Expand Up @@ -1598,21 +1596,11 @@ function applyTerminalTheme(){
osascript -e 'tell application "Terminal" to activate'
}

#Verifies if the current user belongs to the admin group, otherwise warns the user and quits the script. Clears the screen after execution
function veryifyAdminGroup(){
currentUserGroups=($(/usr/bin/id -G -n $(/usr/bin/id -un)))
result=$(containsElement "admin" "${currentUserGroups[@]}"; echo $?;)
if [ $result = "1" ]; then
echo ""
echo "You must run this script with admin privileges, please enter your password."
echo ""
sudo echo -n ""
tput clear
else
currentUser=$(/usr/bin/id -un)
#Verifies if the script is run with sudo privileges otherwise warns the user and quits the script. Clears the screen after execution
function verifySudoPrivileges(){
if [[ -z "$SUDO_COMMAND" ]]; then
echo ""
echo "The current user '${currentUser}' doesn't have the admin privileges required to launch the Continuity Activation Tool."
echo "You need admin privileges to run this tool. Aborting."
echo "You must run this script with admin privileges, please re-run the script with sudo. Aborting."
echo ""
exit;
fi
Expand Down Expand Up @@ -1673,33 +1661,33 @@ function displayMainMenu(){

if [ $# -eq 0 ]; then
applyTerminalTheme
veryifyAdminGroup
verifySudoPrivileges
verifyStringsUtilPresence
displayMainMenu
else
while [ "$1" != "" ]; do
case $1 in
-a | --activate ) veryifyAdminGroup
-a | --activate ) verifySudoPrivileges
verifyStringsUtilPresence
checkAndHack
;;
-d | --diagnostic ) verifyStringsUtilPresence
verboseCompatibilityCheck
;;
-f | --forceHack ) veryifyAdminGroup
-f | --forceHack ) verifySudoPrivileges
verifyStringsUtilPresence
forceHack=1
checkAndHack
;;
-h | --help ) showUsage
exit
;;
-r | --uninstallWithRecovery ) veryifyAdminGroup
-r | --uninstallWithRecovery ) verifySudoPrivileges
verifyStringsUtilPresence
forceRecoveryDiskBackup=1
uninstall
;;
-z | --uninstall ) veryifyAdminGroup
-z | --uninstall ) verifySudoPrivileges
verifyStringsUtilPresence
uninstall
;;
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ Continuity Activation Tool

This tool makes the necessary changes to enable OS X 10.10 Continuity features on compatible hardware. Continuity features activated by this tool include Handoff, Instant Hotspot, and New Airdrop.

## News - 2014.12.14
## News

**Continuity Activation Tool 2.0 released** : Adds compatibility with Bluetooth 4.0 USB dongles, allowing many Macs from 2008 and later to easily upgrade to Continuity. See the chart below to verify available upgrade options.
* 2014.12.21 - **Continuity Activation Tool 2.0.1 released** : Improved reliability, mainly related to command line execution.
* 2014.12.14 - **Continuity Activation Tool 2.0 released** : Adds compatibility with Bluetooth 4.0 USB dongles, allowing many Macs from 2008 and later to easily upgrade to Continuity. See the chart below to verify available upgrade options.

**[Download link](https://github.com/dokterdok/Continuity-Activation-Tool/archive/master.zip)**
**[Download link](https://github.com/dokterdok/Continuity-Activation-Tool/archive/master.zip)** (latest version)

This tool took a lot of research and coding. A small PayPal donation would be much appreciated to support the maintenance and evolution of the app. Thanks! [![Donate](https://www.paypalobjects.com/webstatic/en_US/btn/btn_donate_92x26.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dokterdok%40gmail%2ecom&lc=CH&item_name=Continuity%20Activation%20Tool&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted)

Expand Down Expand Up @@ -90,6 +91,14 @@ Options:

### Changelog

**v.2.0.1 - 2014.12.21**
* Fixed: OS X version check typo corrected, which affected execution on case sensitive file systems ([#97](https://github.com/dokterdok/Continuity-Activation-Tool/issues/97))
* Fixed: rare ioreg crash issue ([#100](https://github.com/dokterdok/Continuity-Activation-Tool/issues/100))
* Fixed: running the script from the command line no longer kills Terminal when quitting ([#101](https://github.com/dokterdok/Continuity-Activation-Tool/pull/101))
* Fixed: the ```-f | --forceHack``` command line option now correctly skips the Wi-Fi card device-id(s) injection check and Bluetooth blacklist check
* Fixed: CAT utilities are now correctly detected when running the tool from the command line
* Fixed: disk permissions repair is no longer silently skipped in some cases when forcing the activation

**v.2.0.0 - 2014.12.14**
* Added compatibility with many older Macs when using a USB Bluetooth 4.0 dongle (see chart).
* Added the ability to choose the admin user executing the tool ([#14](https://github.com/dokterdok/Continuity-Activation-Tool/issues/14))
Expand Down

0 comments on commit 6b88888

Please sign in to comment.