Skip to content

Commit 4da04a1

Browse files
Add support for consumer ProGuard usage
1 parent 0978fae commit 4da04a1

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

sqlcipher/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ android {
1616
// "pm clear" command after each test invocation. This command ensures
1717
// that the app's state is completely cleared between tests.
1818
testInstrumentationRunnerArguments clearPackageData: 'true'
19-
consumerProguardFile 'consumer-rules.pro'
19+
consumerProguardFiles 'consumer-rules.pro'
2020
}
2121

2222
buildTypes {

sqlcipher/consumer-rules.pro

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
-keep class net.zetetic.** {
2-
native <methods>;
3-
private native <methods>;
4-
public <init>(...);
5-
long mNativeHandle;
6-
}
1+
# Keep SQLCipher classes and JNI descriptors
2+
-keep,includedescriptorclasses class net.zetetic.database.** { *; }
3+
-keep,includedescriptorclasses interface net.zetetic.database.** { *; }
74

8-
-keepclassmembers class net.zetetic.database.sqlcipher.SQLiteCustomFunction {
9-
public java.lang.String name;
10-
public int numArgs;
11-
private void dispatchCallback(java.lang.String[]);
5+
# Keep native methods
6+
-keepclasseswithmembernames class net.zetetic.database.** {
7+
native <methods>;
128
}
139

14-
-keepclassmembers class net.zetetic.database.sqlcipher.SQLiteDebug$PagerStats {
15-
public int largestMemAlloc;
16-
public int memoryUsed;
17-
public int pageCacheOverflow;
18-
}
10+
# Prevent warnings for optional Android APIs
11+
-dontwarn net.zetetic.database.**
12+
13+
# Support Room with annontation-based reflection support
14+
-keepattributes *Annotation*

0 commit comments

Comments
 (0)