在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):octarine-noise/simpledeobf开源软件地址(OpenSource Url):https://github.com/octarine-noise/simpledeobf开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):What is this?simpledeobf is a very simple and primitive command-line deobfuscator for Minecraft mods. You can use it to create dev versions of mod releases for debugging. Or anything else, really - it all depends on what inputs and mapping files you use. Feel free to get creative with it. How to use it?simpledeobf will need files from your Gradle cache which are created by ForgeGradle, so it's best to start with a ForgeGradle workspace already set up for your target Minecraft version. Command-line options:
Have your favourite brand of decompiler ready, and be prepared to dig through the result, and make several iterations before you end up with something usable. Also there's no guarantee that it's even possible to create a workable dev jar for any given mod. If it uses reflection and/or class transformation, chances are good that it will just crash anyway, unless it's specifically made to be environment agnostic. Have OptiFine, will debugAs an example, here is a guide on getting OptiFine into your dev environment with simpledeobf. This is the prime use-case of simpledeobf, and the reason for its existence. The following is the actual command I use for the deobfuscation itself, so you'll need to change the directory names. It's a single command, but I broke it up into lines for readability.
This will give you a jar with the Open the resulting jar file, and delete the Now you have to create a tweaker and class transformer, because the default OptiFine ones will not work properly in a dev environment. Here is mine that I use in Better Foliage, you need something similar. The point is to change dots to slashes in the class names, so the OptiFine transformer can find the deobfuscated class files. Edit the The jar is now ready. If you also want source attachment, which is highly recommended, just decompile it with your favourite tool (I prefer JD-GUI), and save a source jar. Make sure that "Realign line numbers" or the equivalent option is turned on. Drop the jar in the mods folder of your workspace, manually add it to the project dependencies after all the Gradle stuff, set its source attachment, and you're ready. You can start your project with OptiFine thrown in the mix, debug, set breakpoints, and everything. Note: Debugging into one of the vanilla classes that OptiFine overwrites may or may not give you some headache under Eclipse. I can only confirm it works fine under IDEA, which allows you to switch between sources on the fly if multiple jar files declare a class. A popup comes up saying "Alternative source available for the class blah blah blah", and you can switch to the OptiFine jar, which contains the class actually executing. OptiFine H5 and beyondStarting with release H5, OptiFine has adopted a patch-based approach. Instead of replacing the impacted class files with alternative ones, it supplies patches in the xdelta format that are applied at runtime. Instead of transforming xdelta files, simpledeobf is able to create classic replacement-style deobfuscated jar files by applying the patches against the original Minecraft jar. Again, you'll need to create a class transformer that is able to load it like this. Here is the example command line I use to deobfuscate OptiFine for 1.9.
Note the use of the regular |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论