Get Legal Shield coverage (Ada Oklahoma company).
Then you can simply bankrupt any patent troll who comes after you.
I can tell you from personal experience, bankrupting people who sue you is highly gratifying.
I've done this twice now.
Each time I get sued, I'm filled with glee, because this means I have a new opportunity for bankrupting someone, so they can't sue anyone else.
Search Clarify for my previous answers detailing how to accomplish bankrupting people who sue you.
I am an experienced technology lawyer and a registered patent attorney. Nothing in my posts should be taken as legal advice.
The short answer is you can't, because people don't have to be right to sue. The slightly longer answer is that you talk to a patent attorney familiar with software patents who can advise you on the risks and how to manage them. I'd be glad to go over the basics/highlights of the question with you on a call.