How to tell ProGuard to keep private fields without specifying each field

前端 未结 1 1468
南旧
南旧 2020-12-03 10:10

This is my class:

package com.tools.app.holiday;

public class Holiday {  

    private String name;

    private Calendar dateFrom = Calendar.getInstance();         


        
相关标签:
1条回答
  • 2020-12-03 10:20

    According to ProGuard documenation the wildcard <fields> matches any field. Thus it should be something like:

    -keepclassmembers class com.tools.app.holiday.Holiday {
        private <fields>;    
    }
    

    If you want to preserve private fields in all classes use:

    -keepclassmembers class * {
        private <fields>;    
    }
    
    0 讨论(0)
提交回复
热议问题