Sna*_*ake 26 android android-lvl
我知道这个主题已多次打开,我学到了很多,但我偶然发现了一个我真正需要建议的问题.
我正在使用带有混淆的LVL.我更改了默认的LVL ALOT,以便防LVL不会破坏它.但是,Lucky Patcher只需点击一下即可打破它!我试图看到新破坏的APK.是的,它只是简称为"允许方法".
我的问题是,如果有人可以推荐一种方法来阻止Lucky Patcher破坏它吗?我知道我不能防弹,但我希望它至少对于一键式软件来说不那么容易.
Per*_*abs 42
用于检查证书的代码
public void checkSignature(final Context context)
{
try
{
Signature[] signatures = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES).signatures;
if (signatures[0].toCharsString() != <YOUR CERTIFICATE STRING GOES HERE>)
{
// Kill the process without warning. If someone changed the certificate
// is better not to give a hint about why the app stopped working
android.os.Process.killProcess(android.os.Process.myPid());
}
}
catch (NameNotFoundException ex)
{
// Must never fail, so if it does, means someone played with the apk, so kill the process
android.os.Process.killProcess(android.os.Process.myPid());
}
}
Run Code Online (Sandbox Code Playgroud)
如何找到哪一个是你的证书,也很简单.您必须在发布模式下生成APK,因为调试证书总是与发行版证书不同.将证书字符串输出到临时文本视图以将其复制,或者输出到下一次调用的文本文件,重要信息:不要将其输出到logcat,因为字符串太大而且logcat不会显示所有内容并删除最后一个字符串特点:
signatures[0].toCharsString();
example: YourTextView.setText(signatures[0].toCharsString());
Run Code Online (Sandbox Code Playgroud)
现在,请记住,当您返回调试模式时,证书会再次出现不同,有时可能会在每次构建时有所不同,因此您将获得调试地狱.然后最好使用下一行在开发时更容易,并在调用证书测试之前将其放置正确:
if ((context.getApplicationContext().getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE) != 0)
{
return;
}
Run Code Online (Sandbox Code Playgroud)
因此,如果处于调试模式,请避免调用此认证码
现在是幸运的补丁检查员
此代码将检查其存在.我反编译所有版本的Lucky Patcher,我发现它的创建者在所有版本之间使用了2个包名.因此,您只需跟踪新版本并继续将未来的幸运补丁程序包名称添加到检查功能中.
另外一个建议,加密包名字符串,而不是只harcoding它们作为例子,太幸运了补丁不会用新版本刚刚替换字符串修补他们出来.让小饼干变得困难.
private boolean checkLuckyPatcher()
{
if (packageExists("com.dimonvideo.luckypatcher"))
{
return true;
}
if (packageExists("com.chelpus.lackypatch"))
{
return true;
}
if (packageExists("com.android.vending.billing.InAppBillingService.LACK"))
{
return true;
}
return false;
}
private boolean packageExists(final String packageName)
{
try
{
ApplicationInfo info = this.getPackageManager().getApplicationInfo(packageName, 0);
if (info == null)
{
// No need really to test for null, if the package does not
// exist it will really rise an exception. but in case Google
// changes the API in the future lets be safe and test it
return false;
}
return true;
}
catch (Exception ex)
{
// If we get here only means the Package does not exist
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
从当前版本(6.4.6)开始,Lucky Patcher生成非常短的令牌。例如,实际购买令牌:
felihnbdiljiajicjhdpcgbb.AO-J1OyQgD6gEBTUHhduDpATg3hLkTYSWyVZUvFwe4KzT3r-O7o5kdt_PbG7sSUuoC1l6dtqsYZW0ZuoEkVUOq5TMi8LO1MvDwdx5Kr7vIHCVBDcjCl3CKP4UigtKmXotCUd6znJ0KfW
Run Code Online (Sandbox Code Playgroud)
那就是幸运令牌:
kvfmqjhewuojbsfiwqngqqmc
Run Code Online (Sandbox Code Playgroud)
非常简单的解决方案是检查令牌的字符串长度
@Override public void onIabPurchaseFinished(IabResult result, Purchase info) {
if (info.getToken().length < 25) {
Log.wtf("PIRATE", "PIRATE DETECTED");
return;
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
29766 次 |
最近记录: |