Package com.aliucord
Class PluginManager
-
- All Implemented Interfaces:
public class PluginManager
Aliucord's Plugin Manager
-
-
Field Summary
Fields Modifier and Type Field Description public final static Map<String, Plugin>
plugins
public final static Map<PathClassLoader, Plugin>
classLoaders
public final static Logger
logger
public final static Map<File, Object>
failedToLoad
-
Constructor Summary
Constructors Constructor Description PluginManager()
-
Method Summary
Modifier and Type Method Description static void
loadPlugin(Context context, File file)
Loads a plugin static void
unloadPlugin(String name)
Unloads a plugin static void
enablePlugin(String name)
Enables a loaded plugin if it isn't already enabled static void
disablePlugin(String name)
Disables a loaded plugin if it isn't already disables static void
togglePlugin(String name)
Toggles a plugin. static void
startPlugin(String name)
Starts a plugin static void
stopPlugin(String name)
Stops a plugin static void
remountPlugin(String name)
Remounts the plugin (stop -> unload -> load -> start) static String
getPluginPrefKey(String name)
Gets the preferences key for a plugin. static boolean
isPluginEnabled(String name)
Checks whether a plugin is enabled static boolean
isPluginEnabled(Plugin plugin)
Checks whether a plugin is enabled -
-
Method Detail
-
loadPlugin
static void loadPlugin(Context context, File file)
Loads a plugin
- Parameters:
context
- Contextfile
- Plugin file
-
unloadPlugin
static void unloadPlugin(String name)
Unloads a plugin
- Parameters:
name
- Name of the plugin to unload
-
enablePlugin
static void enablePlugin(String name)
Enables a loaded plugin if it isn't already enabled
- Parameters:
name
- Name of the plugin to enable
-
disablePlugin
static void disablePlugin(String name)
Disables a loaded plugin if it isn't already disables
- Parameters:
name
- Name of the plugin to disable
-
togglePlugin
static void togglePlugin(String name)
Toggles a plugin. If it is enabled, it will be disabled and vice versa.
- Parameters:
name
- Name of the plugin to toggle
-
startPlugin
static void startPlugin(String name)
Starts a plugin
- Parameters:
name
- Name of the plugin to start
-
stopPlugin
static void stopPlugin(String name)
Stops a plugin
- Parameters:
name
- Name of the plugin to stop
-
remountPlugin
static void remountPlugin(String name)
Remounts the plugin (stop -> unload -> load -> start)
- Parameters:
name
- Name of the plugin to remount
-
getPluginPrefKey
static String getPluginPrefKey(String name)
Gets the preferences key for a plugin. This is used as key for plugin settings. Format: AC_PM_{PLUGIN_NAME}
- Parameters:
name
- Name of the plugin
-
isPluginEnabled
static boolean isPluginEnabled(String name)
Checks whether a plugin is enabled
- Parameters:
name
- Name of the plugin
-
isPluginEnabled
static boolean isPluginEnabled(Plugin plugin)
Checks whether a plugin is enabled
- Parameters:
plugin
- Plugin
-
-
-
-