<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.openintents.safe" \r
- android:versionName="1.1.1-rc1" android:versionCode="7">\r
- <!-- History:\r
+ android:versionName="1.1.1" android:versionCode="8">\r
+ <!-- History:
+ 1.1.1 [8]: 2009-05-30\r
1.1.0 [6]: 2009-03-17\r
1.0.0 [4]: 2009-02-02\r
-->
\r
---------------------------------------------------------\r
release: 1.1.1\r
-date: 2009-??\r
+date: 2009-05-30\r
\r
- Secure deletion of CSV files after import.\r
-- Add support for file encryption.\r
+- Add support for file stream encryption,\r
+ to be used by Obscura.\r
- Add Trivium stream cipher.\r
\r
---------------------------------------------------------\r
\r
public class CryptoContentProvider extends ContentProvider {\r
\r
- private static final boolean debug = true;\r
+ private static final boolean debug = false;\r
private static final String TAG = "CryptoContentProvider";\r
\r
public static final String AUTHORITY = "org.openintents.safe";\r
return null;\r
}\r
\r
- Log.d(TAG, "Original file path: " + originalFile);\r
+ if (debug) Log.d(TAG, "Original file path: " + originalFile);\r
if (CategoryList.isSignedIn()==false) {\r
Intent frontdoor = new Intent(getContext(), FrontDoor.class);\r
frontdoor.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r
if (ch == null) {\r
throw new CryptoHelperException("CryptoHelper not available. Are you logged in?");\r
}\r
- Log.d(TAG, "Decrypt..");\r
+ if (debug) Log.d(TAG, "Decrypt..");\r
Uri newuri = ch.decryptFileWithSessionKeyThroughContentProvider(this.getContext(), Uri.parse(originalFile));\r
cryptSession = newuri.getPathSegments().get(1);\r
sessionFile=SESSION_FILE+"."+cryptSession;\r
path += "/"+sessionFile;\r
- Log.d(TAG, "New path: " + path);\r
+ if (debug) Log.d(TAG, "New path: " + path);\r
break;\r
default:\r
throw new IllegalArgumentException("Unknown URI " + uri);\r
// disappears. This makes for a one time use\r
// content provider.\r
if (!getContext().deleteFile(sessionFile)) {\r
- Log.e(TAG,"openFile: unable to delete: "+sessionFile);\r
+ if (debug) Log.e(TAG,"openFile: unable to delete: "+sessionFile);\r
}\r
} catch (FileNotFoundException e) {\r
if (debug) Log.d(TAG,"openFile: FileNotFound");\r
*/\r
public class CryptoHelper {\r
\r
- private static final boolean debug = true;\r
+ private static final boolean debug = false;\r
private static String TAG = "CryptoHelper";\r
\r
public static final String OISAFE_EXTENSION = ".oisafe";\r
* @throws Exception\r
*/\r
public String encryptWithSessionKey(String plaintext) throws CryptoHelperException {\r
- Log.i(TAG, "Encrypt with session key");\r
+ if (debug) Log.i(TAG, "Encrypt with session key");\r
status=false; // assume failure\r
if(password == null) {\r
String msg = "Must call setPassword before runing encrypt.";\r
String stringCipherVersion = "A";\r
String stringCipherSessionKey = toHexString(cipherSessionKey);\r
String stringCiphertext=toHexString(ciphertext);\r
- Log.i(TAG, "Length: " + stringCipherSessionKey.length() + ", " + stringCipherSessionKey);\r
+ if (debug) Log.i(TAG, "Length: " + stringCipherSessionKey.length() + ", " + stringCipherSessionKey);\r
\r
StringBuilder sb = new StringBuilder(stringCipherVersion.length() \r
+ stringCipherSessionKey.length() \r
* @throws Exception\r
*/\r
public Uri decryptFileWithSessionKey(Context ctx, Uri fileUri) throws CryptoHelperException {\r
- Log.d(TAG, "fileUri="+fileUri.toString());\r
+ if (debug) Log.d(TAG, "fileUri="+fileUri.toString());\r
ContentResolver contentResolver = ctx.getContentResolver();\r
\r
String inputPath = null;\r
* @throws Exception\r
*/\r
public Uri decryptFileWithSessionKeyThroughContentProvider(Context ctx, Uri fileUri) throws CryptoHelperException {\r
- Log.d(TAG, "fileUri="+fileUri.toString());\r
+ if (debug) Log.d(TAG, "fileUri="+fileUri.toString());\r
ContentResolver contentResolver = ctx.getContentResolver();\r
\r
String sessionFile = "";\r