如何防止分数被越狱者更改

发布于 2025-01-05 15:18:37 字数 344 浏览 5 评论 0原文

好的 。 。 。

我制作了一个游戏,使用 NSUserDefaults 来存储高分。将其投放市场后,我的一位朋友向我展示了如何破解它并改变高分 - 我不知道这是可能的。在 v2.0 中,我添加了 GameCenter,因此当我将这些分数发布到排行榜时,这变得更加重要。我不希望越狱者能够仅仅改变他们的高分并在高分列表上拥有一堆万亿。有没有办法将高分保存在设备上,以便越狱者无法轻易编辑它们?我真的很喜欢 NSUserDefaults 的简单性,所以我想知道是否有一种方法可以让越狱者看不到这些,但另一个保存系统会很棒。我在设备上保存每个级别的高分,并将总剧集分数上传到游戏中心,因此我不能只从他们的服务器检索分数。

任何帮助将不胜感激。谢谢!

OK . . .

I made a game where I use NSUserDefaults to store high scores. After placing it on the market, I had a friend show me how he could hack into it and just change high scores-- something I did not know was possible. With v2.0, I am adding GameCenter, so this becomes a much bigger deal as I post these scores to a leader board. I do not want jail breakers to be able to just change their high scores and have a bunch of trillions on the high score list. Is there a way to keep high scores saved on the device so that jail breakers can't edit them so easily? I really liked the simplicity of NSUserDefaults, so I was wondering if there was a way to make these un-see-able to jail breakers, but another save system would be just great. I save high scores for each individual level on the device and upload total episode scores to Game Center, so I can't just retrieve scores from their servers.

Any help would be appreciated. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遮了一弯 2025-01-12 15:18:37

如果信息如此重要,您始终可以尝试对值进行哈希处理或将它们存储在本地数据库中。 CoreData 听起来很适合你。 NSUserDefaults 非常适合存储您可能轻松需要的值,但绝不安全。很遗憾,如果您想让您的应用程序更加安全,您可能需要做一些工作。

需要考虑和研究的几个选项:

  • SQLite
  • CoreData
  • iCloud 存储
  • 本地文件加密 - 将值存储在本地 .plist 中并根据需要加密/解密

您肯定有一些工作要做。希望这对您有所帮助。祝你好运。

If the information is that important, you could always try hashing the values or storing them in a local database. CoreData sounds right up your alley for this. NSUserDefaults is great for storing values you might need easily, but is by no means secure. I'm sorry to say, but you will probably have a little bit of work to do if you want to make your app more secure.

A few options to consider and research:

  • SQLite
  • CoreData
  • iCloud storage
  • Local File encryption - store values in local .plist and encrypt/decrypt as needed

You have some work to do for sure. Hope this helps you on your way. Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文