2017-09-21 12:09:04 +00:00
|
|
|
apply plugin: 'javacard'
|
2017-09-27 17:04:26 +00:00
|
|
|
apply plugin: 'org.junit.platform.gradle.plugin'
|
2017-09-21 12:09:04 +00:00
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
maven { url 'http://releases.marmeladburk.fidesmo.com/' }
|
2017-09-27 17:04:26 +00:00
|
|
|
mavenCentral()
|
2017-09-21 12:09:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
classpath 'com.fidesmo:gradle-javacard:0.2.7'
|
2017-09-27 17:04:26 +00:00
|
|
|
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
|
2017-09-21 12:09:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
javacard {
|
2017-10-04 12:10:59 +00:00
|
|
|
sdkVersion = "3.0.4"
|
2017-09-26 10:05:59 +00:00
|
|
|
|
2017-09-21 12:09:04 +00:00
|
|
|
cap {
|
|
|
|
aid = '0x53:0x74:0x61:0x74:0x75:0x73:0x57:0x61:0x6c:0x6c:0x65:0x74'
|
|
|
|
packageName = 'im.status.wallet'
|
|
|
|
applet {
|
|
|
|
aid = '0x53:0x74:0x61:0x74:0x75:0x73:0x57:0x61:0x6c:0x6c:0x65:0x74:0x41:0x70:0x70'
|
|
|
|
className = 'WalletApplet'
|
|
|
|
}
|
|
|
|
version = '1.0'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2017-09-26 10:05:59 +00:00
|
|
|
testCompile("org.bouncycastle:bcprov-jdk15on:1.58")
|
2017-09-25 11:16:26 +00:00
|
|
|
testCompile("org.junit.jupiter:junit-jupiter-api:5.0.0")
|
|
|
|
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.0")
|
2017-09-21 12:09:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sourceCompatibility = 1.3
|
|
|
|
targetCompatibility = 1.3
|
|
|
|
|
|
|
|
task wrapper(type: Wrapper) {
|
|
|
|
gradleVersion = '2.10'
|
|
|
|
}
|
2017-09-25 11:16:26 +00:00
|
|
|
|
2017-09-27 17:04:26 +00:00
|
|
|
task install(type: Exec) {
|
|
|
|
def gpShellScript = """
|
|
|
|
mode_211
|
|
|
|
enable_trace
|
|
|
|
establish_context
|
|
|
|
card_connect
|
|
|
|
select -AID ${project.properties['im.status.gradle.gpshell.isd']}
|
|
|
|
open_sc -security 1 -keyind 0 -keyver ${project.properties['im.status.gradle.gpshell.kvn']} -mac_key ${project.properties['im.status.gradle.gpshell.mac_key']} -enc_key ${project.properties['im.status.gradle.gpshell.enc_key']} -kek_key ${project.properties['im.status.gradle.gpshell.kek_key']}
|
|
|
|
send_apdu_nostop -sc 1 -APDU 80E400800E4F0C53746174757357616C6C6574
|
|
|
|
install -file build/javacard/im/status/wallet/javacard/wallet.cap -AID 53746174757357616C6C6574417070 -instAID 53746174757357616C6C6574417070 -instParam 313233343536373839303132
|
|
|
|
card_disconnect
|
|
|
|
release_context
|
|
|
|
"""
|
|
|
|
|
|
|
|
executable project.properties['im.status.gradle.gpshell']
|
|
|
|
standardInput new ByteArrayInputStream(gpShellScript.getBytes("UTF-8"))
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.install.dependsOn(convertJavacard)
|
|
|
|
tasks.test.dependsOn(install)
|
|
|
|
|
2017-09-25 11:16:26 +00:00
|
|
|
compileTestJava {
|
|
|
|
sourceCompatibility = 1.8
|
|
|
|
targetCompatibility = 1.8
|
|
|
|
}
|