Added JavaCard stuff.

This commit is contained in:
Eric Butler 2012-08-07 15:10:40 -07:00
parent 1ea9c1c433
commit febca32896
25 changed files with 9275 additions and 3 deletions

1
.gitignore vendored
View File

@ -7,7 +7,6 @@ dist
build build
eggs eggs
parts parts
bin
var var
sdist sdist
develop-eggs develop-eggs

View File

@ -1,2 +1,3 @@
sim-tools # Shadytel SIM Tools
=========
Put README here.

6
bin/converter Executable file
View File

@ -0,0 +1,6 @@
DIR=`dirname $0`
CLASSPATH=$DIR/../javacard/bin/converter.jar:$CLASSPATH
JFLAGS="-classpath $CLASSPATH"
java $JFLAGS com.sun.javacard.converter.Converter "$@"

4
bin/shadysim Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
DIR=`dirname $0`
python $DIR/../shadysim/shadysim.py $@

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
javacard/bin/converter.jar Normal file

Binary file not shown.

BIN
javacard/lib/api21.jar Normal file

Binary file not shown.

BIN
javacard/lib/sim.jar Executable file

Binary file not shown.

View File

@ -0,0 +1,44 @@
BUILD_DIR = ./build
BUILD_CLASSES_DIR = $(BUILD_DIR)/classes
BUILD_JAVACARD_DIR = $(BUILD_DIR)/javacard
JAVACARD_EXPORT_DIR = $(JAVACARD_SDK_DIR)/api21_export_files
CLASSPATH = $(JAVACARD_SDK_DIR)/lib/api21.jar:$(JAVACARD_SDK_DIR)/lib/sim.jar
JFLAGS = -target 1.1 -source 1.3 -g -d $(BUILD_CLASSES_DIR) -classpath $(CLASSPATH)
JC = javac
.SUFFIXES: .java .class
.java.class:
mkdir -p $(BUILD_CLASSES_DIR)
mkdir -p $(BUILD_JAVACARD_DIR)
$(JC) $(JFLAGS) $*.java
$(JAVACARD_SDK_DIR)/bin/converter \
-d $(BUILD_JAVACARD_DIR) \
-classdir $(BUILD_CLASSES_DIR) \
-exportpath $(JAVACARD_EXPORT_DIR) \
-applet $(APPLET_AID) $(APPLET_NAME) \
$(PACKAGE_NAME) $(PACKAGE_AID) $(PACKAGE_VERSION)
default: classes
classes: $(SOURCES:.java=.class)
clean:
$(RM) -rf $(BUILD_DIR)
install:
$(eval CAP_FILE := $(shell find $(BUILD_JAVACARD_DIR) -name *.cap))
$(eval MODULE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g'))
$(eval INSTANCE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g'))
python ../sim-tools/toorsimtool.py \
--serial /dev/ttyUSB0 \
-l $(CAP_FILE) \
-i $(CAP_FILE) \
--enable-sim-toolkit \
--module-aid $(MODULE_AID) \
--instance-aid $(INSTANCE_AID) \
--nonvolatile-memory-required 0100 \
--volatile-memory-for-install 0100 \
--max-menu-entry-text 10 \
--max-menu-entries 01

0
toorsimtool.py → shadysim/shadysim.py Normal file → Executable file
View File