How does a update.zip file update files I have been searching online on multiple sites and could not find one answer to this question, only found one question online but with no answer
How does the android recovery update files from a update.zip file using the package_extract_dir(""); code in the updater-script? 1. Does it clear the folder and copy the files in update.zip to that folder?2. Does it just copy the files over (that don't already exist on the device) and not overwrite any files?3. Or just copy the files from update.zip and overwrite any previous files?
 This is using the default android recovery screen, I am sure it is option 3, but just for anybody asking this question, want to know for definate
Well it's obviously not #2, updates would not work so well if they could not update existing items.

The script as a whole might do #1, but package_extract_* does #3.  You can see the code here: https://android.googlesource.com/platform/bootable/recovery/+/7d0542f28045640dfab6a259ae7bd796e653d66f/updater/install.c