1*5c4dab75SAndroid Build Coastguard Worker# ese-ls-provision tool 2*5c4dab75SAndroid Build Coastguard Worker 3*5c4dab75SAndroid Build Coastguard WorkerRuns on Android host and uploads scripts to the secure element loader service. 4*5c4dab75SAndroid Build Coastguard Worker 5*5c4dab75SAndroid Build Coastguard Worker## Introduction 6*5c4dab75SAndroid Build Coastguard Worker 7*5c4dab75SAndroid Build Coastguard WorkerPN80T and later secure elements include a "loader service" which runs signed, encrypted scripts to 8*5c4dab75SAndroid Build Coastguard Workerperform high-privilege operations like installing and deleting applets in a secure way. The result 9*5c4dab75SAndroid Build Coastguard Workerof compiling, encrypting and signing these scripts with the `ls-cgt.jar` tool is a file containing 10*5c4dab75SAndroid Build Coastguard Workerhexadecimal blocks separated by newlines; the first line usually starting with `7f21` indicating 11*5c4dab75SAndroid Build Coastguard Workerthe certificate for the signing key. This tool takes those signed, encrypted scripts and sends 12*5c4dab75SAndroid Build Coastguard Workerthem to the secure element. 13*5c4dab75SAndroid Build Coastguard Worker 14*5c4dab75SAndroid Build Coastguard Worker## Usage 15*5c4dab75SAndroid Build Coastguard Worker 16*5c4dab75SAndroid Build Coastguard Worker ese-ls-provision <identifier> <script> <responsefile> 17*5c4dab75SAndroid Build Coastguard Worker 18*5c4dab75SAndroid Build Coastguard Worker- `<identifier>` names a file of one to twenty bytes. This is a required parameter to the code 19*5c4dab75SAndroid Build Coastguard Workerwhich drives communication with the loader service, and the identifier is sent to the SE as part 20*5c4dab75SAndroid Build Coastguard Workerof the initial setup, but I'm not sure what effect it has apart from that; the source code says 21*5c4dab75SAndroid Build Coastguard Worker"It is used to provide the ALA with an Unique Identifier of the Application that has triggered the 22*5c4dab75SAndroid Build Coastguard WorkerALA script". 23*5c4dab75SAndroid Build Coastguard Worker- `<script>` is the compiled, encrypted, signed scrypt as generated by `ls-cgt.jar`. 24*5c4dab75SAndroid Build Coastguard Worker- `<responsefile>` is a file to which to write the response from the loader service. This is also 25*5c4dab75SAndroid Build Coastguard Workerwritten as newline-separated hexadecimal. On a successful upload, each line ends with `9000`. 26*5c4dab75SAndroid Build Coastguard Worker 27