swift-frida icon indicating copy to clipboard operation
swift-frida copied to clipboard

Swift 4.1/4.2 support

Open maltek opened this issue 6 years ago • 5 comments

Most apps have already updated to Swift 4.1, so it's getting a bit more urgent. (See also #10.)

maltek avatar Jul 17 '18 08:07 maltek

Doesn't work on 4.0.2 either - errors out when processing metadata. It seems that until Apple stabilizes the ABI in Swift 5, the way to support different versions of Swift would be to add support per swiftlang version and have multiple implementations of the same thing coexisting side by side, which isn't pretty.

pandasauce avatar Oct 16 '18 09:10 pandasauce

@pandasauce 4.0.2 should work in my experience. If it doesn't work for you, it's either a regression or an unhandled edge case in that binary. Feel free to open a new bug for that, if you can give enough information to reproduce. Depending on the issue, you can also try calling enumerateTypesSync for one module at a time, to figure out which library triggers the bug, and at least analyze the types in all other modules.

Supporting many Swift versions at the same time would definitely lead to some ugly conditionals everywhere. From what I've seen, developers tend to update their compiler very fast, though - so just only supporting Swift 5 when it's out seems like a viable option.

maltek avatar Oct 16 '18 11:10 maltek

@maltek I tinkered with it a bit more. Turns out it "works", as in a populated object comes back. It is just that there is no Map type in Frida agent without some further hacks from https://github.com/oleavr/frida-agent-example and walking the result of enumerateTypesSync is therefore not as trivial. swift-frida doesn't seem to work out of the box with newer dependencies as I previously experienced in #12 - this is as far as I got today, might get a chance to look into this again soon.

pandasauce avatar Oct 16 '18 17:10 pandasauce

@pandasauce That's because that example didn't configure Babel correctly. That has since been fixed.

oleavr avatar Nov 05 '18 16:11 oleavr

@oleavr yep, I submitted a corresponding PR here after our chat on Telegram: #13

Thanks!

pandasauce avatar Nov 05 '18 22:11 pandasauce