Skip to content

Commit 793dbfe

Browse files
Upgrading libraries to include support for ICS
1 parent 623447b commit 793dbfe

File tree

10 files changed

+195
-141
lines changed

10 files changed

+195
-141
lines changed

assets/icudt44l.zip

-1.96 MB
Binary file not shown.

assets/icudt46l.zip

2.2 MB
Binary file not shown.
8 Bytes
Binary file not shown.
20.1 KB
Binary file not shown.

libs/sqlcipher.jar

-7 Bytes
Binary file not shown.

net.zetetic.sqlcipher.test.iml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<option name="LIBRARY_PROJECT" value="false" />
2020
<option name="RUN_PROCESS_RESOURCES_MAVEN_TASK" value="false" />
2121
<option name="GENERATE_UNSIGNED_APK" value="false" />
22+
<option name="CUSTOM_DEBUG_KEYSTORE_PATH" value="" />
2223
</configuration>
2324
</facet>
2425
</component>
@@ -27,16 +28,19 @@
2728
<output-test url="file://$MODULE_DIR$/target/test-classes" />
2829
<content url="file://$MODULE_DIR$">
2930
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
31+
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/aidl" isTestSource="false" />
32+
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/combined-assets" isTestSource="false" />
3033
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/r" isTestSource="false" />
31-
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
34+
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" />
35+
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
3236
<excludeFolder url="file://$MODULE_DIR$/target/android-classes" />
3337
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
3438
<excludeFolder url="file://$MODULE_DIR$/target/generated-sources/combined-resources" />
3539
<excludeFolder url="file://$MODULE_DIR$/target/generated-sources/extracted-dependencies" />
3640
<excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" />
41+
<excludeFolder url="file://$MODULE_DIR$/target/surefire" />
3742
<excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
3843
</content>
39-
<orderEntry type="jdk" jdkName="Android 2.1-update1 Platform" jdkType="Android SDK" />
4044
<orderEntry type="sourceFolder" forTests="false" />
4145
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.android:android:2.1.2" level="project" />
4246
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
@@ -49,6 +53,7 @@
4953
<orderEntry type="library" scope="PROVIDED" name="Maven: org.json:json:20080701" level="project" />
5054
<orderEntry type="library" name="Maven: sqlcipher:sqlcipher:1.0" level="project" />
5155
<orderEntry type="library" name="Maven: guava:guava:1.0" level="project" />
56+
<orderEntry type="jdk" jdkName="Android 2.1 Platform" jdkType="Android SDK" />
5257
</component>
5358
</module>
5459

net.zetetic.sqlcipher.test.ipr

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,8 @@
3030
<component name="EntryPointsManager">
3131
<entry_points version="2.0" />
3232
</component>
33-
<component name="FacetAutodetectingManager">
34-
<autodetection-disabled>
35-
<facet-type id="android">
36-
<modules>
37-
<module name="net.zetetic.sqlcipher.test" />
38-
</modules>
39-
</facet-type>
40-
</autodetection-disabled>
33+
<component name="FrameworkDetectionExcludesConfiguration">
34+
<file type="android" url="file://$PROJECT_DIR$" />
4135
</component>
4236
<component name="JavacSettings">
4337
<option name="ADDITIONAL_OPTIONS_STRING" value="-target 1.6" />

net.zetetic.sqlcipher.test.iws

Lines changed: 173 additions & 128 deletions
Large diffs are not rendered by default.

src/main/java/net/zetetic/ZeteticContentProvider.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public class ZeteticContentProvider extends ContentProvider {
1515
private SQLiteDatabase database;
1616

1717
public ZeteticContentProvider() {
18-
SQLiteDatabase.loadLibs(ZeteticApplication.getInstance());
19-
database = ZeteticApplication.getInstance().createDatabase();
18+
2019
}
2120

2221
@Override
@@ -26,6 +25,10 @@ public boolean onCreate() {
2625

2726
@Override
2827
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
28+
29+
SQLiteDatabase.loadLibs(ZeteticApplication.getInstance());
30+
database = ZeteticApplication.getInstance().createDatabase();
31+
2932
createDatabaseWithData(database);
3033
SQLiteQueryBuilder builder = new SQLiteQueryBuilder();
3134
builder.setTables("t1");

src/main/java/net/zetetic/tests/AttachDatabaseTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public boolean execute(SQLiteDatabase encryptedDatabase) {
1212
encryptedDatabase.execSQL("create table t1(a,b)");
1313
encryptedDatabase.execSQL("insert into t1(a,b) values(?, ?)", new Object[]{"one", "two"});
1414

15+
16+
1517
String newKey = "foo";
1618
File newDatabasePath = ZeteticApplication.getInstance().getDatabasePath("normal.db");
1719
String attachCommand = "ATTACH DATABASE ? as encrypted KEY ?";
@@ -22,7 +24,7 @@ public boolean execute(SQLiteDatabase encryptedDatabase) {
2224
encryptedDatabase.execSQL(createCommand);
2325
encryptedDatabase.execSQL(insertCommand);
2426
encryptedDatabase.execSQL(detachCommand);
25-
27+
2628
return true;
2729
}
2830

@@ -32,6 +34,11 @@ protected void tearDown() {
3234
newDatabasePath.delete();
3335
}
3436

37+
public android.database.sqlite.SQLiteDatabase createNormalDatabase(){
38+
File newDatabasePath = ZeteticApplication.getInstance().getDatabasePath("normal.db");
39+
return android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(newDatabasePath.getAbsolutePath(), null);
40+
}
41+
3542
@Override
3643
public String getName() {
3744
return "Attach Database Test";

0 commit comments

Comments
 (0)