# Breaking changes migrating from android-database-sqlcipher 4.5.3 to sqlcipher-android 4.6.1

**URL:** <https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762>\
**Category:** Issues\
**Created:** [December 13, 2024, 12:24pm UTC](https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762 "2024-12-13T12:24:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev\_danny](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dev\_danny](https://discuss.zetetic.net/u/dev_danny)\
**Post date:** [December 13, 2024, 12:24pm UTC](https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762/1 "2024-12-13T12:24:59Z")

</div>

Hi here  
There seem to be lots of breaking changes from migrating from android-database-sqlcipher 4.5.3 to sqlcipher-android 4.6.1 is there like a detailed documentation for the changes?  
For example, SQLiteDatabaseHook has new signature where postKey and preKey has connection parameter now, how do I execute raw queries and get cursor instance to check if migration succeeded?  
SQLiteException is not found from the lib artifacts?

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [December 13, 2024, 4:03pm UTC](https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762/2 "2024-12-13T16:03:55Z")

</div>

Hi @dev_danny,

Thanks for your interest in SQLCipher. The Java API’s attempt to remain similar, however, there are some differences. We have a migration guide available [here](https://www.zetetic.net/sqlcipher/sqlcipher-for-android-migration/) which you should read if you haven’t yet.

---

<div class="post-metadata">

**Author:** ![dev\_danny](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dev\_danny](https://discuss.zetetic.net/u/dev_danny)\
**Post date:** [December 17, 2024, 6:09am UTC](https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762/3 "2024-12-17T06:09:13Z")

</div>

Hi @developernotes thank you for the response, checked the migration guide but It does not cover all changes

1. on SQLiteDatabaseHook has new signature where postKey and preKey has connection parameter now, how do I get db instance from the connection to execute raw queries and get cursor instance to check if migration succeeded?
2. What is the replacement of net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(password) ?

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [December 17, 2024, 9:06pm UTC](https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762/4 "2024-12-17T21:06:50Z")

</div>

Hi @dev_danny,

> [@dev\_danny](#):
>
> on SQLiteDatabaseHook has new signature where postKey and preKey has connection parameter now, how do I get db instance from the connection to execute raw queries and get cursor instance to check if migration succeeded?

The `SQLiteDatabaseHook` isn’t operating at the same level with the `sqlcipher-android` library as compared to `android-database-sqlcipher`. If you need a resultset, you could invoke `executeForCursorWindow`. An example can be found [here](https://github.com/sqlcipher/sqlcipher-android/blob/master/sqlcipher/src/main/java/net/zetetic/database/sqlcipher/SQLiteConnection.java#L1203-L1221).

> [@dev\_danny](#):
>
> What is the replacement of net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(password) ?

The `SQLiteOpenHelper` [constructors](https://github.com/sqlcipher/sqlcipher-android/blob/master/sqlcipher/src/main/java/net/zetetic/database/sqlcipher/SQLiteOpenHelper.java#L173-L209) takes either a `String` or `byte[]` for the password material, then you can just invoke `getWritableDatabase()`.

---

<div class="post-metadata">

**Author:** ![dev\_danny](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dev\_danny](https://discuss.zetetic.net/u/dev_danny)\
**Post date:** [December 19, 2024, 6:08am UTC](https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762/5 "2024-12-19T06:08:41Z")

</div>

Thank you @developernotes  
A quick one, with the new artifact and version is it necessary to add libstlport\_shared.so, libdatabase\_sqlcipher.so, and libsqlcipher\_android.so in my project jniLibs directory?

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [December 19, 2024, 3:22pm UTC](https://discuss.zetetic.net/t/breaking-changes-migrating-from-android-database-sqlcipher-4-5-3-to-sqlcipher-android-4-6-1/6762/6 "2024-12-19T15:22:25Z")

</div>

Hi @dev_danny,

> [@dev\_danny](#):
>
> A quick one, with the new artifact and version is it necessary to add libstlport\_shared.so, libdatabase\_sqlcipher.so, and libsqlcipher\_android.so in my project jniLibs directory?

No, you can just reference the library via AAR as documented [here](https://www.zetetic.net/sqlcipher/sqlcipher-for-android/).
