..unless one does not plan to go at war with countries where it registered patents
Patent registrations are public. Details about a registered patent in any country will be available to all countries worldwide.
It is also unlikely that a country would opt to abide by intellectual property treaties when at war.