java-deobfuscator / deobfuscator

The real deal
https://javadeobfuscator.com
Apache License 2.0
1.59k stars 295 forks source link

Build seems to work but still have error #590

Closed wanalearncode closed 4 years ago

wanalearncode commented 4 years ago

ok so now when I build the project I have that: mvn clean install -U

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< com.javadeobfuscator:deobfuscator >------------------
[INFO] Building deobfuscator 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ deobfuscator ---
[INFO] Deleting /Users/Downloads/deobfuscator-master/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ deobfuscator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/Downloads/deobfuscator-master/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ deobfuscator ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 212 source files to /Users/Downloads/deobfuscator-master/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/Downloads/deobfuscator-master/src/main/java/com/javadeobfuscator/deobfuscator/executor/defined/JVMMethodProvider.java:[62,21] error: package javax.xml.bind does not exist
[ERROR] /Users/Downloads/deobfuscator-master/src/main/java/com/javadeobfuscator/deobfuscator/executor/defined/JVMMethodProvider.java:[772,92] error: cannot find symbol
  symbol: variable DatatypeConverter
[ERROR] /Users/Downloads/deobfuscator-master/src/main/java/com/javadeobfuscator/deobfuscator/executor/defined/JVMMethodProvider.java:[773,89] error: cannot find symbol
  symbol: variable DatatypeConverter
