Alternative UUID for Android (native binary w/o Java)

LK
Lukas Kuzmiak
Mon, Jun 18, 2018 5:30 AM

Hey everyone,

cross-compiling pjproject for Android is not too bad, I written a simple test app with just pj_init() and got a segfault right away.
After debugging it for a while I realized it’s because of guid_android.c trying to get UUID using the JVM which was not present in my native binary.

While I understand most people are going to build apps (and therefore have Java involved) I needed to go around this issue. I did not want to roll back to guid_simple.c for obvious reasons, so I wrote a little patch - see attached.

The patch checks for presence of the JVM and in case it’s not available it reads the UUID from /proc/sys/kernel/random/uuid

Hopefully this could be merged upstream for other folks who don’t necessarily run Java-based apps.

Regards,
Lukas

Hey everyone, cross-compiling pjproject for Android is not too bad, I written a simple test app with just pj_init() and got a segfault right away. After debugging it for a while I realized it’s because of guid_android.c trying to get UUID using the JVM which was not present in my native binary. While I understand most people are going to build apps (and therefore have Java involved) I needed to go around this issue. I did not want to roll back to guid_simple.c for obvious reasons, so I wrote a little patch - see attached. The patch checks for presence of the JVM and in case it’s not available it reads the UUID from /proc/sys/kernel/random/uuid Hopefully this could be merged upstream for other folks who don’t necessarily run Java-based apps. Regards, Lukas