在编译jadx的时候会出现这样的错误:
> Task :jadx-gui:test
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
> Task :spotlessJavaCheck FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':spotlessJavaCheck'.
> The following files had format violations:
jadx-cli\src\main\java\jadx\cli\clst\ConvertToClsSet.java
@@ -1,67 +1,67 @@
-package jadx.cli.clst;\r\n
-\r\n
-import java.nio.file.Path;\r\n
-import java.nio.file.Paths;\r\n
-import java.util.ArrayList;\r\n
-import java.util.EnumSet;\r\n
-import java.util.List;\r\n
-import java.util.stream.Collectors;\r\n
-import java.util.stream.Stream;\r\n
-\r\n
-import org.slf4j.Logger;\r\n
-import org.slf4j.LoggerFactory;\r\n
-\r\n
-import jadx.api.JadxArgs;\r\n
-import jadx.api.plugins.JadxPluginManager;\r\n
-import jadx.api.plugins.input.JadxInputPlugin;\r\n
-import jadx.api.plugins.input.data.ILoadResult;\r\n
-import jadx.core.clsp.ClsSet;\r\n
-import jadx.core.dex.nodes.ClassNode;\r\n
-import jadx.core.dex.nodes.RootNode;\r\n
-import jadx.core.dex.visitors.SignatureProcessor;\r\n
-\r\n
-/**\r\n
- * Utility class for convert dex or jar to jadx classes set (.jcst)\r\n
- */\r\n
-public class ConvertToClsSet {\r\n
- private static final Logger LOG = LoggerFactory.getLogger(ConvertToClsSet.class);\r\n
-\r\n
- public static void usage() {\r\n
- LOG.info("<output .jcst or .jar file> <several input dex or jar files> ");\r\n
- }\r\n
-\r\n
- public static void main(String[] args) throws Exception {\r\n
- if (args.length < 2) {\r\n
- usage();\r\n
- System.exit(1);\r\n
- }\r\n
- List<Path> inputPaths = Stream.of(args).map(Paths::get).collect(Collectors.toList());\r\n
- Path output = inputPaths.remove(0);\r\n
-\r\n
- JadxPluginManager pluginManager = new JadxPluginManager();\r\n
- pluginManager.load();\r\n
- List<ILoadResult> loadedInputs = new ArrayList<>();\r\n
- for (JadxInputPlugin inputPlugin : pluginManager.getInputPlugins()) {\r\n
- loadedInputs.add(inputPlugin.loadFiles(inputPaths));\r\n
- }\r\n
-\r\n
- JadxArgs jadxArgs = new JadxArgs();\r\n
... (86 more lines that didn't fit)
Violations also present in 1289 other files.
Run 'gradlew.bat :spotlessApply' to fix these violations.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
BUILD FAILED in 17s
99 actionable tasks: 4 executed, 95 up-to-date
解决办法build.gradle添加:
allprojects {
...
tasks.withType(JavaExec) {
jvmArgs = ['-Xshare:off']
}
...
}