httptoolkit / frida-interception-and-unpinning

Frida scripts to directly MitM all HTTPS traffic from a target mobile application
https://httptoolkit.com/android/
GNU Affero General Public License v3.0
905 stars 178 forks source link

Error: VM::AttachCurrentThread failed: -1 #3

Closed wizpizz closed 2 years ago

wizpizz commented 2 years ago

For some reason I get this error for every app I try the script on. The app launches and this is the error it gives. My devices is running on Android 11

Error: VM::AttachCurrentThread failed: -1
    at o (frida/node_modules/frida-java-bridge/lib/result.js:4)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:25)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:14)
    at Xe (frida/node_modules/frida-java-bridge/lib/android.js:499)
    at Ie (frida/node_modules/frida-java-bridge/lib/android.js:195)
    at Ce (frida/node_modules/frida-java-bridge/lib/android.js:16)
    at _tryInitialize (frida/node_modules/frida-java-bridge/index.js:17)
    at g (frida/node_modules/frida-java-bridge/index.js:9)
    at <anonymous> (frida/node_modules/frida-java-bridge/index.js:317)
    at call (native)
    at o (/_java.js)
    at <anonymous> (/_java.js)
    at <anonymous> (frida/runtime/java.js:1)
    at call (native)
    at o (/_java.js)
    at r (/_java.js)
    at <eval> (frida/runtime/java.js:3)
    at _loadJava (native)
    at get (frida/runtime/core.js:114)
    at <anonymous> (/frida-script.js:448)
    at apply (native)
    at <anonymous> (frida/runtime/core.js:45)

cmd_b97j9YsBvI

pimterry commented 2 years ago

Thanks for reporting this @wizpizz, I haven't seen that before. There's no many clues there though, and I don't know how I can reproduce this to investigate myself.

Can you try commenting out parts of the script, until you find the part that's causing this? Do you only get that error using this script, or using other Frida scripts too? If we can narrow the issue down to a specific cause then it'll be easier to investigate further.

wizpizz commented 2 years ago

I've tried other Frida scripts I found from CodeShare and I get the same error on almost all of them. After that I tried the scripts on another device and they worked perfectly.

So, it seems like the issue is caused by the device and not the script. It may be because of the ROM the device is running on since it's a custom one. I will probably try other custom ROMs and see the results. And sorry to waste your time :/

And I just want to say that I really enjoy your work. I am a newbie at this kind of stuff and it's really fun using HTTP Toolkit and messing around on my phone and learn more about HTTP. Keep up the good work 👍

pimterry commented 2 years ago

No problem. Glad you found the underlying issue, and thanks for the positive feedback, it's always great to hear when people are appreciating the tool! :smile:

Elegary commented 2 years ago

I have the same problem on a OnePlus device...

qnorsten commented 2 years ago

I had the same problem. This fixed it for me https://github.com/frida/frida/issues/1788#issuecomment-932833126

So might be worth a try in case anyone else have the same problem.