If some form of secure boot is used, then replacing the flash won't work either. There is one-time writable storage inside the SoC itself is used for verification. You won't be able to get it back into a state where it accepts non-signed firmware without also replacing the SoC.