Skip to content

Commit d15b05e

Browse files
Fix rawQuery with read restriction
1 parent c2aa13e commit d15b05e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/net/sqlcipher/CursorWrapper.java

+4
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,9 @@ public CursorWrapper(Cursor cursor) {
3131
public int getType(int columnIndex) {
3232
return mCursor.getType(columnIndex);
3333
}
34+
35+
public Cursor getWrappedCursor() {
36+
return mCursor;
37+
}
3438
}
3539

src/net/sqlcipher/database/SQLiteDatabase.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -1488,11 +1488,9 @@ public Cursor rawQueryWithFactory(
14881488
*/
14891489
public Cursor rawQuery(String sql, String[] selectionArgs,
14901490
int initialRead, int maxRead) {
1491-
SQLiteCursor c = (SQLiteCursor)rawQueryWithFactory(
1492-
null, sql, selectionArgs, null);
1493-
c.setLoadStyle(initialRead, maxRead);
1494-
1495-
return c;
1491+
net.sqlcipher.CursorWrapper cursorWrapper = (net.sqlcipher.CursorWrapper)rawQueryWithFactory(null, sql, selectionArgs, null);
1492+
((SQLiteCursor)cursorWrapper.getWrappedCursor()).setLoadStyle(initialRead, maxRead);
1493+
return cursorWrapper;
14961494
}
14971495

14981496
/**

0 commit comments

Comments
 (0)