NativeHelper: Do not allow arbitrary library strings in user builds
On device, only allow "libart.so" in non-debuggable (user) builds.
Bug: 16404669
(cherry picked from commit 5019faa3a6bdde33785ece0537e8b865ea7cf938)
Change-Id: Ie163c04ce40c82698dcc98ced651dafef094d8b5
diff --git a/include/nativehelper/JniInvocation.h b/include/nativehelper/JniInvocation.h
index 9876d8d..b5198ff 100644
--- a/include/nativehelper/JniInvocation.h
+++ b/include/nativehelper/JniInvocation.h
@@ -38,6 +38,9 @@
// persist.sys.dalvik.vm.lib.
bool Init(const char* library);
+ // Exposes which library is actually loaded from the given name.
+ static const char* GetLibrary(const char* library);
+
private:
bool FindSymbol(void** pointer, const char* symbol);