本文介绍了如何pviously在PC与Android sqlcipher读取加密的数据库中创建$ P $?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想阅读我的电脑上创建sqlcipher加密的数据库,但我不能看在我的应用程序。例如:

I'm trying to read an encrypted database created with sqlcipher on my PC but I can't read it on my app. For example:

Cursor c = database.rawQuery("SELECT name FROM sqlite_master WHERE type='table'", null);
    c.moveToFirst();
    do {
        String s = c.getString(0);
        if (s.equals("android_metadata")) {
            // System.out.println("Get Metadata");
            continue;
        } else {
            dirArray.add(s);
        }
    } while (c.moveToNext());
    Log.i("getS", "DATABASE = " + dirArray.toString());
    Log.i("getS", "length = " + dirArray.size());

以下结果。

03-12 03:28:12.691: I/getS(9895): DATABASE = []
03-12 03:28:12.691: I/getS(9895): length = 0

也是这个:

Cursor c2 = database.query("my_table", new String[] { "name" }, null, null, null, null, "name");

在回归本:

03-12 03:28:12.701: I/Database(9895): sqlite returned: error code = 1, msg = no such table: my_table

我与SDK-7编译,如果我尝试相同的数据库加密和不sqlcipher,我没有任何问题。
谁能教我怎么做我在Android上我的电脑上加密的数据库中读取?
鸭preciate;)

I'm compiling with sdk-7, if I try the same database unencrypted and without the sqlcipher, I don't have any problems.Could anyone teach me how do I read on android a database encrypted on my computer?Appreciate ;)

推荐答案

您将要使用的SQLCipher为Android库,将允许您访问和修改数据库sqlcipher在Android设备上。我们目前支持Android 2.1 - 4.0.3。二进制下载可以在这里找到:

You will want to use the SQLCipher for Android library which will allow you to access and modify a sqlcipher database on an Android device. We currently support Android 2.1 - 4.0.3. Binary downloads can be found here:

在itegrating SQLCipher针对Android的指南可以在这里找到:

A tutorial on itegrating SQLCipher for Android can be found here:

这篇关于如何pviously在PC与Android sqlcipher读取加密的数据库中创建$ P $?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 03:12