Integrating SQLCIPHER in Android Studio Project

后端 未结 1 1496
挽巷
挽巷 2020-12-09 23:22

I tried integrating SQLCipher in my Android Application, using this link and also some stack-overflow links(but they are out-dated and differs from official document).

相关标签:
1条回答
  • 2020-12-10 00:29

    add this to your build.gradle of your app and it should work out of the box:

    dependencies {
         compile 'net.zetetic:android-database-sqlcipher:3.5.2@aar'
         ...
    }
    

    In your code, you should load the 'native libraries' as this 'aar' file contains a few of them.

    SQLiteDatabase.loadLibs(context);
    

    NOTE that you should use the net.sqlcipher.database.SQLiteDatabase instead of android.database.sqlite.SQLiteDatabase, just like a couple of other SQLite classes.

    0 讨论(0)
提交回复
热议问题