Skip to content

sabinjose/sqlcipher_flutter_libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The source was cloned from simolus3/sqlite3.dart at release version 0.5.0 to fall back to the older SQLCipher library (net.zetetic:android-database-sqlcipher:4.4.3) due to issues with the latest version.

sqlcipher_flutter_libs

Flutter apps depending on this package will contain native SQLCipher libraries on Android, iOS and macOS.

Using this package

When using this package on Android, you need to tell the sqlite3 package how to open sqlcipher since it will attempt to open the regular sqlite3 binary by default:

import 'package:sqlite3/open.dart';

// Do this before using any sqlite3 api
open.overrideFor(
    OperatingSystem.android, openCipherOnAndroid);

You will also need to do this when using a package wrapping the sqlite3 package like moor or sqflite_common_ffi!

No changes are necessary for iOS and MacOS

For more details on how to actually use this package in a Flutter app, see sqlite3.

Problems on Android 6

There appears to be a problem when loading native libraries on Android 6 (see this issue). If you're seeing those crashes, you could try setting android.bundle.enableUncompressedNativeLibs=false in your gradle.properties file. Be aware that this increases the size of your application when installed.

Alternatively, you can use the applyWorkaroundToOpenSqlCipherOnOldAndroidVersions method from this library. It will try to open sqlcipher in Java, which seems to work more reliably. After the native library has been loaded from Java, we can open it in Dart too.

About

Lib version 0.5.0

Resources

License

Stars

Watchers

Forks

Packages

No packages published