How to reset phone after installing TWRP?

tnhh

Senior Member
Oct 16, 2011
107
26
0
My P9 no longer boots after I tried to edit /data/system/packages.xml to enable SD card writing :( It boots up but it doesn't let me unlock the phone. logcat shows lots of "java.lang.SecurityException: Permission Denial" so I assume I made an error when editing the file. Grr.

I have rooted it and installed TWRP. I can still boot into TWRP and also the Huawei erecovery. What is the best way to reset the phone? My understanding is that TWRP can't read /data so I assume that it can't wipe it. Is that correct? If I do the erecovery and download an image over Wi-Fi, will that break anything?