Skip to content

heppocogne/gdscript-function-encryption

Repository files navigation

gdscript-function-encryption

Encrypt GDScript funcrion implementations easier

Note that this is not a safe way to protect your codes because .pck includes raw encryption keys.
Use pck encryption if you need stronger protection.

Usage

External script editor is recommended. Godot editor does not recognize .impl as a text file.

  1. Activate this plugin. res://secret and encryption keys are generated.
  2. Write function definitions and variables etc... to .gd file. call_impl() accepts 3 arguments: method name, object, and arguments(optional). If you need more arguments, pass array or dictionary.
extends Node

var _impl:=preload("res://main.gd.impl")  # load implementation
var variable

func _ready():
    _impl.call_impl("_ready",self)


func function(greetings:String):
    _impl.call_impl("function",self,"hello")
  1. Write function implementations to .impl files. These scripts do not need to extend any class. All functions must be like function_name(this:Object,args). Do not use self in .impl file, use this passed by call_impl() instead. You can also use super class function by passing lambda as a argument.
func _ready(this:Object,_args):
    this.variable=1


func function(_this:Object,args):
    print(args)
  1. .impl is encrypted and decrypted when loaded.

About

Encrypt GDScript funcrion implementations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published