如何防止android被反编译

如何防止android被反编译,第1张

apk 打包时,先用代码混淆。打包成后,可以利用网上的很多 加密工具进行加密。 这样别人反编译出来的东西都是乱码。 安全率增加90%

里面说的两个关键词 apk代码混淆,apk加密工具 请自行百度搜索相关资料和用法

当然可以通过加密apk防止反编译的方法可以起到净化国内app市场的作用!你可以尝试使用一下爱加密,他是一个针对APP加密的平台,它可以防止应用在运营推广过程中被反编译,恶意篡改、注入扣费代码、数据等,保护应用的安全性、稳定性,同时对开发者的应有收入提供有力保障。

防破解是个热门话题,最近很多热门的应用都用了采用了第三方的加密服务,毕竟现在通用的加密方法都是很容易被破解的。像史上最坑爹游戏、美食杰、这些热门都用了一个叫爱加密的第三方加密服务,可以防止这个apk反编译,代码注入,山寨盗版的行为。你自己去查一下吧,希望有帮助
这样可以么?

下面具体说一说怎么样让SDK23下的proguardcfg文件起作用,先来看看android-sdk-windows\tools\lib\proguardcfg的内容:view plain 1 -optimizationpasses 5 2 -dontusemixedcaseclassnames 3 -dontskipnonpubliclibraryclasses 4 -dontpreverify 5 -verbose 6 -optimizations !code/simplification/arithmetic,!field/,!class/merging/ 7 8 -keep public class extends androidappActivity 9 -keep public class extends androidappApplication 10 -keep public class extends androidappService 11 -keep public class extends androidcontentBroadcastReceiver 12 -keep public class extends androidcontentContentProvider 13 -keep public class extends androidappbackupBackupAgentHelper 14 -keep public class extends androidpreferencePreference 15 -keep public class comandroidvendinglicensingILicensingService 16 17 -keepclasseswithmembernames class { 18 native <methods>; 19 } 20 21 -keepclasseswithmembernames class { 22 public <init>(androidcontentContext, androidutilAttributeSet); 23 } 24 25 -keepclasseswithmembernames class { 26 public <init>(androidcontentContext, androidutilAttributeSet, int); 27 } 28 29 -keepclassmembers enum { 30 public static [] values(); 31 public static valueOf(javalangString); 32 } 33 34 -keep class implements androidosParcelable { 35 public static final androidosParcelable$Creator ; 36 } 从脚本中可以看到,混淆中保留了继承自Activity、Service、Application、BroadcastReceiver、ContentProvider等基本组件以及comandroidvendinglicensingILicensingService, 并保留了所有的Native变量名及类名,所有类中部分以设定了固定参数格式的构造函数,枚举等等。) 让proguardcfg起作用的做法很简单,就是在eclipse自动生成的defaultproperties文件中加上一句“proguardconfig=proguardcfg”就可以了 完整的defaultproperties文件应该如下:view plain 1 # This file is automatically generated by Android Tools 2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 # 4 # This file must be checked in Version Control Systems 5 # 6 # To customize properties used by the Ant build system use, 7 # "buildproperties", and override values to adapt the script to your 8 # project structure 9 10 # Project target 11 target=android-9 12 proguardproguardconfig=proguardcfg 大功告成,正常的编译签名后就可以防止代码被反编译了。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/13383234.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-25
下一篇 2023-07-25

发表评论

登录后才能评论

评论列表(0条)

保存