Bungee - Proxy Disable Bungeecord SecurityManager 1.0

SecurityManager Bungeecord disable Security Exception SecurityException

  1. WolverinDEV submitted a new resource:

    Disable Bungeecord SecurityManager - SecurityManager Bungeecord disable Security Exception SecurityException

    Read more about this resource...
     
    • Like Like x 1
  2. What is SecurityManager Bungeecord
     
  3. What is the purpose of this plugin? Why would one want to disable the security manager?
     
  4. md_5

    Administrator Developer

    You went through all this trouble:
    Without realising the security manager does nothing aside from print a warning.

    Also the scheduler is there for a reason: to safely run threads.
     
  5. It was implemented so that developers would use the proper APIs when creating new threads in their plugins. Ex: using runAsync (proper) instead of directly creating a new Thread object. It's a good thing, however it means some things just aren't possible without throwing a big annoying warning & stack trace every time the plugin does something the SecurityManager doesn't like.

    It's been especially frustrating trying to work around it in my plugin PlayerServers (which launches other processes via the plugin), despite running everything that would spawn new processes under a runAsync task. It's a harmless warning though. And I hope that enforce boolean never gets flipped. :p
     
  6. With boolean do you mean?
     
  7. Why you obfuscated such small plugin? and why you used javassist?
    You can also just do:
    Code (Text):
    final Method getDeclaredFields0 = Class.class.getDeclaredMethod("getDeclaredFields0", boolean.class);
    getDeclaredFields0.setAccessible(true);
    final Field[] allFields = (Field[]) getDeclaredFields0.invoke(System.class, false);
    for (final Field field : allFields)
    {
        if (field.getName() == "security")
        {
            field.setAccessible(true); // may be good idea to set it back to false, as this will change it forever as this is raw Field instance not a copy.
            field.set(null, null);
        }
    }
    Still hacky, but simple and works fine.
    Add in static block in main class for best results.