title: Load .so / JNI from Assets on Android 7 / Android N
body: <p>I'm looking for a soluton to load .so files using the System.load() method from Assets. </p>
  
  <p>I found a solution that I can read the .so file form AssetManager, save it to the Context.getFilesDir, and load it view System.load().</p>
  
  <p>But this works only below Android 7. 
  On Android 7, I get</p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: dlopen failed: library "&lt;AppDir&gt;"
  needed or dlopened by "/vendor/lib/libnativeloader.so" is not
  accessible for the namespace "classloader-namespace"
  </code></pre>
  
  <p>Actually I would like to load libcrypto.so via System.loadLibrary, which works like a charm for e.g. on Samsung devices, without embedid my own libcrypto.so. But for some devices, like Huawei, I need to include my own libcrypto.so - which would be fine, but on some Samsung devices, it causes kernel panik If I use my own libcrypto.so, while the device has its on (on Android 6).</p>
  
  <p>Btw, Huawei has its on pre-build libcrypto.so, but when I'm tring to load that one, again, I'm getting this:
  java.lang.UnsatisfiedLinkError: dlopen failed: library </p>
  
  <pre><code>"/system/lib/libcrypto.so" needed or dlopened by "/vendor/lib/libnativeloader.so" is not accessible for the namespace "classloader-namespace"
  </code></pre>
  
  <p>I know Android 7.0 has some new security features regarding to native libraries, went through the guide, but I found nothing that can help me finding a workaround.</p>
  
  <p>Any help would be appriciated.</p>