File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
sqlcipher/src/main/java/net/zetetic/database/sqlcipher Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,18 @@ private SQLiteDatabase getDatabaseLocked(boolean writable) {
325325 db = SQLiteDatabase .create (null );
326326 } else {
327327 try {
328- final String path = mContext .getDatabasePath (mName ).getPath ();
328+ final File filePath = mContext .getDatabasePath (mName );
329+ final String path = filePath .getPath ();
330+ /*
331+ Modified by Zetetic, newer Android OS versions will create the
332+ databases directory upon installation of the APK, whereas older
333+ versions, such as some devices running API 21 the databases directory
334+ does not exist.
335+ */
336+ final File databasesDirectory = new File (filePath .getParent ());
337+ if (!databasesDirectory .exists ()){
338+ databasesDirectory .mkdirs ();
339+ }
329340 /*
330341 Modified by Zetetic to support propagation of the mEnableWriteAheadLogging
331342 should a user invoke setWriteAheadLoggingEnabled() when the mDatabase
You can’t perform that action at this time.
0 commit comments