Giter Club home page Giter Club logo

sqliteforunity's Introduction

SqliteForUnity

Sqlite3 for Unity with AES encryption

After trying out alot of sqlite3 libs/plugins for Unity, I couldn't find any that supported encryption, was free and was easy to use. However there were some good ones out there that I forked and added encryption support to it.

Can't Wait ?

Download Unity Packages - Unity 5 | Unity 4.6 Pro

Quick Facts:

  • SqliteForUnity provides sqlite support for Unity3D (5.0 & 4.6 Pro) with encryption
  • Download project folders to try out the sample scenes Unity 5,Unity 4.6 Pro
  • Support for x86/x64/Android
  • Plugins folder contains SqliteForUnity3D.dll,libsqlite3.so(for Android),sqlite.dll(both x8enc6/x64) with encryption support

Sample Scene - [Android]

alt tag alt tag alt tag

Usage

Usage is similiar to sqlite-net & SQLite4Unity3d. Reiterating it here -

using UnityEngine;
using System.Collections;
using SqliteForUnity3D;

public class PStudent {
	[PrimaryKey]
	public string Id { get;set; }
	public string Name { get;set; }
}

//Creating Tables & Inserting
var factory = new ConnectionFactory();
.....
_connection = factory.Create(dbPath);
_connection.CreateTable<PStudent> ();
_connection.Insert(new PStudent{
    Id = "XYZ",
    Name = "John"
});

//This uses Linq Reflections , please avoid using on iOS
_connection.Table<PStudent> ().Where (x => x.Name == "John").FirstOrDefault ();
//Instead
string name = "John";
_connection.Query<PStudent>(string.Format("select * from PStudent where Name = {0}",name));

Encryption

//To lock db
_connection.SetDbKey(key);
// To unlock db
_connection.Key(key);

SqliteForUnity Source

SqliteForUnity is a fork of https://github.com/codecoding/SQLite4Unity3d by @CodeCoding. A wrapper around the great c# client for sqlite - sqlite-net by @praeclarum

x86/x64 Encryption The encryption is based on AES similiar to the one used by https://github.com/rindeal/SQLite3-Encryption (Infact you can use sqlite3.dll by @rindeal too).

Android Encryption For Android I compiled the sqlite3 src with the encryption from @rindeal for both armeabi & x86 platform. I have included the source here.

#TODO

  1. To add support for Windows Phone 8.1/8
  2. To test it on iOS

sqliteforunity's People

Contributors

dragonjawad avatar shreks7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sqliteforunity's Issues

Unity5: Script missing from gameobject, could not find/create database

Hello,

I recently tried to clone and test your Unity5 project example. However, in the example itself, it seems the repo is missing a bit of information.

  • The "CreateDB" gameobject was missing a script. (In the screenshot below, I assumed it was the "Create Game DB" script, and the values in the screenshot were filled in for me)

  • There's an error when trying to access/create the database:

        SQLiteException: Could not open database file: Assets/StreamingAssets/game.db (CannotOpen)
        SqliteForUnity3D.SQLiteConnection..ctor (System.String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks)
        SqliteForUnity3D.ConnectionFactory.Create (System.String address)
    

It seems like a pretty darn amazing example, but unfortunately I can only guess that not all the files were committed/pushed to the repo. As for the "can't open database" issue, the particular version of the error above that I pasted is after trying to check the "Reset Database" box.

Best,
Jawad

screenshot 2015-03-15 12 42 07

SQLiteException: database disk image is malformed

Using the example scenes everything works fine in the editor (5.1.2), but on a Droid Razor HD I'm getting the following error "SQLiteException: database disk image is malformed" after entering in the password. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.