Repository: MasonLiuChn/DecompileApk
Branch: master
Commit: 0412aae59292
Files: 83
Total size: 10.6 MB
Directory structure:
gitextract_gg7jn8p8/
├── .gitignore
├── DecompileApk.iml
├── README.md
├── app/
│ ├── build.gradle
│ ├── doc/
│ │ └── test.apk
│ ├── libs/
│ │ ├── jcommander.jar
│ │ └── zip4j_1.3.2.jar
│ ├── runLibs/
│ │ ├── GetApkInfo_bihe0832.jar
│ │ ├── apksigner_xyc000.jar
│ │ ├── apktool_2.3.4.jar
│ │ ├── axmlprinter-0.1.7.jar
│ │ ├── dex-method-counts.jar
│ │ ├── dex-tools-2.1-SNAPSHOT/
│ │ │ ├── LICENSE.txt
│ │ │ ├── NOTICE.txt
│ │ │ ├── bin/
│ │ │ │ ├── dex-tools
│ │ │ │ └── dex-tools.bat
│ │ │ ├── d2j-apk-sign.bat
│ │ │ ├── d2j-apk-sign.sh
│ │ │ ├── d2j-asm-verify.bat
│ │ │ ├── d2j-asm-verify.sh
│ │ │ ├── d2j-baksmali.bat
│ │ │ ├── d2j-baksmali.sh
│ │ │ ├── d2j-class-version-switch.bat
│ │ │ ├── d2j-class-version-switch.sh
│ │ │ ├── d2j-decrypt-string.bat
│ │ │ ├── d2j-decrypt-string.sh
│ │ │ ├── d2j-dex-recompute-checksum.bat
│ │ │ ├── d2j-dex-recompute-checksum.sh
│ │ │ ├── d2j-dex-weaver.bat
│ │ │ ├── d2j-dex-weaver.sh
│ │ │ ├── d2j-dex2jar.bat
│ │ │ ├── d2j-dex2jar.sh
│ │ │ ├── d2j-dex2smali.bat
│ │ │ ├── d2j-dex2smali.sh
│ │ │ ├── d2j-jar-access.bat
│ │ │ ├── d2j-jar-access.sh
│ │ │ ├── d2j-jar-weaver.bat
│ │ │ ├── d2j-jar-weaver.sh
│ │ │ ├── d2j-jar2dex.bat
│ │ │ ├── d2j-jar2dex.sh
│ │ │ ├── d2j-jar2jasmin.bat
│ │ │ ├── d2j-jar2jasmin.sh
│ │ │ ├── d2j-jasmin2jar.bat
│ │ │ ├── d2j-jasmin2jar.sh
│ │ │ ├── d2j-smali.bat
│ │ │ ├── d2j-smali.sh
│ │ │ ├── d2j-std-apk.bat
│ │ │ ├── d2j-std-apk.sh
│ │ │ ├── d2j_invoke.bat
│ │ │ ├── d2j_invoke.sh
│ │ │ └── lib/
│ │ │ ├── ST4-4.0.8.jar
│ │ │ ├── antlr-3.5.2.jar
│ │ │ ├── antlr-runtime-3.5.2.jar
│ │ │ ├── antlr4-4.5.jar
│ │ │ ├── antlr4-runtime-4.5.jar
│ │ │ ├── asm-debug-all-5.0.3.jar
│ │ │ ├── d2j-base-cmd-2.1-SNAPSHOT.jar
│ │ │ ├── d2j-jasmin-2.1-SNAPSHOT.jar
│ │ │ ├── d2j-smali-2.1-SNAPSHOT.jar
│ │ │ ├── dex-ir-2.1-SNAPSHOT.jar
│ │ │ ├── dex-reader-2.1-SNAPSHOT.jar
│ │ │ ├── dex-reader-api-2.1-SNAPSHOT.jar
│ │ │ ├── dex-tools-2.1-SNAPSHOT.jar
│ │ │ ├── dex-translator-2.1-SNAPSHOT.jar
│ │ │ ├── dex-writer-2.1-SNAPSHOT.jar
│ │ │ ├── dx-23.0.0.jar
│ │ │ ├── open-source-license.txt
│ │ │ └── org.abego.treelayout.core-1.0.1.jar
│ │ └── jd-ui.cfg
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── masonliu/
│ └── decompileapk/
│ ├── Main.java
│ ├── MyJCommander.java
│ ├── Result.java
│ └── util/
│ ├── FileUtil.java
│ ├── MyRuntime.java
│ ├── StringUtil.java
│ └── ZipUtil.java
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.iml
.gradle
.idea
.DS_Store
build
local
local.properties
commit.js
commit.sh
decompile_*
================================================
FILE: DecompileApk.iml
================================================
================================================
FILE: README.md
================================================
# DecompileApk
download decompileapk.zip and unzip
decompileapk.zip:https://github.com/MasonLiuChn/DecompileApk/blob/master/app/doc/decompileapk.zip
### Feature 1
it can output dex,jar,smali,xml,AndroidManifest.xml,res,sign,version,packageName.
```java
java -jar decompileapk.jar -apk xx.apk
```
### Feature 2
recreate apk.
```java
java -jar decompileapk.jar -b -out
```
### Feature 3
output dex method counts.
```java
java -jar decompileapk.jar -c -apk xx.apk
```
-----
Blog:http://blog.csdn.net/masonblog
Email:MasonLiuChn@gmail.com
================================================
FILE: app/build.gradle
================================================
apply plugin: 'java'
apply plugin: 'kotlin'
/** 执行java工程(方法一)./gradlew run -PappArgs="['-h']"
**/
ext {
defMainClassName = "com.masonliu.decompileapk.Main"
}
apply plugin: 'application'
run {
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}
mainClassName = project.hasProperty("mainClass") ? project.getProperty("mainClass") : project.ext.defMainClassName
}
defaultTasks 'run'
/** 执行java工程(方法二) ./gradlew runApp -PmainClass="com.masonliu.wanfo.xuefo.TestCollector"
**/
task runApp(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "com.masonliu.decompileapk.Main"
}
/** 打jar包 ./gradlew jar -PmainClass="com.masonliu.decompileapk.Main"
* 其他打包方法 链接:https://www.jianshu.com/p/5bb1e87df15f
另一种方法:application插件
apply plugin: 'application'
mainClassName = appMainClass
执行命令gradle build或者./gradlew build,查看build/distributions会有两个压缩文件,压缩文件包含了两个文件夹,bin为启动脚本,lib则是软件jar包和依赖。还可以执行./gradlew installDist生成未压缩文件目录build/install。
**/
jar {
from {
//添加依懒到打包文件
//configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtime.collect { zipTree(it) }
}
mainClassName = project.hasProperty("mainClass") ? project.getProperty("mainClass") : project.ext.defMainClassName
manifest {
attributes 'Main-Class': mainClassName
}
}
/** 执行jar包 ./gradlew runJar -PappArgs="['-u', 'myuser', 'some other argument', 'and/a/path']"
* 例如:./gradlew runJar -PappArgs="['-apk','doc/test.apk']"
**/
task runJar(type: Exec) {
def myArgs = ["java", "-jar", "${project.buildDir}/libs/app.jar"]
if (project.hasProperty("appArgs")) {
def args = Eval.me(appArgs)
myArgs.addAll(args)
}
commandLine myArgs
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
//compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
mavenCentral()
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
================================================
FILE: app/runLibs/apktool_2.3.4.jar
================================================
[File too large to display: 10.5 MB]
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/LICENSE.txt
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/NOTICE.txt
================================================
dex2jar - Tools to work with android .dex and java .class files
Copyright (c) 2009-2014 Panxiaobo
contributors
- Bob Pan
- Enea Stanzani
- t3stwhat
- paulhooijenga
- yyjdelete
- jcmdev0
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/bin/dex-tools
================================================
#!/usr/bin/env sh
##############################################################################
##
## dex-tools start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/.." >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="dex-tools"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and DEX_TOOLS_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/lib/ST4-4.0.8.jar:$APP_HOME/lib/org.abego.treelayout.core-1.0.1.jar:$APP_HOME/lib/antlr4-runtime-4.5.jar:$APP_HOME/lib/d2j-smali-2.1-SNAPSHOT.jar:$APP_HOME/lib/dex-writer-2.1-SNAPSHOT.jar:$APP_HOME/lib/antlr-runtime-3.5.2.jar:$APP_HOME/lib/asm-debug-all-5.0.3.jar:$APP_HOME/lib/dex-translator-2.1-SNAPSHOT.jar:$APP_HOME/lib/dex-reader-2.1-SNAPSHOT.jar:$APP_HOME/lib/dx-23.0.0.jar:$APP_HOME/lib/dex-reader-api-2.1-SNAPSHOT.jar:$APP_HOME/lib/antlr4-4.5.jar:$APP_HOME/lib/dex-tools-2.1-SNAPSHOT.jar:$APP_HOME/lib/d2j-jasmin-2.1-SNAPSHOT.jar:$APP_HOME/lib/dex-ir-2.1-SNAPSHOT.jar:$APP_HOME/lib/d2j-base-cmd-2.1-SNAPSHOT.jar:$APP_HOME/lib/antlr-3.5.2.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $DEX_TOOLS_OPTS -classpath "\"$CLASSPATH\"" com.googlecode.dex2jar.tools.BaseCmd "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/bin/dex-tools.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem dex-tools startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..
@rem Add default JVM options here. You can also use JAVA_OPTS and DEX_TOOLS_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\lib\ST4-4.0.8.jar;%APP_HOME%\lib\org.abego.treelayout.core-1.0.1.jar;%APP_HOME%\lib\antlr4-runtime-4.5.jar;%APP_HOME%\lib\d2j-smali-2.1-SNAPSHOT.jar;%APP_HOME%\lib\dex-writer-2.1-SNAPSHOT.jar;%APP_HOME%\lib\antlr-runtime-3.5.2.jar;%APP_HOME%\lib\asm-debug-all-5.0.3.jar;%APP_HOME%\lib\dex-translator-2.1-SNAPSHOT.jar;%APP_HOME%\lib\dex-reader-2.1-SNAPSHOT.jar;%APP_HOME%\lib\dx-23.0.0.jar;%APP_HOME%\lib\dex-reader-api-2.1-SNAPSHOT.jar;%APP_HOME%\lib\antlr4-4.5.jar;%APP_HOME%\lib\dex-tools-2.1-SNAPSHOT.jar;%APP_HOME%\lib\d2j-jasmin-2.1-SNAPSHOT.jar;%APP_HOME%\lib\dex-ir-2.1-SNAPSHOT.jar;%APP_HOME%\lib\d2j-base-cmd-2.1-SNAPSHOT.jar;%APP_HOME%\lib\antlr-3.5.2.jar
@rem Execute dex-tools
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %DEX_TOOLS_OPTS% -classpath "%CLASSPATH%" com.googlecode.dex2jar.tools.BaseCmd %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable DEX_TOOLS_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%DEX_TOOLS_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-apk-sign.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.ApkSign %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-apk-sign.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.ApkSign" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-asm-verify.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.AsmVerify %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-asm-verify.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.AsmVerify" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-baksmali.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.d2j.smali.BaksmaliCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-baksmali.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.d2j.smali.BaksmaliCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-class-version-switch.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.ClassVersionSwitch %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-class-version-switch.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.ClassVersionSwitch" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-decrypt-string.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.DecryptStringCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-decrypt-string.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.DecryptStringCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex-recompute-checksum.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.DexRecomputeChecksum %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex-recompute-checksum.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.DexRecomputeChecksum" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex-weaver.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.DexWeaverCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex-weaver.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.DexWeaverCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex2jar.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.Dex2jarCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex2jar.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex2smali.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.d2j.smali.BaksmaliCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-dex2smali.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.d2j.smali.BaksmaliCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar-access.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.JarAccessCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar-access.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.JarAccessCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar-weaver.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.JarWeaverCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar-weaver.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.JarWeaverCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar2dex.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.Jar2Dex %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar2dex.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Jar2Dex" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar2jasmin.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.d2j.jasmin.Jar2JasminCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jar2jasmin.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.d2j.jasmin.Jar2JasminCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jasmin2jar.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.d2j.jasmin.Jasmin2JarCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-jasmin2jar.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.d2j.jasmin.Jasmin2JarCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-smali.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.d2j.smali.SmaliCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-smali.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.d2j.smali.SmaliCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-std-apk.bat
================================================
@echo off
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2013 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM call d2j_invoke.bat to setup java environment
@"%~dp0d2j_invoke.bat" com.googlecode.dex2jar.tools.StdApkCmd %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j-std-apk.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.StdApkCmd" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j_invoke.bat
================================================
@echo off
REM better invocation scripts for windows from lanchon, release in public domain. thanks!
REM https://code.google.com/p/dex2jar/issues/detail?id=192
setlocal enabledelayedexpansion
set LIB=%~dp0lib
set CP=
for %%X in ("%LIB%"\*.jar) do (
set CP=!CP!%%X;
)
java -Xms512m -Xmx1024m -cp "%CP%" %*
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/d2j_invoke.sh
================================================
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "$@"
================================================
FILE: app/runLibs/dex-tools-2.1-SNAPSHOT/lib/open-source-license.txt
================================================
==== dx-*.jar
Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html
==== antlr-*.jar
[The BSD License]
Copyright (c) 2003-2007, Terence Parr
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
==== asm-*.jar
ASM: a very small and fast Java bytecode manipulation framework
Copyright (c) 2000-2005 INRIA, France Telecom
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: app/runLibs/jd-ui.cfg
================================================
[Manifest]
Version=2
[GUI]
MainWindowPosition=229,233 1053x717
[RecentFiles]
Path0=D:\\Project\\AS_MY\\DecompileApk\\app\\build\\output\\decompile_1560837967624\\classes_dex2jar.jar
Path1=D:\\Project\\AS_MY\\DecompileApk\\app\\decompile_1560417853633\\classes_dex2jar.jar
Path2=D:\\Project\\AS_MY\\DecompileApk\\app\\build_decompile_1560417770280\\classes_dex2jar.jar
Path3=D:\\Project\\AS_MY\\DecompileApk\\app\\decompile1560417427517\\classes_dex2jar.jar
Path4=D:\\Project\\AS_MY\\DecompileApk\\app\\decompile1560417284860\\classes_dex2jar.jar
Path5=D:\\Project\\AS_MY\\DecompileApk\\app\\decompile1560416939352\\classes_dex2jar.jar
Path6=D:\\Project\\AS_MY\\DecompileApk\\app\\build\\output\\decompile1560416510138\\classes_dex2jar.jar
Path7=D:\\Project\\AS_MY\\DecompileApk\\app\\build\\output\\decompile1560415873548\\classes_dex2jar.jar
Path8=D:\\Project\\AS_MY\\DecompileApk\\app\\build\\output\\decompile1560415315376\\classes_dex2jar.jar
Path9=D:\\Project\\AS_MY\\DecompileApk\\app\\build\\output\\decompile1560415265442\\classes_dex2jar.jar
================================================
FILE: app/src/main/java/com/masonliu/decompileapk/Main.java
================================================
package com.masonliu.decompileapk;
import com.masonliu.decompileapk.util.FileUtil;
import com.masonliu.decompileapk.util.MyRuntime;
import com.masonliu.decompileapk.util.StringUtil;
import com.masonliu.decompileapk.util.ZipUtil;
import java.io.File;
/**
* 混淆:
* !shrink
* !warning
* !optimize
* !com.mason.**
* keep attribute annotation
*
* @author liumeng
*/
public class Main {
public static void main(String[] args) {
String runtimeDir = System.getProperty("user.dir");
System.out.println("user.dir(当前命令行所在目录): " + runtimeDir);
String jarParentPath = "";
if (runInJar()) {
jarParentPath = jarParentPath();
} else {
jarParentPath = runtimeDir;
}
System.out.println("user.dir(当前class或jar所在目录): " + jarParentPath);
String apkPath = runtimeDir + "/doc/test.apk";
String outPath = runtimeDir + "/build/output";
boolean isLog = true;
boolean isBuild = false;
boolean isCount = false;
if (runInJar()) {
MyJCommander jct = new MyJCommander(args);
apkPath = jct.getApkPath();
outPath = jct.getOutPath();
isLog = jct.debug;
isBuild = jct.build;
isCount = jct.count;
}
MyRuntime myRuntime = MyRuntime.getMyRuntime();
myRuntime.changeDir(jarParentPath + "/runLibs/");
myRuntime.isLog = isLog;
System.out.println("********************************************************");
System.out.println("Processing...");
if (isBuild) {
recreateApk(myRuntime, outPath);
} else if (isCount) {
countMethodApk(myRuntime, apkPath);
} else {
decompileApk(myRuntime, apkPath, outPath);
}
System.out.println("Done!");
System.out.println("********************************************************");
}
public static void recreateApk(MyRuntime myRuntime, String apktoolOutput) {
System.out.println("Recreate apk...");
//重新打包
myRuntime.exec("java -jar apktool_2.0.0.3.jar b -f " + apktoolOutput);
System.out.println("Find apk in " + apktoolOutput + "/dist/");
System.out.println("The apk has no sign and no zipalign,please run 'jarsigner' and 'zipalign'.");
}
public static void countMethodApk(MyRuntime myRuntime, String apktoolOutput) {
myRuntime.isLog = true;
myRuntime.exec("java -jar dex-method-counts.jar " + apktoolOutput);
myRuntime.isLog = false;
}
public static void decompileApk(MyRuntime myRuntime, String apkPath, String outPath) {
outPath = outPath + "/decompile_" + System.currentTimeMillis();
try {
FileUtil.copy(apkPath, outPath + "/tem.apk");
//使用apktool反编译可以得到smali和反编译后的xml
myRuntime.exec("java -jar apktool_2.3.4.jar d " + outPath + "/tem.apk" + " -f -o " + outPath + "/apktool_output");
//apk直接转成jar
if (MyRuntime.isWindowsOS()) {
myRuntime.exec(myRuntime.pb.directory().getAbsolutePath() + "/dex-tools-2.1-SNAPSHOT/d2j-dex2jar.bat -f -o " + outPath + "/classes_dex2jar.jar " + outPath + "/tem.apk");
} else {
myRuntime.exec(myRuntime.pb.directory().getAbsolutePath() + "/dex-tools-2.1-SNAPSHOT/d2j-dex2jar.sh -f -o " + outPath + "/classes_dex2jar.jar " + outPath + "/tem.apk");
}
//检测签名
String signerLog = myRuntime.exec("java -jar apksigner_xyc000.jar verify -v --print-certs " + outPath + "/tem.apk");
StringUtil.string2File(signerLog, outPath + "/signlog.txt");
//unzip、反编译AndroidManifest(apktool反编译的不靠谱) 把 dex 和 AndroidManifest.xml copy到外边
ZipUtil.UnZip(new File(outPath + "/tem.apk"), outPath + "/apkunzip");
String trueAndroidManifest = myRuntime.exec("java -jar axmlprinter-0.1.7.jar " + outPath + "/apkunzip/AndroidManifest.xml");
StringUtil.string2File(trueAndroidManifest, outPath + "/AndroidManifest.xml");
FileUtil.copy(outPath + "/apkunzip/classes.dex", outPath + "/apktool_output/classes.dex");
FileUtil.delete(outPath + "/apkunzip");
//查看结果
Result.handleResult(new String[]{outPath + "/AndroidManifest.xml", outPath + "/signlog.txt"});
//删除签名信息临时文件
FileUtil.delete(outPath + "/signlog.txt");
//调用jd-ui
if (MyRuntime.isWindowsOS()) {
myRuntime.exec(myRuntime.pb.directory().getAbsolutePath() + "/jd-ui.exe " + outPath + "/classes_dex2jar.jar");
}
} catch (Exception e) {
e.printStackTrace();
}
}
private static boolean runInJar() {
return !System.getProperty("java.class.path").contains(";");
}
private static String jarParentPath() {
return new File(System.getProperty("java.class.path")).getParentFile().getAbsolutePath();
}
}
================================================
FILE: app/src/main/java/com/masonliu/decompileapk/MyJCommander.java
================================================
package com.masonliu.decompileapk;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.masonliu.decompileapk.util.StringUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class MyJCommander {
@Parameter
public List parameters = new ArrayList();
@Parameter(names = {"-v", "-debug", "-verbose"}, description = "Debug mode")
public boolean debug;
@Parameter(names = {"-h", "--h", "-help", "--help"}, description = "help")
public boolean help;
@Parameter(names = {"-b"}, description = "recreate apk")
public boolean build;
@Parameter(names = {"-c"}, description = "method counts")
public boolean count;
@Parameter(names = {"-apk"}, description = "apk path")
private String apkPath;
@Parameter(names = {"-out"}, description = "out path or apktool_output_path")
private String outPath;
public MyJCommander(String args[]) {
JCommander jc = new JCommander(this, args);
if (this.help) {
StringBuffer sb = new StringBuffer();
sb.append("\n");
sb.append("********************************************************\n");
sb.append("DecompileApk\n");
sb.append("DecompileApk_v2 a tool for decompiling Android apk files\n");
sb.append("Copyright 2014 Mason Liu \n");
sb.append("********************************************************\n");
jc.setProgramName(sb.toString());
jc.usage();
}
// if (parameters.size() > 0) {
// apkpath = parameters.get(0);
// apkpath = new File(apkpath).getAbsolutePath();
// } else {
// System.exit(0);
// }
//
// if (parameters.size() > 1) {
// output = parameters.get(1);
// }
// if (StringUtil.isBlank(output)) {
// output = System.getProperty("user.dir");
// }
// output = new File(output).getAbsolutePath();
}
public String getApkPath() {
if (StringUtil.isBlank(apkPath)) {
System.exit(0);
}
//new File会自动拼接当前命令行目录
return new File(apkPath).getAbsolutePath();
}
public String getOutPath() {
if (StringUtil.isBlank(outPath)) {
outPath = System.getProperty("user.dir");
}
//new File会自动拼接当前命令行目录
return new File(outPath).getAbsolutePath();
}
}
================================================
FILE: app/src/main/java/com/masonliu/decompileapk/Result.java
================================================
package com.masonliu.decompileapk;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Result {
public static void handleResult(String[] args) {
File file = new File(args[0]);
String a = file2String(file, "UTF-8");
System.out.println(pattern("android:versionCode=\"\\d*\"", a));
System.out.println(pattern("android:versionName=\"[\\S^\"]*\"", a));
System.out.println(pattern("package=\"[\\S^\"]*\"", a));
File file2 = new File(args[1]);
if (file2 == null) {
System.out.println("check sign failed!");
} else {
String d = file2String(file2, "UTF-8");
System.out.println(d);
}
}
private static String pattern(String b, String a) {
Pattern p2 = Pattern.compile(b);
Matcher m2 = p2.matcher(a);
while (m2.find()) {
String s0 = m2.group();
return s0;
}
return "";
}
public static String file2String(File file, String encoding) {
InputStreamReader reader = null;
StringWriter writer = new StringWriter();
try {
if (encoding == null || "".equals(encoding.trim())) {
reader = new InputStreamReader(new FileInputStream(file), encoding);
} else {
reader = new InputStreamReader(new FileInputStream(file));
}
char[] buffer = new char[2048];
int n = 0;
while (-1 != (n = reader.read(buffer))) {
writer.write(buffer, 0, n);
}
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if (reader != null)
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (writer != null)
return writer.toString();
else return null;
}
}
================================================
FILE: app/src/main/java/com/masonliu/decompileapk/util/FileUtil.java
================================================
package com.masonliu.decompileapk.util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author liumeng 新建文件、复制文件、文本文件字符集转换、查找指定字符串
*/
public class FileUtil {
private static List allDoc;
private static Map> allDocs = new HashMap<>();
public static boolean createNewDoc(String targetDocPath) {
File targetDocFile = new File(targetDocPath);
targetDocFile.delete();
try {
targetDocFile.createNewFile();
} catch (Exception e) {
try {
targetDocFile.getParentFile().mkdirs();
return targetDocFile.createNewFile();
} catch (Exception e1) {
e1.printStackTrace();
}
}
return false;
}
public static boolean createNewDir(String targetDirPath) {
File targetDirFile = new File(targetDirPath);
targetDirFile.delete();
return targetDirFile.mkdirs();
}
public static boolean rename(String source, String name) {
File sourceFile = new File(source);
String target = sourceFile.getParentFile().getAbsolutePath() + File.separator + name;
if (source.equals(target)) {
return false;
}
return move(source, target);
}
private static boolean copyFile(String sourceDocPath, String targetDocPath) {
File sourceDocFile = new File(sourceDocPath);
File targetDocFile = new File(targetDocPath);
if (!sourceDocFile.exists() || sourceDocFile.isDirectory())
return false;
FileUtil.createNewDoc(targetDocPath);
try {
// 新建文件输入流并对它进行缓冲
FileInputStream input = new FileInputStream(sourceDocFile);
BufferedInputStream inBuff = new BufferedInputStream(input);
// 新建文件输出流并对它进行缓冲
FileOutputStream output = new FileOutputStream(targetDocFile);
BufferedOutputStream outBuff = new BufferedOutputStream(output);
// 缓冲数组
byte[] b = new byte[1024 * 5];
int len;
while ((len = inBuff.read(b)) != -1) {
outBuff.write(b, 0, len);
}
// 刷新此缓冲的输出流
outBuff.flush();
// 关闭流
input.close();
inBuff.close();
output.close();
outBuff.close();
return true;
} catch (Exception e) {
return false;
}
}
private static boolean copyDirectiory(String sourceDirPath, String targetDirPath) {
File sourceDirFile = new File(sourceDirPath);
if (!sourceDirFile.exists())
return false;
FileUtil.delete(targetDirPath);
File[] files = sourceDirFile.listFiles();
if (files.length > 0) {
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()) {
String targetFilePath = targetDirPath + File.separator + files[i].getName();
copyFile(files[i].getAbsolutePath(), targetFilePath);
} else {
String dir1 = sourceDirPath + File.separator + files[i].getName();
String dir2 = targetDirPath + File.separator + files[i].getName();
copyDirectiory(dir1, dir2);
}
}
} else {
FileUtil.createNewDir(targetDirPath);
}
return true;
}
public static boolean copy(String source, String target) {
File sourceFile = new File(source);
if (!sourceFile.exists())
return false;
if (sourceFile.isDirectory()) {
return copyDirectiory(source, target);
} else {
return copyFile(source, target);
}
}
public static boolean delete(String source) {
File sourceFile = new File(source);
if (sourceFile.isDirectory()) {
for (File f : sourceFile.listFiles()) {
delete(f.getAbsolutePath());
}
}
return sourceFile.delete();
}
public static String findFile(String source, String fileName, boolean cache) {
if (allDocs.containsKey(source)) {
allDoc = allDocs.get(source);
} else {
allDoc = new ArrayList<>();
allDocs.put(source, allDoc);
}
if (!cache || allDoc.size() == 0) {
allDoc.clear();
findAllFile(allDoc, source);
}
for (String url : allDoc) {
if (url.endsWith("/" + fileName)) {
return url;
}
String tmp = "/" + fileName + "/";
if (url.contains(tmp)) {
return url.split(tmp)[0] + tmp;
}
}
return null;
}
public static void findAllFile(List allDoc, String source) {
File sourceFile = new File(source);
if (sourceFile.isDirectory()) {
for (File f : sourceFile.listFiles()) {
findAllFile(allDoc, f.getAbsolutePath());
}
} else {
allDoc.add(sourceFile.getAbsolutePath());
}
}
public static boolean move(String source, String target) {
File sourceFile = new File(source);
if (!sourceFile.exists() || new File(source).getAbsolutePath().equals(new File(target).getAbsolutePath()))
return false;
return copy(source, target) && delete(source);
}
public static String getDocFromDir(String sourceDir, String prefix) {
File sourceDirFile = new File(sourceDir);
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if (name.startsWith(prefix)) {
return true;
}
return false;
}
};
return sourceDirFile.listFiles(filter)[0].getAbsolutePath();
}
// 字符集转换问题
public static void convert(File file, final String posfix,
String oldEncoding, String newEncoding) {
File[] fileName = file.listFiles(new FileFilter() {
public boolean accept(File pathname) {
if (pathname.isDirectory()) {
return true;
}
if (pathname.getName().endsWith(posfix)) {
return true;
}
return false;
}
});
for (File ff : fileName) {
if (ff.isDirectory()) {
convert(ff, posfix, oldEncoding, newEncoding);
} else {
// File source = new File(ff.getParentFile().getAbsoluteFile() +
// "1.txt");
File temp = new File(ff.getAbsolutePath() + ".temp");
createNewDir(temp.getAbsolutePath());
fileIO(ff, getCharset(ff), temp, newEncoding);
ff.delete();
fileIO(temp, newEncoding, ff, newEncoding);
temp.delete();
}
}
}
public static void fileIO(File ff, String oldEncoding, File temp,
String newEncoding) {
FileInputStream fis = null;
FileOutputStream fos = null;
InputStreamReader isr = null;
OutputStreamWriter osw = null;
BufferedReader br = null;
BufferedWriter bw = null;
try {
fis = new FileInputStream(ff);
isr = new InputStreamReader(fis, oldEncoding);
br = new BufferedReader(isr);
fos = new FileOutputStream(temp);
osw = new OutputStreamWriter(fos, newEncoding);
PrintWriter pw = new PrintWriter(osw);
String str = null;
while ((str = br.readLine()) != null) {
// String s=null;
// if (str != null) {
// //用默认字符编码解码字符串。
// byte[] bs = str.getBytes(oldEncoding);
// //用新的字符编码生成字符串
// s= new String(bs, newEncoding);
// }
pw.println(str);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null)
try {
br.close();
} catch (IOException e) {
}
if (bw != null)
try {
bw.close();
} catch (IOException e) {
}
if (osw != null)
try {
osw.close();
} catch (IOException e) {
}
if (isr != null)
try {
isr.close();
} catch (IOException e) {
}
if (fos != null)
try {
fos.close();
} catch (IOException e) {
}
if (fis != null)
try {
fis.close();
} catch (IOException e) {
}
}
}
public static String getCharset(File file) {
String charset = "GBK";
byte[] first3Bytes = new byte[3];
try {
boolean checked = false;
BufferedInputStream bis = new BufferedInputStream(
new FileInputStream(file));
bis.mark(0);
int read = bis.read(first3Bytes, 0, 3);
if (read == -1)
return charset;
if (first3Bytes[0] == (byte) 0xFF && first3Bytes[1] == (byte) 0xFE) {
charset = "UTF-16LE";
checked = true;
} else if (first3Bytes[0] == (byte) 0xFE
&& first3Bytes[1] == (byte) 0xFF) {
charset = "UTF-16BE";
checked = true;
} else if (first3Bytes[0] == (byte) 0xEF
&& first3Bytes[1] == (byte) 0xBB
&& first3Bytes[2] == (byte) 0xBF) {
charset = "UTF-8";
checked = true;
}
bis.reset();
if (!checked) {
int loc = 0;
while ((read = bis.read()) != -1) {
loc++;
if (read >= 0xF0)
break;
// 单独出现BF以下的,也算是GBK
if (0x80 <= read && read <= 0xBF)
break;
if (0xC0 <= read && read <= 0xDF) {
read = bis.read();
if (0x80 <= read && read <= 0xBF)// 双字节 (0xC0 - 0xDF)
// (0x80 -
// 0xBF),也可能在GB编码内
continue;
else
break;
// 也有可能出错,但是几率较小
} else if (0xE0 <= read && read <= 0xEF) {
read = bis.read();
if (0x80 <= read && read <= 0xBF) {
read = bis.read();
if (0x80 <= read && read <= 0xBF) {
charset = "UTF-8";
break;
} else
break;
} else
break;
}
}
}
bis.close();
} catch (Exception e) {
e.printStackTrace();
}
return charset;
}
}
================================================
FILE: app/src/main/java/com/masonliu/decompileapk/util/MyRuntime.java
================================================
package com.masonliu.decompileapk.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
public class MyRuntime {
public static MyRuntime myRuntime;
public static boolean isLog = true;
public ProcessBuilder pb;
public MyRuntime() {
pb = new ProcessBuilder();
}
public static MyRuntime getMyRuntime() {
if (myRuntime == null) {
myRuntime = new MyRuntime();
}
return myRuntime;
}
public static boolean isWindowsOS() {
String osName = System.getProperty("os.name");
if (osName.toLowerCase().contains("win")) {
return true;
}
return false;
}
public String exec(String command) {
log("--------" + command + "--------");
String[] commands = command.split(" ");
for (int i = 0; i < commands.length; i++) {
commands[i] = commands[i].replace(" ", " ");
if (commands[i].startsWith("\"") || commands[i].startsWith("'")) {
commands[i] = commands[i].substring(1);
}
if (commands[i].endsWith("\"") || commands[i].endsWith("'")) {
commands[i] = commands[i].substring(0, commands[i].length() - 1);
}
}
String result = "";
try {
Process process = pb.redirectErrorStream(true).command(commands).start();
// new Thread(new Runnable() {
// @Override
// public void run() {
// try {
// BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
// String line;
// while ((line = in.readLine()) != null) {
// log(line);
// }
// in.close();
// }catch (Exception e){
// e.printStackTrace();
// }
//
// }
// }).start();
// //http://caiguangguang.blog.51cto.com/1652935/1352708
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
log(line);
result = result + line + "\n";
}
in.close();
// process.waitFor();
log("################################");
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public void changeDir(String path) {
pb.directory(new File(path));
}
public void log(String log) {
if (isLog)
System.out.println(log);
}
}
================================================
FILE: app/src/main/java/com/masonliu/decompileapk/util/StringUtil.java
================================================
package com.masonliu.decompileapk.util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtil {
/**
* 追加文件:使用FileWriter
*
* @param fileName
* @param content
*/
public static void string2fileAdd(String fileName, String content) {
string2fileAdd(fileName, content, "UTF-8");
}
public static void string2fileAdd(String fileName, String content, String encode) {
BufferedWriter writer = null;
try {
// 打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件
writer =
new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(fileName, true), encode));
writer.write(content + "\n");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
writer.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 是否有中文
*
* @param c
* @return
*/
public static boolean hasChinese(String c) {
for (int i = 0; i < c.length(); i++) {
int b = c.charAt(i);
if (b >= 0x4E00 && b <= 0x9FA5) {
return true;
}
}
return false;
}
public static boolean hasChinese2(String c) {
Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
Matcher m = p.matcher(c);
if (m.find()) {
return true;
}
return false;
}
/**
* 基本功能:过滤所有以"<"开头以">"结尾的标签
*
*
* @param str
* @return String
*/
public static String filterHtml(String str) {
if (StringUtil.isBlank(str))
return str;
Pattern pattern = Pattern.compile("<([^>]*)>");
Matcher matcher = pattern.matcher(str);
StringBuffer sb = new StringBuffer();
boolean result1 = matcher.find();
while (result1) {
matcher.appendReplacement(sb, "");
result1 = matcher.find();
}
matcher.appendTail(sb);
return sb.toString().replaceAll(" \\n *", "").replace("“", " ")
.replace("”", " ");
}
/**
* 去除字符串首尾的空白字符
*
* @param str
* @return
*/
public static String trim(String str) {
if (str == null || str.length() == 0) {
return str;
}
return str.trim();
}
/**
* 去除文字中的空白字符
*
* @param str
* @return
*/
public static String removeSpace(String str) {
if (str == null || str.length() == 0) {
return str;
}
return str.trim().replaceAll("\\s", "");
}
public static boolean isNotBlank(String str) {
return !isBlank(str);
}
public static boolean isBlank(String str) {
return str == null || str.length() == 0;
}
public static String MD5(String str) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(str.getBytes());
return toHex(messageDigest.digest()).substring(8, 24);
// 下边是替换移位处理
// if(s!=null){
// char[] a=s.toCharArray();
// char[] b=new char[a.length];
// a[4]='s';
// a[9]='t';
// a[24]='y';
// for(int i=0;i> 4, 16));
sb.append(Character.forDigit(buffer[i] & 15, 16));
}
return sb.toString();
}
/**
* web连接正则
*
* @return
*/
public static Pattern getWebPattern() {
Pattern webpattern = Pattern
.compile("http[s]*://[[[^/:]&&[a-zA-Z_0-9]]\\.]+(:\\d+)?(/[a-zA-Z_0-9]+)*(/[a-zA-Z_0-9]*([a-zA-Z_0-9]+\\.[a-zA-Z_0-9]+)*)?(\\?(&?[a-zA-Z_0-9]+=[%[a-zA-Z_0-9]-]*)*)*(#[[a-zA-Z_0-9]|-]+)?");
return webpattern;
}
/**
* web连接正则
*
* @return
*/
public static Pattern getMobilePattern() {
Pattern pattern = Pattern.compile("^1\\d{10}$");
return pattern;
}
/**
* "."匹配除line terminator以外的所有字符(未指定DOTALL时) 在指定DOTAll模式时"."匹配所有字符
*
* @(POST|GET).*?\\) ? 用于指定最小匹配
*/
public static String getPatternStr(String ori, String pat, int a, int b) {
if (StringUtil.isBlank(ori))
return null;
Pattern atPeoplePtn = Pattern.compile(pat, Pattern.DOTALL);
Matcher matcher = atPeoplePtn.matcher(ori);
while (matcher.find()) {
int i = matcher.start();
int j = matcher.end();
String id = ori.substring(i + a, j - b);
return id;
}
return null;
}
public static List getPatternStrs(String ori, String pat, int a, int b) {
if (StringUtil.isBlank(ori))
return null;
List s = new ArrayList<>();
Pattern atPeoplePtn = Pattern.compile(pat, Pattern.DOTALL);
Matcher matcher = atPeoplePtn.matcher(ori);
while (matcher.find()) {
int i = matcher.start();
int j = matcher.end();
String id = ori.substring(i + a, j - b);
s.add(id);
}
return s;
}
/**
* 并取出前5
*
* @param ori
* @param pat
* @return
*/
public static List getPatternStrsInternational(String ori, String pat) {
if (StringUtil.isBlank(ori))
return null;
List s = new ArrayList();
Pattern atPeoplePtn = Pattern.compile(pat);
Matcher matcher = atPeoplePtn.matcher(ori);
while (matcher.find()) {
int i = matcher.start();
int j = matcher.end();
String id;
try {
//-6 或者 -5 的目的是 为了显示 L.i 这种log情况
id = ori.substring(i - 6, j);
} catch (Exception e) {
try {
id = ori.substring(i - 5, j);
} catch (Exception e2) {
id = ori.substring(i, j);
}
}
s.add(id);
}
return s;
}
/**
* 将字符串写入指定文件(当指定的父路径中文件夹不存在时,会最大限度去创建,以保证保存成功!)
*
* @param res 原字符串
* @param filePath 文件路径
* @return 成功标记
*/
public static boolean string2File(String res, String filePath) {
boolean flag = true;
BufferedReader bufferedReader = null;
BufferedWriter bufferedWriter = null;
try {
File distFile = new File(filePath);
if (!distFile.getParentFile().exists()) {
distFile.getParentFile().mkdirs();
}
bufferedReader = new BufferedReader(new StringReader(res));
// bufferedWriter = new BufferedWriter(new FileWriter(distFile));
FileOutputStream writerStream = new FileOutputStream(filePath);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(writerStream, "UTF-8"));
char buf[] = new char[1024]; // 字符缓冲区
int len;
while ((len = bufferedReader.read(buf)) != -1) {
bufferedWriter.write(buf, 0, len);
}
bufferedWriter.flush();
bufferedReader.close();
bufferedWriter.close();
} catch (Exception e) {
e.printStackTrace();
flag = false;
return flag;
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (Exception e) {
e.printStackTrace();
}
}
if (bufferedWriter != null) {
try {
bufferedWriter.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
return flag;
}
/**
* 文本文件转换为指定编码的字符串
*
* @param file 文本文件
* @param encoding 编码类型
* @return 转换后的字符串
* @throws IOException
*/
public static String file2String(File file, String encoding) {
InputStreamReader reader = null;
StringWriter writer = new StringWriter();
try {
if (encoding == null || "".equals(encoding.trim())) {
encoding = "UTF-8";
}
reader = new InputStreamReader(new FileInputStream(file), encoding);
// 将输入流写入输出流
char[] buffer = new char[2048];
int n = 0;
while (-1 != (n = reader.read(buffer))) {
writer.write(buffer, 0, n);
}
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if (reader != null)
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
// 返回转换结果
if (writer != null)
return writer.toString();
else
return null;
}
/**
* 文本文件转换为指定编码的 转换成行 的 list
*
* @param file 文本文件
* @param encoding 编码类型
* @return 转换后的字符串
* @throws IOException
*/
public static List file2Strings(File file, String encoding) {
BufferedReader bufferedReader = null;
try {
if (encoding == null || "".equals(encoding.trim())) {
encoding = "UTF-8";
}
bufferedReader = new BufferedReader(
new InputStreamReader(
new FileInputStream(file), encoding));
List result = new ArrayList();
String tempString = null;
// 一次读入一行,直到读入null为文件结束
while ((tempString = bufferedReader.readLine()) != null) {
result.add(tempString);
}
return result;
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if (bufferedReader != null)
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 文本文件转换为指定编码的 转换成行 的 list
*
* @param file 文本文件
* @param encoding 编码类型
* @return 转换后的字符串
* @throws IOException
*/
public static List searchLineStr(File file, String encoding, String str) {
BufferedReader reader = null;
List result = new ArrayList();
try {
System.out.println("以行为单位读取文件内容,一次读一整行:");
reader = new BufferedReader(new FileReader(file));
String tempString = null;
int line = 1;
// 一次读入一行,直到读入null为文件结束
while ((tempString = reader.readLine()) != null) {
// 显示行号
System.out.println("line " + line + ": " + tempString);
result.add(tempString);
line++;
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e1) {
}
}
}
return result;
}
/**
* 判断是否是数字
*
* @param str
* @return
*/
public static boolean isNumeric(String str) {
Pattern pattern = Pattern.compile("[0-9]*");
return pattern.matcher(str).matches();
}
public static String firstUpperCase(String str) {
if (isNotBlank(str)) {
str = str.substring(0, 1).toUpperCase() + str.substring(1);
}
return str;
}
}
================================================
FILE: app/src/main/java/com/masonliu/decompileapk/util/ZipUtil.java
================================================
package com.masonliu.decompileapk.util;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.util.Zip4jConstants;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
public class ZipUtil {
public static void zip(String sourceDirPath, String zipDocPath) {
try {
File sourceDirFile = new File(sourceDirPath);
if (!sourceDirFile.exists() || sourceDirFile.isFile()) {
return;
}
File zipFile = new File(zipDocPath);
zipFile.getParentFile().mkdirs();
ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(zipDocPath));
zip(sourceDirFile, outputStream);
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
private static void zip(File file, ZipOutputStream outputStream) {
if (file.isDirectory()) {
for (File f : file.listFiles()) {
zip(f, outputStream);
}
} else {
try {
String zipInnerPath = file.getAbsolutePath().substring(file.getParentFile().getAbsolutePath().length() + 1);
System.out.println("zip " + zipInnerPath);
outputStream.putNextEntry(new ZipEntry(zipInnerPath));
FileInputStream inputStream = new FileInputStream(file);
int buffer;
while ((buffer = inputStream.read()) != -1) {
outputStream.write(buffer);
}
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
public static void UnZip(final File temp, final String outPath) {
Thread unZip = new Thread() {
public void run() {
}
};
unZip.start();
try {
String zipFileString = temp.getPath();
ZipInputStream inZip = new ZipInputStream(new FileInputStream(zipFileString));
ZipEntry zipEntry;
String szName = "";
long length = 0;
while ((zipEntry = inZip.getNextEntry()) != null) {
szName = zipEntry.getName();
if (zipEntry.isDirectory()) {
// get the folder name of the widget
szName = szName.substring(0, szName.length() - 1);
File folder = new File(outPath
+ File.separator + szName);
folder.mkdirs();
} else {
File file = new File(outPath + File.separator
+ szName);
if (file.exists()) {
// if(!file.getName().endsWith("bat"))
continue;
// else
// file.delete();
}
FileUtil.createNewDoc(file.getAbsolutePath());
// file.createNewFile();
// get the output stream of the file
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file), 1024);
int len;
byte[] buffer = new byte[1024];
// read (len) bytes into buffer
while ((len = inZip.read(buffer)) != -1) {
bos.write(buffer, 0, len);
bos.flush();
length += len;
}
bos.close();
}
}// end of while
inZip.close();
length = 0;
// 11.25
temp.delete();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* @param zipFile
* @param dir 如/META-INF
* @param fileToAdd
* @throws IOException
*/
public static void addFileToZip(File zipFile, String dir, File fileToAdd) throws IOException {
Map env = new HashMap();
env.put("create", "true");
try (FileSystem fs = FileSystems.newFileSystem(URI.create("jar:" + zipFile.toURI()), env)) {
Path pathToAddFile = fileToAdd.toPath();
Path pathInZipfile = null;
if (dir == null || "".equals(dir)) {
pathInZipfile = fs.getPath("/" + fileToAdd.getName());
} else {
pathInZipfile = fs.getPath(dir + "/" + fileToAdd.getName());
}
Files.copy(pathToAddFile, pathInZipfile, StandardCopyOption.REPLACE_EXISTING);
}
}
/**
* @param mZipFile
* @param targetPath 如填写 META-INF
* @param fileToAdd
*/
public static void addFileToZip2(File mZipFile, String targetPath, File fileToAdd) {
try {
ZipFile zipFile = new ZipFile(mZipFile);
ZipParameters parameters = new ZipParameters();
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
parameters.setRootFolderInZip(targetPath);//填写 META-INF
zipFile.addFile(fileToAdd, parameters);
} catch (Exception e) {
e.printStackTrace();
}
}
}
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Fri Mar 31 09:12:27 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
================================================
FILE: gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: settings.gradle
================================================
include ':app'