Quick-cocos2dx-v3 Encrypted script file

Source: Internet
Author: User
Tags lua strlen zip

Compile_scripts Detailed parameters

-H Help

-I source file directory

-O Output file directory/output filename

-P Package Prefix name

-X does not contain a package, that is, which packages in the current directory do not want to be added

-m compilation mode, contains two, one is the default package into a zip, the other is not packaged directly generated files

-e encryption mode, contains two, Xxtea_chunk is the file itself to encrypt, xxtea_zip is to encrypt the packaged zip

-ek Encryption secret key

-es Encrypted Signature

-ex the suffix name of the encrypted file, which is LUA by default

-C load parameter list from a file

-Q generation process does not output information

1. Command line encryption file

Engine root directory

D:\cocos2dx\v3quick

Project Catalog:

D:\cocos2dx\v3quick\projects\test

In the project directory, open the Command window and enter:

D:\cocos2dx\v3quick\projects\test>d:\cocos2dx\v3quick\quick\bin\

Compile_scripts.bat-i src-o output-mfiles-e Xxtea_chunk-ek mykey-es XT

Here the encryption key is MyKey, the cryptographic signature is XT, all the files under the SRC directory are encrypted and saved to the output folder in the same class as Src

2. File Decryption Code

In the AppDelegate.cpp

Luastack *pstack = Pengine->getluastack ();

Add the following code below:

Pstack->setxxteakeyandsign ("MYKEY", strlen ("MYKEY"), "XT", Strlen ("XT"));

3. Overwrite the files in output to SRC, compile the project, install to the mobile phone, use 7zip to view the LUA files in the APK, all through the encrypted

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.