From fed20c66095126464ae3a46020e87b8271a232f6 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 9 Apr 2016 15:27:51 -0300 Subject: [PATCH 1/9] Add Mac Fans Control download link. closes #37 --- OS X/installAll-10.11.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 From 35d5ab7f5da58aa43c0a87e8c8ad6d0812d9f5e6 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 00:15:00 -0300 Subject: [PATCH 2/9] Add ClassyShark Android utility for all platforms --- createDirectoriesTree.sh | 1 + functions.sh | 28 ++++++++++++++++++++++++---- modules/android.sh | 18 +++++++++++++++++- 3 files changed, 42 insertions(+), 5 deletions(-) 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..4b74c73 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(){ + echo $(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..1b060c9 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -34,4 +34,20 @@ 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 "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" + +postInstallationLog "Android utilities" \ No newline at end of file From 2a2ee6c7562dd8ce8050113f11d92a07802d8a81 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 00:16:24 -0300 Subject: [PATCH 3/9] Add Pidcat for iOS platform. Starts with #38 --- modules/android.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/android.sh b/modules/android.sh index 1b060c9..a7fa643 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -50,4 +50,14 @@ addToShell "alias classyshark='java -jar ~/Coding/tools/classyshark/ClassyShark. logInfo "[Android Utilities]: 'classyshark' alias created." postInstallationLog "ClassyShark" + +if [ "$(isOsx "$PLATFORM")" ]; then + preInstallationLog "Pidcat Android Logcat decorator" + # https://github.com/JakeWharton/pidcat + + brew install pidcat + 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" +fi + postInstallationLog "Android utilities" \ No newline at end of file From 739002d71f49a98865ff7f671594d3cdf72778a5 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 00:37:59 -0300 Subject: [PATCH 4/9] Fix lint issues. --- functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.sh b/functions.sh index 4b74c73..822a65c 100644 --- a/functions.sh +++ b/functions.sh @@ -144,11 +144,11 @@ addToShell() { ## Parameters: # 1. String w/ format: "repoOwner/repoName" getGitHubFirstAssetFromLatestRelease(){ - echo $(curl -s https://api.github.com/repos/$1/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4) + echo $(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 + curl -LOk "$1" } \ No newline at end of file From c5f5ae0668e60b16631b460ef65caab0bf7d501b Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 00:38:15 -0300 Subject: [PATCH 5/9] Add Dex2Jar Android utility for any platform. closes #39 --- modules/android.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/android.sh b/modules/android.sh index 1b060c9..36cd21f 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -39,6 +39,29 @@ 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/ From cc797e390763b53ba31a25265827b8013683fda4 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 00:41:42 -0300 Subject: [PATCH 6/9] Update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5b37198..f9a16f8 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ 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) - Ant - Gimp - GIT From 7b70a4f033f7eacaeef576e96e39d7530a21204c Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 00:42:26 -0300 Subject: [PATCH 7/9] Add Pidcat to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f9a16f8..7f3a670 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ With a little of your interaction, EFU will: - Android - [ClassyShark](https://github.com/google/android-classyshark/) - [Dex2Jar](https://github.com/pxb1988/dex2jar) + - [Pidcat](https://github.com/JakeWharton/pidcat) - Ant - Gimp - GIT From 4c35408a3c4764452c91250a4f2d8eeeb988c37e Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 14:59:22 -0300 Subject: [PATCH 8/9] Install Pidcat for Ubuntu platform too. closes #38 --- modules/android.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/android.sh b/modules/android.sh index e8cb07c..459f716 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -74,13 +74,18 @@ logInfo "[Android Utilities]: 'classyshark' alias created." postInstallationLog "ClassyShark" -if [ "$(isOsx "$PLATFORM")" ]; then - preInstallationLog "Pidcat Android Logcat decorator" - # https://github.com/JakeWharton/pidcat +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 - 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" 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 From 52719560a6da0d430e90f2932273a1f7a4a110e3 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 16 Apr 2016 15:46:39 -0300 Subject: [PATCH 9/9] Fix lint issues. --- functions.sh | 2 +- modules/android.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/functions.sh b/functions.sh index 822a65c..0f9795a 100644 --- a/functions.sh +++ b/functions.sh @@ -144,7 +144,7 @@ addToShell() { ## Parameters: # 1. String w/ format: "repoOwner/repoName" getGitHubFirstAssetFromLatestRelease(){ - echo $(curl -s https://api.github.com/repos/"$1"/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4) + curl -s https://api.github.com/repos/"$1"/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4 } ## Parameters: diff --git a/modules/android.sh b/modules/android.sh index 459f716..db53eaa 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -51,9 +51,9 @@ FILE_NAME=$(getFileName "$DEX2JAR_DOWNLOAD_URL") && downloadAssetFromGitHub "$DEX2JAR_DOWNLOAD_URL" uncompress "$FILE_NAME" -DEX2JAR_DIRECTORY="dex2jar-$(getFileName $(dirname "$DEX2JAR_DOWNLOAD_URL"))" +DEX2JAR_DIRECTORY="dex2jar-$(getFileName "$(dirname "$DEX2JAR_DOWNLOAD_URL")")" cd "$DEX2JAR_DIRECTORY" -chmod +x * +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