此博客按我的编写过程记录将optee example 中的helloworld程序移植为android APP的过程
在正确编译及烧写optee+asop,启动开发板,进入控制台可以成功运行xtest 以及实例程序。对应的客户端程序在/vendor/bin下,对应的TA程序*.ta在/vendor/lib/optee_armtz。(当时找这个找了好久)。在控制台下运行客户端程序例如xtest optee_example_helloworld, 会与对应的ta程序会话完成ta中相应的功能,并获得ta返回的结果。如下:
如果要编写android下的程序实现上述的功能,则android app就对应非安全世界的程序,即控制台界面下的optee_example_hello_world 程序,android app与对应的ta程序会话,获取安全世界的执行结果。
移植过程:
1 在Android Studio下新建一个工程,这里我取名为Jniteeeest(因为调用本地接口需要使用jni) 一切使用默认的配置,选择添加一个空的Activity, 并为该Activity创建布局文件,修改布局文件,为textview增加id属性:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android