I want to obfuscate a part of a project, so I have separated the project into two parts.
In the part I want to obfuscate I have different classes that have a Serializable implements and normal java classes.
On my build.gradle I had the following task:
task myProguardTask(type: ProGuardTask){
injars '/build/libs/Library-files-0.0.1-SNAPSHOT.jar'
outjars '/build/libs/Library-files-outJAR.jar'
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
adaptresourcefilenames '**.properties'
adaptresourcefilecontents '**.properties,META-INF/MANIFEST.MF'
allowaccessmodification()
keepnames 'class * implements java.io.Serializable'
keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
private static final java.io.ObjectStreamField[] serialPersistentFields; \
!static !transient <fields>; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'
adaptclassstrings('com.example.test.xxx.**')
}
(Adaptclassstring is the package of the project and I use ** because I have Serializable implements on 2 different packages.)
However, when I run the task I get this error:
- Type âproguard.gradle.ProGuardTaskâ property âadaptclassstringsâ is missing an input or output annotation.
- Type âproguard.gradle.ProGuardTaskâ property âadaptresourcefilecontentsâ is missing an input or output annotation.
- Type âproguard.gradle.ProGuardTaskâ property âadaptresourcefilenamesâ is missing an input or output annotation.
- Type âproguard.gradle.ProGuardTaskâ property âaddconfigurationdebuggingâ is missing an input or output annotation.
- Type âproguard.gradle.ProGuardTaskâ property âallowaccessmodificationâ is missing an input or output annotation.
Am I missing something or am I creating the task wrong?
Thank you!