document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. # by Electrikjesus 12/20/2014 v1.01
  2. # This script is an adaptation of @rharshit\'s script here: http://forum.xda-developers.com/android/development/script-simplest-to-set-android-build-t2953816 . It is intended for use on Ubuntu
  3. echo \'Starting setup process\'
  4. echo \'\'
  5. echo \'Updating...\'
  6. apt-get update
  7. apt-get upgrade
  8. echo \'\'
  9. echo \'Installing java (this might take some time)\' #Alternatively, you can install oracle java
  10. echo \'\'
  11. echo \'Installing java 6...\'
  12. apt-get install openjdk-6-jdk -y
  13. echo \'Installing java 7...\'
  14. apt-get install openjdk-7-jdk -y
  15. echo \'Config java versions\'
  16. echo \'\'
  17. echo "Tip: Choose version 7 for Lollipop and 6 for KitKat and below"
  18. echo \'\'
  19. echo \'- Configure java\'
  20. update-alternatives --config java
  21. echo \'- Configure javac\'
  22. update-alternatives --config javac
  23. echo \'- Configure javadoc\'
  24. update-alternatives --config javadoc
  25. echo \'\'
  26. echo \'looks like there is an issue with icedtea... fixing that real quick\'
  27. cd /usr/lib/jvm
  28. ln -s java-1.7.0-openjdk-amd64 java-8-openjdk-amd64
  29. apt-get purge icedtea-plugin
  30. apt-get purge icedtea-7-plugin
  31. apt-get purge icedtea-netx
  32. apt-get install icedtea-plugin
  33. echo \'-now on to GCC compiler\'
  34. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  35. echo \'-adding repo\'
  36. sudo apt-get update
  37. echo \'-updating and installing GCC\'    
  38. sudo apt-get install gcc-4.7
  39. echo \'-Configuring GCC\'
  40. sudo update-alternatives --config gcc
  41. echo \'\'
  42. echo \'-installing git-core, curl, and other repo stuff\' #Installing git-core, curl, and other repo stuff. Doing this in parts just in case it fails.
  43. echo \'\'
  44. echo \'(1)\'
  45. apt-get install git gnupg flex bison gperf build-essential -y
  46. echo \'(2)\'
  47. apt-get install zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev -y
  48. echo \'(3)\'
  49. apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 -y
  50. echo \'(4)\'
  51. apt-get install libgl1-mesa-dev g++-multilib mingw32 tofrodos -y
  52. echo \'(5)\'
  53. apt-get install python-markdown libxml2-utils xsltproc zlib1g-dev:i386 -y
  54. echo \'Linking libGL\'
  55. ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
  56. echo \'Getting your identity...\'
  57. export USER=$(whoami | sed \'s/\\\\/\\\\\\\\/\')
  58. echo "Your identity is" $USER
  59. echo \'Configuring USB Access using your identity...\' #Don\'t need to update /etc/udev/rules.d/51-android.rules manually
  60. echo \'\'
  61. echo \'# adb protocol on passion (Nexus One)\' >> /etc/udev/rules.d/51-android.rules
  62. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  63. echo \'# fastboot protocol on passion (Nexus One)\' >> /etc/udev/rules.d/51-android.rules
  64. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  65. echo \'# adb protocol on crespo/crespo4g (Nexus S)\' >> /etc/udev/rules.d/51-android.rules
  66. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  67. echo \'# fastboot protocol on crespo/crespo4g (Nexus S)\' >> /etc/udev/rules.d/51-android.rules
  68. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  69. echo \'# adb protocol on stingray/wingray (Xoom)\' >> /etc/udev/rules.d/51-android.rules
  70. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  71. echo \'# fastboot protocol on stingray/wingray (Xoom)\' >> /etc/udev/rules.d/51-android.rules
  72. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  73. echo \'# adb protocol on maguro/toro (Galaxy Nexus)\' >> /etc/udev/rules.d/51-android.rules
  74. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  75. echo \'# fastboot protocol on maguro/toro (Galaxy Nexus)\' >> /etc/udev/rules.d/51-android.rules
  76. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  77. echo \'# adb protocol on panda (PandaBoard)\' >> /etc/udev/rules.d/51-android.rules
  78. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  79. echo \'# adb protocol on panda (PandaBoard ES)\' >> /etc/udev/rules.d/51-android.rules
  80. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  81. echo \'# fastboot protocol on panda (PandaBoard)\' >> /etc/udev/rules.d/51-android.rules
  82. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  83. echo \'# usbboot protocol on panda (PandaBoard)\' >> /etc/udev/rules.d/51-android.rules
  84. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  85. echo \'# usbboot protocol on panda (PandaBoard ES)\' >> /etc/udev/rules.d/51-android.rules
  86. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  87. echo \'# adb protocol on grouper/tilapia (Nexus 7)\' >> /etc/udev/rules.d/51-android.rules
  88. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  89. echo \'# fastboot protocol on grouper/tilapia (Nexus 7)\' >> /etc/udev/rules.d/51-android.rules
  90. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  91. echo \'# adb protocol on manta (Nexus 10)\' >> /etc/udev/rules.d/51-android.rules
  92. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  93. echo \'# fastboot protocol on manta (Nexus 10)\' >> /etc/udev/rules.d/51-android.rules
  94. echo \'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="\'$USER\'"\' >> /etc/udev/rules.d/51-android.rules
  95. echo \'\'
  96. echo "Downloading and Configuring Android SDK!!"
  97. echo "Making sure unzip is installed"
  98. echo \'\'
  99. echo \'-Preparing for Android SDK\'
  100. sudo apt-get install unzip $PARAM
  101. if [ `getconf LONG_BIT` = "64" ]
  102. then
  103.         echo
  104.         echo "Downloading 64 bit Android SDK"
  105.         wget http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20140702.zip
  106.         echo "Extracting"
  107.         mkdir ~/adt-bundle
  108.         mv adt-bundle-linux-x86_64-20140702.zip ~/adt-bundle/adt_x64.zip
  109.         cd ~/adt-bundle
  110.         unzip adt_x64.zip
  111.         mv -f adt-bundle-linux-x86_64-20140702/* .
  112.         echo "Configuring environment"
  113.         echo -e \'\\n# Android tools\\nexport PATH=${PATH}:~/adt-bundle/sdk/tools\\nexport PATH=${PATH}:~/adt-bundle/sdk/platform-tools\\nexport PATH=${PATH}:~/bin\' >> ~/.bashrc
  114.         echo -e \'\\nPATH="$HOME/adt-bundle/sdk/tools:$HOME/adt-bundle/sdk/platform-tools:$PATH"\' >> ~/.profile
  115.         echo "Making shortcuts"
  116.         ln -s ~/adt-bundle/eclipse/eclipse ~/Desktop/Eclipse
  117.         ln -s ~/adt-bundle/sdk/tools/android ~/Desktop/SDK-Manager
  118.         echo "Done"
  119. else
  120.  
  121.         echo
  122.         echo "Downloading 32 bit Android SDK"
  123.         wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20140702.zip
  124.         echo "Download Complete!!"
  125.         echo "Extracting"
  126.         mkdir ~/adt-bundle
  127.         mv adt-bundle-linux-x86-20140702.zip ~/adt-bundle/adt_x86.zip
  128.         cd ~/adt-bundle
  129.         unzip adt_x86.zip
  130.         mv -f adt-bundle-linux-x86_64-20140702/* .
  131.         echo "Configuring environment"
  132.         echo -e \'\\n# Android tools\\nexport PATH=${PATH}:~/adt-bundle/sdk/tools\\nexport PATH=${PATH}:~/adt-bundle/sdk/platform-tools\\nexport PATH=${PATH}:~/bin\' >> ~/.bashrc
  133.         echo -e \'\\nPATH="$HOME/adt-bundle/sdk/tools:$HOME/adt-bundle/sdk/platform-tools:$PATH"\' >> ~/.profile
  134.         echo "Making shortcuts"
  135.         ln -s ~/adt-bundle/eclipse/eclipse ~/Desktop/Eclipse
  136.         ln -s ~/adt-bundle/sdk/tools/android ~/Desktop/SDK-Manager
  137.         echo "Done"
  138. fi
  139. echo \'Installing DSIXDA Android Kitchen\'
  140. echo \'\'
  141. cd ~/Downloads
  142. wget https://github.com/dsixda/Android-Kitchen/archive/master.zip
  143. unzip master.zip
  144. mv -f Android-Kitchen-master ~/Android-Kitchen
  145. echo -e \'\\n#!/bin/bash\\ncd ~/Android-Kitchen\\n./menu\' >> ~/Android-Kitchen/kitchen
  146. chmod 755 ~/Android-Kitchen/kitchen
  147. ln -s ~/Android-Kitchen/kitchen ~/bin/kitchen
  148. ln -s ~/Android-Kitchen/kitchen ~/Desktop/Android-Kitchen
  149. echo \'Done\'
  150. echo \'Making "bin" directory and adding path...\'
  151. mkdir /bin
  152. PATH=/bin:$PATH
  153. echo \'Downloading...\'
  154. echo \'\'
  155. curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo
  156. echo \'Setting permissions...\'
  157. chmod a+x /bin/repo
  158. echo \'Script Done!\'
  159. echo "Now to copy these lines into your .bashrc"
  160. echo \'JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64\' >> ~/.bashrc
  161. echo \'export JAVA_HOME\' >> ~/.bashrc
  162. echo \'export USE_CCACHE=1\' >> ~/.bashrc
  163. echo \'export CCACHE_NLEVELS=4\' >> ~/.bashrc
  164. echo \'env PATH=$PATH\' >> ~/.bashrc
  165. echo "Now just double-check to make sure there aren\'t any duplicates"
  166. gedit ~/.bashrc
  167. echo \'\'
  168. echo \'All DONE!!\'
');