]> www.average.org Git - YkNeoCR.git/commitdiff
remove enrollment
authorEugene Crosser <crosser@average.org>
Fri, 10 May 2013 10:31:42 +0000 (14:31 +0400)
committerEugene Crosser <crosser@average.org>
Fri, 10 May 2013 10:31:42 +0000 (14:31 +0400)
AndroidManifest.xml
build.xml
res/layout/main.xml
res/values/strings.xml
src/org/average/nfcauthcr/Enroll.java
src/org/average/nfcauthcr/NfcCRdispatch.java
src/org/average/nfcauthcr/QueryCrToken.java
src/org/average/nfcauthcr/YkNeo.java

index 97bd259ee0b122fbb051dbaed7ea304234281a89..eb06d32ff8659768b418cb8828fbbaa1d050450f 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-         package="org.average.nfcauthcr"
+         package="org.average.ykneocr"
          android:versionCode="1"
          android:versionName="1.0">
        <uses-sdk android:minSdkVersion="10"
          android:versionCode="1"
          android:versionName="1.0">
        <uses-sdk android:minSdkVersion="10"
index 2e37978f78bbffe6bfc95fde549da08acbca0bfa..5233369957cefb3400c2affc8f28cea231540c0d 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<project name="NFCAuthCR" default="help">
+<project name="YkNeoCR" default="help">
 
     <!-- The local.properties file is created and updated by the 'android' tool.
          It contains the path to the SDK. It should *NOT* be checked into
 
     <!-- The local.properties file is created and updated by the 'android' tool.
          It contains the path to the SDK. It should *NOT* be checked into
index 611341f7ca121cb1805048953daab23eb55a10d6..2f223061ed2d2c7806a31733e22bbdba6a573aa2 100644 (file)
@@ -1,16 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    tools:context=".NFCAuthCREnroll"
+                xmlns:tools="http://schemas.android.com/tools"
+                android:layout_width="fill_parent"
+                android:layout_height="fill_parent"
     >
     >
+    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+              android:id="@+id/info"
+              android:layout_width="fill_parent"
+              android:layout_height="wrap_content"
+              android:text="@string/info"
+    />
+
     <RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:layout_centerHorizontal="true"
     <RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:layout_centerHorizontal="true"
-                android:layout_alignParentTop="true"
+                android:layout_alignParentBottom="true"
     >
         <RadioButton android:id="@+id/slot_1"
                      android:layout_width="wrap_content"
     >
         <RadioButton android:id="@+id/slot_1"
                      android:layout_width="wrap_content"
                      android:onClick="onSlotSelectionClicked"
         />
     </RadioGroup>
                      android:onClick="onSlotSelectionClicked"
         />
     </RadioGroup>
-    <Button
-        android:id="@+id/enroll"
-        android:text="@string/enroll"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_centerInParent="true"
-        android:onClick="onEnrollClicked"
-    />
 </RelativeLayout>
 </RelativeLayout>
-
index 15a4fc0516117c13ebf9fbce791edbb3ab6e958f..9b83033a34b46ddea8dcdfed17c166eb584e2fa8 100644 (file)
@@ -1,15 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-       <string name="app_name">NFC Auth</string>
-       <string name="enroll">Enroll</string>
+       <string name="app_name">YkNeo CR</string>
+       <string name="info"><![CDATA[
+You need to specify the slot number of the Yubikey Neo to use for
+Challenge-Response.
+       ]]>
+       </string>
+       <string name="enroll">Set Slot</string>
        <string name="select_slot">Select Slot</string>
        <string name="slot_1">Slot 1</string>
        <string name="slot_2">Slot 2</string>
        <string name="need_slot">You must select which slot to use</string>
        <string name="select_slot">Select Slot</string>
        <string name="slot_1">Slot 1</string>
        <string name="slot_2">Slot 2</string>
        <string name="need_slot">You must select which slot to use</string>
-       <string name="enrollresult">Enrollment result:</string>
-       <string name="enroll_success">Token successfully bound to the device</string>
        <string name="challenging">Ready to communicate</string>
        <string name="challenging">Ready to communicate</string>
-       <string name="swipe">Please touch the back of the phone with the NFC token</string>
+       <string name="swipe">Please touch the back of the device with the NFC token</string>
        <string name="no_nfc">Cannot reach the NFC adapter</string>
        <string name="nfc_disabled">Need to enable NFC in Settings</string>
        <string name="tag_lost">Communitation with the tag lost</string>
        <string name="no_nfc">Cannot reach the NFC adapter</string>
        <string name="nfc_disabled">Need to enable NFC in Settings</string>
        <string name="tag_lost">Communitation with the tag lost</string>
index 96fa3147b7ac79c8c8e44d0386a2c925959bd3fc..d8e623df72135802f896d7f8a2a797e79663df15 100644 (file)
@@ -1,4 +1,4 @@
-package org.average.nfcauthcr;
+package org.average.ykneocr;
 
 import java.util.Random;
 
 
 import java.util.Random;
 
@@ -14,7 +14,7 @@ import android.util.Log;
 import android.view.View;
 import android.widget.RadioButton;
 
 import android.view.View;
 import android.widget.RadioButton;
 
