Some features of my Android app are depending on a TEE (Trusted Execution Environment / ARM TrustZone) being present on the phone. How from my Java app can I detect if this phone has a TEE installed, and if so, what vendor's TEE it is? Thanks!
I would suggest the following approach (not tested):
List of system processes is not available through Android SDK API, so we would use
Runtime.exec(...) to execute OS command and to capture its output into string variable. We would use
/system/bin/ps (but we could have used
/proc and then do some proc output parsing)
String cmd = "/system/bin/ps"; // alternative cmd would be "/proc" but then we would need to loop through proc subdirectories, etc // run cmd and read its output into string java.util.Scanner s = new java.util.Scanner(Runtime.getRuntime().exec(cmd).getInputStream()).useDelimiter("\\A"); String cmdRes = s.hasNext() ? s.next() : "";
String cmdResinto list of process names