Skip to content

First attempt to add DatabaseErrorHandler #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

First attempt to add DatabaseErrorHandler #84

wants to merge 1 commit into from

Conversation

brody4hire
Copy link

In response to: https://mail.google.com/mail/ca/u/0/#inbox/13bd59554d89aa4f here is the ability to use a SQLiteOpenHelper with a DatabaseErrorHandler.

@developernotes
Copy link
Member

Hi brodyspark,

Thanks for submitting this - everything looks good, however we would like to include a separate test within the test suite for this feature. Could you include one to cover this addition? Thanks!

@brody4hire
Copy link
Author

I expect to do this sometime next week,

Chris

On Wednesday, January 9, 2013, Nick Parker wrote:

Hi brodyspark,

Thanks for submitting this - everything looks good, however we would like
to include a separate test within the test suitehttps://github.com/sqlcipher/sqlcipher-android-testsfor this feature. Could you include one to cover this addition? Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//pull/84#issuecomment-12071234.

Sent from my mobile

@developernotes
Copy link
Member

Hello @brodybits

Any thoughts to the feedback on the mailing list regarding this pull request?

@brody4hire
Copy link
Author

Posted one reply, about to post another reply.

On Fri, Mar 21, 2014 at 2:22 PM, Nick Parker notifications@github.comwrote:

Hello @brodybits https://github.com/brodybits

Any thoughts to the feedbackhttps://groups.google.com/d/msg/sqlcipher/nV0dM_vJa0U/q0-8y26gPO0Jon the mailing list regarding this pull request?

Reply to this email directly or view it on GitHubhttps://github.com//pull/84#issuecomment-38274517
.

@rage28
Copy link

rage28 commented Feb 16, 2015

Hi,

Any idea when this feature will have a release?

@brody4hire
Copy link
Author

The problem is that we need a test case for this enhancement. I think we
would have to test this with a corrupt database file. Don't know when I
will get a chance to look at it.

Chris
@brodybits

On Mon, Feb 16, 2015 at 5:47 PM, Raghavendra Bhuvan <
notifications@github.com> wrote:

Hi,

Any idea when this feature will have a release?


Reply to this email directly or view it on GitHub
#84 (comment)
.

@rage28
Copy link

rage28 commented Feb 16, 2015

Is it enough if you have any corrupt database? Or any specific type of corruption(s) (as listed on their site)? Maybe I can help here

@brody4hire
Copy link
Author

I just made a simple corrupt database test in this branch: https://github.com/brodybits/sqlcipher-android-tests/tree/first-corrupt-database-test

Following the hint at http://stackoverflow.com/questions/26966905/can-i-deliberately-corrupt-an-sqlite3-database-for-testing I took the existing unencrypted.db from sqlcipher-android-tests and removed blocks of 00 bytes (using vim as described here: http://timmurphy.org/2013/07/27/editing-a-file-in-hex-mode-in-vim/).

Here is a hexdump of my corrupted database (note that extra 00 blocks are suppressed and shown by *):

00000000  53 51 4c 69 74 65 20 66  6f 72 6d 61 74 20 33 00  |SQLite format 3.|
00000010  10 00 01 01 00 40 20 20  00 00 00 02 00 00 00 03  |.....@  ........|
00000020  00 00 00 00 00 00 00 00  00 00 00 01 00 00 00 04  |................|
00000030  00 00 00 00 00 00 00 03  00 00 00 01 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 02  |................|
00000060  00 2d e2 22 0d 00 00 00  01 0f da 00 0f da 00 00  |.-."............|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000000a0  00 00 00 00 00 00 00 00  00 00 24 01 06 17 11 11  |..........$.....|
000000b0  01 35 74 61 62 6c 65 74  31 74 31 03 43 52 45 41  |.5tablet1t1.CREA|
000000c0  54 45 20 54 41 42 4c 45  20 74 31 28 61 2c 62 29  |TE TABLE t1(a,b)|
000000d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000110  00 00 00 00 00 00 00 00  00 00 24 01 03 2f 2d 6f  |..........$../-o|
00000120  6e 65 20 66 6f 72 20 74  68 65 20 6d 6f 6e 65 79  |ne for the money|
00000130  74 77 6f 20 66 6f 72 20  74 68 65 20 73 68 6f 77  |two for the show|
00000140  0a                                                |.|

For comparison, here is the hexdump of the original (unencrypted) db (again, extra 00 blocks suppressed and shown by *):

00000000  53 51 4c 69 74 65 20 66  6f 72 6d 61 74 20 33 00  |SQLite format 3.|
00000010  10 00 01 01 00 40 20 20  00 00 00 02 00 00 00 03  |.....@  ........|
00000020  00 00 00 00 00 00 00 00  00 00 00 01 00 00 00 04  |................|
00000030  00 00 00 00 00 00 00 03  00 00 00 01 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 02  |................|
00000060  00 2d e2 22 0d 00 00 00  01 0f da 00 0f da 00 00  |.-."............|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000fd0  00 00 00 00 00 00 00 00  00 00 24 01 06 17 11 11  |..........$.....|
00000fe0  01 35 74 61 62 6c 65 74  31 74 31 03 43 52 45 41  |.5tablet1t1.CREA|
00000ff0  54 45 20 54 41 42 4c 45  20 74 31 28 61 2c 62 29  |TE TABLE t1(a,b)|
00001000  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00001010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002000  0d 00 00 00 01 0f da 00  0f da 00 00 00 00 00 00  |................|
00002010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002fd0  00 00 00 00 00 00 00 00  00 00 24 01 03 2f 2d 6f  |..........$../-o|
00002fe0  6e 65 20 66 6f 72 20 74  68 65 20 6d 6f 6e 65 79  |ne for the money|
00002ff0  74 77 6f 20 66 6f 72 20  74 68 65 20 73 68 6f 77  |two for the show|

I will finish reworking the changes based on the most recent changes (in the master branch) and issue a new pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants