Drops gpapi-globalplatform 1.7 and gpapi-upgrade 1.1 (AMD-H Amendment H v1.1) under applet/build-tools/gp-amdh/, sourced from OpenJavaCard/globalplatform-exports (master snapshot 2020-09-30). - dt-mvn.sh mounts exports/org/ into the converter's api_export_files/. - pom.xml adds the .jar files as system-scope deps under the j3r452 profile so javac on j3r452 builds resolves org.globalplatform.upgrade symbols (j3r180 builds don't see them on classpath). - .gitignore: narrow build-tools/ exclusion to top-level only so the new applet/build-tools/gp-amdh/ tree is trackable while the top-level build-tools/jcardsim/ vendor fork stays out of the repo. This commit alone produces zero CAP bytecode change because no current source imports org.globalplatform.*. The infra is provably inert until the Task 3.1+ source on feat/amd-h-epic-3-wip is merged. Verified by diffing CAP zip components for both profiles: only the embedded Java-Card-CAP-Creation-Time timestamp in META-INF/MANIFEST.MF differs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
222 lines
10 KiB
XML
222 lines
10 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<groupId>com.dangerousthings.aliro</groupId>
|
|
<artifactId>aliro-applet</artifactId>
|
|
<version>0.1.0-SNAPSHOT</version>
|
|
<packaging>jar</packaging>
|
|
|
|
<description>
|
|
Java Card applet implementing the CSA Aliro v1.0 User Device role over NFC.
|
|
Built and tested inside the vivokey/smartcard-ci Docker image; see scripts/dt-mvn.sh.
|
|
</description>
|
|
|
|
<properties>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<!-- JC 3.0.5 converter supports up to 1.7 bytecode (v51.0). Source
|
|
stays at 1.7 to match. Test classes can be compiled at 1.8 via
|
|
the test compiler config below — they don't go through the JC
|
|
converter and the image's javac handles either version. -->
|
|
<maven.compiler.source>1.7</maven.compiler.source>
|
|
<maven.compiler.target>1.7</maven.compiler.target>
|
|
|
|
<junit.jupiter.version>5.10.2</junit.jupiter.version>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<!--
|
|
jcardsim is pre-built into the smartcard-ci image's local m2 repo
|
|
(see https://github.com/DangerousThings/smartcard-ci Dockerfile).
|
|
No jitpack / central resolution needed.
|
|
-->
|
|
<dependency>
|
|
<groupId>com.licel</groupId>
|
|
<artifactId>jcardsim</artifactId>
|
|
<version>3.0.5-SNAPSHOT</version>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter</artifactId>
|
|
<version>${junit.jupiter.version}</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<repositories>
|
|
<!-- ant-javacard's recent releases are published via jitpack rather
|
|
than Maven Central; the Central artifact is stuck on 2019. -->
|
|
<repository>
|
|
<id>jitpack.io</id>
|
|
<url>https://jitpack.io</url>
|
|
</repository>
|
|
</repositories>
|
|
|
|
<pluginRepositories>
|
|
<pluginRepository>
|
|
<id>jitpack.io</id>
|
|
<url>https://jitpack.io</url>
|
|
</pluginRepository>
|
|
</pluginRepositories>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>3.13.0</version>
|
|
<configuration>
|
|
<!-- Main: 1.7 bytecode for the JC 3.0.5 converter. -->
|
|
<source>1.7</source>
|
|
<target>1.7</target>
|
|
<!-- Tests: JUnit 5 + our helpers use 1.8 features. They
|
|
don't go through the JC converter. -->
|
|
<testSource>1.8</testSource>
|
|
<testTarget>1.8</testTarget>
|
|
</configuration>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<version>3.2.5</version>
|
|
</plugin>
|
|
|
|
<!--
|
|
Builds the Java Card CAP file via ant-javacard, which wraps
|
|
Oracle's converter from the JC SDK pinned by JC_CLASSIC_HOME
|
|
(the dt-mvn.sh wrapper sets this to /app/sdks/jc305u3_kit).
|
|
|
|
Output: target/aliro-applet-${cap.variant}.cap (j3r180 default; -Pj3r452 for AMD-H variant)
|
|
|
|
Package AID: A0 00 00 09 09 44 54 41 4C 49 52 4F (CSA RID + "DTALIRO")
|
|
Applet AIDs:
|
|
AliroApplet A0 00 00 09 09 AC CE 55 01 (Aliro EXPEDITED, spec)
|
|
StepUpApplet A0 00 00 09 09 AC CE 55 02 (Aliro STEP_UP, spec)
|
|
PersonalizationApplet A0 00 00 09 09 AC CE 55 99 01 (DT-internal, CSA-RID-namespaced)
|
|
|
|
JavaCard requires all applet AIDs in a CAP to share the
|
|
package's RID (first 5 bytes); using the CSA RID throughout
|
|
lets the three applets ship in one CAP.
|
|
-->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
<version>3.1.0</version>
|
|
<executions>
|
|
<execution>
|
|
<id>build-cap</id>
|
|
<phase>package</phase>
|
|
<goals><goal>run</goal></goals>
|
|
<configuration>
|
|
<target>
|
|
<taskdef name="javacard"
|
|
classname="pro.javacard.ant.JavaCard"
|
|
classpathref="maven.plugin.classpath"/>
|
|
<javacard jckit="${env.JC_CLASSIC_HOME}">
|
|
<cap output="${project.build.directory}/${cap.output.name}"
|
|
aid="${cap.elf.aid}"
|
|
package="com.dangerousthings.aliro"
|
|
version="0.1"
|
|
classes="${project.build.outputDirectory}">
|
|
<applet class="com.dangerousthings.aliro.AliroApplet"
|
|
aid="A000000909ACCE5501"/>
|
|
<applet class="com.dangerousthings.aliro.StepUpApplet"
|
|
aid="A000000909ACCE5502"/>
|
|
<applet class="com.dangerousthings.aliro.PersonalizationApplet"
|
|
aid="A000000909ACCE559901"/>
|
|
</cap>
|
|
</javacard>
|
|
</target>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>com.github.martinpaljak</groupId>
|
|
<artifactId>ant-javacard</artifactId>
|
|
<version>v26.02.22</version>
|
|
</dependency>
|
|
</dependencies>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
<profiles>
|
|
<profile>
|
|
<!-- Mutually exclusive with j3r452. Activate exactly one. -->
|
|
<id>j3r180</id>
|
|
<activation><activeByDefault>true</activeByDefault></activation>
|
|
<properties>
|
|
<!-- cap.variant: consumed by later tasks (CI matrix, profile-conditional source roots). -->
|
|
<cap.variant>j3r180</cap.variant>
|
|
<cap.elf.aid>A0000009094454414C49524F</cap.elf.aid>
|
|
<cap.output.name>aliro-applet-j3r180.cap</cap.output.name>
|
|
</properties>
|
|
</profile>
|
|
<profile>
|
|
<!-- Mutually exclusive with j3r180. Activate exactly one. -->
|
|
<id>j3r452</id>
|
|
<properties>
|
|
<cap.variant>j3r452</cap.variant>
|
|
<!-- Last byte differs so both CAPs can coexist on the same card during testing. -->
|
|
<cap.elf.aid>A0000009094454414C49524F02</cap.elf.aid>
|
|
<cap.output.name>aliro-applet-j3r452.cap</cap.output.name>
|
|
</properties>
|
|
<dependencies>
|
|
<!--
|
|
GlobalPlatform AMD-H export JARs (system-scope, vendored
|
|
under build-tools/gp-amdh/lib/). Scoped to this profile only
|
|
so they never leak onto the j3r180 classpath. See
|
|
build-tools/gp-amdh/README.md for provenance.
|
|
|
|
system scope is deprecated in modern Maven but remains
|
|
functional in 3.x and is the canonical pattern for
|
|
locally-vendored JARs that we don't want to push through
|
|
`mvn install:install-file` as a CI ordering step.
|
|
-->
|
|
<dependency>
|
|
<groupId>org.globalplatform</groupId>
|
|
<artifactId>gpapi-globalplatform</artifactId>
|
|
<version>1.7</version>
|
|
<scope>system</scope>
|
|
<systemPath>${project.basedir}/build-tools/gp-amdh/lib/gpapi-globalplatform.jar</systemPath>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.globalplatform</groupId>
|
|
<artifactId>gpapi-upgrade</artifactId>
|
|
<version>1.1</version>
|
|
<scope>system</scope>
|
|
<systemPath>${project.basedir}/build-tools/gp-amdh/lib/gpapi-upgrade.jar</systemPath>
|
|
</dependency>
|
|
</dependencies>
|
|
<build>
|
|
<plugins>
|
|
<!--
|
|
AMD-H bridge classes (e.g. OnUpgradeListener implementations) live
|
|
under src/main/java-amdh and are only compiled into the j3r452 CAP.
|
|
Keeping them out of the j3r180 source set prevents org.globalplatform.upgrade
|
|
imports from leaking into the J3R180 build, which lacks the AMD-H API.
|
|
-->
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>build-helper-maven-plugin</artifactId>
|
|
<version>3.6.0</version>
|
|
<executions>
|
|
<execution>
|
|
<id>add-amdh-sources</id>
|
|
<phase>generate-sources</phase>
|
|
<goals><goal>add-source</goal></goals>
|
|
<configuration>
|
|
<sources><source>src/main/java-amdh</source></sources>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</profile>
|
|
</profiles>
|
|
</project>
|