-import org.average.nfcauthcr.QueryCrToken;
+import org.average.ykneocr.QueryCrToken;
 
 public class Enroll extends Activity {
 
 
 public class Enroll extends Activity {
 
@@ -60,67 +60,4 @@ public class Enroll extends Activity {
                editor.commit();
                Log.v(TAG, "stored slot number " + slot);
        }
                editor.commit();
                Log.v(TAG, "stored slot number " + slot);
        }
-
-       public void onEnrollClicked(View view) {
-               Log.v(TAG, "Enroll clicked");
-               if (slot > 0) {
-                       runEnrollment(slot);
-               } else {
-                       showEnrollResult(R.string.need_slot);
-               }
-       }
-
-       public void onActivityResult(int requestCode, int resultCode,
-                                       Intent intent) {
-               Log.v(TAG, "Got activity result");
-               waitingForResult = false;
-
-               if (resultCode != RESULT_OK) {
-                       Log.v(TAG, "Error result code " + resultCode);
-                       return;
-               }
-               byte[] challenge = intent.getByteArrayExtra("challenge");
-               Log.v(TAG, "Challenge is \"" + hex(challenge) + "\"");
-               byte[] response = intent.getByteArrayExtra("response");
-               Log.v(TAG, "Response is  \"" + hex(response) + "\"");
-               Editor editor = prefs.edit();
-               editor.putString("challenge", hex(challenge));
-               editor.putString("response", hex(response));
-               editor.commit();
-               showEnrollResult(R.string.enroll_success);
-               Log.v(TAG, "stored new challenge and response");
-       }
-
-       private void showEnrollResult(int messageid) {
-               AlertDialog.Builder builder = new AlertDialog.Builder(this);
-               builder.setTitle(R.string.enrollresult);
-               builder.setMessage(messageid);
-               builder.setPositiveButton(android.R.string.ok,
-                               new DialogInterface.OnClickListener() {
-                       public void onClick(DialogInterface dialog, int which) {
-                               dialog.dismiss();
-                               if (!waitingForResult) { finish(); }
-                       }
-               });
-               AlertDialog dialog = builder.create();
-               dialog.show();
-       }
-
-       private void runEnrollment(int slot) {
-               Random rng = new Random();
-               byte[] challenge = new byte[63];
-               rng.nextBytes(challenge);
-               Log.v(TAG, "Random challenge: " + hex(challenge));
-               Intent crIntent = new Intent(this, QueryCrToken.class);
-               crIntent.putExtra("challenge", challenge);
-               waitingForResult = true;
-               this.startActivityForResult(crIntent, 0);
-       }
-
-       private String hex(byte[] a) {
-               StringBuilder sb = new StringBuilder();
-               if (a == null) return "<null>";
-               for (byte b: a) sb.append(String.format("%02x", b&0xff));
-               return sb.toString();
-       }
 }
 }
index 25198beff5fdf39e9b1819d673d8822bbe688cc7..d5342f018fce227d7f2e91ba85f332a46911c1bb 100644 (file)
@@ -1,4 +1,4 @@
-package org.average.nfcauthcr;
+package org.average.ykneocr;
 
 import java.io.IOException;
 import java.util.ArrayList;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -14,8 +14,8 @@ import android.nfc.tech.IsoDep;
 import android.util.Log;
 import android.widget.Toast;
 
 import android.util.Log;
 import android.widget.Toast;
 
-import org.average.nfcauthcr.YkNeo;
-import org.average.nfcauthcr.CRException;
+import org.average.ykneocr.YkNeo;
+import org.average.ykneocr.CRException;
 
 public class NfcCRdispatch {
 
 
 public class NfcCRdispatch {
 
index 903aefb4a39937d69a098f529f6ede80e0d28d87..8e5c4632a1f2594db141cfc8910657ec875c04a5 100644 (file)
@@ -1,4 +1,4 @@
-package org.average.nfcauthcr;
+package org.average.ykneocr;
 
 import java.util.ArrayList;
 
 
 import java.util.ArrayList;
 
@@ -18,7 +18,7 @@ import android.preference.PreferenceManager;
 import android.util.Log;
 import android.widget.Toast;
 
 import android.util.Log;
 import android.widget.Toast;
 
-import org.average.nfcauthcr.NfcCRdispatch;
+import org.average.ykneocr.NfcCRdispatch;
 
 public class QueryCrToken extends Activity {
 
 
 public class QueryCrToken extends Activity {
 
index 9c19135b23194dfb5afbf2948445c4892a8f1be2..864e7b07d9bf5a58cf757a490545fedad46f76ac 100644 (file)
@@ -1,4 +1,4 @@
-package org.average.nfcauthcr;
+package org.average.ykneocr;
 
 import java.io.IOException;
 import java.lang.String;
 
 import java.io.IOException;
 import java.lang.String;
@@ -9,7 +9,7 @@ import android.nfc.NfcAdapter;
 import android.nfc.Tag;
 import android.nfc.tech.IsoDep;
 
 import android.nfc.Tag;
 import android.nfc.tech.IsoDep;
 
-import org.average.nfcauthcr.CRException;
+import org.average.ykneocr.CRException;
 
 public class YkNeo {
 
 
 public class YkNeo {