I recently broke the display of my smartphone and wanted to sell it on eBay. However, I am paranoid about my data. So this is what I did:
*   Get a new phone and set it up.
*   Encrypt the Phone with Android's builtin encryption feature:
    * Set a lock screen password (not a PIN) with a random 16 letter string (at the time of writing, Android won't let you choose longer passwords).
    * Go to security in your settings and find the option to encrypt the phone, confirming your password.
*   After this is done, open an ADB shell on your phone. Because the phone's internal memory is flash, there might still be areas that contain sensible and unencrypted information. We will overwrite them with random data.
    
						
				
						
										
									
										
			cat /dev/random > /data/junkfile
for img in $(ls *.jpg); do mogrify -strip $img; done