[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.266 s
[INFO] Finished at: 2020-06-26T15:14:31-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project deobfuscator: Compilation failure: Compilation failure: 
[ERROR] /Users/Downloads/deobfuscator-master/src/main/java/com/javadeobfuscator/deobfuscator/executor/defined/JVMMethodProvider.java:[62,21] error: package javax.xml.bind does not exist
[ERROR] /Users/Downloads/deobfuscator-master/src/main/java/com/javadeobfuscator/deobfuscator/executor/defined/JVMMethodProvider.java:[772,92] error: cannot find symbol
[ERROR]   symbol: variable DatatypeConverter
[ERROR] /Users/Downloads/deobfuscator-master/src/main/java/com/javadeobfuscator/deobfuscator/executor/defined/JVMMethodProvider.java:[773,89] error: cannot find symbol
[ERROR]   symbol: variable DatatypeConverter
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I have last java 8 jdk when It try to add this to pom.xml:

<dependency>
  <groupId>javax.xml.bind</groupId>
  <artifactId>jaxb-api</artifactId>
  <version>2.3.0</version>
</dependency>
<dependency>
  <groupId>com.sun.xml.bind</groupId>
  <artifactId>jaxb-core</artifactId>
  <version>2.3.0</version>
</dependency>
<dependency>
  <groupId>com.sun.xml.bind</groupId>
  <artifactId>jaxb-impl</artifactId>
  <version>2.3.0</version>
</dependency>

it seems to build with no error but some warning here is build try:

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< com.javadeobfuscator:deobfuscator >------------------
[INFO] Building deobfuscator 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ deobfuscator ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ deobfuscator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/Downloads/deobfuscator-master/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ deobfuscator ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 212 source files to /Users/Downloads/deobfuscator-master/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ deobfuscator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ deobfuscator ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/Downloads/deobfuscator-master/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ deobfuscator ---
[INFO] Surefire report directory: /Users/Downloads/deobfuscator-master/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.javadeobfuscator.deobfuscator.TestRunner
java.nio.file.NoSuchFileException: /usr/local/Cellar/openjdk/13.0.2+8_2/libexec/openjdk.jdk/Contents/Home/lib/rt.jar
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
    at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
    at java.base/java.nio.file.Files.readAttributes(Files.java:1842)
    at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1160)
    at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:719)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:239)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:169)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:183)
    at com.javadeobfuscator.deobfuscator.TestRunner.setup(TestRunner.java:36)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Krakatau assembler does not exist
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.108 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ deobfuscator ---
[INFO] Building jar: /Users/Downloads/deobfuscator-master/target/deobfuscator-1.0.0.jar
[INFO] 
[INFO] --- maven-shade-plugin:3.1.0:shade (default) @ deobfuscator ---
[INFO] Including commons-cli:commons-cli:jar:1.3.1 in the shaded jar.
[INFO] Including commons-io:commons-io:jar:2.5 in the shaded jar.
[INFO] Including com.google.guava:guava:jar:19.0 in the shaded jar.
[INFO] Including org.jooq:jool:jar:0.9.9 in the shaded jar.
[INFO] Including com.google.code.gson:gson:jar:2.6.2 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-core:jar:2.9.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-databind:jar:2.9.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0 in the shaded jar.
[INFO] Including org.slf4j:slf4j-api:jar:1.8.0-alpha2 in the shaded jar.
[INFO] Including org.slf4j:slf4j-simple:jar:1.8.0-alpha2 in the shaded jar.
[INFO] Including com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.1 in the shaded jar.
[INFO] Including org.yaml:snakeyaml:jar:1.18 in the shaded jar.
[INFO] Including com.javadeobfuscator:javavm:jar:3.0.0 in the shaded jar.
[INFO] Including org.ow2.asm:asm:jar:7.1 in the shaded jar.
[INFO] Including org.ow2.asm:asm-commons:jar:7.1 in the shaded jar.
[INFO] Including org.ow2.asm:asm-util:jar:7.1 in the shaded jar.
[INFO] Including org.ow2.asm:asm-tree:jar:7.1 in the shaded jar.
[INFO] Including org.ow2.asm:asm-analysis:jar:7.1 in the shaded jar.
[INFO] Including javax.xml.bind:jaxb-api:jar:2.3.0 in the shaded jar.
[INFO] Including com.sun.xml.bind:jaxb-core:jar:2.3.0 in the shaded jar.
[INFO] Including com.sun.xml.bind:jaxb-impl:jar:2.3.0 in the shaded jar.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] javavm-3.0.0.jar, asm-tree-7.1.jar define 35 overlapping classes: 
[WARNING]   - org.objectweb.asm.tree.InsnList
[WARNING]   - org.objectweb.asm.tree.MethodNode$1
[WARNING]   - org.objectweb.asm.tree.ModuleRequireNode
[WARNING]   - org.objectweb.asm.tree.FieldInsnNode
[WARNING]   - org.objectweb.asm.tree.LineNumberNode
[WARNING]   - org.objectweb.asm.tree.LocalVariableNode
[WARNING]   - org.objectweb.asm.tree.LocalVariableAnnotationNode
[WARNING]   - org.objectweb.asm.tree.FieldNode
[WARNING]   - org.objectweb.asm.tree.TableSwitchInsnNode
[WARNING]   - org.objectweb.asm.tree.JumpInsnNode
[WARNING]   - 25 more...
[WARNING] javavm-3.0.0.jar, asm-commons-7.1.jar define 26 overlapping classes: 
[WARNING]   - org.objectweb.asm.commons.CodeSizeEvaluator
[WARNING]   - org.objectweb.asm.commons.TryCatchBlockSorter$1
[WARNING]   - org.objectweb.asm.commons.FieldRemapper
[WARNING]   - org.objectweb.asm.commons.JSRInlinerAdapter$Instantiation
[WARNING]   - org.objectweb.asm.commons.InstructionAdapter
[WARNING]   - org.objectweb.asm.commons.SimpleRemapper
[WARNING]   - org.objectweb.asm.commons.AnnotationRemapper
[WARNING]   - org.objectweb.asm.commons.ModuleHashesAttribute
[WARNING]   - org.objectweb.asm.commons.JSRInlinerAdapter
[WARNING]   - org.objectweb.asm.commons.StaticInitMerger
[WARNING]   - 16 more...
[WARNING] javavm-3.0.0.jar, asm-util-7.1.jar define 18 overlapping classes: 
[WARNING]   - org.objectweb.asm.util.Textifiable
[WARNING]   - org.objectweb.asm.util.Textifier
[WARNING]   - org.objectweb.asm.util.TraceAnnotationVisitor
[WARNING]   - org.objectweb.asm.util.Printer
[WARNING]   - org.objectweb.asm.util.ASMifier
[WARNING]   - org.objectweb.asm.util.CheckSignatureAdapter
[WARNING]   - org.objectweb.asm.util.CheckAnnotationAdapter
[WARNING]   - org.objectweb.asm.util.TraceClassVisitor
[WARNING]   - org.objectweb.asm.util.TraceFieldVisitor
[WARNING]   - org.objectweb.asm.util.CheckClassAdapter
[WARNING]   - 8 more...
[WARNING] javavm-3.0.0.jar, guava-19.0.jar define 1624 overlapping classes: 
[WARNING]   - com.google.common.collect.ImmutableMapValues$1
[WARNING]   - com.google.common.io.LineProcessor
[WARNING]   - com.google.common.util.concurrent.AbstractService$5
[WARNING]   - com.google.common.io.BaseEncoding$StandardBaseEncoding$2
[WARNING]   - com.google.common.io.ByteProcessor
[WARNING]   - com.google.common.math.package-info
[WARNING]   - com.google.common.util.concurrent.SimpleTimeLimiter
[WARNING]   - com.google.common.cache.AbstractCache$StatsCounter
[WARNING]   - com.google.common.util.concurrent.CycleDetectingLockFactory$Policies
[WARNING]   - com.google.common.primitives.UnsignedInts$LexicographicalComparator
[WARNING]   - 1614 more...
[WARNING] javavm-3.0.0.jar, asm-7.1.jar define 27 overlapping classes: 
[WARNING]   - org.objectweb.asm.CurrentFrame
[WARNING]   - org.objectweb.asm.Type
[WARNING]   - org.objectweb.asm.AnnotationVisitor
[WARNING]   - org.objectweb.asm.MethodVisitor
[WARNING]   - org.objectweb.asm.Attribute
[WARNING]   - org.objectweb.asm.MethodWriter
[WARNING]   - org.objectweb.asm.Handler
[WARNING]   - org.objectweb.asm.ByteVector
[WARNING]   - org.objectweb.asm.ModuleVisitor
[WARNING]   - org.objectweb.asm.Opcodes
[WARNING]   - 17 more...
[WARNING] javavm-3.0.0.jar, asm-analysis-7.1.jar define 13 overlapping classes: 
[WARNING]   - org.objectweb.asm.tree.analysis.SourceInterpreter
[WARNING]   - org.objectweb.asm.tree.analysis.SmallSet
[WARNING]   - org.objectweb.asm.tree.analysis.SimpleVerifier
[WARNING]   - org.objectweb.asm.tree.analysis.Analyzer
[WARNING]   - org.objectweb.asm.tree.analysis.SourceValue
[WARNING]   - org.objectweb.asm.tree.analysis.Frame
[WARNING]   - org.objectweb.asm.tree.analysis.BasicValue
[WARNING]   - org.objectweb.asm.tree.analysis.BasicInterpreter
[WARNING]   - org.objectweb.asm.tree.analysis.Subroutine
[WARNING]   - org.objectweb.asm.tree.analysis.Interpreter
[WARNING]   - 3 more...
[WARNING] javavm-3.0.0.jar, commons-io-2.5.jar define 123 overlapping classes: 
[WARNING]   - org.apache.commons.io.FileCleaningTracker
[WARNING]   - org.apache.commons.io.comparator.SizeFileComparator
[WARNING]   - org.apache.commons.io.input.CloseShieldInputStream
[WARNING]   - org.apache.commons.io.filefilter.EmptyFileFilter
[WARNING]   - org.apache.commons.io.monitor.FileEntry
[WARNING]   - org.apache.commons.io.output.ThresholdingOutputStream
[WARNING]   - org.apache.commons.io.input.TailerListener
[WARNING]   - org.apache.commons.io.IOExceptionWithCause
[WARNING]   - org.apache.commons.io.comparator.PathFileComparator
[WARNING]   - org.apache.commons.io.filefilter.NotFileFilter
[WARNING]   - 113 more...
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /Users/Downloads/deobfuscator-master/target/deobfuscator-1.0.0.jar with /Users/Downloads/deobfuscator-master/target/deobfuscator-1.0.0-shaded.jar
[INFO] Dependency-reduced POM written at: /Users/Downloads/deobfuscator-master/dependency-reduced-pom.xml
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ deobfuscator ---
[INFO] Installing /Users/Downloads/deobfuscator-master/target/deobfuscator-1.0.0.jar to /Users/.m2/repository/com/javadeobfuscator/deobfuscator/1.0.0/deobfuscator-1.0.0.jar
[INFO] Installing /Users/Downloads/deobfuscator-master/dependency-reduced-pom.xml to /Users/.m2/repository/com/javadeobfuscator/deobfuscator/1.0.0/deobfuscator-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13.443 s
[INFO] Finished at: 2020-06-26T15:01:22-04:00
[INFO] ------------------------------------------------------------------------

