proguard.cfg

问题:

I have a app that uses ActiveAndroid, a database ORM library that relies on annotations.

@Table(name="test")
public class DatabaseItem extends ActiveRecordBase<databaseitem> {

    public DatabaseItem(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }

    @Column(name="counter")
    public int counter;

}
What would I need to do to get Proguard working nice with this? Currently I get errors about not finding a column name by activeandroid when using proguard. I guess it somehow mangles the annotation.

My relevant proguard cfg:

#ActiveAndroid
-keep public class com.activeandroid.**
-keep public class * extends com.activeandroid.ActiveRecordBase
-keepattributes Column
-keepattributes Table

=========================================================================
Solution was to keep all members of the library and the database classes

-keep class com.activeandroid.**
{
     *;
}
-keep public class my.app.database.**
{
    *;
}
-keepattributes Column
-keepattributes Table

Column and Table aren't existing java class file attributes. You'll at least have to specify

-keepattributes *Annotation*</databaseitem>

猜你喜欢

转载自asdf314159265.iteye.com/blog/1724911
cfg
今日推荐