From what I know, it’s simply not possible to create an app that does what you want. Signal definitions for an app (timing data, mostly) need to be defined up-front (in
app.json) and cannot be created dynamically.
Also, with RF, there is no such thing as a “code”. An RF signal deals with timings and encodings, and only if those are known to Homey (the “defined up-front” part) is it possible to decode the signal. The result of that decoding process will be a code that could be used in flows, but that’s only the last part of the “RF chain”.
The Sonoff RF Bridge (mentioned in the thread that @Dijker referred to) does the decoding part in hardware and passes the code to Homey (but that device is also limited in the amount of different timings and encodings that it can recognize, it’s not a generic RF receiver either).