I think you will struggle to find a general solution. I had not come across @mistergreen's hack but I think that would only be suitable for very particular cases, where e.g. it provides some benefit to users. More generally you have to contend with different device policies and built in capabilities, with third party apps which provide enhanced screen capture, with freely available debug tools, and with screen sharing to other devices.
The only thing I can think of is DRM, where some DRM is implemented in the OS so screen recording/capture is disallowed at an OS level. It's not something you can implement in an app though; it's more you use the relevant API and the protection is baked into the media.