leibnitz27 / cfr

This is the public repository for the CFR Java decompiler
https://www.benf.org/other/cfr
MIT License
1.94k stars 249 forks source link

Help finding option to match overloaded methods #227

Closed omeraydindev closed 2 years ago

omeraydindev commented 3 years ago

I can decompile a certain method body using --methodname argument with CFR. like:

/storage/emulated/0/cfr150/SrcCodeEditor.class --methodname onBackPressed --outputdir /storage/emulated/0/cfr150/out

but this argument only allows method names, and not full method signatures. This leads to some problems with overloaded methods. How can I match an overloaded method using this argument? CFR throws IllegalStateException with "no such method" if I use a full method signature such as myMethod(Ljava/lang/String;)V

leibnitz27 commented 3 years ago

Hi - this isn't currently supported but I don't see any reason not to add the facility, wouldn't be too tricky. That being said, if you're using CFR through the API, you could do this yourself fairly easily - seems like an odd use case for the command line - are you embedding this?