How should I use proguard with ormlite library on Android?
Trying this:
-keep class com.j256.**
-keepclassmembers class com.j256.**
-keep enum com.j256.**
-keepclassmembers enum com.j256.**
-keep interface com.j256.**
-keepclassmembers interface com.j256.**
But I get:
03-23 20:23:54.518: E/AndroidRuntime(3032): java.lang.RuntimeException: Unable to start activity ComponentInfo{cz.eman.android.cepro/cz.eman.android.cepro.activity.StationsOverviewActivity}: java.lang.IllegalStateException: Could not find constructor that takes a Context argument for helper class class kb
I also tried to add this:
-keepclassmembers class * { public <init>(android.content.Context); }
But I get another classmembers errors.
In addittion to default necessary for reflection:
I needed to keep all my Entity classes:
Otherwise entity classes are stripped out. I use predefined DB(generated earlier).
Is there an easier/better way to obfuscate. Maybe I'm keeping too many classes?
A small addition for the latest version OrmLite 5.
You may want to add these rows to hide some new warnings:
Warnings are like these:
The accepted answer was not enough for my case, so I enhanced it and this is what I ended up with:
I don't have the solution but here are a couple of references to help:
You may be missing:
and/or
In my case this did the trick:
and
With obfucation and optimizations.
Thank you a lot for posts like this that help us to advance step by step.
I've came up with other solution after i have tried the last one without success:
I hope it can help someone.