Ever thought what would you do if someone copies your idea? I mean how would you prove that you are the original creator?
I think the best one can do is to craft their software in a way that the most important logic will always run in some sort of online backend. Anything could be behind the scenes. Well, you can't really do anything about the "someone stole my idea" phenomenon, but you can make their life hard by not giving away your precious code. Whenever I launch anything my first thought is "how can I make it work in a form of a web application". Good thing is, managing infrastructure is like a nonexistent thing for indies, just think of hosting your stuff on Google Cloud Run for example.
Ideas are not protected. You just have the advantage of being firstmover in the market
If something is online then there isn't much you can do to prevent copying.
You can put licensing, but that only prevents someone from copying your code. People can always take your idea, tweak it a little bit and launch their product.
But you can make good out of it, by observing their product, learning from their mistakes, and prevent yourself from doing the same mistakes as they did.
Just heard about 10duke that is doing it. So trying to figure out how?