Skip to content

unable open db from sdcard  #88

Closed
Closed
@algoroq

Description

@algoroq

I can't open encrypted db from sdcard.

The code

database = SQLiteDatabase.openDatabase(filePath, password, null, SQLiteDatabase.OPEN_READONLY | SQLiteDatabase.NO_LOCALIZED_COLLATORS);

or

database = SQLiteDatabase.openDatabase(filePath, password, null, SQLiteDatabase.OPEN_READWRITE| SQLiteDatabase.NO_LOCALIZED_COLLATORS);

throws the same exception

02-03 17:40:15.815: I/Database(3470): sqlite returned: error code = 8, msg = statement aborts at 4: [DELETE FROM android_metadata] attempt to write a readonly database
02-03 17:40:15.815: E/Database(3470): DELETE failed setting locale
02-03 17:40:15.830: E/Database(3470): Failed to setLocale() when constructing, closing the database
02-03 17:40:15.830: E/Database(3470): net.sqlcipher.database.SQLiteException: attempt to write a readonly database
02-03 17:40:15.830: E/Database(3470):   at net.sqlcipher.database.SQLiteDatabase.native_setLocale(Native Method)
02-03 17:40:15.830: E/Database(3470):   at net.sqlcipher.database.SQLiteDatabase.setLocale(SQLiteDatabase.java:2101)
02-03 17:40:15.830: E/Database(3470):   at net.sqlcipher.database.SQLiteDatabase.<init>(SQLiteDatabase.java:1967)
02-03 17:40:15.830: E/Database(3470):   at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:900)
02-03 17:40:15.830: E/Database(3470):   at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:947)

I also tried add and remove android_metadata table unfortunately without success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions