diff --git a/OS X/installAll-10.11.sh b/OS X/installAll-10.11.sh index c305070..b3da608 100644 --- a/OS X/installAll-10.11.sh +++ b/OS X/installAll-10.11.sh @@ -5,4 +5,6 @@ preInstallationLog "Transmission" brew install transmission -postInstallationLog "Transmission" \ No newline at end of file +postInstallationLog "Transmission" + +logInfo "Download Mac Fans Control from: http://www.crystalidea.com/macs-fan-control" \ No newline at end of file diff --git a/README.md b/README.md index 5b37198..7f3a670 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,9 @@ With a little of your interaction, EFU will: - Create a directories tree under ~/Coding for coders. - Install (and setup) many software: - Android + - [ClassyShark](https://github.com/google/android-classyshark/) + - [Dex2Jar](https://github.com/pxb1988/dex2jar) + - [Pidcat](https://github.com/JakeWharton/pidcat) - Ant - Gimp - GIT diff --git a/createDirectoriesTree.sh b/createDirectoriesTree.sh index 809ffcf..42260ab 100644 --- a/createDirectoriesTree.sh +++ b/createDirectoriesTree.sh @@ -10,6 +10,7 @@ cd Coding mkdir IDEs mkdir xDKs mkdir servers +mkdir tools mkdir workspace-mine mkdir workspace-test mkdir workspace-work diff --git a/functions.sh b/functions.sh index 201a39b..0f9795a 100644 --- a/functions.sh +++ b/functions.sh @@ -111,14 +111,22 @@ downloadAndUncompress() { # Get file name from path or URL. FILE_NAME=$(getFileName "$2") && + uncompress "$FILE_NAME" +} + +## Parameters: +# 1. File name (without path). +uncompress(){ + log "Uncompressing $1" + # Use the file extension to use unzip or tar to uncompress the file. - if [ "$(getFileExtension "$FILE_NAME")" = "zip" ]; then - unzip "$FILE_NAME" + if [ "$(getFileExtension "$1")" = "zip" ]; then + unzip "$1" else - tar -zxf "$FILE_NAME" + tar -zxf "$1" fi - echo "$1 uncompressed successfully." + log "$1 uncompressed successfully." } addToShell() { @@ -131,4 +139,16 @@ addToShell() { echo "$1" >> ~/.zshrc && . ~/.zshrc fi +} + +## Parameters: +# 1. String w/ format: "repoOwner/repoName" +getGitHubFirstAssetFromLatestRelease(){ + curl -s https://api.github.com/repos/"$1"/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4 +} + +## Parameters: +# 1. Url to the browser download url. +downloadAssetFromGitHub(){ + curl -LOk "$1" } \ No newline at end of file diff --git a/modules/android.sh b/modules/android.sh index 907dba2..db53eaa 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -34,4 +34,58 @@ addToShell 'export PATH=$ANDROID_HOME/platform-tools:$PATH' # This is to be able to use the hierarchy viewer addToShell "export ANDROID_HVPROTO=ddm" -log "Successfully added Android environment variables." \ No newline at end of file +log "Successfully added Android environment variables." + + +preInstallationLog "Android utilities" + +preInstallationLog "Dex 2 Jar" +# https://github.com/pxb1988/dex2jar + +cd ~/Coding/tools/ +DEX2JAR_DOWNLOAD_URL=$(getGitHubFirstAssetFromLatestRelease "pxb1988/dex2jar") + +# Get file name from url. +FILE_NAME=$(getFileName "$DEX2JAR_DOWNLOAD_URL") && + +downloadAssetFromGitHub "$DEX2JAR_DOWNLOAD_URL" +uncompress "$FILE_NAME" + +DEX2JAR_DIRECTORY="dex2jar-$(getFileName "$(dirname "$DEX2JAR_DOWNLOAD_URL")")" +cd "$DEX2JAR_DIRECTORY" +chmod +x ./* +addToShell "alias d2j='~/Coding/tools/$DEX2JAR_DIRECTORY/d2j-dex2jar.sh'" + +echo "Usage: d2j-dex2jar.sh -f path/to/your-apk.apk" >> USAGE.txt +echo "More info at: https://github.com/pxb1988/dex2jar" >> USAGE.txt +logInfo "[Android Utilities]: 'd2j' alias created." +postInstallationLog "Dex 2 Jar" + + +preInstallationLog "ClassyShark" +# https://github.com/google/android-classyshark/ + +cd ~/Coding/tools/ +mkdir classyshark +cd classyshark +downloadAssetFromGitHub "$(getGitHubFirstAssetFromLatestRelease "google/android-classyshark")" +addToShell "alias classyshark='java -jar ~/Coding/tools/classyshark/ClassyShark.jar &'" +logInfo "[Android Utilities]: 'classyshark' alias created." +postInstallationLog "ClassyShark" + + +preInstallationLog "Pidcat Android Logcat decorator" +# https://github.com/JakeWharton/pidcat + +if [ "$(isUbuntu "$PLATFORM")" ]; then + cd ~/Coding/tools/ + curl -H "Accept: application/vnd.github.v3.raw" \ + -LO https://api.github.com/repos/JakeWharton/pidcat/contents/pidcat.py + addToShell "alias pidcat='python ~/Coding/tools/pidcat.py'" +else + brew install pidcat +fi +logInfo "[Android Utilities]: run 'pidcat your.application.package' to see an improved logcat. More info at https://github.com/JakeWharton/pidcat" +postInstallationLog "Pidcat Android Logcat decorator" + +postInstallationLog "Android utilities" \ No newline at end of file