Keep primitive members used by MessageUtils.

This includes in particular {Full,Network}Score.POLICY_* members
which were removed recently.

Before :
  Policies : 55&62&63
After :
  Policies : EVER_EVALUATED&EVER_VALIDATED&IS_VALIDATED

This patch also unifies the directives under Tethering/ for
simplicity.

Test: adb logcat & dumpsys connectivity & dumpsys tethering
Change-Id: I3d231fbaaebe233b2633da8bb880b5ad1613a32f
This commit is contained in:
Chalard Jean 2022-09-29 18:01:49 +09:00
commit 88edc35da6
2 changed files with 16 additions and 8 deletions

View file

@ -1,7 +1,10 @@
# Keep class's integer static field for MessageUtils to parsing their name.
-keep class com.android.networkstack.tethering.Tethering$TetherMainSM {
static final int CMD_*;
static final int EVENT_*;
-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 {
@ -21,12 +24,8 @@
*;
}
-keepclassmembers class android.net.ip.IpServer {
static final int CMD_*;
}
# 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>;
}
}

View file

@ -6,3 +6,12 @@
-keepclassmembers public class * extends **.com.android.net.module.util.Struct {
*;
}
-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_*;
}