8

Do the Android Dalvik standard libraries have any class similar to the undocumented class sun.misc.Unsafe in Java SE which allows direct access to memory.

2 Answers2

5

Android implements parts of sun.misc.Unsafe, primarily to support the JSR-166 concurrency classes. It's not part of the Android API.

fadden
  • 51,356
  • 5
  • 116
  • 166
  • 2
    You can call unsafe APIs via reflection, and use the 'catch' clause to fall back in case unsafe is not available. – Jesse Wilson Mar 19 '11 at 04:18
3

It has the JNI bridge which could allow for just about anything but it's not "unsafe" since you have to code that into your app. As far as I know there is no exposed way to get out of the JVM sandbox (at least not without finding an exploit).

Andrew White
  • 52,720
  • 19
  • 113
  • 137