Other Skript Obfuscation & Jar Encapsulation

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Donut

Well-Known Member
Mar 27, 2017
1,336
177
0
U.S.
Preface

This tutorial will walk you though obfuscating your skripts as well as encapsulating them in a jar with Obfuskator. Obfuskator is not a plugin! Obfuscated skripts do not require any additional plugins besides skript to run. The obfuscation is not irreversible of course and is solely intended to deter amateur skript thieves.

Initial Setup

1. Download Obfuskator
2. Install the JDK (not JRE!) if you do not have it
3. Run the Ofuskator program (you may have to tell Windows it is safe to run)
4. Once on the main menu click either "classic obfuscation" or "jar obfuscation" and proceed to the corresponding tutorial section

Obfuscating Your Skript

If you are not there already, navigate to the classic obfuscation interface:

V071a47.png


1. Click the "Add files" button to upload the skript(s) you would like to obfuscate
2. Select either the normal or lite obfuscation option (normal is recommended but lite obfuscation will output a smaller file)
3. Click the "Obfuscate" button
4. The skript(s) will be obfuscated and saved as "obfuscated_original_name.sk" in the directory you ran the program from
5. The obfuscated skripts are now ready to be used

Note: You must remove all options in your skript before obfuscating or it will not work properly!

The obfuscated skript will look something like this:

nnk6mGl.png


Encapsulating Your Skript in a Jar (aka skar)

Encapsulating your skript in a jar is an efficient way to streamline distribution and your skript will not be exposed in the scripts folder. You have the option to package Skript and/or skript-mirror with your skript (see steps 3-4). When the jar is run the Skript Runtime Envrironment and Mirror Runtime Environment (SRE and MRE respectively) will be initialized.

If you are not there already, navigate to the jar obfuscation interface:

eiZim3x.png


1. Click the "Add files" button to upload the skript(s) you would like to encapsulate in the jar
2. Select the "Don't obfuscate" option if you do not want the skript(s) to be obfuscated
3. Select the "Package Skript" option if you want Skript to be embedded in the jar with your skript. In the drop down menu proceed to select the appropriate Skript version you would like to package
4. Select the "Package skript-mirror" option if you want skript-mirror to be embedded in the jar with your skript. This means that if your skript uses skript-mirror it will still work properly even if the server does not have skript-mirror installed
5. Fill out the jar info fields (only the name and version are required). The addon error message is a warning that will be sent to console if the server does not have the specified addons installed
6. Click the "Obfuscate" button and the jar will created in the directory you ran the program from and is ready to be used
 
Last edited:
  • Like
Reactions: DieHollander_
Does this set the .sk file into a .jar file?
And if so, how is this made possible?
Ill answer this one since Donut is no longer in this community.

1) Yes it makes the Skript into a jar file
2) Long story short, it creates a new "plugin" (jar file) that has your script code built into it, in one REALLY long line.
When the plugin starts up, it loads the script very similarly to how you load any other script
 
Ill answer this one since Donut is no longer in this community.

1) Yes it makes the Skript into a jar file
2) Long story short, it creates a new "plugin" (jar file) that has your script code built into it, in one REALLY long line.
When the plugin starts up, it loads the script very similarly to how you load any other script
So wait, that means that the Skript has been put into a .jar file? Does this automatically install the addons in it as well? Except skript-mirrorskript-mirror.
 
So wait, that means that the Skript has been put into a .jar file? Does this automatically install the addons in it as well? Except skript-mirrorskript-mirror.
1) You have the option to encapsulate Skript.jar into the plugin as well. Its not required but it can be done.
2) No, it does not encapsulate addons as well. You would still require the addons to be in your plugin folder
 
1) You have the option to encapsulate Skript.jar into the plugin as well. Its not required but it can be done.
2) No, it does not encapsulate addons as well. You would still require the addons to be in your plugin folder
Oh okay, so as the OP stated in the thread it's basically just to stop these skript thieves.

Is there a way to re-convert it back to a normal .sk file?
 
Oh okay, so as the OP stated in the thread it's basically just to stop these skript thieves.

Is there a way to re-convert it back to a normal .sk file?
Once it is encapsulated no. Unless you were to decompile the jar, copy the line in the class file that is your script (your entire script is put into one long line)
You can then copy that line to a txt (.sk) file, and you would have to sort out all your tabs/new lines, since in the code it would just be something like this
Code:
"command /test:\n\ttrigger:\n\t\tsome effect here"
something crazy like that.
 
Once it is encapsulated no. Unless you were to decompile the jar, copy the line in the class file that is your script (your entire script is put into one long line)
You can then copy that line to a txt (.sk) file, and you would have to sort out all your tabs/new lines, since in the code it would just be something like this
Code:
"command /test:\n\ttrigger:\n\t\tsome effect here"
something crazy like that.
Oh damn, okay. So like if I'd made a core of something it'd be like impossible to convert it back :emoji_joy:
 
This plugin no longer exists on spigot, anyone has an old copy? if so please send me it on discord. Thanks if you do so!

Greetings Anger

Discord: AngerMinecraftYT#0001