如何检查是否存在类在包的地方? [英] How to check if class exists somewhere in package?

查看:105
本文介绍了如何检查是否存在类在包的地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在处理一个特定的问题,我的付费应用。在内部它包含了一个许可检查。这个应用程序进行了修补被黑客通过修改应用程序的apk /瓶。他们添加新的类,它可以帮助绕过许可检查。

I'm currently dealing with a particular issue with my paid application. Internally it contains a licensing check. The app is patched by hackers by modifying the app apk/jar. They are adding a new class which helps bypass the licensing check.

我的目标就是以某种方式检查这个特殊的补丁。如果我觉得我知道我的应用程序已经被破坏。

My goal is to somehow check for this particular patch. If I find it I know my app has been compromised.

如何知道的东西已被修改,在包装上有什么建议?做一个哈希过的应用程序是不是真的在我的情况选择。

Any tips on how to know that something has been modified on the package? Doing a hash over the app is not really an option in my case.

我想也许检查,如果此类存在会有所帮助,但如果他们改变了类的名称?然后,另一个想法是某种检查意想不到包括添加到类。

I thought maybe checking if this class exists would help, but what if they change the name of the class? Then, another idea is somehow check for unexpected includes added to the class.

所有这些可能的吗?任何建议将帮助:)

Any of these possible? Any suggestions would help :)

推荐答案

不知道关于Android,但在标准的JDK,你会做这样的事情:

Not sure about android but in standard JDK you would do something like this:

try {
 Class.forName( "your.fqdn.class.name" );
} catch( ClassNotFoundException e ) {
 //my class isn't there!
}

这篇关于如何检查是否存在类在包的地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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