Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip exception in "Decompile && Save All Classes" #485

Open
phith0n opened this issue Jan 31, 2024 · 1 comment
Open

Skip exception in "Decompile && Save All Classes" #485

phith0n opened this issue Jan 31, 2024 · 1 comment

Comments

@phith0n
Copy link

phith0n commented Jan 31, 2024

I try to decompile a whole jar file and save result by "Menu -> File -> Decompile && Save All Classes". After a period of time, I got an exception from CFR. The decompiler process stopped and I only got part of the files.

I hope that if an exception occurs inside the decompiler, don't stop the process and continue to work on next file.

Exception log:

Please send this error log to https://github.com/Konloch/bytecode-viewer/issues or Konloch at https://the.bytecode.club or [email protected]
If you hold appropriate legal rights to the relevant class/jar/apk file please include that as well.
Bytecode Viewer Version: 2.12 [Fat Jar], OS: Windows 10, Java: 17.0.6

java.lang.ClassCastException: class com.strobel.assembler.metadata.CoreMetadataFactory$MethodSignature cannot be cast to class com.strobel.assembler.metadata.MethodReference (com.strobel.assembler.metadata.CoreMetadataFactory$MethodSignature and com.strobel.assembler.metadata.MethodReference are in unnamed module of loader 'app')
	at com.strobel.decompiler.languages.java.utilities.TypeUtilities.getExpectedTypeByParent(TypeUtilities.java:365)
	at com.strobel.decompiler.languages.java.utilities.RedundantCastUtility$IsRedundantVisitor.visitCastExpression(RedundantCastUtility.java:345)
	at com.strobel.decompiler.languages.java.utilities.RedundantCastUtility$IsRedundantVisitor.visitCastExpression(RedundantCastUtility.java:168)
	at com.strobel.decompiler.languages.java.ast.CastExpression.acceptVisitor(CastExpression.java:55)
	at com.strobel.decompiler.languages.java.utilities.RedundantCastUtility.getRedundantCastsInside(RedundantCastUtility.java:50)
	at com.strobel.decompiler.languages.java.ast.transforms.RemoveRedundantCastsTransform.visitCastExpression(RemoveRedundantCastsTransform.java:50)
	at com.strobel.decompiler.languages.java.ast.transforms.RemoveRedundantCastsTransform.visitCastExpression(RemoveRedundantCastsTransform.java:30)
	at com.strobel.decompiler.languages.java.ast.CastExpression.acceptVisitor(CastExpression.java:55)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitCastExpression(DepthFirstAstVisitor.java:304)
	at com.strobel.decompiler.languages.java.ast.transforms.RemoveRedundantCastsTransform.visitCastExpression(RemoveRedundantCastsTransform.java:48)
	at com.strobel.decompiler.languages.java.ast.transforms.RemoveRedundantCastsTransform.visitCastExpression(RemoveRedundantCastsTransform.java:30)
	at com.strobel.decompiler.languages.java.ast.CastExpression.acceptVisitor(CastExpression.java:55)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitReturnStatement(DepthFirstAstVisitor.java:149)
	at com.strobel.decompiler.languages.java.ast.ReturnStatement.acceptVisitor(ReturnStatement.java:57)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitBlockStatement(DepthFirstAstVisitor.java:104)
	at com.strobel.decompiler.languages.java.ast.BlockStatement.acceptVisitor(BlockStatement.java:72)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitLambdaExpression(DepthFirstAstVisitor.java:409)
	at com.strobel.decompiler.languages.java.ast.LambdaExpression.acceptVisitor(LambdaExpression.java:49)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitInvocationExpression(DepthFirstAstVisitor.java:59)
	at com.strobel.decompiler.languages.java.ast.InvocationExpression.acceptVisitor(InvocationExpression.java:78)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitMemberReferenceExpression(DepthFirstAstVisitor.java:74)
	at com.strobel.decompiler.languages.java.ast.MemberReferenceExpression.acceptVisitor(MemberReferenceExpression.java:120)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitInvocationExpression(DepthFirstAstVisitor.java:59)
	at com.strobel.decompiler.languages.java.ast.InvocationExpression.acceptVisitor(InvocationExpression.java:78)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitCastExpression(DepthFirstAstVisitor.java:304)
	at com.strobel.decompiler.languages.java.ast.transforms.RemoveRedundantCastsTransform.visitCastExpression(RemoveRedundantCastsTransform.java:48)
	at com.strobel.decompiler.languages.java.ast.transforms.RemoveRedundantCastsTransform.visitCastExpression(RemoveRedundantCastsTransform.java:30)
	at com.strobel.decompiler.languages.java.ast.CastExpression.acceptVisitor(CastExpression.java:55)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitAssignmentExpression(DepthFirstAstVisitor.java:354)
	at com.strobel.decompiler.languages.java.ast.AssignmentExpression.acceptVisitor(AssignmentExpression.java:88)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitExpressionStatement(DepthFirstAstVisitor.java:109)
	at com.strobel.decompiler.languages.java.ast.ExpressionStatement.acceptVisitor(ExpressionStatement.java:47)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitBlockStatement(DepthFirstAstVisitor.java:104)
	at com.strobel.decompiler.languages.java.ast.BlockStatement.acceptVisitor(BlockStatement.java:72)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitMethodDeclaration(DepthFirstAstVisitor.java:234)
	at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitMethodDeclarationOverride(ContextTrackingVisitor.java:84)
	at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitMethodDeclaration(ContextTrackingVisitor.java:76)
	at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitMethodDeclaration(ContextTrackingVisitor.java:31)
	at com.strobel.decompiler.languages.java.ast.MethodDeclaration.acceptVisitor(MethodDeclaration.java:94)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitTypeDeclaration(DepthFirstAstVisitor.java:264)
	at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitTypeDeclarationOverride(ContextTrackingVisitor.java:69)
	at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitTypeDeclaration(ContextTrackingVisitor.java:60)
	at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.visitTypeDeclaration(ContextTrackingVisitor.java:31)
	at com.strobel.decompiler.languages.java.ast.TypeDeclaration.acceptVisitor(TypeDeclaration.java:98)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitChildren(DepthFirstAstVisitor.java:41)
	at com.strobel.decompiler.languages.java.ast.DepthFirstAstVisitor.visitCompilationUnit(DepthFirstAstVisitor.java:274)
	at com.strobel.decompiler.languages.java.ast.CompilationUnit.acceptVisitor(CompilationUnit.java:82)
	at com.strobel.decompiler.languages.java.ast.ContextTrackingVisitor.run(ContextTrackingVisitor.java:100)
	at com.strobel.decompiler.languages.java.ast.transforms.RemoveRedundantCastsTransform.run(RemoveRedundantCastsTransform.java:43)
	at com.strobel.decompiler.languages.java.ast.transforms.TransformationPipeline.runTransformationsUntil(TransformationPipeline.java:101)
	at com.strobel.decompiler.languages.java.ast.AstBuilder.runTransformations(AstBuilder.java:122)
	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 the.bytecode.club.bytecodeviewer.decompilers.impl.ProcyonDecompiler.doSaveJarDecompiled(ProcyonDecompiler.java:187)
	at the.bytecode.club.bytecodeviewer.decompilers.impl.ProcyonDecompiler.decompileToZip(ProcyonDecompiler.java:141)
	at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling.decompileSaveAll(ResourceDecompiling.java:262)
	at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling.lambda$decompileSaveAll$0(ResourceDecompiling.java:122)
	at java.base/java.lang.Thread.run(Thread.java:833)

@ThexXTURBOXx
Copy link
Contributor

Small note: This exception is from Procyon, not CFR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants