There is a library and I need to add some methods to it ... How can I implement it? I get to the class and there is a lock sign on it, I can see it and there is no change ...

    1 answer 1

    There are several ways.

    The easiest way is to search for the source code of this library on a github or contact the developer. Change what you need in the source code and build the library, optionally - make a pull request.

    The next most difficult option is to inherit from the desired class and override the desired method. The problem is that it will be necessary to create an object of exactly your class (if it is created inside the library, it is bad). Also problems with static or final methods.

    The most difficult is to completely decompile the library and replace the required method. There are many programs for decompiling (jd-gui, procyclon, and so on). They all have their own characteristics, the method requires accuracy and be careful with the legal side.

    • the mod that I want it already has on Git and with pull request. Can I run it? I have all the source code changed there - elik
    • @elik of course. The easiest way is to remove the library itself from the project and simply add to the project all the code downloaded from the github. - pavel