A big risk in an airplane is a fire, so every piece of electrical kit has a circuit breaker to isolate it, which the pilots can access. That applies to satellite kit, transponders etc.
Having two pilots or pilot + flight attendant always in the cockpit doesn't necessarily help. Pilots can obtain weapons onboard (there is a fire ax) or smuggle weapons in. In one flight, a pilot attacked the others with the axe. Once you have a crew member hostage, they can be used to persuade other crew ("turn that switch off or I kill the captain!").
Elaborate security procedures to address a relatively tiny risk are impractical, and as we saw with Germanwings may have unintended consequences. Really you have to proceed on the basis that flight crew are trustworthy. Since a pilot has direct control of a plane, he/she can crash a plane at will really, just enter roll and dive...
The only foolproof method might be to have complete autonomous control with no access to the computer by those onboard, even then, it seems everything can get hacked.
Agree with all that. By deciding to lock cockpit doors (for anti-terrorism reasons I think?), sure that mitigated a risk: any passenger entering the cockpit and getting control of the plane, but introduced a whole range of new risks that didn't exist before.
The Germanwings affair was "interesting" in that regard, because not only did it show how this could go bad, but it also showed that choosing to fully trust the fight crew - which is the whole idea behind locking cockpits - is also flawed. AFAIR, the pilot had had mental health problems for a long time, and it didn't seem to have affected his position much. You may say that it was an isolated case - I'm not sure at all. Even if it's not for obvious health problems, almost anyone - no matter how good your psychological tests are - can be corrupted.
As you said, even autonomous control could be hacked, and it's impossible to automate it as far as having absolutely NO way of disabling it, even from outside, in case anything goes wrong. And as long as there is a way to circumvent it - this way will be used.
If an entire plane with hundreds of passengers is taken hostage in an autonomous plane, obviously first thing the bad guys would do is ask control towers to disable the autonomous mode (as I said above, there ought to be a procedure for that IMO.) Even if control towers themselves become fully autonomous without any human control - will we, as a society, accept the possibility that the machines will favor potential death of all passengers of a flight rather than giving them at least a small chance of surviving? That's actually a question that is raised with any form of fully autonomous systems - how they will/should handle safety when human lives are involved. This is such a can of worms that just beginning to think of this is scary, and anyone thinking they have found an easy solution to this has usually just not thought very much.