Plugin security

I am a beginner python developer. I wanted to create a paid plugin, so I looked into various ways to secure the .py file. I obfuscated the file with pyarmor, but the plugin that includes window seems to have an error in the reading part.

Traceback (most recent call last):

  File "<frozen __main__com_sindpfla98_pluginName_>", line 3, in <module>

  File "<frozen plugin>", line 19, in <module>

  File "/Users/sindpfla98/Library/Application Support/Glyphs 3/Repositories/GlyphsPythonPlugin/Python.framework/Versions/3.10/lib/python3.10/site-packages/objc/_transform.py", line 68, in processClassDict
    new_value = transformAttribute(key, value, class_object, protocols)

  File "/Users/sindpfla98/Library/Application Support/Glyphs 3/Repositories/GlyphsPythonPlugin/Python.framework/Versions/3.10/lib/python3.10/site-packages/objc/_transform.py", line 387, in transformAttribute
    returns_object = returns_value(value)

  File "/Users/sindpfla98/Library/Application Support/Glyphs 3/Repositories/GlyphsPythonPlugin/Python.framework/Versions/3.10/lib/python3.10/site-packages/objc/_transform.py", line 526, in returns_value
    for inst in dis.get_instructions(func):

  File "/Users/sindpfla98/Library/Application Support/Glyphs 3/Repositories/GlyphsPythonPlugin/Python.framework/Versions/3.10/lib/python3.10/dis.py", line 353, in _get_instructions_bytes
    argval, argrepr = _get_name_info(arg, cells)

  File "/Users/sindpfla98/Library/Application Support/Glyphs 3/Repositories/GlyphsPythonPlugin/Python.framework/Versions/3.10/lib/python3.10/dis.py", line 304, in _get_name_info
    argval = name_list[name_index]

IndexError: tuple index out of range

Do you know how to solve this?

I would appreciate it if you could tell me about another way to obfuscate or encrypt files for free.

I would also like to know if I need permission from Glyphs to sell the plugin.

Without seeing your code, it is pretty much impossible to help.

I obfuscated ‘GylphsSDK/Python Samples/Plugin With Window’ uploaded to github with pyarmor, but the same error as above occurs.
The obfuscated file is Plugin With Window.glyphsPlugin pyarmor.zip.
The file before obfuscation is Plugin With Window.glyphsPlugin pyarmor.zip

Plugin With Window.glyphsPlugin.zip (28.5 KB)
Plugin With Window.glyphsPlugin pyarmor.zip (243.5 KB)

Your sample plugin works fine for me.

Oh, sorry. I explained it wrong
The file before obfuscation is “Plugin With Window.glyphsPlugin.zip”.
The obfuscated file is “Plugin With Window.glyphsPlugin pyarmor.zip”.

And my MacOS is Sonoma 14.1 and Glyphs 3.1.2 (3151).
Please check again. Thank you.

I did test the right version. I’m not on Sonoma, yet.

As far as I can tell, the problem is with the obfuscation methods used by Pyarmor. Maybe there are other options that you can use or other obfuscation tools that do not have the same issues.

1 Like