O'Reilly logo

Cocos2d-x Cookbook by Akihiro Matsuura

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using encrypted SQLite files

We often use SQLite to save the user data or game data. SQLite is a powerful and useful database. However, there is a database file in your game's sand box. Cheaters will get it from your game and they will edit it to cheat. In this recipe, you will learn how to encrypt your SQLite and prevent cheaters from editing it.

Getting ready

We will use the wxSqlite library to encrypt SQLite. This is free software. Firstly, you need to install wxSqlite in Cocos2d-x and edit some code and set files in Cocos2d-x.

  1. Download the wxSqlite3 project's zip file. Visit the following url: http://sourceforge.net/projects/wxcode/files/Components/wxSQLite3/wxsqlite3-3.1.1.zip/download
  2. Expand the zip file.
  3. Create a new folder called wxsqlite

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required