Skip to content

Commit

Permalink
exclude inner class
Browse files Browse the repository at this point in the history
  • Loading branch information
bsp committed Jan 13, 2018
1 parent c88105f commit 1d35765
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/bryansharp/jar2java/Decompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ public class Decompiler {
/**
* Actual call to the native lib.
*
* @param basePath Path to the root of the classpath, either a path to a directory or a path to a jar file.
* @param internalTypeName internal name of the type.
* @param basePath Path to the root of the classpath, either a path to a directory or a path to a jar file.
* @param internalTypeName internal name of the type.
* @return Decompiled class text.
*/
public static String decompile(String basePath, String internalTypeName) {
// Load preferences
boolean showDefaultConstructor = true;
boolean showDefaultConstructor = false;
boolean realignmentLineNumber = true;
boolean showPrefixThis = false;
boolean mergeEmptyLines = false;
boolean mergeEmptyLines = true;
boolean unicodeEscape = false;
boolean showLineNumbers = true;
boolean showLineNumbers = false;
boolean showMetadata = false;

// Create preferences
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/bryansharp/jar2java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ private static void printJar(String jarFullPath) throws IOException {
ZipEntry zipEntry = entries.nextElement();
String name = zipEntry.getName();
if (name.endsWith(".class")) {
log("start to decompile class " + name);
//内部类直接跳过
if (name.contains("$")) {
log("jump inner class " + name);
continue;
}
String result = null;
log("start to decompile class " + name);
try {
result = Decompiler.decompile(jarFullPath, name);
stringToClassFile(name, result);
Expand Down

0 comments on commit 1d35765

Please sign in to comment.