【问题标题】:Proguard configuration for sqlite android bindingssqlite android绑定的Proguard配置
【发布时间】:2016-08-04 04:15:51
【问题描述】:

我正在尝试使用 SQLite android 绑定在我的 android 应用程序中使用自定义加密 SQLite DB。一切正常,我即将发布我的应用程序。我正在尝试使用 ProGuard 进行代码混淆和压缩,但似乎不适用于 SQLite android 绑定。我发布的应用程序在启动时崩溃,因为它找不到 SQLite 使用的少量 .so 文件。我不确定保留这些库的正确 ProGuard 规则应该是什么。

现在我只在我的 ProGuard 中添加了这个:

-keep class org.sqlite.**

【问题讨论】:

    标签: android sqlite android-sqlite android-proguard


    【解决方案1】:

    通常,

    -keep class org.sqlite.** { *; }
    -keep class org.sqlite.database.** { *; }
    

    会成功的。

    验证您的 mapping.txt 是否已经完成了 ProGuard,并确保您的 模型 没有被重命名。如果是这样,您可能需要

    -keep class com.your.modelspackage.**
    -keepclassmembers com.your.modelspackage.** { *; }  
    

    希望对你有帮助

    【讨论】:

    • 我目前遇到了这个问题,我已经在 Unity for android 中使用了以下插件,它在没有 proguard 的情况下工作得很好。 github.com/rizasif/sqlite-unity-plugin-example 我将前两行添加到我的专业守卫中,但它没有用。从@Let'sRefactor 的上述答案中,您能解释一下什么代表模型包吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-19
    • 1970-01-01
    • 2013-08-19
    相关资源
    最近更新 更多