Hiya folks, I hope you can help.
I'm trying to make a generic ZIP for flashing deodexed files. What I want to be able to do is have a chunk of code that will delete a folder on the phone
only if the same folder exists in the ZIP. That way the ZIP can have any combination of folders in it but will only act on the ones that it actually has.
It seems that I'm going to need the "
ifelse" command and I was thinking of doing something like this:
Code:
ifelse(package_extract_dir("system/app", "/system/app") == "t",
(
delete ("system/app");
package_extract_dir("system/app","/system/app");
),
(
ui_print(" ");
)
);
The idea is that the phone tries to copy the contents of "system/app" from the ZIP onto the phone. If it fails, nothing happens. If it succeeds, it deletes the entire system/app folder and does it again.
Doing the package extract twice seems a little redundant to me but I can't see a better way of doing it.
I'm quite new to using conditions in my updater scripts - up until a few minutes ago, I didn't know you could! So my question is, would this work and is there a better more efficient way of doing it?