If you decide to keep the code for yourself, then you end up sweating it out with him, being stressed, and so on. Best to tell him good luck. I'm sure you're a smart guy so you'll find another adventure, so let that guy run with his pipedream, and just keep proof of the fact you built it, as I'm sure you have emails and proof showing equity division and so on.
Wish him the best of luck because ultimately if he succeeds you do as well (after the lawsuit), regardless if you split up or not.
You could always do a friendly "shotgun" clause tactic too.