Konloch / bytecode-viewer

A Java 8+ Jar & Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger & More)
https://bytecodeviewer.com
GNU General Public License v3.0
14.6k stars 1.14k forks source link

Janino Compiler does not replace cooked classes properly #394

Open ThexXTURBOXx opened 2 years ago

ThexXTURBOXx commented 2 years ago

Whe developing plugins, I noticed the following behavior:

  1. Create a new Java Plugin
  2. Save the default file somwehere
  3. Run the plugin
  4. Change something noticable in the plugin file
  5. Re-run the plugin

Here, I would expect that the plugin gets cooked again and "replaced" such that the new behavior is executed. However, this is not the case right now. My suspicion is that Janino does not "replace" the classes inside the current ClassLoader. I spent around 2 hours trying to fix this, but did not succeed. If someone is able to do it, that would be great! :)

Janmm14 commented 2 years ago

Replacing classes while allowing all kinds of changes is not possible. You can only invalidate a whole class loader and have to make sure each plugin has its own class loader and that there are no references to any class instances anywhere anymore.