Creating a game is hard work - especially creating all the graphics and animations. Maybe you even hired somebody to draw all the stuff for you.
Did you ever realize how easy it is for somebody to steal the assets from your game?
No? Let me show you!
- Download the game in iTunes
- Locate the game's .ipa file using Finder or Spotlight (Mac)
- Copy the .ipa file and rename the copy's extension to .zip
- Extract the .zip file
- Open the Payload folder
- Right-click the <app-name>.app and use Show Package Contents
- Here you go - all sounds, images, sprite sheets, etc., - are there!
We did not even have to use any fancy tools - it's just renaming a file.
... well - you know that. But does that protect your precious images?
Just type sprite sheet <your favorite game> in Google and see what comes up.
And in the end - what would you do? Sue somebody in a foreign country? Forget about that.
Encrypt your assets!
I've added a new feature to TexturePacker which helps you to prevent all this from happening. It's called ContentProtection and simply encrypts the images.
Your app will still be able to decrypt the data, but somebody else is going to have a hard time getting it done.
Designing the encryption, I had the following goals in mind:
All of this works! Encrypting your assets is a piece of cake - it comes at nearly no effort - and does not have any impact on your game.
In theory it would be possible for somebody to extract the key from the app and write some decoder. The decoder and key are stored in your app - otherwise it would not be possible to use the assets in your game at all. But this will take knowledge, time and effort - and it is something that not every 6-year-old school boy or girl can perform. So instead of stealing your assets, it's likely that they go and find some easier prey.
Setting up TexturePacker for encryption
I assume that you already have TexturePacker running to create sprite sheets. So simply open an existing .tps file.
Download the newest TexturePacker - here you'll find a new option on the left: Content Protection. Press the "lock" icon and a new popup opens:
You can enter your own key in the line edit - or simply create a new one by pressing Create new key.
To disable encryption use Clear / Disable.
Save as global key stores the key in TexturePacker as global - using it for decryption in the .pvr viewer and allowing you to paste it in other sprite sheets by simply pressing Use global key.
It is important that you change the file format to pvr.ccz - which is currently the only file format that supports encryption.
Press Publish and you are done in TexturePacker.
The corresponding command in command line is --content-protection <key>
where the key must be a 32-digits hex value.
Preparing your Cocos2D project for content protection
Download and copy the following 2 files inside your Cocos2D folder: libs/cocos2d/Support
- replacing the 2 files that are already there:
Now set the key in your app. You can do this by placing 4 calls inside your startup sequence before the first sprite sheet is loaded. Try to distribute the calls among several files to make them harder to spot.
If your license key is aaaaaaaabbbbbbbbccccccccdddddddd
, you have to split it into 4 parts with 8 digits each:
aaaaaaaa
bbbbbbbb
cccccccc
dddddddd
Each value is a 32-bit part of the whole 128-bit encryption key. It's quite hard to spot inside the app since it's simply another value passed to a function.
caw_setkey_part(0, 0xaaaaaaaa); caw_setkey_part(1, 0xbbbbbbbb); caw_setkey_part(2, 0xcccccccc); caw_setkey_part(3, 0xdddddddd);
Make sure to add the following line to each file in which you use caw_setkey_part
:
#import "ZipUtils.h"
If you had to change the file format, make sure to now load the .pvr.ccz
file instead of whatever you used before. Also add the new files to your project.
That's it!
Conclusion
Protecting your game assets from content thieves is easy. Using the new ContentProtection feature can be set up in less than 5 minutes!
Apple's requirements on encryption and Content Protection
See the Bureau of Industry and Securitys Encryption FAQ - Question 15 (What is Note 4?):
...
Examples of items that are excluded from Category 5, Part 2 by Note 4 include, but are not limited to, the following:
Consumer applications. Some examples:...
- piracy and theft prevention for software or music;
- music, movies, tunes/music, digital photos – players, recorders and organizers
- games/gaming – devices, runtime software, HDMI and other component interfaces, development tools
Picture taken from iTunes Connect Developer Guide - Adding New Apps (scroll down to "Ready to Upload Your Binary" to find the paragraph about encryption)
from:http://www.codeandweb.com/texturepacker/contentprotection
相关推荐
《Cocos2d-android.jar:Android游戏开发的关键组件》 在Android游戏开发领域,Cocos2d-x是一个广泛使用的开源游戏引擎,它基于C++,并提供了多种语言接口,包括Java,使得开发者能够轻松地创建跨平台的游戏。本文...
在本文中,我们将深入探讨如何使用Cocos2d-x创建项目并将其导入Eclipse进行开发。Cocos2d-x是一个跨平台的游戏开发框架,而Eclipse是一款广泛使用的集成开发环境,尤其适合Android应用开发。以下是详细的步骤: ...
cocos2d-android.jar fps_images.png Next download fps_images.png and put into the assets folder of your project. You are now setup with Cocos2D!
在"唐门世界源码 Quick-cocos2d-x学习好资料assets"这个压缩包中,你将能够深入理解如何利用Quick-cocos2d-x进行游戏开发,并了解相关的UI设计和网络通信技术。 首先,Cocos2d-x是一个开源的、跨平台的游戏开发框架...
《cocos2d-x小游戏小狗快跑源码详解》 cocos2d-x是一个开源的、跨平台的游戏开发框架,广泛应用于2D游戏的开发。它基于C++,支持多种编程语言,包括JavaScript和Lua,使得开发者能够在iOS、Android、Windows等多个...
Cocos2d-x是一款流行的开源跨平台2D游戏开发框架,广泛应用于iOS、Android和Windows等多平台的游戏开发。在游戏开发过程中,为了提供更好的用户体验和持续服务,更新游戏资源包是必不可少的。Cocos2d-x 3.2版本引入...
### cocos2d引擎在Android中的使用说明 #### 引言 Cocos2d是一款非常流行的跨平台游戏开发框架,它支持iOS、Android等多个操作系统。本文将详细介绍如何在Android平台上使用cocos2d引擎来开发游戏。 #### 准备...
在IT行业中,游戏开发是一个非常重要的领域,而Cocos2d-x是一个广泛使用的开源游戏引擎,它支持多种平台,如iOS、Android、Windows等。在游戏开发中,资源管理是核心部分之一,其中包括如何安全地存储和加载资源。...
【cocos2d for android 项目部署详解】 在Android平台上,Cocos2d是一个流行的开源游戏开发框架,它基于C++,提供了丰富的功能和高效的游戏引擎。本篇将深入探讨如何部署一个cocos2d for android项目,我们将涵盖...
"萝莉快跑-跑酷源码2.1.3cocos2d-x"是一款基于Cocos2d-x游戏引擎开发的跑酷类游戏。Cocos2d-x是一款开源、跨平台的游戏开发框架,它使用C++作为主要编程语言,同时支持Lua和JavaScript等脚本语言,使得开发者能够...
在本文中,我们将深入探讨如何使用Cocos2d游戏引擎的2.4.3版本来创建一个可控的日志更新滚动界面。Cocos2d是一款广泛应用于2D游戏开发的开源框架,它提供了丰富的图形渲染、动画和物理模拟功能。在这个实例代码中,...
《Cocos2d-x项目移植到Android平台的全面指南》 Cocos2d-x是一款流行的开源游戏开发框架,广泛应用于跨平台游戏开发。当开发者在完成一个基于Cocos2d-x的Win32项目后,可能希望将其移植到Android设备上以触及更广泛...
【cocos2d-x蛇梯棋(cocos creator)】是一个基于Cocos Creator 1.2版本开发的桌面游戏,它将传统的蛇梯棋玩法移植到了移动设备上。Cocos Creator是一个强大的2D游戏开发框架,它集成了编辑器、引擎和资源管理,使得...
《废弃工厂游戏场景RPGFPS Game Assets for PC Industrial Set v30 3.0》是一款专为PC平台设计的游戏资源包,集成了丰富的RPG(角色扮演游戏)和FPS(第一人称射击游戏)元素,旨在为游戏开发者提供一个充满工业化...
首先,您需要下载cocos2d-unity插件。 $ git clone --recursive git@github.com:BigWoodGames/cocos2d-unity.git 在Unity编辑器中创建一个新的2D项目。 需要Unity 5。 我们建议使用Unity 5.4.6f3。 将BBGamelib...
Cocos Creator是一款强大的2D和3D游戏开发引擎,它提供了丰富的工具和框架,使得开发者可以更高效地创建游戏。在游戏设计中,寻路系统是一项至关重要的技术,它使得游戏角色能够智能地在游戏场景中找到最佳路径。...
在网页设计领域,引入Live2D技术可以为网站增添生动有趣的元素,使用户交互体验更加丰富。"看板娘"是这种技术的一个典型应用,它通常表现为动态的2D卡通角色,能够在网页上做出各种动作,与用户进行互动。本文将深入...
### cocos2d-x 常用UI控件详解 #### CCLabelTTF **1. 创建** `CCLabelTTF` 是一个用于显示文本的基本UI元素。它支持自定义字体、大小、颜色以及布局方式。 - **方法一:** ```cpp CCLabelTTF* label = ...