简体   繁体   English

Proguard保留所有Java接口

[英]Proguard keep all java interfaces

How to keep all api interfaces and internal ones that are used like callbacks? 如何保留所有API接口和内部接口(如回调函数)? I didn't find it there http://proguard.sourceforge.net/manual/examples.html 我在那里找不到http://proguard.sourceforge.net/manual/examples.html

The URL already offer the answer. 该URL已提供答案。

A fast but sub-optimal alternative would be simply keeping all interfaces with "-keep interface *". 一种快速但次优的选择是将所有接口都保留为“ -keep interface *”。

Update in 2016/3/25 To keep all methods in the Interface . 2016年3月25日更新,将所有方法保留在Interface

-keep interface * {
  <methods>;
}

Update in 2017/7/24 The class file of Java8 could store metadata for reflection on method parameters, include Interface . 2017/7/24中更新Java8的类文件可以存储元数据以反映方法参数,包括Interface Proguard v5.3 could keep these metadata with following options : Proguard v5.3可以通过以下选项保留这些元数据:

-keepattributes MethodParameters -keepattributes方法参数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM