如何从ProGuard的构建排除R * .class文件 [英] How to exclude R*.class files from a proguard build

查看:355
本文介绍了如何从ProGuard的构建排除R * .class文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个步骤就可以制造方法如下所述: <一href="http://stackoverflow.com/questions/2761443/targeting-android-with-scala-2-8-trunk-builds">http://stackoverflow.com/questions/2761443/targeting-android-with-scala-2-8-trunk-builds

I am one step away from making the method described here: http://stackoverflow.com/questions/2761443/targeting-android-with-scala-2-8-trunk-builds

通过一个单一的项目工作(对1项目Scala和一个用于机器人)。

work with a single project (vs one project for scala and one for android).

我遇到的一个问题。使用该输入文件(参数)ProGuard的:

I've come across a problem. Using this input file (arguments to) proguard:

-injars bin;lib/scala-library.jar(!META-INF/MANIFEST.MF,!library.properties)

-outjar lib/scandroid.jar

-libraryjars lib/android.jar

-dontwarn
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
                SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
-keep public class org.scala.jeb.** { public protected *; }
-keep public class org.xml.sax.EntityResolver { public protected *; }

Proguard的成功建立scandroid.jar,但它似乎已经包括了阵列生成的R类android的资源生成器生成和编译。在这种情况下,它们都位于斌/组织/杰布/ R的* .class。这不是我想要的。 Android的Dalvik的转换器无法建立,因为它认为有R类的副本(它在scandroid也是R * .class文件)。我怎样才能修改上面的ProGuard参数从scandroid.jar排除R * .class文件,以便在Dalvik转换器是幸福? 编辑:我要指出,我尝试添加;斌/组织/杰布/ R.class;等等......到-libraryjars说法,那好像只是使其抱怨重复的类,并且除了ProGuard的决定排除我Scala的类文件了。

Proguard successfully builds scandroid.jar, however it appears to have included the generated R classes that the android resource builder generates and compiles. In this case, they are located in bin/org/jeb/R*.class. This is not what I want. The android dalvik converter cannot build because it thinks there is a duplicate of the R class (it's in scandroid and also the R*.class files). How can I modify the above proguard arguments to exclude the R*.class files from the scandroid.jar so the dalvik converter is happy? I should note that I tried adding ;bin/org/jeb/R.class;etc... to the -libraryjars argument, and that only seemed to cause it to complain about duplicate classes, and in addition proguard decided to exclude my scala class files too.

推荐答案

文件过滤器!** / * R.java换句话说,这留置权力量Proguard的保持混淆所有Java文件除了R.java文件

file filter !**/*R.java in other words this lien forces Proguard to keep all java files except R.java files in the obfuscation

这篇关于如何从ProGuard的构建排除R * .class文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