如何从Proguard构建中排除R * .class文件

编程入门 行业动态 更新时间:2024-10-24 22:26:43
本文介绍了如何从Proguard构建中排除R * .class文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我离开这里描述的方法一步之遥: 使用Scala定位Android 2.8中继线构建

I am one step away from making the method described here: Targeting Android with Scala 2.8 Trunk builds

使用单个项目(vs一个项目为scala,一个为android)。

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资源构建器生成并编译。在这种情况下,它们位于bin / org / jeb / R * .class中。这不是我想要的。 android dalvik转换器无法构建,因为它认为有一个重复的R类(它在scandroid,也是R * .class文件)。如何修改上述proguard参数以从scandroid.jar中排除R * .class文件,以便dalvik转换器很开心? 编辑:我应该注意到,我尝试添加; bin / org / jeb / 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文件之外的所有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文件

本文发布于:2023-11-16 16:59:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606155.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   Proguard   class

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!