How to put a TA and secure applciation onto a board

With this you end up with a files named uuid.{ta,elf,dmp,map} etc in the ta folder where you did the build.

I’m currently getting a ta working with the settings core app. Right now i don’t know how to get the ta onto the board. i’m able to compile the ta and i get the uuid products. I found in the faq that says that the ta files are put in /arm/tz is that in the build directory or the aosp? also what do i do with elf dmp and map? How do i refer to the secure world in my application?

Just adb push the out/target/product/<board>/vendor/lib/optee_armtz/<uuid>.ta file on your PC to /vendor/lib/optee_armtz/ of your board. The rest (elf, dmp, map, etc) are not needed to run the TA.

The counter part of the TA, called the CA (client application i think), are in e.g. out/target/product/<board>/vendor/bin/optee_example_hello_world. You adb push this to /vendor/bin/ of your board, and just run it, it will ‘call’ the TA.

so i only need to push the TA i guess. My host is just a modified version of a android package app (so i’m using jni). So all i have to do is to build the host application and refer to it like this.

LOCAL_PATH := $(call my-dir)
CFG_TEEC_PUBLIC_INCLUDE = /home/jsherman/devel/optee/optee_client/public

and also i’ll need to import the libteec.so file

> include $(CLEAR_VARS)
> LOCAL_MODULE := libteec
> LOCAL_SRC_FILES := <path_to_libteec_so>
> include $(PREBUILT_SHARED_LIBRARY)

So you managed to build an app for this? That’s great! Perhaps you can help by giving some comments on this thread too? https://discuss.96boards.org/t/op-tee-ca-as-an-android-application-apk-build-problem

i mean i’m just modifying the android settings app not making a app from scratch.
The reason why i find it a bit difficult is that sometimes the intrusctions are not quite applicable to me

i would just like to know how to integrate the ta in my context

TEEC_UUID uuid = TA_HELLO_WORLD_UUID;

so i know i need to include the ta .h file

CFG_TEEC_PUBLIC_INCLUDE = /home/jsherman/devel/optee/optee_client/public

doe this mean i also need to include the directory where (but the problem is that this thread talks about buildling on a pc on the board).

for reference my android.mk file looks like this:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libteec
LOCAL_SRC_FILES := /storage/optee_android/out/target/product/hikey/system/lib64/libteec.so
include $(PREBUILT_SHARED_LIBRARY)
CFG_TEEC_PUBLIC_INCLUDE = /home/test/devel/optee/optee_client/public

LOCAL_STATIC_LIBRARIES := libteec
LOCAL_MODULE    := libhello-jni
LOCAL_SRC_FILES := hello-jni.c

LOCAL_C_INCLUDES += \
        $(JNI_H_INCLUDE)

LOCAL_CFLAGS += -O0 -g3

include $(BUILD_SHARED_LIBRARY)