proguard 不混淆类中或内部类中部分方法

package com.android.test;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
public class MyTest{
    public ServiceConnection mMyConnection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
        @Override
        public void onServiceDisconnected(ComponentName name) {
    public Intent MyIntent= new Intent() {
        @Override
        public Object clone() {
            return new Intent(this);

如果希望整个类的public都不混淆写法如下:

-keep class com.android.test.MyTest {
public *;

如果只希望内部类的某几个public函数不混淆,写法如下:

-keepnames class com.android.test.MyTest$* {
    public void onServiceConnected(android.content.ComponentName, android.os.IBinder);