md-5 / SpecialSource

Automatic generator and renamer of jar obfuscation mappings.
Other
209 stars 48 forks source link

How to remap method param names? #93

Closed ShaneBeee closed 1 month ago

ShaneBeee commented 1 month ago

I recently just started using SpecialSource programatically in an app. I have everything worked out to remap (and its insanely fast so I'm grateful for that)

Last issue I have gotten down to is param names are always var1, var2, etc.

I know that CB/Spigot have these remapped, so Im assuming there is a way, I just dont know how.

This is what I have thus far: https://github.com/ShaneBeeStudios/McDeob/blob/aefd7f02813fee73aa813c2fe97c25c653edab24/src/main/java/com/shanebeestudios/mcdeob/Processor.java#L159-L176

Example of what a method remaps to currently: public void playSound(SoundEvent var1, float var2, float var3) {

Any help would be appreciated.

md-5 commented 1 month ago

SpecialSource doesn't support local variable mapping as far as I know. In CB/Spigot the decompiler is just configured to use the type name as the base rather than 'var'.

ShaneBeee commented 1 month ago

ohhhhhh, ok. Well, that is a bummer but I've survived this long. Thanks for letting me know!

WAIT, while I have you here, are you referring to Fernflower? I tried copying the params from CB and Im definitely not getting those. Im probably missing something

md-5 commented 1 month ago

WAIT, while I have you here, are you referring to Fernflower?

Yes but custom https://hub.spigotmc.org/stash/projects/SPIGOT/repos/fernflower/commits/383c4aba04ad915110b5666aaaf8258d3d2c5c8c#src%2Forg%2Fjetbrains%2Fjava%2Fdecompiler%2Futil%2FVarHelper.java

ShaneBeee commented 1 month ago

ahh, ok cool. thank you