android混淆Android 混淆出问题了,求教

android混淆  时间:2021-07-20  阅读:()

Android-android 怎么实现只混淆自己的代码,而不混淆第3方jar包

当项目中有第3方jar包时,怎么实现混淆打包,而不对第3方包混淆 在项目中有第3方包时打包出错日志: [2012-06-14 14:14:28 - ] Proguard returned with error code 1. See console [2012-06-14 14:14:28 - ] Note: there were 2068 duplicate class definitions. [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.datatransfer.DataProxy: can't find superclass or interface java.awt.datatransfer.Transferable [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.datatransfer.NativeClipboard: can't find superclass or interface java.awt.datatransfer.Clipboard [2012-06-14 14:14:28 - ] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans [2012-06-14 14:14:28 - ] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans [2012-06-14 14:14:28 - ] Warning:.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslException [2012-06-14 14:14:28 - ] Warning:.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslException [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.datatransfer.DataSource: can't find referenced class java.awt.datatransfer.DataFlavor [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.datatransfer.DataSource: can't find referenced class java.awt.datatransfer.DataFlavor ………………………………………………………………………………中间部分省略 [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.datatransfer.NativeClipboard: can't find referenced class java.awt.datatransfer.Clipboard [2012-06-14 14:14:28 - ] Warning:.apache.harmony.awt.datatransfer.NativeClipboard: can't find referenced class java.awt.datatransfer.Clipboard [2012-06-14 14:14:28 - ] Warning: there were 288 unresolved references to classes or interfaces. [2012-06-14 14:14:28 - ] You may need to specify additional library jars (using '-libraryjars'), [2012-06-14 14:14:28 - ] or perhaps the '-dontskipnonpubliclibraryclasses' option. [2012-06-14 14:14:28 - ] java.io.IOException: Please correct the above warnings first. [2012-06-14 14:14:28 - ] at proguard.Initializer.execute(Initializer.java:308) [2012-06-14 14:14:28 - ] at proguard.ProGuard.initialize(ProGuard.java:210) [2012-06-14 14:14:28 - ] at proguard.ProGuard.execute(ProGuard.java:85) [2012-06-14 14:14:28 - ] at proguard.ProGuard.main(ProGuard.java:499) 我的proguard.cfg 文件时这样的 -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose -ignorewarnings -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -libraryjars libs/bcprov-jdk15on-147.jar -libraryjars libs/PanoramaGL.jar -libraryjars libs/activation.jar -libraryjars libs/additionnal.jar -libraryjars libs/mail.jar -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference -keep public .android.vending.licensing.ILicensingService -keepclasseswithmembernames class * { native <methods>; } -keepclasseswithmembers class * { public <init>(android.content.Context, android.util.AttributeSet); } -keepclasseswithmembers class * { public <init>(android.content.Context, android.util.AttributeSet, int); } -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } 已经尝试的方案:方案一: 加入-ignorewarnings 可以正常打包了。

能过滤掉警告信息。

但是治标不治本,打好的包,在实际运行中用到过的第3方包类库时,均报空指针。

方案二:不使用-ignorewarnings 添加-dontwarn java.awt.datatransfer.Transferable.** 警告信息并没有减少,打包会失败。

android混淆打包 功能不能用

ProGuard来进行混淆打包,大大的优化Apk包的大小。

但是注意ProGuard对文件路径的名名很有讲究,不支持括号,也不支持空格。

在混淆过后,可以在工程目录的proguard中的mapping.txt看到混淆后的类名,方法名,变量名和混淆前的类名,方法名,变量名。

  在使用Eclipse新建一个工程,都会在工程目录下生产配置project.properties和proguard-project.tx。

  # To enable ProGuard to shrink and obfuscate your code, ment this (available properties: sdk.dir, user.home):   #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt   # Project target.   target=android-10   project.properties用于配置Android工程的一些属性,#号的话表示当前行是注释,这里的proguard.config就用于指定ProGuard的混淆配置文件,并对使用release方式打包应用程序时开启代码混淆功能。

对于是否是使用release方式打包,和AndroidManifest.xml中application的android:debuggable属性有很多关系。

如果该值为android:debuggable="true",那么最终就是debug方式打包。

最明智的方式就是在AndroidManifest.xml并不显示的指定它,而是是打包工具在打包时来决定它最终的值。

对于ant就是ant release或ant debug。

而对于直接在Eclipse中使用run 或debgu来打包的话就是debug,使用export的话就是release.   proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt   这里的话指定了混淆的基本配置文件proguard-android.txt,和混淆的个性化配置文件proguard-project.txt。

Android 混淆出问题了,求教

您好,我在别的论坛也看到您的问题,很高兴为您解答: duplicate definition of library class [.http.SslError] 看来不是混淆问题,你的包自身就有多余的吧?结果是相同的类冲突了。

在proguard.cfg加上忽略警告的代码,就可以了。

如果我的回答没能帮助您,请继续追问。

ShockHosting日本机房VPS测试点评

这个月11号ShockHosting发了个新上日本东京机房的邮件,并且表示其他机房可以申请转移到日本,刚好赵容手里有个美国的也没数据就发工单申请新开了一个,这里做个简单的测试,方便大家参考。ShockHosting成立于2013年,目前提供的VPS主机可以选择11个数据中心,包括美国洛杉矶、芝加哥、达拉斯、杰克逊维尔、新泽西、澳大利亚、新加坡、日本、荷兰和英国等。官方网站:https://shoc...

41云,服务器8折优惠券,200G TCP防御

41云怎么样?41云是国人主机品牌,目前经营产品有国内外云服务器、CDN(高防CDN)和物理机,其中国内外云服务器又细分小类有香港限流量VPS、香港大带宽VPS、香港弹性自选VPS、香港不限流VPS、香港BGP线路VPS、香港Cera+大带宽机器、美国超防VPS、韩国原生VPS、仁川原生VPS、日本CN2 VPS、枣庄高防VPS和金华高防VPS;物理机有美国Cera服务器、香港单程CN2服务器、香...

创梦网络-四川大带宽、镇江电信服务器云服务器低至56元

达州创梦网络怎么样,达州创梦网络公司位于四川省达州市,属于四川本地企业,资质齐全,IDC/ISP均有,从创梦网络这边租的服务器均可以备案,属于一手资源,高防机柜、大带宽、高防IP业务,一手整C IP段,四川电信,一手四川托管服务商,成都优化线路,机柜租用、服务器云服务器租用,适合建站做游戏,不须要在套CDN,全国访问快,直连省骨干,大网封UDP,无视UDP攻击,机房集群高达1.2TB,单机可提供1...

android混淆为你推荐
android半透明android状态栏怎么设置透明谷歌德语在线翻译德语翻译 不找你不代表我不想你 别用翻译器 谢谢~常用软件开发工具java编程常用的软件有哪些百度预测世界杯世界杯,今晚预测...magento2心慌方2是什么意思?windows7系统要求Windows7系统对电脑配置的要求,2020带来好运的微信头像2020带来好运抖音网名罗振宇2017跨年演讲第五届“时间的朋友”跨年演讲关键词:基本盘,什么叫“基本盘”?Costco茅台被抢光Costco在中国大陆第一家店开业首日被挤爆,为什么人们都特别青睐洋货?500人同时满足500人在线的性能测试jmeter怎么设置线程和并发数
虚拟主机mysql 北京服务器租用 warez 新加坡主机 hkbn jsp主机 优key 远程登陆工具 服务器架设 北京主机 架设服务器 789电视 双线主机 91vps 流媒体加速 空间租赁 百度云空间 中国域名 空间申请 广州服务器托管 更多