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

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

问题描述

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

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天全站免登陆