How to create an update.zip file that can copy & rename a file? Here's exactly what I'm looking for - I need an 'update.zip' file that can copy a file (example):

/system/framework/file-to-copy.apk

to another folder:

/system/

and then it would rename the 'file-to-copy.apk' in the 'system' folder to:

renamed-file.apk

and copy it back to:

/system/framework/

It would have to overwrite an already existing 'renamed-file.apk' in 'system/framework' folder.

Note: The permissions can NOT change.

Is it even possible to do this?

Any help would be appreciated!
Actually you can do that by using the run_program syntax in updater-script to execute a shell script that moves/copies/pastes files while in recovery. But of course, you must extract the files that are to be pasted in somewhere (/tmp for instance).

Part of the updater-script:

package_extract_dir("stuff", "/tmp/stuff");
set_perm(0, 0, 0755, "/tmp/stuff/movefiles.sh");
run_program("/tmp/stuff/movefiles.sh");


The sample shell script can be like this (named movefiles.sh in this case):

#!/sbin/sh
# Backup files
cp /system/framwork/something.apk /path/you/want

# Paste files
cp /tmp/somethingssss.apk /system/framework/something.apk

# Set back permissions (the copied file has the same permissons, but the new ones does not)
chmod 644 /system/framework/something.apk


But remember, the EOL of updater-script and the shell script must be the same, in UNIX format, or else it won't work.