New Paste

 

Recent Pastes

Administrate




Pastebin on paste.luisaranguren.com

PasteID: 2q
Pasted by Anonymous, 2016-12-04 01:28:46 GMT
Expires Never
Paste size 16.64 Kb
Tools Raw   Download
 
  1. #!/usr/bin/env bash  
  2. # PATCH VERSION: 0.9.7  
  3. # ableton_live_9.x.x_smart_patch.command  
  4. # by techietrash (patch logic by pitchshifter)  
  5. #  
  6. # Patches both 64-bit and 32-bit versions of Ableton Live Suite  
  7. # After patching double-click the generate Authorize.auz file  
  8. #  
  9. # Requires Ableton Live 9 Suite.app to be located in /Applications  
  10. # ex: /Applications/Ableton\ Live\ 9\ Suite.app  
  11. #  
  12. # It's recommended to have the Xcode Command Line Tools installed so that  
  13. # Live's architecture can be determined automatically and so that Live can be  
  14. # re-codesigned after it is patched.  
  15. #  
  16. # Set Gatekeeper to Allow Applications From: Anywhere  
  17. #  
  18. # Tested on 10.10.5 with Live 9.7 x64 and x86  
  19.   
  20. # display banner  
  21. echo -e "\033[1;31m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓  
  22. ┃                                                                              ┃  
  23. ┃           ABLETON LIVE SUITE 9.x.x SMART PATCHER -- by techietrash           ┃  
  24. ┃                   (using new patch logic by pitchshifter)                    ┃  
  25. ┃                                 Patch v0.9.7                                 ┃  
  26. ┃     This patch will determine your version of Ableton Live and patch it!     ┃  
  27. ┃                          (Tested on Live 9.7 32/64)                          ┃  
  28. ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\033[0m"  
  29. # display menu  
  30. echo -e "\033[0;30;42m 1. FRESH INSTALL  \033[0m\033[0;32m: I want to patch Live AND generate the authorization file.\033[0m  
  31. \033[0;30;43m 2. AUTH FILE ONLY \033[0m\033[0;33m: I've already patched, just generate the authorization file.\033[0m  
  32. \033[0;30;43m 3. PATCH ONLY     \033[0m\033[0;33m: I already have an authorization file, just patch Live.\033[0m  
  33. \033[0;34m▶ Please enter an option (\033[0m\033[0;30;42m 1 \033[0m\033[0;34m, \033[0m\033[0;30;43m 2 \033[0m\033[0;34m or \033[0m\033[0;30;43m 3 \033[0m\033[0;34m) \033[0m\033[0;31m(or press any other key to abort)\033[0m: "  
  34. read -p "" -n 1  
  35. echo ""  
  36. # process reply  
  37. if [[ $REPLY =~ ^[123]$ ]]; then  
  38.   # set variables we'll need  
  39.   LIVE="/Applications/Ableton Live 9 Suite.app"  
  40.   BINARY="$LIVE/Contents/MacOS/Live"  
  41.   INFO="$LIVE/Contents/Info.plist"  
  42.   AUTHFILE="$HOME/Desktop/Authorize.auz"  
  43.   if [[ -e "$AUTHFILE" ]]; then  
  44.     # use unique name if Authorize.auz already exists on the Desktop  
  45.     DATE=`date +%s`  
  46.     AUTHFILE="$HOME/Desktop/Authorize ${DATE}.auz"  
  47.   fi  
  48.   # embedded Authorize.auz file, all-in-one, woo!  
  49.   AUZ=$(cat <<'AUTH'  
  50. 3006-B802-3ECF-762C-38AC-E7FD,00,90,Standard,97079038274421008708204196987934929633656964554684957545854029135395601187849874  
  51. 3404-A10C-2FE7-D7ED-1C77-519F,40,10,Standard,34333153616624383962842015438849562093371961656972439377305501639140517073772519  
  52. 3415-4101-9F0E-C4F7-7AC3-F7D8,41,10,Standard,37139082434184859929986839531969618349778914555780091203885834205826456835028235  
  53. 3864-A10C-97C6-E7FA-DF00-EB3D,86,10,Standard,31526400600138321679429933991999660716087999645757611183124194357904494994649444  
  54. 3614-310F-5100-9DB5-3256-2996,61,10,Standard,13086484553569269582932135515844418936104185227942097645302488606697940762267182  
  55. 3627-D102-351F-4F8C-8898-937F,62,10,Standard,65579994113800453603233323515844368533368218834222340342166814691227418614580429  
  56. 3857-4101-31A6-33E2-5658-7372,85,10,Standard,54172760821613136360230099499441996735216670843926577682437575361562675413831378  
  57. 3802-4101-011B-4887-D01E-251B,80,10,Standard,58733227563797303081103995006094580450126063300420915958359255658834722693207230  
  58. 3605-210D-A187-6F99-01C0-BE85,60,10,Standard,62562520138357779000599046756587194066359913924765199551824140067768478598200116  
  59. 3636-7107-F967-817D-8E8A-F2E4,63,10,Standard,38058769567315949576691830153660431958226684725076539864102563903798163182013283  
  60. 3846-D102-64E2-4A0E-18CE-4E89,84,10,Standard,58222490268800328690827929468020729383436154357075315293952895386267740221892290  
  61. 3813-7107-5F43-1F3D-FF15-5BA3,81,10,Standard,28874256800035332889993865509640202458593889278322857806206757644643387817086583  
  62. 3831-8108-5C97-CA69-FA86-885D,83,10,Standard,80324164240521028330880325279916158619203043462611579436284036102595967995588862  
  63. 3820-B10E-0676-AD80-B7D5-32EB,82,10,Standard,19513570544385731070268910601919751836919482598092736910668552384691993920805037  
  64. 3875-0109-A35B-E307-FD36-968A,87,10,Standard,80668348456585631293678092237987846667095828409168041633716912962179330944291598  
  65. 370D-C100-1B85-D323-1B83-D0A3,70,10,Standard,87974700299072829003159164310420965414135877704489648890829066653239882127628501  
  66. 371C-5103-465C-CDEA-E6D7-AD63,71,10,Standard,57130251648316199841761819209237998045217261243744037009542225217615182494249442  
  67. 3641-210D-11D5-6527-5694-78DF,64,10,Standard,67461951379841003894828271122476845521809166721337939195210447108564156020613120  
  68. 3AFC-5103-0871-F249-C1C9-3B2B,AF,10,Standard,54398028116285697109405633056697814023701757532645741610647942838980296048278284  
  69. 3A56-4101-3597-34AD-9BC6-5F98,A5,10,Standard,87491528599967835839573251653263587519069578542610813030153358388615325766308780  
  70. 3BC7-B10E-4D40-8CD9-6398-5EE1,BC,10,Standard,26959234851665085770210111982604869300433205300997902331948497327573229574080910  
  71. 3B6D-E104-8C05-2BF5-2C71-D4D9,B6,10,Standard,93874430183246886847917576174834113053775539997868985762819951789502773938033000  
  72. 3BD6-110B-C9E9-BFE5-FBF9-7518,BD,10,Standard,99179262466698417931967225999810387868523581105792163182840099918832824833607208  
  73. 3AB8-A10C-D090-FAB2-9A64-2F56,AB,10,Standard,57060161299114779691570856930027632418185737384922759735576195586807945787267910  
  74. 3B92-210D-442A-A2AD-7BF8-87A8,B9,10,Standard,41099404521865599275772378834429380421236680003542179990419975325503200019266838  
  75. 3AA9-7107-62B4-E02C-6D60-64A3,AA,10,Standard,24849182653554494647367715629139573774866172147165187998349304008907504028880336  
  76. 3A8B-0109-4544-7B88-5086-0ECF,A8,10,Standard,75889145314685672635674460386754266513685439198579406430821536453985546751147397  
  77. 3B83-5103-6EF6-4BF9-9A57-47C1,B8,10,Standard,37902283556030291676255333031543276952449741708520908290102147207468062068987475  
  78. 3A9A-7107-3D82-9289-FD41-90C7,A9,10,Standard,82560688260537492890630688684460330475919670258421561931907190514549897212832072  
  79. 3C66-4101-D46D-CF05-EEF1-958C,C6,10,Standard,99167230652314334105475427089144701947526711472867292423141608024385632221372567  
  80. 3BA1-B10E-B226-CC84-68C0-763F,BA,10,Standard,82973054208398804348482324948205688128308174177967591088742821204884893938539269  
  81. 3B5E-8108-624B-35B4-CEB1-8ECD,B5,10,Standard,19799982859285671049050826747825195351738728920817132530599397014578766094528878  
  82. 3BB0-8108-0329-DA58-1DB3-8982,BB,10,Standard,30708331318112305898897373826798949043029921123662730680521902399349211868483843  
  83. 3A65-A10C-E99A-55FC-DA39-7541,A6,10,Standard,82207108485850918298109265758144499616502923544975210979697472977385209717141571  
  84. 3B4F-6105-CB8E-EB47-687B-0AAB,B4,10,Standard,50164103619482047799678054276970290001541691976196281936643012214737814837357686  
  85. 3A12-310F-28FD-6A6C-34FF-6D63,A1,10,Standard,26047886722052023131708049386736817052952524420038142912310255642422512893358555  
  86. 3B7C-8108-9E06-EDEE-E45E-E5CF,B7,10,Standard,65819924536765045878479547559651313314904215789281373522144395747235093588021280  
  87. 3B29-910A-1665-AA56-ECC3-C706,B2,10,Standard,74420279105891662184779030154072261334494257868811965590417983596592713488763814  
  88. 3A03-7107-6763-6485-95D0-110B,A0,10,Standard,19778203561995008893963030442299751346565033625839266958446520848082666260898395  
  89. 3BE5-910A-9BB7-CB8F-31B1-39E6,BE,10,Standard,54726800772028513800770053021637913840405045081163121534943476981486770075450904  
  90. 3C55-210D-2559-A11F-2C24-0FF4,C5,10,Standard,49296495785216903431300062484743639439951612829820752723837028862916128192828036  
  91. 3AED-310F-7E29-9AFA-3400-206C,AE,10,Standard,63755125984876889897070956409699483383324721191060690418875934446630415850391291  
  92. 3A21-8108-F337-06EE-79DB-C239,A2,10,Standard,68723121655243466781805873700640537748469516024245831090676192434620869034793318  
  93. 3A47-5103-60A4-E7BE-0652-C50E,A4,10,Standard,82508030528095212108129350890607724873061971071259473564387483957358263945840431  
  94. 3A74-E104-8780-5B40-1A65-A038,A7,10,Standard,73016715468021222865146785737283514995241266501658706268719344705209346569212043  
  95. 3ACF-6105-624B-ADE6-91E1-615F,AC,10,Standard,31055416560712569913505952643704774680614466057043019200875286618689222315508701  
  96. 3C33-D102-5940-7ED7-0A67-2665,C3,10,Standard,61973183324125208518457757512568144451106534128824842062417080171916173278617370  
  97. 3A30-310F-DC69-6A39-C668-036E,A3,10,Standard,69689665539635935988287676216758365197888093447391162811763651956411124093665424  
  98. 3C11-0109-A8CF-0581-7FD8-42AE,C1,10,Standard,91369157318707788195275899162701888659712891667478174954511552418282630066655693  
  99. 3B1A-4101-9233-447E-35F7-BD20,B1,10,Standard,24963657773461681215180015806443330177679279324380406518878603502560685194262380  
  100. 3C44-4101-B1E3-F336-F01A-FDE7,C4,10,Standard,56884000300557249626134349880768996112922481470750469300869139168173014095299450  
  101. 3ADE-4101-0508-AB1A-8BB3-4647,AD,10,Standard,22349874360841375059383435366444605112561844979023243153178550384484782178018568  
  102. 3C00-D102-77F8-720C-C724-6228,C0,10,Standard,35019840793696165205102194559155497977574423320055732601165687973791326631649357  
  103. 3BF4-210D-134D-0B3D-2FE1-E8BF,BF,10,Standard,50784394686441084777682030428471927140974471365897414460958945843605256530410336  
  104. 3B0B-D102-F717-3E46-77FE-A1ED,B0,10,Standard,66514145599054218318621081897500360930931447654847919877837287113554341132517378  
  105. 3C22-6105-D720-9A72-E189-7102,C2,10,Standard,94620125921178046208436138980829571458233320536148782350735960139969042066663399  
  106. 3B38-310F-1E07-09F0-50E0-4039,B3,10,Standard,79177520120056564889336091409250351556294196705449484212282226942194125786978322  
  107. AUTH  
  108. )  
  109.   # functions because I didn't want to mess with making the switch case more complicated  
  110.   
  111.   function check_tools {  
  112.     command -v lipo >/dev/null 2>&1  
  113.     if [[ "${?}" > 0 ]]; then  
  114.       TOOLS=false  
  115.       echo -e "\033[0;34m  
  116. ▶ Command Line Tools are not installed!  I recommended installing them, they are  
  117. required to automatically determine Live's architecture and to re-codesign Live  
  118. after patching. To proceed without them, please specify Architecture manually:\033[0m"  
  119.       echo -e "\033[0;30;42m 1 \033[0m\033[0;34m 32-bit (i386)"  
  120.       echo -e "\033[0m\033[0;30;43m 2 \033[0m\033[0;34m 64-bit (x86_64)"  
  121.       echo -e "Please press \033[0;30;42m 1 \033[0m\033[0;34m or \033[0m\033[0;30;43m 2 \033[0m\033[0;34m \033[0m\033[0;31m(press any other key to abort and for more info)\033[0m: "  
  122.       read -p "" -n 1  
  123.       echo ""  
  124.       if [[ "$REPLY" == "1" ]]; then  
  125.         ARCH="i386"  
  126.       elif [[ "$REPLY" == "2" ]]; then  
  127.         ARCH="x86_64"  
  128.       else  
  129.         echo -e "\033[1;97;41m  Aborted! Architecture not selected! \033[0m"  
  130.         echo -e "\033[0;34m▶ To install the Xcode Command Line Tools (Recommended):  
  131.   
  132. OS X 10.9 and later, simply type in terminal and press enter:  
  133. \033[0m\033[0;31mxcode-select --install\033[0m  
  134.   
  135. \033[0;34mOS X 10.8 and 10.7 require downloading the installer from apple:  
  136.   
  137. 10.8\033[0m  
  138. \033[0;31mhttp://devimages.apple.com/downloads/xcode/command_line_tools_for_osx_mountain_lion_april_2014.dmg\033[0m\033[0;34m  
  139.   
  140. 10.7\033[0m  
  141. \033[0;31mhttp://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg\033[0m"  
  142.         echo -en "\033[0;97;44m▶ Press any key to exit this script \033[0m\n"  
  143.         read -p "" -n 1  
  144.         exit -1  
  145.       fi  
  146.     fi  
  147.   
  148.   }  
  149.   
  150.   function patch_it {  
  151.     if [[ -e "${LIVE}" ]]; then  
  152.       # determine live version number  
  153.       VERSION=$(/usr/libexec/PlistBuddy -c Print:CFBundleShortVersionString "${INFO}" | awk '{printf $1}')  
  154.   
  155.       ARCH="?"  
  156.       TOOLS=true  
  157.       check_tools  
  158.       if [[ "$ARCH" == "?" ]]; then  
  159.         # determine live architecture, will be "x86_64" or "i386"  
  160.         ARCH=$(lipo -info "${BINARY}" | awk -F ": " '{printf $3}')  
  161.         # output version and architecture  
  162.         echo -e "\033[0;34m▶ Ableton Live Suite ${VERSION} ${ARCH} Detected...\033[0m"  
  163.       else  
  164.         echo -e "\033[0;34m▶ Ableton Live Suite ${VERSION} ${ARCH} Specified...\033[0m"  
  165.       fi  
  166.   
  167.       # drop current sudo permissions just in case  
  168.       sudo -k  
  169.   
  170.       # get sudo permissions  
  171.       echo -e "\033[0;31m▶ This script requires Administrator Privileges!\033[0m"  
  172.       sudo -v  
  173.   
  174.       # exit if sudo permissions can't be attained in order to avoid errors  
  175.       if [[ "$(sudo whoami)" != "root" ]]; then  
  176.         echo -e "\033[1;97;41m  Aborted! Script didn't have sudo privileges !!! \033[0m"  
  177.         echo -en "\033[0;97;44m▶ Press any key to exit this script \033[0m\n"  
  178.         read -p "" -n 1  
  179.         exit -1  
  180.       fi  
  181.   
  182.       if [[ "$ARCH" = "x86_64" ]]; then  
  183.         # patch 64-bit version  
  184.         echo -e "\033[0;34m▶ Patching 64-bit Ableton Live Suite...\033[0m"  
  185.         sudo perl -pi -e 's|\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x41\x54\x53\x48\x83\xEC\x78\x49\x89\xCE\x49\x89\xD7\x41\x89\xF5|\xB8\x01\x00\x00\x00\xC3\x41\x56\x41\x55\x41\x54\x53\x48\x83\xEC\x78\x49\x89\xCE\x49\x89\xD7\x41\x89\xF5|g' "${BINARY}"  
  186.       elif [[ "$ARCH" = "i386" ]]; then  
  187.         # patch 32-bit version  
  188.         echo -e "\033[0;34m▶ Patching 32-bit Ableton Live Suite...\033[0m"  
  189.         sudo perl -pi -e 's|\x55\x53\x57\x56\x83\xEC\x7C\xE8\x00\x00\x00\x00\x5D\x8B\xB4\x24\x9C\x00\x00\x00|\x31\xc0\x40\xc3\x83\xEC\x7C\xE8\x00\x00\x00\x00\x5D\x8B\xB4\x24\x9C\x00\x00\x00|g' "${BINARY}"  
  190.       else  
  191.         echo -e "\033[1;97;41m  Error! Architecture could not be determined !!!  \033[0m"  
  192.         echo -en "\033[0;97;44m▶ Press any key to exit this script \033[0m\n"  
  193.         read -p "" -n 1  
  194.         exit -1  
  195.       fi  
  196.       # remove quarantine attribute from Live  
  197.       sudo xattr -rc "${LIVE}"  
  198.   
  199.       # patch success message  
  200.       echo -e "\033[0;30;42m▶ Ableton Live Suite ${VERSION} ${ARCH} Successfully Patched! \033[0m"  
  201.   
  202.       if [[ "$TOOLS" == true ]]; then  
  203.         # re-codesign the app, to avoid errors, requires gatekeeper to be disabled  
  204.         echo -e "\033[0;34m▶ Re-Codesigning Ableton Live Installation.cfg... (please be patient!)\033[0m"  
  205.         codesign -f -s - -v "${LIVE}/Contents/MacOS/Installation.cfg" >/dev/null 2>&1  
  206.         echo -e "\033[0;30;42m▶ Ableton Live Installation.cfg Successfully Codesigned! \033[0m"  
  207.         echo -e "\033[0;34m▶ Re-Codesigning Ableton Live 9 Suite.app... (please be patient!)\033[0m"  
  208.         codesign -f -s - -v "${LIVE}" >/dev/null 2>&1  
  209.         echo -e "\033[0;30;42m▶ Ableton Live 9 Suite.app Successfully Codesigned! \033[0m"  
  210.       else  
  211.         echo -e "\033[0;34m▶ Command Line Tools are not installed, skipping codesigning.\033[0m"  
  212.         echo -e "\033[0;34m▶ (Live should still work without re-codesigning)\033[0m"  
  213.       fi  
  214.     else  
  215.       echo -e "\033[1;97;41m  Ableton Live 9 Suite.app is not in /Applications !!!\033[0m"  
  216.       echo -en "\033[0;97;44m▶ Press any key to exit this script \033[0m\n"  
  217.       read -p "" -n 1  
  218.       exit -1  
  219.     fi  
  220.   }  
  221.   
  222.   function gen_auth {  
  223.     # create the authorize.auz file on the desktop  
  224.     echo -e "\033[0;34m▶ Creating Authorization file...\033[0m"  
  225.     echo -n "$AUZ" > "${AUTHFILE}"  
  226.     echo -e "\033[0;30;42m▶ Authorization File Created: $AUTHFILE \033[0m"  
  227.   }  
  228.   function complete {  
  229.     # displays final instructions, reveals files, and exits  
  230.     echo -e "\033[0;30;43m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\033[0m  
  231. \033[0;30;43m┃     PLEASE OPEN LIVE AND DOUBLE CLICK THE AUTHORIZE.AUZ FILE TO REGISTER     ┃\033[0m  
  232. \033[0;30;43m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\033[0m"  
  233.     sleep 1  
  234.     # reveal live and authorize files in Finder, if they exist  
  235.     if [[ -e "${LIVE}" ]]; then  
  236.       open -R "${LIVE}"  
  237.     fi  
  238.     if [[ -e "${AUTHFILE}" ]]; then  
  239.       open -R "${AUTHFILE}"  
  240.     fi  
  241.     echo -en "\033[0m\033[0;97;44m▶ Press any key to exit this script \033[0m"  
  242.     read -p "" -n 1  
  243.     exit 0  
  244.   }  
  245.   
  246.   # determine which functions to run, based on menu choice  
  247.   case "$REPLY" in  
  248.     "1")  
  249.       patch_it  
  250.       gen_auth  
  251.     ;;  
  252.     "2")  
  253.       gen_auth  
  254.     ;;  
  255.     "3")  
  256.       patch_it  
  257.     ;;  
  258.     *)  
  259.       #do nothing  
  260.     ;;  
  261.   esac  
  262.   # run 'complete' function regardless, as choice 1-3 has to be run to reach this  
  263.   complete  
  264. fi  
  265. # abort if menu choic is not 1, 2, or 3  
  266. echo -e "\033[1;97;41m  Script was Aborted !!! No changes have been made to your system \033[0m"  
  267. echo -en "\033[0;97;44m▶ Press any key to exit this script \033[0m\n"  
  268. read -p "" -n 1  
  269. exit -1  
  270.  
 
 
 
 
Written by Xan Manning, 2010.