document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/sh
  2.  
  3. name=Whatsapp
  4. url=\'https://web.whatsapp.com/\'
  5. if [ -f /usr/local/bin/wget ]
  6. then
  7.     wget \'https://web.whatsapp.com/img/favicon/2x/favicon.png\'
  8.     icon="`pwd`/favicon.png"
  9. else
  10.     echo "Download https://web.whatsapp.com/img/favicon/2x/favicon.png and enter the full path of favicon.png"
  11.     read inputline
  12.     icon=$inputline
  13. fi
  14.  
  15. chromePath="/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome"
  16. appRoot="$HOME/Applications"
  17. # various paths used when creating the app
  18. resourcePath="$appRoot/$name.app/Contents/Resources"
  19. execPath="$appRoot/$name.app/Contents/MacOS"
  20. profilePath="$appRoot/$name.app/Contents/Profile"
  21. plistPath="$appRoot/$name.app/Contents/Info.plist"
  22.  
  23. # make the directories
  24. mkdir -p  $resourcePath $execPath $profilePath
  25.  
  26. # convert the icon and copy into Resources
  27. if [ -f $icon ] ; then
  28.     sips -s format tiff $icon --out $resourcePath/icon.tiff --resampleWidth 128 >& /dev/null
  29.     tiff2icns -noLarge $resourcePath/icon.tiff >& /dev/null
  30. fi
  31.  
  32. # create the executable
  33. cat >$execPath/$name <<EOF
  34. #!/bin/sh
  35. exec $chromePath  --app="$url" --user-data-dir="$profilePath" "\\$@"
  36. EOF
  37. chmod +x $execPath/$name
  38.  
  39. # create the Info.plist
  40. cat > $plistPath <<EOF
  41. <?xml version="1.0" encoding="UTF-8"?>
  42. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
  43. <plist version=”1.0″>
  44. <dict>
  45. <key>CFBundleExecutable</key>
  46. <string>$name</string>
  47. <key>CFBundleIconFile</key>
  48. <string>icon</string>
  49. </dict>
  50. </plist>
  51. EOF
');