Update upstream source from tag 'upstream/1.3.5'
Update to upstream version '1.3.5'
with Debian dir 64452033bc1c02b8a23b5d7b72c47137cbf38e95
Sophie Brun
2 years ago
1 | 1 | |
2 | 2 | ## JADX |
3 | 3 | |
4 | [![Build Status](https://travis-ci.com/skylot/jadx.svg?branch=master)](https://travis-ci.com/skylot/jadx) | |
5 | [![Code Coverage](https://codecov.io/gh/skylot/jadx/branch/master/graph/badge.svg)](https://codecov.io/gh/skylot/jadx) | |
4 | [![Build status](https://github.com/skylot/jadx/workflows/Build/badge.svg)](https://github.com/skylot/jadx/actions?query=workflow%3ABuild) | |
6 | 5 | [![Alerts from lgtm.com](https://img.shields.io/lgtm/alerts/g/skylot/jadx.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/skylot/jadx/alerts/) |
7 | [![SonarQube Bugs](https://sonarcloud.io/api/project_badges/measure?project=jadx&metric=bugs)](https://sonarcloud.io/dashboard?id=jadx) | |
6 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) | |
7 | [![Maven Central](https://img.shields.io/maven-central/v/io.github.skylot/jadx-core)](https://search.maven.org/search?q=g:io.github.skylot%20AND%20jadx) | |
8 | 8 | [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) |
9 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) | |
10 | 9 | |
11 | 10 | **jadx** - Dex to Java decompiler |
12 | 11 | |
13 | 12 | Command line and GUI tools for producing Java source code from Android Dex and Apk files |
14 | 13 | |
14 | :exclamation::exclamation::exclamation: Please note that in most cases **jadx** can't decompile all 100% of the code, so errors will occur. Check [Troubleshooting guide](https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A#decompilation-issues) for workarounds | |
15 | ||
15 | 16 | **Main features:** |
16 | - decompile Dalvik bytecode to java classes from APK, dex, aar and zip files | |
17 | - decompile Dalvik bytecode to java classes from APK, dex, aar, aab and zip files | |
17 | 18 | - decode `AndroidManifest.xml` and other resources from `resources.arsc` |
18 | 19 | - deobfuscator included |
19 | 20 | |
22 | 23 | - jump to declaration |
23 | 24 | - find usage |
24 | 25 | - full text search |
26 | - smali debugger, check [wiki page](https://github.com/skylot/jadx/wiki/Smali-debugger) for setup and usage | |
27 | ||
28 | Jadx-gui key bindings can be found [here](https://github.com/skylot/jadx/wiki/JADX-GUI-Key-bindings) | |
25 | 29 | |
26 | 30 | See these features in action here: [jadx-gui features overview](https://github.com/skylot/jadx/wiki/jadx-gui-features-overview) |
27 | 31 | |
28 | ||
29 | ![jadx-gui screenshot](https://i.imgur.com/h917IBZ.png) | |
30 | ||
32 | <img src="https://user-images.githubusercontent.com/118523/142730720-839f017e-38db-423e-b53f-39f5f0a0316f.png" width="700"/> | |
31 | 33 | |
32 | 34 | ### Download |
33 | - latest [unstable build: ![Download](https://api.bintray.com/packages/skylot/jadx/unstable/images/download.svg) ](https://bintray.com/skylot/jadx/unstable/_latestVersion#files) | |
34 | 35 | - release from [github: ![Latest release](https://img.shields.io/github/release/skylot/jadx.svg)](https://github.com/skylot/jadx/releases/latest) |
35 | - release from [bintray: ![Download](https://api.bintray.com/packages/skylot/jadx/releases/images/download.svg) ](https://bintray.com/skylot/jadx/releases/_latestVersion#files) | |
36 | - latest [unstable build](https://nightly.link/skylot/jadx/workflows/build/master) | |
36 | 37 | |
37 | 38 | After download unpack zip file go to `bin` directory and run: |
38 | 39 | - `jadx` - command line version |
39 | 40 | - `jadx-gui` - UI version |
40 | 41 | |
41 | 42 | On Windows run `.bat` files with double-click\ |
42 | **Note:** ensure you have installed Java 8 or later 64-bit version. | |
43 | For windows you can download it from [adoptopenjdk.net](https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot#x64_win) (select "Install JRE"). | |
43 | **Note:** ensure you have installed Java 11 or later 64-bit version. | |
44 | For Windows, you can download it from [oracle.com](https://www.oracle.com/java/technologies/downloads/#jdk17-windows) (select x64 Installer). | |
44 | 45 | |
45 | 46 | ### Install |
46 | 47 | 1. Arch linux |
51 | 52 | ```bash |
52 | 53 | brew install jadx |
53 | 54 | ``` |
55 | ||
56 | ### Use jadx as a library | |
57 | You can use jadx in your java projects, check details on [wiki page](https://github.com/skylot/jadx/wiki/Use-jadx-as-a-library) | |
54 | 58 | |
55 | 59 | ### Build from source |
56 | 60 | JDK 8 or higher must be installed: |
67 | 71 | |
68 | 72 | ### Usage |
69 | 73 | ``` |
70 | jadx[-gui] [options] <input file> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc) | |
74 | jadx[-gui] [options] <input files> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc, .aab) | |
71 | 75 | options: |
72 | 76 | -d, --output-dir - output directory |
73 | 77 | -ds, --output-dir-src - output directory for sources |
74 | 78 | -dr, --output-dir-res - output directory for resources |
75 | 79 | -r, --no-res - do not decode resources |
76 | 80 | -s, --no-src - do not decompile source code |
77 | --single-class - decompile a single class | |
81 | --single-class - decompile a single class, full name, raw or alias | |
82 | --single-class-output - file or dir for write if decompile a single class | |
78 | 83 | --output-format - can be 'java' or 'json', default: java |
79 | 84 | -e, --export-gradle - save as android gradle project |
80 | 85 | -j, --threads-count - processing threads count, default: 4 |
86 | -m, --decompilation-mode - code output mode: | |
87 | 'auto' - trying best options (default) | |
88 | 'restructure' - restore code structure (normal java code) | |
89 | 'simple' - simplified instructions (linear, with goto's) | |
90 | 'fallback' - raw instructions without modifications | |
81 | 91 | --show-bad-code - show inconsistent code (incorrectly decompiled) |
82 | 92 | --no-imports - disable use of imports, always write entire package name |
83 | 93 | --no-debug-info - disable debug info |
94 | --add-debug-lines - add comments with debug line numbers if available | |
84 | 95 | --no-inline-anonymous - disable anonymous classes inline |
96 | --no-inline-methods - disable methods inline | |
85 | 97 | --no-replace-consts - don't replace constant value with matching constant field |
86 | 98 | --escape-unicode - escape non latin characters in strings (with \u) |
87 | 99 | --respect-bytecode-access-modifiers - don't change original access modifiers |
88 | 100 | --deobf - activate deobfuscation |
89 | 101 | --deobf-min - min length of name, renamed if shorter, default: 3 |
90 | 102 | --deobf-max - max length of name, renamed if longer, default: 64 |
91 | --deobf-rewrite-cfg - force to save deobfuscation map | |
103 | --deobf-cfg-file - deobfuscation map file, default: same dir and name as input file with '.jobf' extension | |
104 | --deobf-cfg-file-mode - set mode for handle deobfuscation map file: | |
105 | 'read' - read if found, don't save (default) | |
106 | 'read-or-save' - read if found, save otherwise (don't overwrite) | |
107 | 'overwrite' - don't read, always save | |
108 | 'ignore' - don't read and don't save | |
109 | --deobf-rewrite-cfg - set '--deobf-cfg-file-mode' to 'overwrite' (deprecated) | |
92 | 110 | --deobf-use-sourcename - use source file name as class name alias |
93 | --rename-flags - what to rename, comma-separated, 'case' for system case sensitivity, 'valid' for java identifiers, 'printable' characters, 'none' or 'all' (default) | |
111 | --deobf-parse-kotlin-metadata - parse kotlin metadata to class and package names | |
112 | --use-kotlin-methods-for-var-names - use kotlin intrinsic methods to rename variables, values: disable, apply, apply-and-hide, default: apply | |
113 | --rename-flags - fix options (comma-separated list of): | |
114 | 'case' - fix case sensitivity issues (according to --fs-case-sensitive option), | |
115 | 'valid' - rename java identifiers to make them valid, | |
116 | 'printable' - remove non-printable chars from identifiers, | |
117 | or single 'none' - to disable all renames | |
118 | or single 'all' - to enable all (default) | |
94 | 119 | --fs-case-sensitive - treat filesystem as case sensitive, false by default |
95 | 120 | --cfg - save methods control flow graph to dot file |
96 | 121 | --raw-cfg - save methods control flow graph (use raw instructions) |
97 | -f, --fallback - make simple dump (using goto instead of 'if', 'for', etc) | |
122 | -f, --fallback - set '--decompilation-mode' to 'fallback' (deprecated) | |
123 | --use-dx - use dx/d8 to convert java bytecode | |
124 | --comments-level - set code comments level, values: error, warn, info, debug, user-only, none, default: info | |
125 | --log-level - set log level, values: quiet, progress, error, warn, info, debug, default: progress | |
98 | 126 | -v, --verbose - verbose output (set --log-level to DEBUG) |
99 | 127 | -q, --quiet - turn off output (set --log-level to QUIET) |
100 | --log-level - set log level, values: QUIET, PROGRESS, ERROR, WARN, INFO, DEBUG, default: PROGRESS | |
101 | 128 | --version - print jadx version |
102 | 129 | -h, --help - print this help |
103 | Example: | |
104 | jadx -d out classes.dex | |
105 | jadx --rename-flags "none" classes.dex | |
106 | jadx --rename-flags "valid,printable" classes.dex | |
107 | jadx --log-level error app.apk | |
130 | ||
131 | Plugin options (-P<name>=<value>): | |
132 | 1) dex-input (Load .dex and .apk files) | |
133 | -Pdex-input.verify-checksum - Verify dex file checksum before load, values: [yes, no], default: yes | |
134 | 2) java-convert (Convert .jar and .class files to dex) | |
135 | -Pjava-convert.mode - Convert mode, values: [dx, d8, both], default: both | |
136 | -Pjava-convert.d8-desugar - Use desugar in d8, values: [yes, no], default: no | |
137 | ||
138 | Examples: | |
139 | jadx -d out classes.dex | |
140 | jadx --rename-flags "none" classes.dex | |
141 | jadx --rename-flags "valid, printable" classes.dex | |
142 | jadx --log-level ERROR app.apk | |
143 | jadx -Pdex-input.verify-checksum=no app.apk | |
108 | 144 | ``` |
109 | 145 | These options also worked on jadx-gui running from command line and override options from preferences dialog |
110 | 146 | |
117 | 153 | - Submit decompilation issues, please read before proceed: [Open issue](CONTRIBUTING.md#Open-Issue) |
118 | 154 | - Open pull request, please follow these rules: [Pull Request Process](CONTRIBUTING.md#Pull-Request-Process) |
119 | 155 | |
120 | ### Related projects: | |
121 | - [PyJadx](https://github.com/romainthomas/pyjadx) - python binding for jadx by [@romainthomas](https://github.com/romainthomas) | |
122 | ||
123 | 156 | --------------------------------------- |
124 | 157 | *Licensed under the Apache 2.0 License* |
0 | #!/usr/bin/env sh | |
1 | ||
2 | # | |
3 | # Copyright 2015 the original author or authors. | |
0 | #!/bin/sh | |
1 | ||
2 | # | |
3 | # Copyright © 2015-2021 the original authors. | |
4 | 4 | # |
5 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | # you may not use this file except in compliance with the License. |
16 | 16 | # |
17 | 17 | |
18 | 18 | ############################################################################## |
19 | ## | |
20 | ## jadx start up script for UN*X | |
21 | ## | |
19 | # | |
20 | # jadx start up script for POSIX generated by Gradle. | |
21 | # | |
22 | # Important for running: | |
23 | # | |
24 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is | |
25 | # noncompliant, but you have some other compliant shell such as ksh or | |
26 | # bash, then to run this script, type that shell name before the whole | |
27 | # command line, like: | |
28 | # | |
29 | # ksh jadx | |
30 | # | |
31 | # Busybox and similar reduced shells will NOT work, because this script | |
32 | # requires all of these POSIX shell features: | |
33 | # * functions; | |
34 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», | |
35 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; | |
36 | # * compound commands having a testable exit status, especially «case»; | |
37 | # * various built-in commands including «command», «set», and «ulimit». | |
38 | # | |
39 | # Important for patching: | |
40 | # | |
41 | # (2) This script targets any POSIX shell, so it avoids extensions provided | |
42 | # by Bash, Ksh, etc; in particular arrays are avoided. | |
43 | # | |
44 | # The "traditional" practice of packing multiple parameters into a | |
45 | # space-separated string is a well documented source of bugs and security | |
46 | # problems, so this is (mostly) avoided, by progressively accumulating | |
47 | # options in "$@", and eventually passing that to Java. | |
48 | # | |
49 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, | |
50 | # and JADX_OPTS) rely on word-splitting, this is performed explicitly; | |
51 | # see the in-line comments for details. | |
52 | # | |
53 | # There are tweaks for specific operating systems such as AIX, CygWin, | |
54 | # Darwin, MinGW, and NonStop. | |
55 | # | |
56 | # (3) This script is generated from the Groovy template | |
57 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | |
58 | # within the Gradle project. | |
59 | # | |
60 | # You can find Gradle at https://github.com/gradle/gradle/. | |
61 | # | |
22 | 62 | ############################################################################## |
23 | 63 | |
24 | 64 | # Attempt to set APP_HOME |
65 | ||
25 | 66 | # Resolve links: $0 may be a link |
26 | PRG="$0" | |
27 | # Need this for relative symlinks. | |
28 | while [ -h "$PRG" ] ; do | |
29 | ls=`ls -ld "$PRG"` | |
30 | link=`expr "$ls" : '.*-> \(.*\)$'` | |
31 | if expr "$link" : '/.*' > /dev/null; then | |
32 | PRG="$link" | |
33 | else | |
34 | PRG=`dirname "$PRG"`"/$link" | |
35 | fi | |
67 | app_path=$0 | |
68 | ||
69 | # Need this for daisy-chained symlinks. | |
70 | while | |
71 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path | |
72 | [ -h "$app_path" ] | |
73 | do | |
74 | ls=$( ls -ld "$app_path" ) | |
75 | link=${ls#*' -> '} | |
76 | case $link in #( | |
77 | /*) app_path=$link ;; #( | |
78 | *) app_path=$APP_HOME$link ;; | |
79 | esac | |
36 | 80 | done |
37 | SAVED="`pwd`" | |
38 | cd "`dirname \"$PRG\"`/.." >/dev/null | |
39 | APP_HOME="`pwd -P`" | |
40 | cd "$SAVED" >/dev/null | |
81 | ||
82 | APP_HOME=$( cd "${APP_HOME:-./}.." && pwd -P ) || exit | |
41 | 83 | |
42 | 84 | APP_NAME="jadx" |
43 | APP_BASE_NAME=`basename "$0"` | |
85 | APP_BASE_NAME=${0##*/} | |
44 | 86 | |
45 | 87 | # Add default JVM options here. You can also use JAVA_OPTS and JADX_OPTS to pass JVM options to this script. |
46 | DEFAULT_JVM_OPTS='"-Xms128M" "-Xmx4g" "-XX:+UseG1GC"' | |
88 | DEFAULT_JVM_OPTS='"-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC"' | |
47 | 89 | |
48 | 90 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
49 | MAX_FD="maximum" | |
91 | MAX_FD=maximum | |
50 | 92 | |
51 | 93 | warn () { |
52 | 94 | echo "$*" |
53 | } | |
95 | } >&2 | |
54 | 96 | |
55 | 97 | die () { |
56 | 98 | echo |
57 | 99 | echo "$*" |
58 | 100 | echo |
59 | 101 | exit 1 |
60 | } | |
102 | } >&2 | |
61 | 103 | |
62 | 104 | # OS specific support (must be 'true' or 'false'). |
63 | 105 | cygwin=false |
64 | 106 | msys=false |
65 | 107 | darwin=false |
66 | 108 | nonstop=false |
67 | case "`uname`" in | |
68 | CYGWIN* ) | |
69 | cygwin=true | |
70 | ;; | |
71 | Darwin* ) | |
72 | darwin=true | |
73 | ;; | |
74 | MINGW* ) | |
75 | msys=true | |
76 | ;; | |
77 | NONSTOP* ) | |
78 | nonstop=true | |
79 | ;; | |
109 | case "$( uname )" in #( | |
110 | CYGWIN* ) cygwin=true ;; #( | |
111 | Darwin* ) darwin=true ;; #( | |
112 | MSYS* | MINGW* ) msys=true ;; #( | |
113 | NONSTOP* ) nonstop=true ;; | |
80 | 114 | esac |
81 | 115 | |
82 | CLASSPATH=$APP_HOME/lib/jadx-cli-1.2.0.jar:$APP_HOME/lib/jadx-core-1.2.0.jar:$APP_HOME/lib/android-29-clst.jar:$APP_HOME/lib/android-29-res.jar:$APP_HOME/lib/logback-classic-1.2.3.jar:$APP_HOME/lib/jadx-smali-input-1.2.0.jar:$APP_HOME/lib/jadx-java-convert-1.2.0.jar:$APP_HOME/lib/dx-1.16.jar:$APP_HOME/lib/jadx-dex-input-1.2.0.jar:$APP_HOME/lib/jadx-plugins-api-1.2.0.jar:$APP_HOME/lib/slf4j-api-1.7.30.jar:$APP_HOME/lib/baksmali-2.4.0.jar:$APP_HOME/lib/smali-2.4.0.jar:$APP_HOME/lib/util-2.4.0.jar:$APP_HOME/lib/jcommander-1.80.jar:$APP_HOME/lib/gson-2.8.6.jar:$APP_HOME/lib/logback-core-1.2.3.jar:$APP_HOME/lib/dexlib2-2.4.0.jar:$APP_HOME/lib/guava-29.0-jre.jar:$APP_HOME/lib/asm-8.0.1.jar:$APP_HOME/lib/failureaccess-1.0.1.jar:$APP_HOME/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:$APP_HOME/lib/jsr305-3.0.2.jar:$APP_HOME/lib/checker-qual-2.11.1.jar:$APP_HOME/lib/error_prone_annotations-2.3.4.jar:$APP_HOME/lib/j2objc-annotations-1.3.jar:$APP_HOME/lib/antlr-runtime-3.5.2.jar:$APP_HOME/lib/stringtemplate-3.2.1.jar:$APP_HOME/lib/antlr-2.7.7.jar | |
116 | CLASSPATH=$APP_HOME/lib/jadx-cli-1.3.5.jar:$APP_HOME/lib/jadx-core-1.3.5.jar:$APP_HOME/lib/logback-classic-1.2.11.jar:$APP_HOME/lib/jadx-java-convert-1.3.5.jar:$APP_HOME/lib/jadx-smali-input-1.3.5.jar:$APP_HOME/lib/jadx-dex-input-1.3.5.jar:$APP_HOME/lib/jadx-java-input-1.3.5.jar:$APP_HOME/lib/jadx-plugins-api-1.3.5.jar:$APP_HOME/lib/raung-disasm-0.0.2.jar:$APP_HOME/lib/raung-common-0.0.2.jar:$APP_HOME/lib/slf4j-api-1.7.36.jar:$APP_HOME/lib/baksmali-2.5.2.jar:$APP_HOME/lib/smali-2.5.2.jar:$APP_HOME/lib/util-2.5.2.jar:$APP_HOME/lib/jcommander-1.82.jar:$APP_HOME/lib/gson-2.9.0.jar:$APP_HOME/lib/aapt2-proto-4.2.1-7147631.jar:$APP_HOME/lib/protobuf-java-3.11.4.jar:$APP_HOME/lib/logback-core-1.2.11.jar:$APP_HOME/lib/dexlib2-2.5.2.jar:$APP_HOME/lib/guava-30.1.1-jre.jar:$APP_HOME/lib/dalvik-dx-11.0.0_r3.jar:$APP_HOME/lib/r8-3.3.28.jar:$APP_HOME/lib/asm-9.3.jar:$APP_HOME/lib/antlr-3.5.2.jar:$APP_HOME/lib/ST4-4.0.8.jar:$APP_HOME/lib/antlr-runtime-3.5.2.jar:$APP_HOME/lib/stringtemplate-3.2.1.jar:$APP_HOME/lib/jsr305-3.0.2.jar:$APP_HOME/lib/failureaccess-1.0.1.jar:$APP_HOME/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:$APP_HOME/lib/checker-qual-3.8.0.jar:$APP_HOME/lib/error_prone_annotations-2.5.1.jar:$APP_HOME/lib/j2objc-annotations-1.3.jar:$APP_HOME/lib/antlr-2.7.7.jar | |
83 | 117 | |
84 | 118 | |
85 | 119 | # Determine the Java command to use to start the JVM. |
86 | 120 | if [ -n "$JAVA_HOME" ] ; then |
87 | 121 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
88 | 122 | # IBM's JDK on AIX uses strange locations for the executables |
89 | JAVACMD="$JAVA_HOME/jre/sh/java" | |
123 | JAVACMD=$JAVA_HOME/jre/sh/java | |
90 | 124 | else |
91 | JAVACMD="$JAVA_HOME/bin/java" | |
125 | JAVACMD=$JAVA_HOME/bin/java | |
92 | 126 | fi |
93 | 127 | if [ ! -x "$JAVACMD" ] ; then |
94 | 128 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME |
97 | 131 | location of your Java installation." |
98 | 132 | fi |
99 | 133 | else |
100 | JAVACMD="java" | |
134 | JAVACMD=java | |
101 | 135 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
102 | 136 | |
103 | 137 | Please set the JAVA_HOME variable in your environment to match the |
105 | 139 | fi |
106 | 140 | |
107 | 141 | # Increase the maximum file descriptors if we can. |
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | |
109 | MAX_FD_LIMIT=`ulimit -H -n` | |
110 | if [ $? -eq 0 ] ; then | |
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | |
112 | MAX_FD="$MAX_FD_LIMIT" | |
113 | fi | |
114 | ulimit -n $MAX_FD | |
115 | if [ $? -ne 0 ] ; then | |
116 | warn "Could not set maximum file descriptor limit: $MAX_FD" | |
117 | fi | |
118 | else | |
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | |
120 | fi | |
121 | fi | |
122 | ||
123 | # For Darwin, add options to specify how the application appears in the dock | |
124 | if $darwin; then | |
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | |
126 | fi | |
127 | ||
128 | # For Cygwin or MSYS, switch paths to Windows format before running java | |
129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then | |
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` | |
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | |
132 | ||
133 | JAVACMD=`cygpath --unix "$JAVACMD"` | |
134 | ||
135 | # We build the pattern for arguments to be converted via cygpath | |
136 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | |
137 | SEP="" | |
138 | for dir in $ROOTDIRSRAW ; do | |
139 | ROOTDIRS="$ROOTDIRS$SEP$dir" | |
140 | SEP="|" | |
141 | done | |
142 | OURCYGPATTERN="(^($ROOTDIRS))" | |
143 | # Add a user-defined pattern to the cygpath arguments | |
144 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then | |
145 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | |
146 | fi | |
147 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | |
148 | i=0 | |
149 | for arg in "$@" ; do | |
150 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | |
151 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | |
152 | ||
153 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | |
154 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | |
155 | else | |
156 | eval `echo args$i`="\"$arg\"" | |
157 | fi | |
158 | i=`expr $i + 1` | |
159 | done | |
160 | case $i in | |
161 | 0) set -- ;; | |
162 | 1) set -- "$args0" ;; | |
163 | 2) set -- "$args0" "$args1" ;; | |
164 | 3) set -- "$args0" "$args1" "$args2" ;; | |
165 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; | |
166 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | |
167 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | |
168 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | |
169 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | |
170 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | |
142 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then | |
143 | case $MAX_FD in #( | |
144 | max*) | |
145 | MAX_FD=$( ulimit -H -n ) || | |
146 | warn "Could not query maximum file descriptor limit" | |
147 | esac | |
148 | case $MAX_FD in #( | |
149 | '' | soft) :;; #( | |
150 | *) | |
151 | ulimit -n "$MAX_FD" || | |
152 | warn "Could not set maximum file descriptor limit to $MAX_FD" | |
171 | 153 | esac |
172 | 154 | fi |
173 | 155 | |
174 | # Escape application args | |
175 | save () { | |
176 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | |
177 | echo " " | |
178 | } | |
179 | APP_ARGS=`save "$@"` | |
180 | ||
181 | # Collect all arguments for the java command, following the shell quoting and substitution rules | |
182 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $JADX_OPTS -classpath "\"$CLASSPATH\"" jadx.cli.JadxCLI "$APP_ARGS" | |
156 | # Collect all arguments for the java command, stacking in reverse order: | |
157 | # * args from the command line | |
158 | # * the main class name | |
159 | # * -classpath | |
160 | # * -D...appname settings | |
161 | # * --module-path (only if needed) | |
162 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and JADX_OPTS environment variables. | |
163 | ||
164 | # For Cygwin or MSYS, switch paths to Windows format before running java | |
165 | if "$cygwin" || "$msys" ; then | |
166 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) | |
167 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) | |
168 | ||
169 | JAVACMD=$( cygpath --unix "$JAVACMD" ) | |
170 | ||
171 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | |
172 | for arg do | |
173 | if | |
174 | case $arg in #( | |
175 | -*) false ;; # don't mess with options #( | |
176 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath | |
177 | [ -e "$t" ] ;; #( | |
178 | *) false ;; | |
179 | esac | |
180 | then | |
181 | arg=$( cygpath --path --ignore --mixed "$arg" ) | |
182 | fi | |
183 | # Roll the args list around exactly as many times as the number of | |
184 | # args, so each arg winds up back in the position where it started, but | |
185 | # possibly modified. | |
186 | # | |
187 | # NB: a `for` loop captures its iteration list before it begins, so | |
188 | # changing the positional parameters here affects neither the number of | |
189 | # iterations, nor the values presented in `arg`. | |
190 | shift # remove old arg | |
191 | set -- "$@" "$arg" # push replacement arg | |
192 | done | |
193 | fi | |
194 | ||
195 | # Collect all arguments for the java command; | |
196 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $JADX_OPTS can contain fragments of | |
197 | # shell script including quotes and variable substitutions, so put them in | |
198 | # double quotes to make sure that they get re-expanded; and | |
199 | # * put everything else in single quotes, so that it's not re-expanded. | |
200 | ||
201 | set -- \ | |
202 | -classpath "$CLASSPATH" \ | |
203 | jadx.cli.JadxCLI \ | |
204 | "$@" | |
205 | ||
206 | # Use "xargs" to parse quoted args. | |
207 | # | |
208 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. | |
209 | # | |
210 | # In Bash we could simply go: | |
211 | # | |
212 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && | |
213 | # set -- "${ARGS[@]}" "$@" | |
214 | # | |
215 | # but POSIX shell has neither arrays nor command substitution, so instead we | |
216 | # post-process each arg (as a line of input to sed) to backslash-escape any | |
217 | # character that might be a shell metacharacter, then use eval to reverse | |
218 | # that process (while maintaining the separation between arguments), and wrap | |
219 | # the whole thing up as a single "set" statement. | |
220 | # | |
221 | # This will of course break if any of these variables contains a newline or | |
222 | # an unmatched quote. | |
223 | # | |
224 | ||
225 | eval "set -- $( | |
226 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $JADX_OPTS" | | |
227 | xargs -n1 | | |
228 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | | |
229 | tr '\n' ' ' | |
230 | )" '"$@"' | |
183 | 231 | |
184 | 232 | exec "$JAVACMD" "$@" |
0 | #!/usr/bin/env sh | |
1 | ||
2 | # | |
3 | # Copyright 2015 the original author or authors. | |
0 | #!/bin/sh | |
1 | ||
2 | # | |
3 | # Copyright © 2015-2021 the original authors. | |
4 | 4 | # |
5 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | # you may not use this file except in compliance with the License. |
16 | 16 | # |
17 | 17 | |
18 | 18 | ############################################################################## |
19 | ## | |
20 | ## jadx-gui start up script for UN*X | |
21 | ## | |
19 | # | |
20 | # jadx-gui start up script for POSIX generated by Gradle. | |
21 | # | |
22 | # Important for running: | |
23 | # | |
24 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is | |
25 | # noncompliant, but you have some other compliant shell such as ksh or | |
26 | # bash, then to run this script, type that shell name before the whole | |
27 | # command line, like: | |
28 | # | |
29 | # ksh jadx-gui | |
30 | # | |
31 | # Busybox and similar reduced shells will NOT work, because this script | |
32 | # requires all of these POSIX shell features: | |
33 | # * functions; | |
34 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», | |
35 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; | |
36 | # * compound commands having a testable exit status, especially «case»; | |
37 | # * various built-in commands including «command», «set», and «ulimit». | |
38 | # | |
39 | # Important for patching: | |
40 | # | |
41 | # (2) This script targets any POSIX shell, so it avoids extensions provided | |
42 | # by Bash, Ksh, etc; in particular arrays are avoided. | |
43 | # | |
44 | # The "traditional" practice of packing multiple parameters into a | |
45 | # space-separated string is a well documented source of bugs and security | |
46 | # problems, so this is (mostly) avoided, by progressively accumulating | |
47 | # options in "$@", and eventually passing that to Java. | |
48 | # | |
49 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, | |
50 | # and JADX_GUI_OPTS) rely on word-splitting, this is performed explicitly; | |
51 | # see the in-line comments for details. | |
52 | # | |
53 | # There are tweaks for specific operating systems such as AIX, CygWin, | |
54 | # Darwin, MinGW, and NonStop. | |
55 | # | |
56 | # (3) This script is generated from the Groovy template | |
57 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | |
58 | # within the Gradle project. | |
59 | # | |
60 | # You can find Gradle at https://github.com/gradle/gradle/. | |
61 | # | |
22 | 62 | ############################################################################## |
23 | 63 | |
24 | 64 | # Attempt to set APP_HOME |
65 | ||
25 | 66 | # Resolve links: $0 may be a link |
26 | PRG="$0" | |
27 | # Need this for relative symlinks. | |
28 | while [ -h "$PRG" ] ; do | |
29 | ls=`ls -ld "$PRG"` | |
30 | link=`expr "$ls" : '.*-> \(.*\)$'` | |
31 | if expr "$link" : '/.*' > /dev/null; then | |
32 | PRG="$link" | |
33 | else | |
34 | PRG=`dirname "$PRG"`"/$link" | |
35 | fi | |
67 | app_path=$0 | |
68 | ||
69 | # Need this for daisy-chained symlinks. | |
70 | while | |
71 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path | |
72 | [ -h "$app_path" ] | |
73 | do | |
74 | ls=$( ls -ld "$app_path" ) | |
75 | link=${ls#*' -> '} | |
76 | case $link in #( | |
77 | /*) app_path=$link ;; #( | |
78 | *) app_path=$APP_HOME$link ;; | |
79 | esac | |
36 | 80 | done |
37 | SAVED="`pwd`" | |
38 | cd "`dirname \"$PRG\"`/.." >/dev/null | |
39 | APP_HOME="`pwd -P`" | |
40 | cd "$SAVED" >/dev/null | |
81 | ||
82 | APP_HOME=$( cd "${APP_HOME:-./}.." && pwd -P ) || exit | |
41 | 83 | |
42 | 84 | APP_NAME="jadx-gui" |
43 | APP_BASE_NAME=`basename "$0"` | |
85 | APP_BASE_NAME=${0##*/} | |
44 | 86 | |
45 | 87 | # Add default JVM options here. You can also use JAVA_OPTS and JADX_GUI_OPTS to pass JVM options to this script. |
46 | DEFAULT_JVM_OPTS='"-Xms128M" "-Xmx4g" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true" "-XX:+UseG1GC"' | |
88 | DEFAULT_JVM_OPTS='"-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true"' | |
47 | 89 | |
48 | 90 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
49 | MAX_FD="maximum" | |
91 | MAX_FD=maximum | |
50 | 92 | |
51 | 93 | warn () { |
52 | 94 | echo "$*" |
53 | } | |
95 | } >&2 | |
54 | 96 | |
55 | 97 | die () { |
56 | 98 | echo |
57 | 99 | echo "$*" |
58 | 100 | echo |
59 | 101 | exit 1 |
60 | } | |
102 | } >&2 | |
61 | 103 | |
62 | 104 | # OS specific support (must be 'true' or 'false'). |
63 | 105 | cygwin=false |
64 | 106 | msys=false |
65 | 107 | darwin=false |
66 | 108 | nonstop=false |
67 | case "`uname`" in | |
68 | CYGWIN* ) | |
69 | cygwin=true | |
70 | ;; | |
71 | Darwin* ) | |
72 | darwin=true | |
73 | ;; | |
74 | MINGW* ) | |
75 | msys=true | |
76 | ;; | |
77 | NONSTOP* ) | |
78 | nonstop=true | |
79 | ;; | |
109 | case "$( uname )" in #( | |
110 | CYGWIN* ) cygwin=true ;; #( | |
111 | Darwin* ) darwin=true ;; #( | |
112 | MSYS* | MINGW* ) msys=true ;; #( | |
113 | NONSTOP* ) nonstop=true ;; | |
80 | 114 | esac |
81 | 115 | |
82 | CLASSPATH=$APP_HOME/lib/jadx-gui-1.2.0.jar:$APP_HOME/lib/jfontchooser-1.0.5.jar:$APP_HOME/lib/jadx-cli-1.2.0.jar:$APP_HOME/lib/jadx-core-1.2.0.jar:$APP_HOME/lib/android-29-clst.jar:$APP_HOME/lib/android-29-res.jar:$APP_HOME/lib/logback-classic-1.2.3.jar:$APP_HOME/lib/jadx-smali-input-1.2.0.jar:$APP_HOME/lib/jadx-java-convert-1.2.0.jar:$APP_HOME/lib/dx-1.16.jar:$APP_HOME/lib/jadx-dex-input-1.2.0.jar:$APP_HOME/lib/jadx-plugins-api-1.2.0.jar:$APP_HOME/lib/slf4j-api-1.7.30.jar:$APP_HOME/lib/baksmali-2.4.0.jar:$APP_HOME/lib/smali-2.4.0.jar:$APP_HOME/lib/util-2.4.0.jar:$APP_HOME/lib/jcommander-1.80.jar:$APP_HOME/lib/rsyntaxtextarea-3.1.1.jar:$APP_HOME/lib/image-viewer-1.2.3.jar:$APP_HOME/lib/gson-2.8.6.jar:$APP_HOME/lib/commons-text-1.9.jar:$APP_HOME/lib/commons-lang3-3.11.jar:$APP_HOME/lib/rxjava2-swing-0.3.7.jar:$APP_HOME/lib/rxjava-2.2.19.jar:$APP_HOME/lib/apksig-4.0.1.jar:$APP_HOME/lib/logback-core-1.2.3.jar:$APP_HOME/lib/reactive-streams-1.0.3.jar:$APP_HOME/lib/dexlib2-2.4.0.jar:$APP_HOME/lib/guava-29.0-jre.jar:$APP_HOME/lib/asm-8.0.1.jar:$APP_HOME/lib/failureaccess-1.0.1.jar:$APP_HOME/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:$APP_HOME/lib/jsr305-3.0.2.jar:$APP_HOME/lib/checker-qual-2.11.1.jar:$APP_HOME/lib/error_prone_annotations-2.3.4.jar:$APP_HOME/lib/j2objc-annotations-1.3.jar:$APP_HOME/lib/antlr-runtime-3.5.2.jar:$APP_HOME/lib/stringtemplate-3.2.1.jar:$APP_HOME/lib/antlr-2.7.7.jar | |
116 | CLASSPATH=$APP_HOME/lib/jadx-gui-1.3.5.jar:$APP_HOME/lib/jfontchooser-1.0.5.jar:$APP_HOME/lib/jadx-cli-1.3.5.jar:$APP_HOME/lib/jadx-core-1.3.5.jar:$APP_HOME/lib/logback-classic-1.2.11.jar:$APP_HOME/lib/jadx-java-convert-1.3.5.jar:$APP_HOME/lib/jadx-smali-input-1.3.5.jar:$APP_HOME/lib/jadx-dex-input-1.3.5.jar:$APP_HOME/lib/jadx-java-input-1.3.5.jar:$APP_HOME/lib/jadx-plugins-api-1.3.5.jar:$APP_HOME/lib/raung-disasm-0.0.2.jar:$APP_HOME/lib/raung-common-0.0.2.jar:$APP_HOME/lib/slf4j-api-1.7.36.jar:$APP_HOME/lib/baksmali-2.5.2.jar:$APP_HOME/lib/smali-2.5.2.jar:$APP_HOME/lib/util-2.5.2.jar:$APP_HOME/lib/jcommander-1.82.jar:$APP_HOME/lib/rsyntaxtextarea-3.2.0.jar:$APP_HOME/lib/image-viewer-1.2.3.jar:$APP_HOME/lib/flatlaf-intellij-themes-2.1.jar:$APP_HOME/lib/flatlaf-extras-2.1.jar:$APP_HOME/lib/flatlaf-2.1.jar:$APP_HOME/lib/svgSalamander-1.1.3.jar:$APP_HOME/lib/gson-2.9.0.jar:$APP_HOME/lib/commons-text-1.9.jar:$APP_HOME/lib/commons-lang3-3.12.0.jar:$APP_HOME/lib/rxjava2-swing-0.3.7.jar:$APP_HOME/lib/rxjava-2.2.21.jar:$APP_HOME/lib/apksig-4.2.1.jar:$APP_HOME/lib/jdwp-1.0.jar:$APP_HOME/lib/aapt2-proto-4.2.1-7147631.jar:$APP_HOME/lib/protobuf-java-3.11.4.jar:$APP_HOME/lib/logback-core-1.2.11.jar:$APP_HOME/lib/reactive-streams-1.0.3.jar:$APP_HOME/lib/dexlib2-2.5.2.jar:$APP_HOME/lib/guava-30.1.1-jre.jar:$APP_HOME/lib/dalvik-dx-11.0.0_r3.jar:$APP_HOME/lib/r8-3.3.28.jar:$APP_HOME/lib/asm-9.3.jar:$APP_HOME/lib/antlr-3.5.2.jar:$APP_HOME/lib/ST4-4.0.8.jar:$APP_HOME/lib/antlr-runtime-3.5.2.jar:$APP_HOME/lib/stringtemplate-3.2.1.jar:$APP_HOME/lib/jsr305-3.0.2.jar:$APP_HOME/lib/failureaccess-1.0.1.jar:$APP_HOME/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:$APP_HOME/lib/checker-qual-3.8.0.jar:$APP_HOME/lib/error_prone_annotations-2.5.1.jar:$APP_HOME/lib/j2objc-annotations-1.3.jar:$APP_HOME/lib/antlr-2.7.7.jar | |
83 | 117 | |
84 | 118 | |
85 | 119 | # Determine the Java command to use to start the JVM. |
86 | 120 | if [ -n "$JAVA_HOME" ] ; then |
87 | 121 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
88 | 122 | # IBM's JDK on AIX uses strange locations for the executables |
89 | JAVACMD="$JAVA_HOME/jre/sh/java" | |
123 | JAVACMD=$JAVA_HOME/jre/sh/java | |
90 | 124 | else |
91 | JAVACMD="$JAVA_HOME/bin/java" | |
125 | JAVACMD=$JAVA_HOME/bin/java | |
92 | 126 | fi |
93 | 127 | if [ ! -x "$JAVACMD" ] ; then |
94 | 128 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME |
97 | 131 | location of your Java installation." |
98 | 132 | fi |
99 | 133 | else |
100 | JAVACMD="java" | |
134 | JAVACMD=java | |
101 | 135 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
102 | 136 | |
103 | 137 | Please set the JAVA_HOME variable in your environment to match the |
105 | 139 | fi |
106 | 140 | |
107 | 141 | # Increase the maximum file descriptors if we can. |
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | |
109 | MAX_FD_LIMIT=`ulimit -H -n` | |
110 | if [ $? -eq 0 ] ; then | |
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | |
112 | MAX_FD="$MAX_FD_LIMIT" | |
113 | fi | |
114 | ulimit -n $MAX_FD | |
115 | if [ $? -ne 0 ] ; then | |
116 | warn "Could not set maximum file descriptor limit: $MAX_FD" | |
117 | fi | |
118 | else | |
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | |
120 | fi | |
121 | fi | |
122 | ||
123 | # For Darwin, add options to specify how the application appears in the dock | |
124 | if $darwin; then | |
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | |
126 | fi | |
127 | ||
128 | # For Cygwin or MSYS, switch paths to Windows format before running java | |
129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then | |
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` | |
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | |
132 | ||
133 | JAVACMD=`cygpath --unix "$JAVACMD"` | |
134 | ||
135 | # We build the pattern for arguments to be converted via cygpath | |
136 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | |
137 | SEP="" | |
138 | for dir in $ROOTDIRSRAW ; do | |
139 | ROOTDIRS="$ROOTDIRS$SEP$dir" | |
140 | SEP="|" | |
141 | done | |
142 | OURCYGPATTERN="(^($ROOTDIRS))" | |
143 | # Add a user-defined pattern to the cygpath arguments | |
144 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then | |
145 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | |
146 | fi | |
147 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | |
148 | i=0 | |
149 | for arg in "$@" ; do | |
150 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | |
151 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | |
152 | ||
153 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | |
154 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | |
155 | else | |
156 | eval `echo args$i`="\"$arg\"" | |
157 | fi | |
158 | i=`expr $i + 1` | |
159 | done | |
160 | case $i in | |
161 | 0) set -- ;; | |
162 | 1) set -- "$args0" ;; | |
163 | 2) set -- "$args0" "$args1" ;; | |
164 | 3) set -- "$args0" "$args1" "$args2" ;; | |
165 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; | |
166 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | |
167 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | |
168 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | |
169 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | |
170 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | |
142 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then | |
143 | case $MAX_FD in #( | |
144 | max*) | |
145 | MAX_FD=$( ulimit -H -n ) || | |
146 | warn "Could not query maximum file descriptor limit" | |
147 | esac | |
148 | case $MAX_FD in #( | |
149 | '' | soft) :;; #( | |
150 | *) | |
151 | ulimit -n "$MAX_FD" || | |
152 | warn "Could not set maximum file descriptor limit to $MAX_FD" | |
171 | 153 | esac |
172 | 154 | fi |
173 | 155 | |
174 | # Escape application args | |
175 | save () { | |
176 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | |
177 | echo " " | |
178 | } | |
179 | APP_ARGS=`save "$@"` | |
180 | ||
181 | # Collect all arguments for the java command, following the shell quoting and substitution rules | |
182 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $JADX_GUI_OPTS -classpath "\"$CLASSPATH\"" jadx.gui.JadxGUI "$APP_ARGS" | |
156 | # Collect all arguments for the java command, stacking in reverse order: | |
157 | # * args from the command line | |
158 | # * the main class name | |
159 | # * -classpath | |
160 | # * -D...appname settings | |
161 | # * --module-path (only if needed) | |
162 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and JADX_GUI_OPTS environment variables. | |
163 | ||
164 | # For Cygwin or MSYS, switch paths to Windows format before running java | |
165 | if "$cygwin" || "$msys" ; then | |
166 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) | |
167 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) | |
168 | ||
169 | JAVACMD=$( cygpath --unix "$JAVACMD" ) | |
170 | ||
171 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | |
172 | for arg do | |
173 | if | |
174 | case $arg in #( | |
175 | -*) false ;; # don't mess with options #( | |
176 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath | |
177 | [ -e "$t" ] ;; #( | |
178 | *) false ;; | |
179 | esac | |
180 | then | |
181 | arg=$( cygpath --path --ignore --mixed "$arg" ) | |
182 | fi | |
183 | # Roll the args list around exactly as many times as the number of | |
184 | # args, so each arg winds up back in the position where it started, but | |
185 | # possibly modified. | |
186 | # | |
187 | # NB: a `for` loop captures its iteration list before it begins, so | |
188 | # changing the positional parameters here affects neither the number of | |
189 | # iterations, nor the values presented in `arg`. | |
190 | shift # remove old arg | |
191 | set -- "$@" "$arg" # push replacement arg | |
192 | done | |
193 | fi | |
194 | ||
195 | # Collect all arguments for the java command; | |
196 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $JADX_GUI_OPTS can contain fragments of | |
197 | # shell script including quotes and variable substitutions, so put them in | |
198 | # double quotes to make sure that they get re-expanded; and | |
199 | # * put everything else in single quotes, so that it's not re-expanded. | |
200 | ||
201 | set -- \ | |
202 | -classpath "$CLASSPATH" \ | |
203 | jadx.gui.JadxGUI \ | |
204 | "$@" | |
205 | ||
206 | # Use "xargs" to parse quoted args. | |
207 | # | |
208 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. | |
209 | # | |
210 | # In Bash we could simply go: | |
211 | # | |
212 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && | |
213 | # set -- "${ARGS[@]}" "$@" | |
214 | # | |
215 | # but POSIX shell has neither arrays nor command substitution, so instead we | |
216 | # post-process each arg (as a line of input to sed) to backslash-escape any | |
217 | # character that might be a shell metacharacter, then use eval to reverse | |
218 | # that process (while maintaining the separation between arguments), and wrap | |
219 | # the whole thing up as a single "set" statement. | |
220 | # | |
221 | # This will of course break if any of these variables contains a newline or | |
222 | # an unmatched quote. | |
223 | # | |
224 | ||
225 | eval "set -- $( | |
226 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $JADX_GUI_OPTS" | | |
227 | xargs -n1 | | |
228 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | | |
229 | tr '\n' ' ' | |
230 | )" '"$@"' | |
183 | 231 | |
184 | 232 | exec "$JAVACMD" "$@" |
32 | 32 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi |
33 | 33 | |
34 | 34 | @rem Add default JVM options here. You can also use JAVA_OPTS and JADX_GUI_OPTS to pass JVM options to this script. |
35 | set DEFAULT_JVM_OPTS="-Xms128M" "-Xmx4g" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true" "-XX:+UseG1GC" | |
35 | set DEFAULT_JVM_OPTS="-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true" | |
36 | 36 | |
37 | 37 | @rem Find javaw.exe |
38 | 38 | if defined JAVA_HOME goto findJavaFromJavaHome |
66 | 66 | :execute |
67 | 67 | @rem Setup the command line |
68 | 68 | |
69 | set CLASSPATH=%APP_HOME%\lib\jadx-gui-1.2.0.jar;%APP_HOME%\lib\jfontchooser-1.0.5.jar;%APP_HOME%\lib\jadx-cli-1.2.0.jar;%APP_HOME%\lib\jadx-core-1.2.0.jar;%APP_HOME%\lib\android-29-clst.jar;%APP_HOME%\lib\android-29-res.jar;%APP_HOME%\lib\logback-classic-1.2.3.jar;%APP_HOME%\lib\jadx-smali-input-1.2.0.jar;%APP_HOME%\lib\jadx-java-convert-1.2.0.jar;%APP_HOME%\lib\dx-1.16.jar;%APP_HOME%\lib\jadx-dex-input-1.2.0.jar;%APP_HOME%\lib\jadx-plugins-api-1.2.0.jar;%APP_HOME%\lib\slf4j-api-1.7.30.jar;%APP_HOME%\lib\baksmali-2.4.0.jar;%APP_HOME%\lib\smali-2.4.0.jar;%APP_HOME%\lib\util-2.4.0.jar;%APP_HOME%\lib\jcommander-1.80.jar;%APP_HOME%\lib\rsyntaxtextarea-3.1.1.jar;%APP_HOME%\lib\image-viewer-1.2.3.jar;%APP_HOME%\lib\gson-2.8.6.jar;%APP_HOME%\lib\commons-text-1.9.jar;%APP_HOME%\lib\commons-lang3-3.11.jar;%APP_HOME%\lib\rxjava2-swing-0.3.7.jar;%APP_HOME%\lib\rxjava-2.2.19.jar;%APP_HOME%\lib\apksig-4.0.1.jar;%APP_HOME%\lib\logback-core-1.2.3.jar;%APP_HOME%\lib\reactive-streams-1.0.3.jar;%APP_HOME%\lib\dexlib2-2.4.0.jar;%APP_HOME%\lib\guava-29.0-jre.jar;%APP_HOME%\lib\asm-8.0.1.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\checker-qual-2.11.1.jar;%APP_HOME%\lib\error_prone_annotations-2.3.4.jar;%APP_HOME%\lib\j2objc-annotations-1.3.jar;%APP_HOME%\lib\antlr-runtime-3.5.2.jar;%APP_HOME%\lib\stringtemplate-3.2.1.jar;%APP_HOME%\lib\antlr-2.7.7.jar | |
69 | set CLASSPATH=%APP_HOME%\lib\jadx-gui-1.3.5.jar;%APP_HOME%\lib\jfontchooser-1.0.5.jar;%APP_HOME%\lib\jadx-cli-1.3.5.jar;%APP_HOME%\lib\jadx-core-1.3.5.jar;%APP_HOME%\lib\logback-classic-1.2.11.jar;%APP_HOME%\lib\jadx-java-convert-1.3.5.jar;%APP_HOME%\lib\jadx-smali-input-1.3.5.jar;%APP_HOME%\lib\jadx-dex-input-1.3.5.jar;%APP_HOME%\lib\jadx-java-input-1.3.5.jar;%APP_HOME%\lib\jadx-plugins-api-1.3.5.jar;%APP_HOME%\lib\raung-disasm-0.0.2.jar;%APP_HOME%\lib\raung-common-0.0.2.jar;%APP_HOME%\lib\slf4j-api-1.7.36.jar;%APP_HOME%\lib\baksmali-2.5.2.jar;%APP_HOME%\lib\smali-2.5.2.jar;%APP_HOME%\lib\util-2.5.2.jar;%APP_HOME%\lib\jcommander-1.82.jar;%APP_HOME%\lib\rsyntaxtextarea-3.2.0.jar;%APP_HOME%\lib\image-viewer-1.2.3.jar;%APP_HOME%\lib\flatlaf-intellij-themes-2.1.jar;%APP_HOME%\lib\flatlaf-extras-2.1.jar;%APP_HOME%\lib\flatlaf-2.1.jar;%APP_HOME%\lib\svgSalamander-1.1.3.jar;%APP_HOME%\lib\gson-2.9.0.jar;%APP_HOME%\lib\commons-text-1.9.jar;%APP_HOME%\lib\commons-lang3-3.12.0.jar;%APP_HOME%\lib\rxjava2-swing-0.3.7.jar;%APP_HOME%\lib\rxjava-2.2.21.jar;%APP_HOME%\lib\apksig-4.2.1.jar;%APP_HOME%\lib\jdwp-1.0.jar;%APP_HOME%\lib\aapt2-proto-4.2.1-7147631.jar;%APP_HOME%\lib\protobuf-java-3.11.4.jar;%APP_HOME%\lib\logback-core-1.2.11.jar;%APP_HOME%\lib\reactive-streams-1.0.3.jar;%APP_HOME%\lib\dexlib2-2.5.2.jar;%APP_HOME%\lib\guava-30.1.1-jre.jar;%APP_HOME%\lib\dalvik-dx-11.0.0_r3.jar;%APP_HOME%\lib\r8-3.3.28.jar;%APP_HOME%\lib\asm-9.3.jar;%APP_HOME%\lib\antlr-3.5.2.jar;%APP_HOME%\lib\ST4-4.0.8.jar;%APP_HOME%\lib\antlr-runtime-3.5.2.jar;%APP_HOME%\lib\stringtemplate-3.2.1.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\checker-qual-3.8.0.jar;%APP_HOME%\lib\error_prone_annotations-2.5.1.jar;%APP_HOME%\lib\j2objc-annotations-1.3.jar;%APP_HOME%\lib\antlr-2.7.7.jar | |
70 | 70 | |
71 | 71 | |
72 | 72 | @rem Execute jadx-gui |
32 | 32 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi |
33 | 33 | |
34 | 34 | @rem Add default JVM options here. You can also use JAVA_OPTS and JADX_OPTS to pass JVM options to this script. |
35 | set DEFAULT_JVM_OPTS="-Xms128M" "-Xmx4g" "-XX:+UseG1GC" | |
35 | set DEFAULT_JVM_OPTS="-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC" | |
36 | 36 | |
37 | 37 | @rem Find java.exe |
38 | 38 | if defined JAVA_HOME goto findJavaFromJavaHome |
66 | 66 | :execute |
67 | 67 | @rem Setup the command line |
68 | 68 | |
69 | set CLASSPATH=%APP_HOME%\lib\jadx-cli-1.2.0.jar;%APP_HOME%\lib\jadx-core-1.2.0.jar;%APP_HOME%\lib\android-29-clst.jar;%APP_HOME%\lib\android-29-res.jar;%APP_HOME%\lib\logback-classic-1.2.3.jar;%APP_HOME%\lib\jadx-smali-input-1.2.0.jar;%APP_HOME%\lib\jadx-java-convert-1.2.0.jar;%APP_HOME%\lib\dx-1.16.jar;%APP_HOME%\lib\jadx-dex-input-1.2.0.jar;%APP_HOME%\lib\jadx-plugins-api-1.2.0.jar;%APP_HOME%\lib\slf4j-api-1.7.30.jar;%APP_HOME%\lib\baksmali-2.4.0.jar;%APP_HOME%\lib\smali-2.4.0.jar;%APP_HOME%\lib\util-2.4.0.jar;%APP_HOME%\lib\jcommander-1.80.jar;%APP_HOME%\lib\gson-2.8.6.jar;%APP_HOME%\lib\logback-core-1.2.3.jar;%APP_HOME%\lib\dexlib2-2.4.0.jar;%APP_HOME%\lib\guava-29.0-jre.jar;%APP_HOME%\lib\asm-8.0.1.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\checker-qual-2.11.1.jar;%APP_HOME%\lib\error_prone_annotations-2.3.4.jar;%APP_HOME%\lib\j2objc-annotations-1.3.jar;%APP_HOME%\lib\antlr-runtime-3.5.2.jar;%APP_HOME%\lib\stringtemplate-3.2.1.jar;%APP_HOME%\lib\antlr-2.7.7.jar | |
69 | set CLASSPATH=%APP_HOME%\lib\jadx-cli-1.3.5.jar;%APP_HOME%\lib\jadx-core-1.3.5.jar;%APP_HOME%\lib\logback-classic-1.2.11.jar;%APP_HOME%\lib\jadx-java-convert-1.3.5.jar;%APP_HOME%\lib\jadx-smali-input-1.3.5.jar;%APP_HOME%\lib\jadx-dex-input-1.3.5.jar;%APP_HOME%\lib\jadx-java-input-1.3.5.jar;%APP_HOME%\lib\jadx-plugins-api-1.3.5.jar;%APP_HOME%\lib\raung-disasm-0.0.2.jar;%APP_HOME%\lib\raung-common-0.0.2.jar;%APP_HOME%\lib\slf4j-api-1.7.36.jar;%APP_HOME%\lib\baksmali-2.5.2.jar;%APP_HOME%\lib\smali-2.5.2.jar;%APP_HOME%\lib\util-2.5.2.jar;%APP_HOME%\lib\jcommander-1.82.jar;%APP_HOME%\lib\gson-2.9.0.jar;%APP_HOME%\lib\aapt2-proto-4.2.1-7147631.jar;%APP_HOME%\lib\protobuf-java-3.11.4.jar;%APP_HOME%\lib\logback-core-1.2.11.jar;%APP_HOME%\lib\dexlib2-2.5.2.jar;%APP_HOME%\lib\guava-30.1.1-jre.jar;%APP_HOME%\lib\dalvik-dx-11.0.0_r3.jar;%APP_HOME%\lib\r8-3.3.28.jar;%APP_HOME%\lib\asm-9.3.jar;%APP_HOME%\lib\antlr-3.5.2.jar;%APP_HOME%\lib\ST4-4.0.8.jar;%APP_HOME%\lib\antlr-runtime-3.5.2.jar;%APP_HOME%\lib\stringtemplate-3.2.1.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\checker-qual-3.8.0.jar;%APP_HOME%\lib\error_prone_annotations-2.5.1.jar;%APP_HOME%\lib\j2objc-annotations-1.3.jar;%APP_HOME%\lib\antlr-2.7.7.jar | |
70 | 70 | |
71 | 71 | |
72 | 72 | @rem Execute jadx |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown