1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Other Skript Obfuscation & Jar Encapsulation

Discussion in 'Tutorials' started by Donut, Apr 30, 2018.

  1. Donut

    Addon Developer

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    175
    Medals:
    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:

    [​IMG]

    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:

    [​IMG]

    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:

    [​IMG]

    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
     
    #1 Donut, Apr 30, 2018
    Last edited: Sep 12, 2018
    • Like Like x 1
    • Winner Winner x 1
    • Useful Useful x 1
  2. Pikachu

    Moderator Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    871
    Likes Received:
    124
    Medals:
    • Winner Winner x 2
    • Useful Useful x 1
  3. Donut

    Addon Developer

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    175
    Medals:
    • Like Like x 1
    • Useful Useful x 1
  4. matvapes

    matvapes Member

    Joined:
    May 15, 2018
    Messages:
    11
    Likes Received:
    0
    Does this set the .sk file into a .jar file?
    And if so, how is this made possible?
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,760
    Likes Received:
    124
    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
     
  6. matvapes

    matvapes Member

    Joined:
    May 15, 2018
    Messages:
    11
    Likes Received:
    0
    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.
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,760
    Likes Received:
    124
    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
     
  8. matvapes

    matvapes Member

    Joined:
    May 15, 2018
    Messages:
    11
    Likes Received:
    0
    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?
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,760
    Likes Received:
    124
    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 (Text):
    1. "command /test:\n\ttrigger:\n\t\tsome effect here"
    something crazy like that.
     
  10. matvapes

    matvapes Member

    Joined:
    May 15, 2018
    Messages:
    11
    Likes Received:
    0
    Oh damn, okay. So like if I'd made a core of something it'd be like impossible to convert it back :emoji_joy:
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,760
    Likes Received:
    124
    Im not sure why you would WANT to convert it back. Just keep a copy of the script you are encapsulating into the jar
     
  12. Duetro

    Duetro Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    138
    Likes Received:
    47
    Medals:
    • Like Like x 1
  13. H

    Hexivoid Active Member

    Joined:
    Oct 22, 2017
    Messages:
    35
    Likes Received:
    5
Loading...