frida-il2cpp-bridge icon indicating copy to clipboard operation
frida-il2cpp-bridge copied to clipboard

Make schedule method asynchronous to handle Promise callbacks

Open thinhbuzz opened this issue 6 months ago • 2 comments

refer to commit https://github.com/vfsfitvnm/frida-il2cpp-bridge/commit/d5f7dff2b2cc34a3c4330547e9ef4f2465b1c481

thinhbuzz avatar Jun 06 '25 06:06 thinhbuzz

Old

const value = await Il2Cpp.mainThread.schedule<number>(() => {
    return new Promise<number>(resolve => resolve(1));
});
// Error: TS2345: Argument of type () => Promise<number> is not assignable to parameter of type () => number

New

const value = await Il2Cpp.mainThread.schedule<number>(() => {
    return new Promise<number>(resolve => resolve(1));
});
// OK

thinhbuzz avatar Jun 06 '25 06:06 thinhbuzz

Hmm, schedule should not be async, but should handle Promises as well. What's your use case?

vfsfitvnm avatar Jun 10 '25 13:06 vfsfitvnm