Second, say you solve the above and decide to deploy the gun. You don't have a lot of time, and you don't know if the approaching boat is a pirate or a local fisherman who wants to sell you a fish. Make the wrong call, and bad things happen.
Say you solved the permit/registration issue by hiding the gun and then you deploy the gun. Bad things happen. Ok, it might have been justified and might have saved your life, but you are still probably going to jail for not declaring the weapon.