So basically I'm wondering if its possible to have your plugin check a pastebin file on startup. The pastebin will either contain true or false. Whatever is in the pastebin will set the boolean of the plugin being enable or not(Can you stop a plugin from starting with a boolean?). This way, if you do not want your plugin used anymore, you can set the pastebin file to false, and it will stop the plugin from initializing.
@Gater12 When the server starts the plugin checks the pastebin file, if it says false, the plugin does not enable, if it says true, it enables.
MrDynamo Assuming the first line in the Pastebin is just "true" or "false", just create the Pastebin and paste the Pastebin's raw file path. Code: URL url = new URL("pastebin raw"); Scanner scanner = new Scanner(url.openStream()); boolean enabled = Boolean.valueOf(scanner.nextLine()); scanner.close();
Compressions Ok thanks. And what do think the best way to disable the plugin would be? Check the boolean on all my methods and continue if it's true?
@Compressions Hmm. Is there any type of method that can stop the enabling of the plugin? I know I can do the if statement on all methods, but is that the easiest wat?
Anyhow all of these ways of preventing the plugin from being used when you don't want it too are terrible. People can just decompile it, or if you were to obsfucate it, just bytecode edit out very easily.
Technical discussion aside (I think there could be cool/good reasons for pulling data off the web), I'd be inherently distrustful of any plugin that reaches out to an external server without an obvious reason to do so. You might start with an on/off switch.. but then decide maybe someone irk'd you, and now you'd like to add a "delete all worlds" flag. It could get very malicious very quickly is I guess what I'm trying to say Not to mention the implications of their server configuration- maybe they don't allow network connections on all outgoing ports, or to all addresses. Maybe they're on the other side of the world, somewhere where pastebin isn't properly mirrored.. now your plugin might stall their entire server trying to "authorize" itself. Anyway, that said I don't have anything useful to add to the general conversation on preventing people from stealing plugins. I think in a way, if you code a plugin for someone, you kind of have to let it go, yeah?