Still use the test project generated last time. I put it in the bin directory.
Create the file test. bat in the bin directory. The content is as follows:
@ Echo offset dir = % ~ Dp0 % dir % Win32 \ php.exe % dir % \ Lib \ compile_scripts.php-zip-x main test/scripts/test/RES/test
Let's talk about the usage of complie_scripts.php:
Usage: compile_scripts [Options] dirname output_filenameoptions:-zip package to zip-suffix package file extension name-P prefix package name-x exclude packages, eg:-x framework. server, framework. tests-Q quietexamples: * packageing scripts /*. lua to RES/game.zip compile_scripts-zip scripts/RES/Game
Note: You need to add the quick-cocos2d-x \ bin \ Win32 Directory to the system path environment variables, in addition to the process may prompt the lack of msvcr110.dll file, you can solve it yourself.
After you run test. bat, the test.zip file is generated in the test/res.
To call the script, add the following code in the cclualoadchunksfromzip ("Res/framework_precompiled.zip") Statement in the mail. Lua file:
Cclualoadchunksfromzip ("Res/test.zip ")
Delete the original script. Keep main. Lua and test it to prove that the program can run.
In this way, the script does not need encryption and decryption.