| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- Copyright (C) 2017 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <!-- Ant XML for out of band building the applet. --> |
| <project basedir="." default="avb_storage" name="applet build"> |
| |
| <target name="check-checksum"> |
| <checksum file="${tocheck}" algorithm="SHA-512" fileext=".SHA-512" pattern="{0} {1}" |
| verifyProperty="checksum_verifies"/> |
| <fail message="Checksum mismatch on ${tocheck}"> |
| <condition> |
| <not> |
| <istrue value="${checksum_verifies}" /> |
| </not> |
| </condition> |
| </fail> |
| </target> |
| |
| <target name="dependencies"> |
| <!-- Check we have the files that have to be placed in source dir by hand --> |
| <antcall target="check-checksum"> |
| <param name="tocheck" location="loaderservice/ls_library_v02.00.jar"/> |
| </antcall> |
| <unzip src="loaderservice/ls_library_v02.00.jar" dest="loaderservice" /> |
| |
| <antcall target="check-checksum"> |
| <param name="tocheck" location="com.nxp.id.jcop.eclipse.targetpacks1_4.10.0.1.jar"/> |
| </antcall> |
| <unzip src="com.nxp.id.jcop.eclipse.targetpacks1_4.10.0.1.jar" dest="unpack/com.nxp.id.jcop.eclipse.targetpacks1_4.10.0.1" /> |
| |
| <!-- Grab the awesome ant helper. --> |
| <get src="https://github.com/martinpaljak/ant-javacard/releases/download/v1.7/ant-javacard.jar" dest="." skipexisting="true"/> |
| <antcall target="check-checksum"> |
| <param name="tocheck" location="ant-javacard.jar"/> |
| </antcall> |
| |
| <taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="ant-javacard.jar"/> |
| |
| <!-- Grab the sdk. --> |
| <get src="https://github.com/martinpaljak/oracle_javacard_sdks/archive/master.zip" |
| dest="javacard_sdks.zip" skipexisting="true"/> |
| <antcall target="check-checksum"> |
| <param name="tocheck" location="javacard_sdks.zip"/> |
| </antcall> |
| <unzip src="javacard_sdks.zip" dest="." stripAbsolutePathSpec="true"> |
| <patternset> |
| <include name="**/jc303_kit/**"/> |
| </patternset> |
| <cutdirsmapper dirs="1" /> |
| </unzip> |
| |
| </target> |
| |
| <target name="shared_interfaces" depends="dependencies"> |
| <javacard jckit="jc303_kit"> |
| <!-- CallbackInterface --> |
| <cap aid="A000000476424F4F54525354300000" package="com.android.verifiedboot.globalstate.callback" version="0.1" |
| output="globalstate-callback.cap" sources="src/com/android/verifiedboot/globalstate/callback" export="export/callback"> |
| <import exps="export/callback"/> |
| </cap> |
| <!-- OwnerInterface --> |
| <cap aid="A000000476424F4F54524547300000" package="com.android.verifiedboot.globalstate.owner" version="0.1" |
| output="globalstate-owner.cap" sources="src/com/android/verifiedboot/globalstate/owner" export="export/owner"> |
| <import exps="export/owner"/> |
| </cap> |
| </javacard> |
| </target> |
| |
| <target name="avb_storage" depends="shared_interfaces"> |
| <property name="apidir" location="unpack/com.nxp.id.jcop.eclipse.targetpacks1_4.10.0.1/apis/jcopx-4.0-R2"/> |
| <!-- Remove the duplicate .exps --> |
| <delete> |
| <fileset dir="${apidir}" includes="*.exp"/> |
| </delete> |
| <javacard jckit="jc303_kit"> |
| <!-- CallbackInterface --> |
| <cap aid="A0000004765049584C424F4F54000100" package="com.android.verifiedboot.storage" version="0.1" |
| output="avb_storage.cap" sources="src/com/android/verifiedboot" export="export/avb_storage"> |
| <!-- Use supplied exp and build interface jar from the eclipse plugin targetpack. --> |
| <import exps="${apidir}" jar="${apidir}/api-jcopx-4.0-R2.jar"/> |
| <!-- Requires ls_library to be on the device already. --> |
| <import exps="loaderservice" jar="loaderservice/ls_library_v02.00.jar"/> |
| <!-- Grab the other interfaces from export/ --> |
| <import exps="export/owner" jar="export/owner/owner.jar" /> |
| <import exps="export/callback" jar="export/callback/callback.jar" /> |
| <applet class="com.android.verifiedboot.storage.Storage" aid="A0000004765049584C424F4F54000101"/> |
| <import exps="export/avb_storage"/> |
| </cap> |
| </javacard> |
| </target> |
| </project> |