如何prevent与Ga​​mecih作弊? [英] How to prevent cheating with Gamecih?

查看:322
本文介绍了如何prevent与Ga​​mecih作弊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

我已经有一段时间了,现在的问题与球员作弊在我的Andr​​oid游戏。对于严格的单人游戏,这将不会是一个大问题,但因为我的游戏包含多人对战和全球排行榜名单,这是造成合法的玩家停止,因为骗子玩。

他们怎么骗

骗子使用的应用程序的根用户名为 Gamecih 。 Gamecih允许用户暂停一个应用程序,修改变量值,然后恢复应用程序。所以,在我的情况下,他们只是暂停游戏,将健康为74万亿美元,然后踢的废话了大家对多人。这里有一个影片展示了如何Gamecih用于水果忍者(不是我的游戏)作弊。

考虑方法

  1. code混淆。这是行不通的,因为混淆不会改变变量的的,只是变量的的名字的。这意味着,骗子仍然可以找到具有相同的价值,他们目前健康变量,然后修改这个变量。
  2. code混淆+吸气和放大器;二传手的价值变化。这样一来,健康实际上不会再present真正的健康价值。在getter方法​​我会做类似的回报卫生* 10;而在二传我会做卫生=输入/ 10;当然,这可能是更复杂的。

我要什么

这可以说,考虑方法NR 2是我应该使用什么样,但话又说回来,它没有prevent黑客攻击,它只是变得更加困难。理想情况下,我想,以检测当人们使用Gamecih作弊,显示弹出说:该死,你讨厌的黑客,然后关闭应用程序。我做的没有的希望依赖于服务器的解决方案,因为我希望我的球员能够玩一会儿下线为好。如果可能的话,我也想避免code混淆。

解决方案

 尝试{
    ApplicationInfo信息= getPackageManager()。
            getApplicationInfo(com.cih.gamecih,0);
    返回true;
}赶上(PackageManager.NameNotFoundException E){
    返回false;
}
 

如果该函数返回true,甚至都不让黑客进入多人游戏模式,并提示他将其卸载。

Background

I've had problems for quite a while now with players cheating in my android game. For a strict single-player game this wouldn't be a big issue, but since my game contains multiplayer battles and global highscore lists, it's causing legit players to stop playing because of the cheaters.

How they cheat

Cheaters use an app for root users called Gamecih. Gamecih lets users pause an app, change variable values, and then resume the app. So in my case they just pause the game, change "health" to 74 trillions and then kick the crap out of everyone on multiplayer. Here's a video showing how Gamecih is used to cheat in Fruit Ninja(not my game).

Considered methods

  1. Code obfuscation. This won't work because obfuscation doesn't change variable values, just variable names. This means that cheaters can still find the variable that has the same value as their current health and then change that variable.
  2. Code obfuscation + getter & setter value changing. This way, health will not actually represent the real health value. In the getter method I would do something like return health*10; and in the setter I would do health=input/10; This could of course be more complicated.

What I want

It could be argued that considered method nr 2 is what I should use, but then again, it doesn't prevent hacking, it just makes it harder. Ideally, I would like to detect when people cheat using Gamecih, display a pop-up saying "Darn you, you nasty hacker", and then close the application. I do not want a server-dependent solution as I would like my players to be able to play while offline as well. If possible, I would also like to avoid code obfuscation.

解决方案

try{
    ApplicationInfo info = getPackageManager().
            getApplicationInfo("com.cih.gamecih", 0 );
    return true;
} catch( PackageManager.NameNotFoundException e ){
    return false;
}

If this function returns true, don't even let the hacker enter Multiplayer mode, and prompt him to uninstall it.

这篇关于如何prevent与Ga​​mecih作弊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