Remove xxtea.

This commit is contained in:
halx99 2019-11-24 19:17:23 +08:00
parent af22abc2a8
commit d319436cdc
2 changed files with 4 additions and 36 deletions

View File

@ -13,7 +13,6 @@ set(lua_bindings_manual_headers
manual/platform/ios/CCLuaObjcBridge.h
manual/network/lua_cocos2dx_network_manual.h
manual/network/lua_xml_http_request.h
manual/network/Lua_web_socket.h
manual/network/lua_extensions.h
manual/network/lua_downloader.h
manual/audioengine/lua_cocos2dx_audioengine_manual.h
@ -56,7 +55,6 @@ set(lua_bindings_manual_files
manual/extension/lua_cocos2dx_extension_manual.cpp
manual/network/lua_extensions.c
manual/network/lua_cocos2dx_network_manual.cpp
manual/network/Lua_web_socket.cpp
manual/network/lua_xml_http_request.cpp
manual/network/lua_downloader.cpp
#manual/spine/lua_cocos2dx_spine_manual.cpp

View File

@ -27,7 +27,6 @@
#include "scripting/lua-bindings/manual/CCLuaStack.h"
#include "scripting/lua-bindings/manual/tolua_fix.h"
#include <string.h>
#include "external/xxtea/xxtea.h"
extern "C" {
#include "lua.h"
#include "tolua++.h"
@ -776,20 +775,9 @@ int LuaStack::luaLoadChunksFromZIP(lua_State *L)
bool isXXTEA = stack && stack->_xxteaEnabled && size >= stack->_xxteaSignLen
&& memcmp(stack->_xxteaSign, bytes, stack->_xxteaSignLen) == 0;
if (isXXTEA) { // decrypt XXTEA
xxtea_long len = 0;
buffer = xxtea_decrypt(bytes + stack->_xxteaSignLen,
(xxtea_long)size - (xxtea_long)stack->_xxteaSignLen,
(unsigned char*)stack->_xxteaKey,
(xxtea_long)stack->_xxteaKeyLen,
&len);
zip = ZipFile::createWithBuffer(buffer, len);
} else {
if (size > 0) {
zip = ZipFile::createWithBuffer(bytes, (unsigned long)size);
}
}
if (zip) {
CCLOG("lua_loadChunksFromZIP() - load zip file: %s%s", zipFilePath.c_str(), isXXTEA ? "*" : "");
@ -865,26 +853,8 @@ int LuaStack::luaLoadBuffer(lua_State *L, const char *chunk, int chunkSize, cons
{
int r = 0;
if (_xxteaEnabled && strncmp(chunk, _xxteaSign, _xxteaSignLen) == 0)
{
// decrypt XXTEA
xxtea_long len = 0;
unsigned char* result = xxtea_decrypt((unsigned char*)chunk + _xxteaSignLen,
(xxtea_long)chunkSize - _xxteaSignLen,
(unsigned char*)_xxteaKey,
(xxtea_long)_xxteaKeyLen,
&len);
unsigned char* content = result;
xxtea_long contentSize = len;
skipBOM((const char*&)content, (int&)contentSize);
r = luaL_loadbuffer(L, (char*)content, contentSize, chunkName);
free(result);
}
else
{
skipBOM(chunk, chunkSize);
r = luaL_loadbuffer(L, chunk, chunkSize, chunkName);
}
#if defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0
if (r)