title: Frida - hook native method failure on android-Q
body: <p>I have a sample app, which have a <code>int add(int a,int b)</code> in native library.</p>
  
  <p>I use below code to hook the <code>add</code> method:</p>
  
  <pre><code>#!/usr/bin/env python3
  
  import frida
  import sys
  
  package_name = "com.sample.hello"
  apiname = "add"
  
  def get_messages_from_js(message, data):
      if message['type'] == 'send':
          print(message['payload'])
      else:
          print(message)
  
  def instrument_debugger_checks():
      hook_code = """
  Interceptor.attach(Module.findExportByName(null, "%s"), {
      onEnter: function(args) {
          console.log("onEnter...");
          //send (Memory.readUtf8String (args [1]));     
      },
      onLeave: function(args) {
          console.log("onLeave...");
      }
  });
  """%(apiname)
      return hook_code
  
  process = frida.get_usb_device().attach(package_name)
  script = process.create_script(instrument_debugger_checks())
  script.on('message',get_messages_from_js)
  script.load()
  sys.stdin.read()
  </code></pre>
  
  <p>I use below command to get the function name from so:</p>
  
  <pre><code>$ nm -D libnative2.so |grep add
  
  0000000000082504 T _ZNSt6__ndk114__shared_count12__add_sharedEv
  0000000000082574 T _ZNSt6__ndk119__shared_weak_count10__add_weakEv
  000000000008255c T _ZNSt6__ndk119__shared_weak_count12__add_sharedEv
  0000000000042d8c T add
  </code></pre>
  
  <p>I have tried all these names, result is the same.</p>
  
  <p>But when I run it, I got below error:</p>
  
  <pre><code>{'type': 'error', 'description': 'Error: expected a pointer', 'stack': 'Error: expected a pointer\n    at frida/runtime/core.js:387\n    at /script1.js:9', 'fileName': 'frida/runtime/core.js', 'lineNumber': 387, 'columnNumber': 1}
  </code></pre>
  
  <p>What's wrong with my code?</p>