1# Keep JNI registered methods 2-keepclasseswithmembers,includedescriptorclasses class * { native <methods>; } 3 4# Keep class's integer static field for MessageUtils to parsing their name. 5-keepclassmembers class com.android.server.**,android.net.**,com.android.networkstack.** { 6 static final % POLICY_*; 7 static final % NOTIFY_TYPE_*; 8 static final % TRANSPORT_*; 9 static final % CMD_*; 10 static final % EVENT_*; 11} 12 13# Ensure runtime-visible field annotations are kept when using R8 full mode. 14-keepattributes RuntimeVisibleAnnotations,AnnotationDefault 15-keep interface com.android.networkstack.tethering.util.Struct$Field { 16 *; 17} 18-keepclassmembers public class * extends com.android.networkstack.tethering.util.Struct { 19 *; 20} 21 22# The lite proto runtime uses reflection to access fields based on the names in 23# the schema, keep all the fields. 24-keepclassmembers class * extends com.android.networkstack.tethering.protobuf.MessageLite { 25 <fields>; 26} 27