deathmarine / Luyten

An Open Source Java Decompiler Gui for Procyon
Other
5.01k stars 999 forks source link

Decompiler throws NPE at DefiniteAssignmentAnalysis.setAnalyzedRange #84

Closed jamesqo closed 5 years ago

jamesqo commented 7 years ago

Repro

  1. Go to https://apps.evozi.com/apk-downloader/
  2. Type in com.aor.droidedit & download
  3. Go to https://github.com/pxb1988/dex2jar and run the tool on this APK to create a JAR
  4. Navigate to com.aor.droidedit.DroidEditActivity to hit the below error
java.lang.NullPointerException
    at com.strobel.decompiler.languages.java.ast.DefiniteAssignmentAnalysis.setAnalyzedRange(DefiniteAssignmentAnalysis.java:117)
    at com.strobel.decompiler.languages.java.ast.DefiniteAssignmentAnalysis.setAnalyzedRange(DefiniteAssignmentAnalysis.java:108)
    at com.strobel.decompiler.languages.java.ast.transforms.DeclareVariablesTransform.findDeclarationPoint(DeclareVariablesTransform.java:422)
    at com.strobel.decompiler.languages.java.ast.transforms.DeclareVariablesTransform.findDeclarationPoint(DeclareVariablesTransform.java:367)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.canMoveVariableDeclarationIntoStatement(ConvertLoopsTransform.java:1469)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.canInlineInitializerDeclarations(ConvertLoopsTransform.java:480)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.transformFor(ConvertLoopsTransform.java:346)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitWhileStatement(ConvertLoopsTransform.java:85)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitWhileStatement(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.WhileStatement.acceptVisitor(WhileStatement.java:64)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitBlockStatement(DepthFirstAstVisitor.java:96)
    at com.strobel.decompiler.languages.java.ast.BlockStatement.acceptVisitor(BlockStatement.java:72)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitMethodDeclaration(DepthFirstAstVisitor.java:206)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitMethodDeclaration(ContextTrackingVisitor.java:64)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitMethodDeclaration(ContextTrackingVisitor.java:28)
    at com.strobel.decompiler.languages.java.ast.MethodDeclaration.acceptVisitor(MethodDeclaration.java:85)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitTypeDeclaration(DepthFirstAstVisitor.java:236)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitTypeDeclaration(ContextTrackingVisitor.java:52)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitTypeDeclaration(ContextTrackingVisitor.java:28)
    at com.strobel.decompiler.languages.java.ast.TypeDeclaration.acceptVisitor(TypeDeclaration.java:90)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitAnonymousObjectCreationExpression(DepthFirstAstVisitor.java:351)
    at com.strobel.decompiler.languages.java.ast.AnonymousObjectCreationExpression.acceptVisitor(AnonymousObjectCreationExpression.java:59)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitCastExpression(DepthFirstAstVisitor.java:271)
    at com.strobel.decompiler.languages.java.ast.CastExpression.acceptVisitor(CastExpression.java:55)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitInvocationExpression(DepthFirstAstVisitor.java:51)
    at com.strobel.decompiler.languages.java.ast.InvocationExpression.acceptVisitor(InvocationExpression.java:68)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitMemberReferenceExpression(DepthFirstAstVisitor.java:66)
    at com.strobel.decompiler.languages.java.ast.MemberReferenceExpression.acceptVisitor(MemberReferenceExpression.java:92)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitInvocationExpression(DepthFirstAstVisitor.java:51)
    at com.strobel.decompiler.languages.java.ast.InvocationExpression.acceptVisitor(InvocationExpression.java:68)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitMemberReferenceExpression(DepthFirstAstVisitor.java:66)
    at com.strobel.decompiler.languages.java.ast.MemberReferenceExpression.acceptVisitor(MemberReferenceExpression.java:92)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitInvocationExpression(DepthFirstAstVisitor.java:51)
    at com.strobel.decompiler.languages.java.ast.InvocationExpression.acceptVisitor(InvocationExpression.java:68)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitMemberReferenceExpression(DepthFirstAstVisitor.java:66)
    at com.strobel.decompiler.languages.java.ast.MemberReferenceExpression.acceptVisitor(MemberReferenceExpression.java:92)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitInvocationExpression(DepthFirstAstVisitor.java:51)
    at com.strobel.decompiler.languages.java.ast.InvocationExpression.acceptVisitor(InvocationExpression.java:68)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitAssignmentExpression(DepthFirstAstVisitor.java:321)
    at com.strobel.decompiler.languages.java.ast.AssignmentExpression.acceptVisitor(AssignmentExpression.java:88)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitExpressionStatement(DepthFirstAstVisitor.java:101)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitExpressionStatement(ConvertLoopsTransform.java:68)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitExpressionStatement(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.ExpressionStatement.acceptVisitor(ExpressionStatement.java:47)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitBlockStatement(DepthFirstAstVisitor.java:96)
    at com.strobel.decompiler.languages.java.ast.BlockStatement.acceptVisitor(BlockStatement.java:72)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitMethodDeclaration(DepthFirstAstVisitor.java:206)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitMethodDeclaration(ContextTrackingVisitor.java:64)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitMethodDeclaration(ContextTrackingVisitor.java:28)
    at com.strobel.decompiler.languages.java.ast.MethodDeclaration.acceptVisitor(MethodDeclaration.java:85)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitTypeDeclaration(DepthFirstAstVisitor.java:236)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitTypeDeclaration(ContextTrackingVisitor.java:52)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitTypeDeclaration(ContextTrackingVisitor.java:28)
    at com.strobel.decompiler.languages.java.ast.TypeDeclaration.acceptVisitor(TypeDeclaration.java:90)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:56)
    at com.strobel.decompiler.languages.java.ast.transforms.ConvertLoopsTransform.visitChildren(ConvertLoopsTransform.java:42)
    at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitCompilationUnit(DepthFirstAstVisitor.java:241)
    at com.strobel.decompiler.languages.java.ast.CompilationUnit.acceptVisitor(CompilationUnit.java:81)
    at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.run(ContextTrackingVisitor.java:84)
    at com.strobel.decompiler.languages.java.ast.transforms.TransformationPipeline.runTransformationsUntil(TransformationPipeline.java:91)
    at com.strobel.decompiler.languages.java.ast.AstBuilder.runTransformations(AstBuilder.java:99)
    at com.strobel.decompiler.languages.java.JavaLanguage.runTransforms(JavaLanguage.java:97)
    at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:72)
    at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)
    at us.deathmarine.luyten.DecompilerLinkProvider.generateContent(DecompilerLinkProvider.java:97)
    at us.deathmarine.luyten.OpenFile.decompileWithNavigationLinks(OpenFile.java:469)
    at us.deathmarine.luyten.OpenFile.decompile(OpenFile.java:442)
    at us.deathmarine.luyten.Model.extractClassToTextPane(Model.java:420)
    at us.deathmarine.luyten.Model.openEntryByTreePath(Model.java:339)
    at us.deathmarine.luyten.Model$TreeListener$1.run(Model.java:266)
deathmarine commented 5 years ago

Procyon errors are being closed.