when I try use the .jar from build result, I have this kind of error seems to be a VM error

[Deobfuscation failed. Please open a ticket on GitHub and provide the following error:
java.lang.NullPointerException
    at com.javadeobfuscator.javavm.mirrors.JavaClass.<init>(JavaClass.java:178)
    at com.javadeobfuscator.javavm.mirrors.JavaClass.forName(JavaClass.java:219)
    at com.javadeobfuscator.javavm.hooks.HookGenerator.generateUnknownHandlingHook(HookGenerator.java:73)
    at com.javadeobfuscator.javavm.nativeimpls.sun_misc_URLClassPath.registerNatives(sun_misc_URLClassPath.java:28)
    at com.javadeobfuscator.javavm.VirtualMachine.registerNatives(VirtualMachine.java:500)
    at com.javadeobfuscator.javavm.VirtualMachine.<init>(VirtualMachine.java:124)
    at com.javadeobfuscator.deobfuscator.utils.TransformerHelper.newVirtualMachine(TransformerHelper.java:167)
    at com.javadeobfuscator.deobfuscator.transformers.dasho.string.StringEncryptionTransformer.transform(StringEncryptionTransformer.java:39)
    at com.javadeobfuscator.deobfuscator.Deobfuscator.runFromConfig(Deobfuscator.java:409)
    at com.javadeobfuscator.deobfuscator.Deobfuscator.start(Deobfuscator.java:366)
    at com.javadeobfuscator.deobfuscator.DeobfuscatorMain.run(DeobfuscatorMain.java:120)
    at com.javadeobfuscator.deobfuscator.DeobfuscatorMain.run(DeobfuscatorMain.java:113)
    at com.javadeobfuscator.deobfuscator.DeobfuscatorMain.main(DeobfuscatorMain.java:50)]

Any idea what I did wrong? Thank you!

ThisTestUser commented 4 years ago

Super late reply here, but the problem seems to be that javavm is using ASM 6.0, while the ASM version in the deobfuscator project is 7.1. You can try changing the ASM version to 6.0 to fix this.

ItzSomebody commented 4 years ago

No reply for several months. Closing.