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加上忽略警告的代码,就可以了。

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

提速啦(900元/月),杭州BGP E5-2665/89*2 32核 48G 100G防御

提速啦的来历提速啦是 网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑提速啦的市场定位提速啦主要代理市场稳定速度的云服务器产品,避免新手购买云服务器的时候众多商家不知道如何选择,妮妮云就帮你选择好了产品,无需承担购买风险,不用担心出现被跑路 被诈骗的情况。提速啦的售后保证提速啦退款 通过于合作商的友好协商,云服务器提供3天内全额退款,超过3天不退款 物理机部分支持当天全额退款提速啦提现 充...

JustHost,最新高性价比超便宜俄罗斯CN2 VPS云服务器终身8折优惠,最低仅8元/月起,200Mbps带宽不限流量,五大机房自助自由切换,免费更换IP,俄罗斯cn2vps怎么样,justhost云服务器速度及综合性能详细测评报告

主机参考最新消息:JustHost怎么样?JustHost服务器好不好?JustHost好不好?JustHost是一家成立于2006年的俄罗斯服务器提供商,支持支付宝付款,服务器价格便宜,200Mbps大带宽不限流量,支持免费更换5次IP,支持控制面板自由切换机房,目前JustHost有俄罗斯5个机房可以自由切换选择,最重要的还是价格真的特别便宜,最低只需要87卢布/月,约8.5元/月起!just...

PacificRack(19.9美元/年)内存1Gbps带vps1GB洛杉矶QN机房,七月特价优惠

pacificrack怎么样?pacificrack商家发布了七月最新优惠VPS云服务器计划方案,推出新款优惠便宜VPS云服务器采用的是国产魔方管理系统,也就是PR-M系列,全系基于KVM虚拟架构,这次支持Windows server 2003、2008R2、2012R2、2016、2019、Windows 7、Windows 10以及Linux等操作系统,最低配置为1核心2G内存1Gbps带宽1...

android混淆为你推荐
限制局域网网速怎么限制局域网的网速?qq空间维护QQ空间正在维护中,暂不支持访问是怎么回事安卓性能测试工具三款安卓系统手机测试软件哪个好用智能机刷机软件安卓手机刷机,用什么软件最简单?百度预测世界杯谁来帮我预测世界杯!智能公共广播系统有谁知道公共广播系统都包括那些设备flv转换avi怎样把视频flv格式转换成avi 、 mp4格式云图好看吗云图这部电影好看吗金山铁路最新时刻表上海南叶线的时刻表罗振宇2017跨年演讲罗胖的 “侠爷泼妖” 是什么梗,跨年演讲时提到的~
汉邦高科域名注册 vps服务器租用 云网数据 hostmaster locvps themeforest BWH mediafire下载工具 wordpress技巧 主机屋免费空间 百兆独享 秒杀汇 卡巴斯基试用版 服务器干什么用的 万网空间管理 台湾google 独享主机 空间申请 apnic windowssever2008 更多