Comments (14)
Do you think this should be the default behavior, or just a commandline switch?
from krakatau.
Having it as a command line switch would be nice as you would know that there are issues with missing jar files and you want to override the default behaviour. Otherwise you wouldn't know you needed other jars until the whole decompilation was complete. It would also be nice to see a little report about the classes that it couldn't find, along with the class that was asking to use it. That way hopefully the user can track down the missing files/jars needed.However I still do think that the class you are decompiling when you encounter the ClassNotFoundException should be completely decompiled before exiting the application. I also tried the '-out' option when decompiling to a jar/zip file. But I couldn't get it to work. It would be nice if it did because decompiling obfuscated code contains the same filenames but with different case. This is not needed for case sensitive OS's like Linux, but for case insensitive OS's like Windows it would be a great benefit. Thanks for making a really cool piece of software. I appreciate your time. Justin. Sent from my BlackBerry 10 smartphone. From: StoryyellerSent: Thursday, October 3, 2013 6:52 PMTo: Storyyeller/KrakatauReply To: Storyyeller/KrakatauSubject: Re: [Krakatau] Gracefully handle ClassNotFound errors (#25)Do you think this should be the default behavior, or just a commandline switch?
—Reply to this email directly or view it on GitHub.
from krakatau.
Outputting to a jar is something that I've long wanted but never got around to actually implementing.
Normally what I do in situations like this is to just change the filenames its writing to. It won't compile since the filename doesn't match the classname, but in a case like this, you're probably not going to be able to compile it anyway.
from krakatau.
Ok. Anyway of it detecting the duplicate and auto renaming the java file? Sent from my BlackBerry 10 smartphone. From: StoryyellerSent: Thursday, October 3, 2013 7:54 PMTo: Storyyeller/KrakatauReply To: Storyyeller/KrakatauCc: gist-githubSubject: Re: [Krakatau] Gracefully handle ClassNotFound errors (#25)Outputting to a jar is something that I've long wanted but never got around to actually implementing.
Normally what I do in situations like this is to just change the filenames its writing too. It won't compile since the filename doesn't match the classname, but in a case like this, you're probably not going to be able to compile it anyway.
—Reply to this email directly or view it on GitHub.
from krakatau.
Well I'm not sure if there's a good way to detect duplicates. You could just hardcode a check for Windows and assume case sensitivity otherwise, but I'm not sure this is reliable.
Also, the problem is not just case. They could also make an invalid filename by using special characters or a name that's too long in which case it won't work on any OS (luckily, no obfuscator I know of actually does this).
from krakatau.
Understood. Good point. I appreciate you looking into this. Sent from my BlackBerry 10 smartphone. From: StoryyellerSent: Thursday, October 3, 2013 8:04 PMTo: Storyyeller/KrakatauReply To: Storyyeller/KrakatauCc: gist-githubSubject: Re: [Krakatau] Gracefully handle ClassNotFound errors (#25)Well I'm not sure if there's a good way to detect duplicates. You could just hardcode a check for Windows and assume case sensitivity otherwise, but I'm not sure this is reliable.
Also, the problem is not just case. They could also make an invalid filename by using special characters or a name that's too long in which case it won't work on any OS (luckily, no obfuscator I know of actually does this).
—Reply to this email directly or view it on GitHub.
from krakatau.
Krakatau now automatically resolves output filename collisions on Windows. If an invalid filename is detected, it uses a prefix plus the md5 instead.
Unfortunately, I don't have any easy way to test other platforms, but hopefully they still work.
from krakatau.
Nice. Can’t wait to try it. Sent from my BlackBerry 10 smartphone. From: StoryyellerSent: Sunday, October 13, 2013 4:22 PMTo: Storyyeller/KrakatauReply To: Storyyeller/KrakatauCc: gist-githubSubject: Re: [Krakatau] Gracefully handle ClassNotFound errors (#25)Krakatau now automatically resolves output filename collisions on Windows. If an invalid filename is detected, it uses a prefix plus the md5 instead.
Unfortunately, I don't have any easy way to test other platforms, but hopefully they still work.
—Reply to this email directly or view it on GitHub.
from krakatau.
So, is ignoring classnotfound exception is going to be implemented?
from krakatau.
Sorry, I forgot about this. Anyway, I'm not sure exactly what the desired behavior is. Should it just silently fail to decompile a file when a class not found error occurs?
Also one other note:
"Or be able to display the package/path of the Class it is trying to find so I can include it in the path."
Krakatau already does this and always has. In the particular case quoted, the class not found is "Callback", in the default package. You can often find the appropriate library by googling the classname and/or using sites such as findjar.
from krakatau.
In my case i'm trying to decompile a minecraft mod that has a tons of dependencies(but this mod can work without them), the other decompilers still decompiles the mod classes, but not his one, maybe there is a reason for that but i don't know.
from krakatau.
So do you want it to just skip the affected classes entirely?
from krakatau.
I think yes.
from krakatau.
Ok, see if the new version does what you want. You can enable skipping by passing the -skip command line option to decompile.py.
I didn't have any examples handy to test, but it should work.
from krakatau.
Related Issues (20)
- Re-assembled class fails to load (java/lang/ClassFormatError) HOT 11
- Assemble resource files HOT 2
- Decompilation error: AttributeError: 'NoneType' object has no attribute 'type' HOT 4
- try-catch class name causing UnicodeEncodeError: 'ascii' codec can't encode character u'\u200b' in position 0: ordinal not in range(128) HOT 2
- error Traceback (most recent call last) HOT 1
- illegal class/method/package names or modifiers HOT 2
- Interest in Krakatau 2? HOT 85
- bytecode peephole optimization non-looping-loops HOT 6
- Krakatau does not generate local variables info HOT 5
- Missing undocumented opcodes. HOT 3
- Cannot reassemble HOT 4
- is there any grammar book/doc for krak2? HOT 2
- When executing the command, an error "krak2 dis --out temp" HOT 2
- Fields without access flags have an extra space in the disassembly result.
- v2 seems not to have an option to assemble multiple classes into a single .jar HOT 7
- RuntimeError: maximum recursion depth exceeded while calling a Python object HOT 1
- crash with useless trycatches HOT 3
- Assemble .j files in Directory HOT 3
- 'rU' mode generate a backtrace in python 3.11+ HOT 3
- Issue with building "cargo build --release" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from krakatau.