File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 3636 <javacard jckit =" ${ JCKIT } " >
3737 <cap output =" ${ cap.dir } /SecureApplet.cap"
3838 sources =" ${ src.dir } /toys"
39- classes =" ${ class.dir } /SecureApplet "
39+ classes =" ${ class.dir } /Secure "
4040 includes =" ${ deps.secureapplet } "
4141 >
4242 <applet class =" toys.SecureApplet" aid =" B00B5111FF01" />
Original file line number Diff line number Diff line change 1+ import subprocess , os , sys
2+
3+ CURRENT_DIR = os .path .join (os .path .dirname (os .path .abspath (__file__ )))
4+
5+ # TODO: get from build
6+ aids = {
7+ "Teapot" : "B00B5111CA01" ,
8+ "Secure" : "B00B5111FF01" ,
9+ "MemoryCard" : "B00B5111CB01" ,
10+ "BlindOracle" : "B00B5111CE01" ,
11+ "SingleUseKey" : "B00B5111CD01"
12+ }
13+
14+ if __name__ == '__main__' :
15+ if len (sys .argv ) == 1 :
16+ print ("No arguments provided." )
17+ print (f"Usage: { sys .argv [0 ]} applet [aid]" )
18+ print (f"Examples: { sys .argv [0 ]} BlindOracle" )
19+ print (f" { sys .argv [0 ]} BlindOracle B00B5111CE01" )
20+ sys .exit (1 )
21+ applet = sys .argv [1 ]
22+ aid = None
23+ if len (sys .argv ) >= 3 :
24+ aid = sys .argv [2 ]
25+ if aid is None and applet not in aids :
26+ print ("Applet not found" )
27+ sys .exit (1 )
28+ args = ["java" , "-jar" , "simulator.jar" ,
29+ "-p" , "21111" ,
30+ "-a" , aids [applet ],
31+ "-c" , f"toys.{ applet } Applet" ,
32+ "-u" , f"file://{ CURRENT_DIR } /build/classes/{ applet } /"
33+ ]
34+ while True :
35+ print ("Starting simulator..." )
36+ proc = subprocess .run (args )
You can’t perform that action at this time.
0 commit comments