I need help de-compiling a plugin and editing it

Discussion in 'Spigot Plugin Development' started by wsavage9, Mar 9, 2018.

  1. Hi there, I'm a bit new to coding in Java and using eclipse. I just bought an sg plugin and I want to change and add some things to the plugin. The dev says that it's alright to edit the plugin but I'm not sure how to. I could not find a link to the source code. I already tried de-compiling the plugin and copying the classes it into eclipse. I got a lot of errors after I imported spigot api. Please describe the best way to do this or link me to a vid. Any help will be appreciated
  2. Open the File with Winrar and then open the Classpath file, It will say the files he/she used to make the plugin. then you can try that.
  3. Best thing to do at this point is either:

    1. Contact the dev to see if he can implement your changes

    2. Contact the dev to see if he can provide source code

    3. Go to http://www.javadecompilers.com and decompile. After, click the gray "save" button upload_2018-3-8_18-22-41.png and see if you can work from there.

    (Note: I do not support using a decompiling website if you have not contacted the developer of the jar)

  4. Once i get the folder how do I import that into eclipse?
  5. if you select fernflower you usually get the whole project with the .yml files etc ,making import into the ide easier.
  6. Remember that working with decompiled code won't be as easy as using the source code. Is normal you get some errors, since not everytime the decompiler is able to fully get the code from a .jar. I (and this is just personal) hate and try to avoid working with the decompiled code.
  7. That can't be true. Java is byte-code so if you have a functional decompiler like Java Decompiler (http://jd.benow.ca/) everything except for comments, original formatting, and line numbers, among other small stuff will still be there and everything should work exactly as compiled.

    • Funny Funny x 1
  8. Strahan


    What plugin is it?
  9. MiniDigger


    Lmao, how can you say functional and jd in the same sentence if jd doesn't even support any of javas functional language features ^^

    I would recommend fernflower (if possible forgeflower since that produces less compiler issues) or procyon (luyten is a nice gui for that if you are more of a gui guy)

    Both of those support all major java Lang features including newer stuff link strings in switches or lambdas, meaning your code will be perfectly readable and reasonable close to the original code.
    • Agree Agree x 2
  10. Which plugin is this?
  11. Just ask the developer to implement the feature. If the developer says you can do it yourself, he should be open sourcing his plugin (if it's not already).
  12. Strahan


    Why not just @Wazup92 if he has the source available somewhere that you can access?
  13. You can edit the code without exporting the classes to your IDE in Helios
  14. What is helios?
  15. You could just create a new empty plugin and then replace the classes with the decompiled ones. Then you can go about fixing decompile errors or including missing dependencies.

    The basic step is copying files into another folder. What was so hard with that. If you can't create the projects around the source, create it somewhere else and copy the decompiled stuff in.
  16. MiniDigger


    a decompiler suite

  17. you mind sending a link to it?
  18. MiniDigger


Share This Page