]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
Changed PassView to use TextView.
authorrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Fri, 30 Jan 2009 00:58:21 +0000 (00:58 +0000)
committerrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Fri, 30 Jan 2009 00:58:21 +0000 (00:58 +0000)
Import now checks for passwordsafe.csv.
Set various debug = true to false.

git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@1875 72b678ce-9140-0410-bee8-679b907dd61a

res/layout/pass_view.xml
src/org/openintents/safe/CategoryList.java
src/org/openintents/safe/CryptoHelper.java
src/org/openintents/safe/IntentHandler.java
src/org/openintents/safe/PassView.java
src/org/openintents/safe/service/ServiceDispatchImpl.java

index d05799f6a7296aa9499dba1e51de16982e063d5c..c7c7da7e5c20934571d4a03dd58f901767287e80 100644 (file)
                                        android:layout_marginRight="2sp"\r
                                        android:layout_marginBottom="1sp"\r
                                        android:text="@string/description" />
-                               <EditText android:id="@+id/description"\r
-                                       android:editable="false"\r
+                               <TextView android:id="@+id/description"\r
+                                       android:textColor="#eee"\r
+                                       android:background="#445"\r
+                                       android:textSize="18sp"\r
+                                       android:padding="2sp"\r
+                                       android:layout_margin="1sp"\r
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content" 
                                        android:layout_weight="1"/>
                                        android:layout_height="wrap_content" 
                                        android:layout_marginRight="2sp"\r
                                        android:text="@string/website" />
-                               <EditText android:id="@+id/website"\r
-                                       android:editable="false"\r
+                               <TextView android:id="@+id/website"\r
+                                       android:textColor="#eee"\r
+                                       android:background="#445"\r
+                                       android:textSize="18sp"\r
+                                       android:padding="2sp"\r
+                                       android:layout_margin="1sp"\r
                                    android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"\r
                                        android:layout_weight="1"/>\r
                                        android:layout_height="wrap_content" \r
                                        android:layout_marginRight="2sp"\r
                                        android:text="@string/username" />\r
-                               <EditText android:id="@+id/username" \r
-                                       android:editable="false"\r
+                               <TextView android:id="@+id/username" \r
+                                       android:textColor="#eee"\r
+                                       android:background="#445"\r
+                                       android:textSize="18sp"\r
+                                       android:padding="2sp"\r
+                                       android:layout_margin="1sp"\r
                                        android:layout_width="wrap_content"\r
                                        android:layout_height="wrap_content" \r
                                        android:layout_weight="1"/>\r
                                        android:layout_height="wrap_content" 
                                        android:layout_marginRight="2sp"\r
                                        android:text="@string/password" />
-                               <EditText android:id="@+id/password"\r
-                                       android:editable="false"\r
+                               <TextView android:id="@+id/password"\r
+                                       android:textColor="#eee"\r
+                                       android:background="#445"\r
+                                       android:textSize="18sp"\r
+                                       android:padding="2sp"\r
+                                       android:layout_margin="1sp"\r
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content" 
                                        android:layout_weight="1"/>
        <TextView android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:text="@string/notes" />
-       <EditText android:id="@+id/note" android:layout_width="fill_parent"
-               android:editable="false"\r
+       <TextView android:id="@+id/note" android:layout_width="fill_parent"
+               android:textColor="#eee"\r
+               android:background="#445"\r
+               android:textSize="18sp"\r
+               android:padding="2sp"\r
                android:gravity="top" \r
