在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):bertrandmartel/javacard-gradle-plugin开源软件地址(OpenSource Url):https://github.com/bertrandmartel/javacard-gradle-plugin开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):JavaCard Gradle pluginA Gradle plugin for building JavaCard applets. This plugin is a wrapper on ant-javacard and Global Platform Pro, it is inspired by gradle-javacard Features
Usagebuildscript {
repositories {
jcenter()
}
dependencies {
classpath 'fr.bmartel:gradle-javacard:1.5.6'
}
}
apply plugin: 'javacard'
dependencies {
compile 'com.github.martinpaljak:globalplatformpro:18.09.14'
}
javacard {
config {
cap {
packageName 'fr.bmartel.javacard'
version '0.1'
aid '01:02:03:04:05:06:07:08:09'
output 'applet.cap'
applet {
className 'fr.bmartel.javacard.HelloWorld'
aid '01:02:03:04:05:06:07:08:09:01:02'
}
}
}
scripts {
script {
name 'select'
apdu '00:A4:04:00:0A:01:02:03:04:05:06:07:08:09:01:00'
}
script {
name 'hello'
apdu '00:40:00:00:00'
}
task {
name 'sendHello'
scripts 'select', 'hello'
}
}
} plugin is available from Check this project for more usage examples JavaCard SDK pathThe path to JavaCard SDK can be specified through :
Tasks
It's possible to create custom tasks that will send series of custom apdu : scripts {
script {
name 'select'
apdu '00:A4:04:00:0A:01:02:03:04:05:06:07:08:09:01:00'
}
script {
name 'hello'
apdu '00:40:00:00:00'
}
task {
name 'sendHello'
scripts 'select', 'hello'
}
} The above will create task Custom Global Platform Pro taskYou can build custom tasks that launch Global Platform Pro tool : task displayHelp(type: fr.bmartel.javacard.gp.GpExec) {
description = 'display Global Platform pro help'
group = 'help'
args '-h'
} More complex exampleapply plugin: 'javacard'
dependencies {
compile 'com.github.martinpaljak:globalplatformpro:18.09.14'
}
repositories {
maven {
url 'http://dl.bintray.com/bertrandmartel/maven'
}
}
javacard {
config {
jckit '../oracle_javacard_sdks/jc222_kit'
cap {
packageName 'fr.bmartel.javacard'
version '0.1'
aid '01:02:03:04:05:06:07:08:09'
output 'applet1.cap'
applet {
className 'fr.bmartel.javacard.HelloSmartcard'
aid '01:02:03:04:05:06:07:08:09:01:02'
}
applet {
className 'fr.bmartel.javacard.GoodByeSmartCard'
aid '01:02:03:04:05:06:07:08:09:01:03'
}
}
cap {
packageName 'fr.bmartel.javacard'
version '0.1'
aid '01:02:03:04:05:06:07:08:0A'
output 'applet2.cap'
applet {
className 'fr.bmartel.javacard.SomeOtherClass'
aid '01:02:03:04:05:06:07:08:09:01:04'
}
dependencies {
local {
jar '/path/to/dependency.jar'
exps '/path/to/expfolder'
}
remote 'fr.bmartel:gplatform:2.1.1'
}
}
}
defaultKey '40:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F'
// or
/*
key {
enc '40:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F'
kek '40:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F'
mac '40:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F'
}
*/
scripts {
script {
name 'select'
apdu '00:A4:04:00:0A:01:02:03:04:05:06:07:08:09:01:00'
}
script {
name 'hello'
apdu '00:40:00:00:00'
}
task {
name 'sendHello'
scripts 'select', 'hello'
}
}
} Note1 : the Syntax
(*) If you specify at least one dependency, jcardsim & junit won't be automatically added so you will need to add them manually if you need them for example : test {
dependencies {
compile 'junit:junit:4.12'
compile 'com.licel:jcardsim:3.0.4'
}
} CompatibilityThis plugin has been tested on following IDE :
Recommended IDE : IntelliJ IDEA or Android Studio LicenseThe MIT License (MIT) Copyright (c) 2017-2018 Bertrand Martel |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论