【问题标题】:How do I get proguard working with sjersey?我如何让 proguard 与 sjersey 一起工作?
【发布时间】:2015-08-14 19:51:54
【问题描述】:

尝试通过 a fork of SJersey 将 Jersey 与 Scala 一起使用,并使用 ProGuard 对其进行混淆。

这些东西我都有了:

-keepattributes SourceFile,LineNumberTable,*Annotation*,EnclosingMethod,Signature,InnerClasses

我正在这样做:

-keep public class com.example.*JsonSeralisedClasses {
    public *;
}

但是当我用球衣编码东西时,什么都没有出来!

【问题讨论】:

    标签: json scala jersey proguard


    【解决方案1】:

    最终发现 SJersey 不使用公共方法,而是对私有字段进行内省,因此需要这样做:

    -keep public class com.example.*JsonSeralisedClasses {
        public protected private *;
    }
    

    请参阅受保护的私人是不同的。

    或者,您可以使用 @BeanProperty 注释所有内容(这使得使用原始配置保留的公共访问器)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-01
      • 2016-05-28
      • 2023-02-02
      • 2017-06-25
      • 2020-12-13
      • 2012-02-02
      • 2011-02-22
      • 2013-03-24
      相关资源
      最近更新 更多