From 435282667420c37f9ea36dfbfea5314542dbd726 Mon Sep 17 00:00:00 2001 From: Conor Gilsenan Date: Fri, 8 May 2020 14:20:19 -0700 Subject: [PATCH 1/3] Remove unused JD-GUI --- Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 319697d..a35c42a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,6 @@ RUN apt-get update && apt-get install -y \ unzip \ p7zip-full; -ENV JD_VERSION "1.4.0" -#ENV JD_VERSION "1.6.6" ENV JD_CLI_VERSION "0.9.1.Final" # ENV JD_CLI_VERSION "1.0.1.Final" @@ -22,9 +20,6 @@ RUN wget -q -O "dex2jar-2.1.zip" https://github.com/pxb1988/dex2jar/files/186756 && rm -f dex2jar-2.1.zip ENV PATH $PATH:/opt/dex-tools-2.1-SNAPSHOT -# JD-GUI -RUN wget -q -O "jd-gui.jar" "https://github.com/java-decompiler/jd-gui/releases/download/v$JD_VERSION/jd-gui-$JD_VERSION.jar" - # JD-CLI RUN wget -q -O "jd-cli.zip" "https://github.com/kwart/jd-cmd/releases/download/jd-cmd-$JD_CLI_VERSION/jd-cli-$JD_CLI_VERSION-dist.zip" RUN unzip jd-cli.zip From c5d38d537d76f0e8df117f38c065c60f96dd79fa Mon Sep 17 00:00:00 2001 From: Conor Gilsenan Date: Fri, 8 May 2020 14:20:44 -0700 Subject: [PATCH 2/3] Upgrade JD_CLI_VERSION to 1.0.1.Final --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a35c42a..363d33d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,7 @@ RUN apt-get update && apt-get install -y \ unzip \ p7zip-full; -ENV JD_CLI_VERSION "0.9.1.Final" -# ENV JD_CLI_VERSION "1.0.1.Final" +ENV JD_CLI_VERSION "1.0.1.Final" RUN mkdir -p /opt WORKDIR /opt From 6949d9141e72c90a89f4aedadd8f5b1753eb0052 Mon Sep 17 00:00:00 2001 From: Conor Gilsenan Date: Fri, 8 May 2020 14:23:16 -0700 Subject: [PATCH 3/3] Improve readability --- extract.sh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/extract.sh b/extract.sh index 31263f7..5aa8136 100644 --- a/extract.sh +++ b/extract.sh @@ -1,9 +1,9 @@ #!/bin/sh -# check that 7z is installed +# Verify that 7z is installed command -v 7z >/dev/null 2>&1 || { echo >&2 "This script requires 7z. Aborting."; exit 1; } -jdgui="/opt/jd-cli" +jd="/opt/jd-cli" dex2jar="/opt/dex-tools-2.1-SNAPSHOT/d2j-dex2jar.sh" if [ $# -eq 0 ] @@ -12,25 +12,20 @@ if [ $# -eq 0 ] exit 1 fi -# extracting the apk +# Extract the apk echo "apk file: $1" DIRECTORY=$(dirname ${1}) FILE=$(basename ${1}) -echo "Creating directory $FILE.files" -# echo "mkdir $1.files" +echo "[7z] Extracting apk files to: $1.files/" mkdir $1.files - -echo "Extracting apk to $1.files/" 7z x $1 -o$1.files/ -echo "Generating $FILE.jar in $1.files/" -# echo "$dex2jar $dexfile -o $1.files/$FILE.jar" +echo "[dex2jar] Creating temporary .jar file" $dex2jar $1 -o $FILE.jar -echo "Opening jd-gui with .jar file" -# echo "$jdgui $1.files/$FILE.jar" -$jdgui -od $1.src $FILE.jar 2> /dev/null +echo "[jd-cli] Extracting source files to: $1.src/" +$jd --outputDir $1.src $FILE.jar 2> /dev/null -echo "Removing created .jar file" +echo "Removing temporary .jar file" rm $FILE.jar