How to make a complete factory reset, without anyone being able to retrieve my data?

I will have a few Android phones that I will have to let go.

I would like to make a proper clean wipe of the data, without no one being able to retrieve them, and do a factory reset.

I have read about the Schneier Method, encrypting the device before doing a factory reset, doing both, etc.

Since I am not an Android/adb guru, I would like to know if some of you would have some idea on how to achieve this with certainty.

I know “certainty” is a big word when it comes to proper data erasure on flash memory but still.

I have found some answers here and somewhere else, saying that encrypting and doing a factory reset on your Android device is enough, but I could not find a reliable source.

Just a few information that could be useful:

  • I’m running Linux as my OS and, therefore, I’m not looking for a Windows-based solution
  • My devices are non-rooted and (almost) identical (Samsung A510F + 1 A510FD)