21 Aug 2010 bse   » (Apprentice)

ProGuard Pro Tips

With my launch of Proton, I decided to incorporate the recently released License Verification Library (LVL), which is meant to improve security of Android apps by adding a licensing layer to help ensure you’re running an app legally.

Google’s own documentation for the LVL notes code obfuscation is strongly recommended. What they don’t mention are the specific ProGuard settings (or any other Java obfuscator, for that matter) to use when LVL is in place. The default ProGuard configuration example will cause your app to force quit with an enumeration related exception.

The only documentation online that deals with the LVL/ProGuard combination is a lot of people complaining about their apps crashing after obfuscation. Not very helpful.

After much time spent tweaking settings, and searching for solutions, I found a combination that works without causing any force quits or license verification errors.

Add the following to your ProGuard configuration:

-keep class com.android.vending.licensing.ILicensingService

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);

The main problem lay with allowing ProGuard touch enumerations (as noted in documentation I can’t easily link to). A secondary issue was a missing entry point to the LVL service.

The enumeration fix may also be of use if you’re experiencing problems with ProGuard and not using the License Verification Library. Your mileage may vary. Document any further related problems or fixes in the comments.

With all of the above said, I’m still not sure LVL is quite mature enough to rely on yet. Unless I’m just doing it wrong.

Syndicated 2010-08-21 02:41:02 from RedProcess Blog

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!