I agree with @XeduR, there is nothing much you can do to prevent piracy. People will always find a way to get around those measure but if you still want to take a shot at it, you can try licensing.*. I haven’t used it for some time now but I guess it still works.