frida / frida-core

Frida core library intended for static linking into bindings
https://frida.re
Other
603 stars 191 forks source link

'setTimeout' is not working in frida-gadget on 'script' mode? #416

Open te3 opened 2 years ago

te3 commented 2 years ago
rpc.exports = {
  init: (stage, parameters) => {
    Java.perform(function () {
      const Log = Java.use("android.util.Log");
      Log.e("script", "step-1");

      setTimeout(() => Log.e("script", "step-2"), 2000);
      Log.e("script", "step-3");
    });
  },
};

logs: 04-18 11:19:29.270 21742 21811 E script : step-1 04-18 11:19:29.270 21742 21811 E script : step-3 //no step-2

environment: frida-gadget-15.1.17-android-arm64.so

aku-ato commented 6 months ago

Hi,

same problem here with latest version 16.2, Android 12 arm64, ... I think that this issue affect very few people because it's a bit old and nobody else commented on it... maybe we are doing something wrong

pierluigicdc commented 5 months ago
rpc.exports = {
  init: (stage, parameters) => {
    Java.perform(function () {
      const Log = Java.use("android.util.Log");
      Log.e("script", "step-1");

      setTimeout(() => Log.e("script", "step-2"), 2000);
      Log.e("script", "step-3");
    });
  },
};

logs: 04-18 11:19:29.270 21742 21811 E script : step-1 04-18 11:19:29.270 21742 21811 E script : step-3 //no step-2

environment: frida-gadget-15.1.17-android-arm64.so

same here. I didn't found any solution at moment.

aku-ato commented 5 months ago

sadly I'm not alone 😔

gogibeet-dpl commented 4 months ago

Hello! You should move the SetTimeout function out of the Java.Perform() block.

jinghaifeng1 commented 4 months ago

Lucky and sad I'm not alone 😔

jinghaifeng1 commented 4 months ago

Hi, 你好

same problem here with latest version 16.2, Android 12 arm64, ... I think that this issue affect very few people because it's a bit old and nobody else commented on it... maybe we are doing something wrong最新版本 16.2、Android 12 arm64 也有同样的问题......我认为这个问题影响的人很少,因为它有点老了,没有人对此发表评论......也许我们做错了什么

I had the same problem as you in the same device environment