They'd still have to use the Lemmy API, thus, recognizing ads and/or reversing code should be fairly easy (when you actually know how everything communicates).
Just as a side note (am kinda curious to be honest) I always ran the official Reddit app (don't mod anything, so... didn't see the point in using 3rd party apps) and I never EVER saw a single ad in the app. Maybe it's because I don't live in the US, IDK, but would like to hear an explanation as to why ads weren't served on my client... not that it bothered me, lol ๐.