How to preserve method content when obfuscation

I’m trying to preserve or keep method content when obfuscate a class. I tried:

  1. use keep rule, e.g., keep ‘class com.mycorp.util MyUtil { *;}’
  2. use keepclassmembers ‘class com.mycorp.util.MyUtil {
    public static void printApi(byte[]);
    }’

None of the above preserved the content of printAPI method.

Did I miss any rule or misconfigured rules?

Thanks,
Jingkun