zoukankan      html  css  js  c++  java
  • Proguard

    Proguard

        You are here: Platform Specific Issues > Android > Proguard
        Direct Link to this Article
        Proguard

        The Android SDK includes Proguard to shrink the size of the application by removing unused stuff, shorting names and other optimisations.

        db4o relies heavily on reflection, which can lead to major issues when code is processed with Proguard. db4o has not been tested under such a environment. When you're using Proguard you need to test yourself if your application is still working.

        You should to exclude all persisted classes from the shrinking process, because db4o manages objects by their name. Therefore db4o will have issue when those name changes by the shrinking process. Read the Proguard documentation for the right configuration. For example when your persisted classes in a certain package you can exclude them like this:

        ########################
        -keep class com.db4odoc.android.**
        -keepnames class com.db4odoc.android.**
        -keepclassmembers class com.db4odoc.android.** {
            !static !transient <fields>;
            !private <fields>;
            !private <methods>;
        }

        proguard.cfg: Keep persisted classes intact
        Download Code
        Copy Code

        To be on the save side you should keep all db4o classes in the original state. Especially since db4o stores some internal data structures which shouldn't be renamed.

        ########################
        ## Monitoring requires JMX, which is not available on Android
        -dontwarn com.db4o.monitoring.*
        -dontwarn com.db4o.cs.monitoring.*
        -dontwarn com.db4o.internal.monitoring.*

        ## Ant is usually not used in a running app
        -dontwarn com.db4o.instrumentation.ant.*
        -dontwarn com.db4o.ta.instrumentation.ant.*

        ## Keep internal classes.
        -keep class com.db4o.** { *; }

        proguard.cfg: keep db4o intact
  • 相关阅读:
    Nexus 3048的NX-OS升级方法
    ASA防火墙忘记密码之后的恢复步骤
    关闭AnyConnect登录安全警告窗口
    使用vASA842配置ASDM645
    SSL 证书格式普及,PEM、CER、JKS、PKCS12
    Python基础练习
    理解管理信息系统
    各大搜索引擎蜘蛛的UserAgent
    iOS应用程序内购/内付费
    iOS开发解决:iOS8.1中UIBarButtonItem的setTitleTextAttributes对Disabled颜色设置无效问题
  • 原文地址:https://www.cnblogs.com/lexus/p/2792760.html
Copyright © 2011-2022 走看看