Skip to content

Commit 3cdeb07

Browse files
Merge pull request #36 from brodybits/build-and-documentation-updates
build & documentation updates
2 parents 791422b + 90deada commit 3cdeb07

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ build
99
local.properties
1010
.idea/**
1111
*.iml
12+
*.aar
13+
*.jar

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
1-
To run, clone this repo and make sure you have the Android Studio installed:
2-
- SQLCipher for Android defines [compatibility support](https://github.com/sqlcipher/android-database-sqlcipher#compatibility), simply run on either an emulator or device.
3-
- More information can be found at [SQLCipher for Android](https://zetetic.net/sqlcipher/sqlcipher-for-android/).
1+
To run: clone this repo and open with a recent version of Android Studio, or [build from the command line](https://developer.android.com/studio/build/building-cmdline).
2+
3+
It is possible to run on an emulator or device, as documented in the [SQLCipher for Android compatibility section](https://github.com/sqlcipher/android-database-sqlcipher#compatibility).
4+
5+
More information can be found in [SQLCipher for Android](https://zetetic.net/sqlcipher/sqlcipher-for-android/).
46

57
### Creating A New Test
68

79
1. Open this repository within Android Studio
810
2. Add a new class within `net.zetetic.tests` package that extends `SQLCipherTest`:
911

10-
```
12+
```Java
1113
package net.zetetic.tests;
1214

1315
import net.sqlcipher.database.SQLiteDatabase;
1416

15-
public class DemoTest extends SQLCipherTest {
17+
public class AwesomeTest extends SQLCipherTest {
1618

1719
@Override
1820
public boolean execute(SQLiteDatabase database) {
1921
try {
2022
// Add your scenario here
2123
return true;
22-
}catch (Exception e){
24+
} catch (Exception e) {
2325
return false;
2426
}
2527
}
2628

2729
@Override
2830
public String getName() {
29-
return "Demo Test";
31+
return "Awesome Test";
3032
}
3133
}
3234
```
3335

34-
3. Add `DemoTest` to the [`TestSuiteRunner`](https://github.com/sqlcipher/sqlcipher-android-tests/blob/master/src/main/java/net/zetetic/tests/TestSuiteRunner.java):
36+
3. Add `AwesomeTest` to the [`TestSuiteRunner`](https://github.com/sqlcipher/sqlcipher-android-tests/blob/master/src/main/java/net/zetetic/tests/TestSuiteRunner.java):
3537

38+
```Java
39+
tests.add(new AwesomeTest());
3640
```
37-
tests.add(new DemoTest());
38-
```
39-
4. Build and run the application on an Android device/emulator
41+
4. Build and run the application on an Android device or emulator

app/build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ android {
1919
}
2020

2121
dependencies {
22-
implementation fileTree(dir: 'libs', include: ['*.jar'])
22+
// For testing JAR-based distribution:
23+
// implementation files('libs/sqlcipher.jar')
2324

24-
// For testing zip-based distributions:
25-
//implementation files('libs/sqlcipher.jar')
25+
// For testing local AAR package:
26+
// implementation (name: 'android-database-sqlcipher-4.4.0-release', ext: 'aar')
2627

27-
// For testing local AAR packages:
28-
//implementation (name: 'android-database-sqlcipher-4.3.0-release', ext: 'aar')
28+
// For testing on remote AAR reference:
29+
implementation 'net.zetetic:android-database-sqlcipher:4.4.0@aar'
2930

30-
31-
// For testing on remote AAR references:
32-
implementation 'net.zetetic:android-database-sqlcipher:4.3.0@aar'
31+
// Mandatory dependency:
3332
implementation "androidx.sqlite:sqlite:2.0.1"
33+
34+
// For Room tests:
3435
implementation "androidx.room:room-runtime:2.1.0"
3536
annotationProcessor "androidx.room:room-compiler:2.1.0"
3637
}

app/src/main/java/net/zetetic/tests/JavaClientLibraryVersionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public class JavaClientLibraryVersionTest extends SQLCipherTest {
66

7-
String expectedClientLibraryVersion = "4.3.0";
7+
String expectedClientLibraryVersion = "4.4.0";
88

99
@Override
1010
public boolean execute(SQLiteDatabase database) {
@@ -16,4 +16,4 @@ public boolean execute(SQLiteDatabase database) {
1616
public String getName() {
1717
return "Java Client Library Version Test";
1818
}
19-
}
19+
}

app/src/main/java/net/zetetic/tests/PragmaCipherVersionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class PragmaCipherVersionTest extends SQLCipherTest {
88

9-
private final String CURRENT_CIPHER_VERSION = "4.3.0";
9+
private final String CURRENT_CIPHER_VERSION = "4.4.0";
1010

1111
@Override
1212
public boolean execute(SQLiteDatabase database) {
@@ -31,4 +31,4 @@ public boolean execute(SQLiteDatabase database) {
3131
public String getName() {
3232
return "PRAGMA cipher_version Test";
3333
}
34-
}
34+
}

0 commit comments

Comments
 (0)