Files
android_packages_modules_Co…/Tethering/proguard.flags
Mark 87800837dd SyncSM10: explicitly keep TetheringUtils jni methods
Found R8 accidentally remove TetheringUtils jni methods while doing
some refactor. If any of jni java methods is removed by R8, devices
would fail to boot because of jni registering failure. Explicitly
adding progurad rule to make sure R8 never remove it.

Test: boot, atest CtsTetheringTest

Change-Id: I091a2f094d01f683fb454ed4624be35555940393
2023-09-14 14:39:25 +00:00

36 lines
1.1 KiB
Plaintext

# Keep class's integer static field for MessageUtils to parsing their name.
-keepclassmembers class com.android.server.**,android.net.**,com.android.networkstack.** {
static final % POLICY_*;
static final % NOTIFY_TYPE_*;
static final % TRANSPORT_*;
static final % CMD_*;
static final % EVENT_*;
}
-keep class com.android.networkstack.tethering.util.BpfMap {
native <methods>;
}
-keep class com.android.networkstack.tethering.util.TcUtils {
native <methods>;
}
-keep class com.android.networkstack.tethering.util.TetheringUtils {
native <methods>;
}
# Ensure runtime-visible field annotations are kept when using R8 full mode.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
-keep interface com.android.networkstack.tethering.util.Struct$Field {
*;
}
-keepclassmembers public class * extends com.android.networkstack.tethering.util.Struct {
*;
}
# The lite proto runtime uses reflection to access fields based on the names in
# the schema, keep all the fields.
-keepclassmembers class * extends com.android.networkstack.tethering.protobuf.MessageLite {
<fields>;
}