+               android:layout_margin="1sp"\r
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:scrollbars="vertical" />
index 85095e7e0b08cd0ac19642afdeb6cada33c06936..f87971e054338839afecfe968cea93673023603c 100644 (file)
@@ -106,6 +106,7 @@ public class CategoryList extends ListActivity {
 
     private static final String EXPORT_FILENAME = "/sdcard/oisafe.csv";
     public static final String BACKUP_FILENAME = "/sdcard/oisafe.xml";
+    private static final String PASSWORDSAFE_IMPORT_FILENAME = "/sdcard/passwordsafe.csv";
     
     public static final String KEY_ID = "id";  // Intent keys
 
@@ -815,7 +816,14 @@ public class CategoryList extends ListActivity {
        }
                
        public void importDatabase(){
-               final String filename=EXPORT_FILENAME;
+               final String filename;
+               File oiImport=new File(EXPORT_FILENAME);
+               File pwsImport=new File(PASSWORDSAFE_IMPORT_FILENAME);
+               if (oiImport.exists() || !pwsImport.exists()) {
+                       filename=EXPORT_FILENAME;
+               }else{
+                       filename=PASSWORDSAFE_IMPORT_FILENAME;
+               }
                File csvFile=new File(filename);
                if (!csvFile.exists()) {
                        String msg=getString(R.string.import_file_missing) + " " +
index 802e6654a73b4290ed3fac7957afff872470e7dc..1d75651348ac8415476b21e8722afd071e1ebfa2 100644 (file)
@@ -52,7 +52,7 @@ import android.util.Log;
  */\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
     protected static PBEKeySpec pbeKeySpec;\r
     protected static PBEParameterSpec pbeParamSpec;\r
index 092b65ec5419922d1cf35f7ec7cd56fdd8df1e10..371a0414b84287cbf84a3934c0402bf1233901a0 100644 (file)
@@ -48,7 +48,7 @@ import android.widget.Toast;
  */\r
 public class IntentHandler extends Activity {\r
 \r
-       private static final boolean debug = !false;\r
+       private static final boolean debug = false;\r
        private static String TAG = "IntentHandler";\r
        \r
        private static final int REQUEST_CODE_ASK_PASSWORD = 1;\r
index 8554341da3baf815a3e8f4bcbc8c502fd365fee6..c345bb34c887f85d0ffc4543ec1054758c629913 100644 (file)
@@ -54,11 +54,11 @@ public class PassView extends Activity {
 
        public static final int REQUEST_EDIT_PASS = 1;
        
-       private EditText descriptionText;
-       private EditText passwordText;
-       private EditText usernameText;
-       private EditText websiteText;
-       private EditText noteText;
+       private TextView descriptionText;
+       private TextView passwordText;
+       private TextView usernameText;
+       private TextView websiteText;
+       private TextView noteText;
        private TextView lastEditedText;
        private TextView uniqueNameText;
        private TextView packageAccessText;
@@ -92,11 +92,11 @@ public class PassView extends Activity {
 
                setContentView(R.layout.pass_view);
 
-               descriptionText = (EditText) findViewById(R.id.description);
-               websiteText = (EditText) findViewById(R.id.website);
-               usernameText = (EditText) findViewById(R.id.username);
-               passwordText = (EditText) findViewById(R.id.password);
-               noteText = (EditText) findViewById(R.id.note);
+               descriptionText = (TextView) findViewById(R.id.description);
+               websiteText = (TextView) findViewById(R.id.website);
+               usernameText = (TextView) findViewById(R.id.username);
+               passwordText = (TextView) findViewById(R.id.password);
+               noteText = (TextView) findViewById(R.id.note);
                lastEditedText = (TextView) findViewById(R.id.last_edited);
                uniqueNameText = (TextView) findViewById(R.id.uniquename);
                packageAccessText = (TextView) findViewById(R.id.packageaccess);
index 50ee4684e9005a46020236a09e60965d5cd7b310..eccea2bd2e915154a997cabb74dbd58cf9fd3e07 100644 (file)
@@ -35,7 +35,7 @@ import android.util.Log;
 import android.os.CountDownTimer;
 
 public class ServiceDispatchImpl extends Service {
-       private static boolean debug = true;
+       private static boolean debug = false;
        private static String TAG = "ServiceDispatchIMPL";
        private CryptoHelper ch;
        private String salt;