Feature #2939

StreamFile class for easy stream read/write with IOCipher

Added by hans almost 4 years ago. Updated almost 3 years ago.

Status:NewStart date:02/07/2014
Priority:HighDue date:
Assignee:-% Done:

0%

Category:-
Target version:0.3.1
Component:

Description

Ok, I found the best example. I tweaked the TransferThread in this project to make it more flexible.

This also has my hacked jni to create pipes and some of my exploratio on how to hook up all the threads to get around blocking.

On Fri, Aug 23, 2013 at 10:59 AM, Josh Steiner <> wrote:
Ok, here was my plan of attack.

Make StreamFile derive from java.io.File. @Override methods such as getAbsolutePath( and getFD(). If this is the firsdt call, create two pipes using JNI, one of in one for out. also spin up two threads to attach to both pipes.

One of the tricky spots here is attaching to the pipes will block the java calls until both ends are hooked up, so you also have to use a thread (AsyncTask) just to do the hooking up. I hacked my way into this and got lost in a deadlock nightmare, but done carefully this should work.

Once all that is setup you can return a real FD or path.

Then @Override the close() method and kill the threads and delete the pipe files.

My reader/writer threads were modeled after this:

https://github.com/commonsguy/cw-omnibus/blob/master/Media/AudioRecordStream/src/com/commonsware/android/audiorecstream/MainActivity.java#L156

PipeTest.tgz (19.2 MB) hans, 02/07/2014 04:50 pm

History

#1 Updated by hans almost 4 years ago

#2 Updated by hans almost 4 years ago

  • Target version set to 0.2 - reliability and cacheword interop

#3 Updated by hans almost 4 years ago

  • Tracker changed from Task to Feature
  • Subject changed from StreamFile example to StreamFile class for easy stream read/write with IOCipher

#4 Updated by hans almost 4 years ago

  • Priority changed from Normal to Urgent

#5 Updated by hans almost 4 years ago

  • Priority changed from Urgent to High

#6 Updated by hans over 3 years ago

  • Target version deleted (0.2 - reliability and cacheword interop)

#7 Updated by hans over 3 years ago

  • Target version set to 0.3

#8 Updated by hans almost 3 years ago

  • Target version changed from 0.3 to 0.3.1

Also available in: Atom PDF