@Keep annotation

264 views
Skip to first unread message

Tomáš Procházka

unread,
May 20, 2016, 9:56:02 AM5/20/16
to adt-dev
@Keep annotation is very usefull, you mentioned it on the I/O as new think bat id exist long time already.
Bud I think that sometimes keep the method/class/field is not enough.
Sometimes is also important keep the name of the method/class/field. 
O found @KeepName annotation, but in the com.google.android.gms.common.annotation package, so I think that it is not supported now by build plugin.
It would be very useful to add this also to the support library.

Michal Bendowski

unread,
May 23, 2016, 12:06:57 PM5/23/16
to adt-dev
@Keep is recognized by "-keep" rules in the default ProGuard files, which means the names will be preserved as well, right?

Michal

Tomáš Procházka

unread,
May 24, 2016, 5:33:20 PM5/24/16
to adt-dev
Yes. -keep prevent just before remove class/method, but not before obfuscation.
If you wan to keep also the names (for reflection access, serialization, etc) you must to use -keepnames

Dne pondělí 23. května 2016 18:06:57 UTC+2 Michal Bendowski napsal(a):

Makoto Yamazaki

unread,
May 24, 2016, 9:22:08 PM5/24/16
to adt...@googlegroups.com
ProGuard manual says that -keepnames is the same with -keep,allow shrinking
That means -keep will preserve names as well.


--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
YAMAZAKI Makoto

Tomáš Procházka

unread,
May 26, 2016, 8:35:47 AM5/26/16
to adt...@googlegroups.com
But current @Keep annotation is transated to  -keep not  -keep,allowshrinking, right?

--
Ing. Tomáš Procházka

--
You received this message because you are subscribed to a topic in the Google Groups "adt-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adt-dev/ter404z4EKw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adt-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages