加密
cocos luacompile -s src -d dst_dir -e -b xxxxx -k xxxxx --disable-compile
解密
cocos luacompile -s src -d dst_dir -e -j -b xxxxx -k xxxxx --disable-compile
说明:cocos默认只支持加密,不支持反向解密, 本人改一下python脚本 使其支持解密。 -b 后面接的参数是在文件中可以见的。
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos "luacompile" plugin # # Copyright 2013 (C) Intel # # License: MIT # ---------------------------------------------------------------------------- ''' "luacompile" plugin for cocos command line tool ''' __docformat__ = 'restructuredtext' import sys import subprocess import os import json import inspect import shutil import cocos from MultiLanguage import MultiLanguage ############################################################ #http://www.coolcode.org/archives/?article-307.html ############################################################ import struct _DELTA = 0x9E3779B9 def _long2str(v, w): n = (len(v) - 1) << 2 if w: m = v[-1] if (m < n - 3) or (m > n): return '' n = m s = struct.pack('<%iL' % len(v), *v) return s[0:n] if w else s def _str2long(s, w): n = len(s) m = (4 - (n & 3) & 3) + n s = s.ljust(m, "