Android & Proguard

A quick note about using ProGuard to optimize and/or obfuscate Android packages. Maybe this is useful to someone..

You can use optimize, but I had to disable code/simplification/cast and code/allocation/variable optimizations. In addition, overloadaggressively and allowaccessmodification will result in illegal opcodes detected at runtime only.

        <proguard optimize="true" shrink="true" defaultpackage=""
                  printmapping="false" verbose="false"
                  usemixedcaseclassnames="true" obfuscate="${obfuscate}"
                  overloadaggressively="false" printseeds="false"
                  allowaccessmodification="false" microedition="false">
            ... snip ...
            <keep name="*" extends="android.app.Activity">
                <method name="*"/>
            </keep>
            -optimizations !code/simplification/cast
            -optimizations !code/allocation/variable
        </proguard>

tfdj

No comments yet. Be the first.

Leave a reply