History has shown again and again that anything that ends up on someone else's computer becomes theirs in the essential sense, regardless of the legal sense.
Sooner or later, all locks get broken, and the net result is that you've annoyed your honest customers while slowing the dishonest ones hardly at all.
As Ernest has said, the only way to protect code is to execute it on the server.
Just as a personal observation, however, if you have innovative ideas embedded in the code,
you should patent them. If you're concerned about people getting a free ride on your development, copyright the distribution. And if you're a control freak, it's server-side or disappointment, take your pick. Such is life.
Although it's worth noting that a rather large industry exists these days based on NOT holding work private and proprietary - and in fact, I'll go so far as to assert that Texas Instruments' rather short stay in the PC market was due in large part to their attempts to ensure that they and only they could develop apps that fully utilized the hardware.
Then there's the iPhone story....