Assuming you don't have any viable counter-attack plan with your current setup, you might want to consider retreating.
In the advanced edition the flagship has to occupy the "base" for 3 consecutive turns before you lose. If you can visit a shop and trade a weapon for another that might do the trick. More likely there are some encounter beacons you haven't completed or allowed the rebels to capture. These will give scrap.
The best option, however, is reaching a repair station which in the advanced edition will give you scrap in addition to other benefits. If you truly will reach a deadlock, you'll need to use some extra scrap to change your loadout.
Oh, and the best part about retreating? They'll have to hack all over again, and they might choose your sensors next time!