1

我在我的应用程序中使用@CommonsWare 的CWAC-LoaderEx库及其SQLiteCursorLoader

但是当我尝试使用 Proguard 时,我收到了以下警告:

Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader: can't find referenced class net.sqlcipher.database.SQLiteOpenHelper
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$DeleteTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$InsertTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$ReplaceTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$UpdateTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning: com.commonsware.cwac.loaderex.SQLCipherUtils: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning: com.commonsware.cwac.loaderex.SQLCipherUtils: can't find referenced class net.sqlcipher.database.SQLiteDatabase$CursorFactory
Warning: com.commonsware.cwac.loaderex.acl.SQLCipherCursorLoader: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning: com.commonsware.cwac.loaderex.acl.SQLCipherCursorLoader$DeleteTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase

... 等等。我尝试添加到我的proguardcfg文件中:

-libraryjars libs/CWAC-LoaderEx.jar
-keep class net.sqlcipher.** { *; }
-keep class net.sqlcipher.database.** { *; }

除了默认的proguard-android.txt,包含在 SDK 中。

有没有人有任何想法?谢谢!

4

2 回答 2

3

如果您的应用程序没有使用 SQLCipher,您可以告诉 ProGuard 忽略丢失的类。例如:

-dontwarn net.sqlcipher.**

请参阅 ProGuard 手册 > 故障排除 >警告:找不到引用的类

您不应在配置文件中指定-injars-libraryjars选项。Ant/Eclipse/Gradle 构建过程已经根据您的项目内容自动为您指定了所有必要-injars-outjars、 和。-libraryjars

请参阅 ProGuard 手册 > 故障排除 >注意:程序/库类的重复定义

于 2013-10-23T10:06:15.203 回答
1

因为我没有使用 SQLCipher,我可以告诉 Proguard 忽略它吗?

你可以告诉 ProGuard 摆脱com.commonsware.cwac.loaderex.SQLCipherCursorLoader,大概。

警告就是:警告。除了警告之外,我还假设(错误地)您正在崩溃。只要您从未尝试过使用SQLCipherCursorLoader,警告就不会给您带来任何特殊问题。

于 2013-10-17T23:43:44.057 回答