On 2/7/13 3:41 AM, Hani wrote:
> Salute,
>
> I have put this error message :
>
> 02-07 10:25:52.775: System.err(20576): java.io.FileNotFoundException:
> /data/data/com.company.myprojectname/databases/encrypted.db: open
> failed: ENOENT (No such file or directory)
> 02-07 10:25:52.779: System.err(20576): at
> libcore.io.IoBridge.open(IoBridge.java:416)
> 02-07 10:25:52.783: System.err(20576): at
> java.io.FileOutputStream.<init>(FileOutputStream.java:88)
>
> So I imagine that the issue comes from the fact that the application
> cannot create the file from copying it.
> Do I need to add a permission ?
>
> I did the encrypted file by first editing a database with SQLite
> Database Browser then I got the source of SQLCipher. I compiled it with
> a special ./configure and make. And encrypted it with the generated
> sqlite command. Then I did just as this link explained it :
>
http://zetetic.net/blog/2009/12/29/how-to-encrypt-a-plaintext-sqlite-database-to-use-sqlcipher.html
>
> I have inspected the encrypted file with hexdump and I got some
> unreadable datas.
>
> Hani.
>
>
> Le mercredi 6 f�vrier 2013 19:21:19 UTC+1, Stephen Lombardo a �crit :
>
> Hi Hani,
>
> On 2013-02-06, Hani wrote:
> > I have an encrypted database created with SQLite Database Browser and
> > encrypted using sqlcipher (with ATTACH DATABASE ...).
>
> I have a few questions:
>
> 1. How did you create the encrypted database? e.g. did you create it
> in SQLite Database Browser and then use the SQLCipher command line
> tool to encrypt it before transferring it to the device, or did you
> build SQLite Database Browser with SQLCipher support?
>
> 2. Have you inspected encrypted database file to ensure that it is
> actually encrypted, for instance using hexdump?
>
> Cheers,
> Stephen
>
Thank you for including the stack trace. From the packaging name it
appears you are using IOCipher, is that correct? If so, it may be
helpful if you could explain the scenario you are attempting to give us
a better understanding.
That said, if you are having an issue copying a file from the assets
directory of your application into the databases directory could you try
the following things:
* Verify you are able to get a non null InputStream when calling open
from the AssetManager
* Observe bytes are read from the InputStream
* Verify the full path used for writing the FileOutputStream
--
Nick Parker