Oliver Smith | 04f2586 | 2020-02-19 12:16:01 +0100 | [diff] [blame] | 1 | SIMTOOLS_DIR = ../../sim-tools |
Oliver Smith | 537fba0 | 2020-02-19 12:12:52 +0100 | [diff] [blame] | 2 | |
| 3 | APPLET_AID = 0xd0:0x70:0x02:0xca:0x44:0x90:0x01:0x01 |
Oliver Smith | 7528b38 | 2020-02-21 08:43:25 +0100 | [diff] [blame] | 4 | APPLET_NAME = org.osmocom.IMSIPseudo.IMSIPseudo |
Oliver Smith | 537fba0 | 2020-02-19 12:12:52 +0100 | [diff] [blame] | 5 | PACKAGE_AID = 0xd0:0x70:0x02:0xCA:0x44:0x90:0x01 |
Oliver Smith | 7528b38 | 2020-02-21 08:43:25 +0100 | [diff] [blame] | 6 | PACKAGE_NAME = org.osmocom.IMSIPseudo |
Oliver Smith | 537fba0 | 2020-02-19 12:12:52 +0100 | [diff] [blame] | 7 | PACKAGE_VERSION = 1.0 |
| 8 | |
Neels Hofmeyr | ad4531a | 2020-02-25 03:19:26 +0100 | [diff] [blame] | 9 | SOURCES = \ |
| 10 | src/org/osmocom/IMSIPseudo/Bytes.java \ |
| 11 | src/org/osmocom/IMSIPseudo/MobileIdentity.java \ |
| 12 | src/org/osmocom/IMSIPseudo/IMSIPseudo.java \ |
| 13 | $(NULL) |
Neels Hofmeyr | d20f93a | 2020-02-24 22:42:22 +0100 | [diff] [blame] | 14 | |
Oliver Smith | c18064a | 2020-02-21 09:29:20 +0100 | [diff] [blame] | 15 | CAP_FILE = build/javacard/org/osmocom/IMSIPseudo/javacard/IMSIPseudo.cap |
Oliver Smith | 537fba0 | 2020-02-19 12:12:52 +0100 | [diff] [blame] | 16 | |
Neels Hofmeyr | c916b97 | 2020-02-24 22:51:21 +0100 | [diff] [blame] | 17 | include ./applet-project.mk |
Oliver Smith | c18064a | 2020-02-21 09:29:20 +0100 | [diff] [blame] | 18 | |
Neels Hofmeyr | ff5364a | 2020-02-25 03:41:53 +0100 | [diff] [blame] | 19 | .PHONY: flash |
Oliver Smith | c18064a | 2020-02-21 09:29:20 +0100 | [diff] [blame] | 20 | flash: classes |
| 21 | $(eval MODULE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g')) |
| 22 | $(eval INSTANCE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g')) |
| 23 | . $$PWD/.sim-keys && $(SIMTOOLS_DIR)/bin/shadysim \ |
| 24 | --pcsc \ |
| 25 | -l $(CAP_FILE) \ |
| 26 | -i $(CAP_FILE) \ |
| 27 | --enable-sim-toolkit \ |
Oliver Smith | 799fe1d | 2020-02-24 15:20:55 +0100 | [diff] [blame] | 28 | --access-domain=00 \ |
Oliver Smith | c18064a | 2020-02-21 09:29:20 +0100 | [diff] [blame] | 29 | --module-aid $(MODULE_AID) \ |
| 30 | --instance-aid $(INSTANCE_AID) \ |
| 31 | --nonvolatile-memory-required 0100 \ |
| 32 | --volatile-memory-for-install 0100 \ |
| 33 | --max-menu-entry-text 21 \ |
| 34 | --max-menu-entries 01 \ |
| 35 | --kic "$$KIC1" \ |
| 36 | --kid "$$KID1" |
| 37 | |
Neels Hofmeyr | ff5364a | 2020-02-25 03:41:53 +0100 | [diff] [blame] | 38 | .PHONY: remove |
Oliver Smith | c18064a | 2020-02-21 09:29:20 +0100 | [diff] [blame] | 39 | remove: |
| 40 | . $$PWD/.sim-keys && $(SIMTOOLS_DIR)/bin/shadysim \ |
| 41 | --pcsc \ |
| 42 | -d "$$(echo $(PACKAGE_AID) | sed 's/0x//g' | sed 's/\://g')" \ |
| 43 | --kic "$$KIC1" \ |
| 44 | --kid "$$KID1" |
Oliver Smith | 0f7c8bb | 2020-02-24 11:32:48 +0100 | [diff] [blame] | 45 | |
Neels Hofmeyr | ff5364a | 2020-02-25 03:41:53 +0100 | [diff] [blame] | 46 | .PHONY: list |
Neels Hofmeyr | 7c5e973 | 2020-02-25 03:19:36 +0100 | [diff] [blame] | 47 | list: |
| 48 | . $$PWD/.sim-keys && $(SIMTOOLS_DIR)/bin/shadysim \ |
| 49 | --pcsc \ |
| 50 | --list-applets \ |
| 51 | --kic "$$KIC1" \ |
| 52 | --kid "$$KID1" |
| 53 | |
Neels Hofmeyr | ff5364a | 2020-02-25 03:41:53 +0100 | [diff] [blame] | 54 | .PHONY: delete |
Oliver Smith | 0f7c8bb | 2020-02-24 11:32:48 +0100 | [diff] [blame] | 55 | delete: remove |
Neels Hofmeyr | d20f93a | 2020-02-24 22:42:22 +0100 | [diff] [blame] | 56 | |
Neels Hofmeyr | 872140d | 2020-02-25 03:43:12 +0100 | [diff] [blame] | 57 | .PHONY: reflash |
| 58 | reflash: |
| 59 | $(MAKE) remove |
| 60 | $(MAKE) flash |
| 61 | |
Neels Hofmeyr | d20f93a | 2020-02-24 22:42:22 +0100 | [diff] [blame] | 62 | .PHONY: test |
| 63 | test: |
| 64 | mkdir -p ./test/classes |
Neels Hofmeyr | ad4531a | 2020-02-25 03:19:26 +0100 | [diff] [blame] | 65 | javac -target 1.1 -source 1.3 -classpath test/classes -g -d ./test/classes src/org/osmocom/IMSIPseudo/Bytes.java |
Neels Hofmeyr | d20f93a | 2020-02-24 22:42:22 +0100 | [diff] [blame] | 66 | javac -target 1.1 -source 1.3 -classpath test/classes -g -d ./test/classes src/org/osmocom/IMSIPseudo/MobileIdentity.java |
| 67 | javac -target 1.1 -source 1.3 -classpath test/classes -g -d ./test/classes src/org/osmocom/IMSIPseudo/Test.java |
| 68 | java -classpath test/classes org.osmocom.IMSIPseudo.Test |