[Android Q&A, Help & Troubleshooting] baboomerang:
Greetings XDA Forums! First time poster due to a very annoying problem I have with my Updater-Script.

Let me provide background knowledge:

I flashed the Sammy Deluxe Operation IVY Rom on my S4. It's essentially a 100% port of the S5 rom. It works better than my expectation and I was mentally blown away. However there was one annoyance. The hardware keys for the Context Menu and App Switcher were changed to emulate the S5 method. I didnt like it because now context menu is inaccessible. I tried doing the trick where I hold down the capacitive button to see if that works, but Im afraid that trick is a hardware coded trick that was only implemented on the S5. Not the S4 where its merely being emulated.

Adding to my state of annoyance, the ROM author wrote on the front page he wont change it back and dont even ask to change it back. Quote, he said this : "Please change it yourself. This is a S5 style ROM and I don’t understand what the problem is to adapt to new changings. If not, there is always the possibility for you to revert to the original softkey layout." I do understand why he would say that. Let me keep going.

I decided to fix it myself by visiting these 2 links

http://xdaforums.com/showthread.php?t=2792460

This forum post shows you how to emulate the S5 Capacitive Context Menu Button on the S4 ( now the app switcher button )

So I did the reverse process of that. I decompiled the framework-res.apk, edited the boolean back to S4 Default ( which is what I want )

also set the key 139 ( Left Side Capacative ) back to Context Menu function. Recompiled the framework-res.apk.

The question is now is how to install my changes.

I made a flashable zip with updater script and everything. I followed this guide here so I can see the basic syntax and have an understanding of it.

http://xdaforums.com/showthread.php?t=2377695

On doing so, the process of deleting the old framework-res.apk and putting the new one in

works perfectly.

However the command set_perm

doesnt

after copying the file to the /system/framework folder. During the flash everything else is good, but once it gets to set perm, Status 7 error is spewed by CWM and it says set_perm some changes failed

I double checked my parenthesis, my semi-colons, and my quotations.

I'm sure the problem is within the syntax of set_perm

Here is my code and I will attach it at the bottom as well for any additional help.

ui_print("framework-res fix by baboomerang");

ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
show_progress(0.150000, 1);

ui_print("Removing old copy of framework-res");
ui_print("Removing old copy of Generic");
delete("/system/framework/framework-res.apk");
delete("/system/usr/keylayout/Generic.kl");

ui_print("Installation...");
show_progress(0.250000, 2);
package_extract_file("/system/framework/framework-res.apk", "/system/framework");
package_extract_file("/system/usr/keylayout/Generic.kl", "/system/usr/keylayout");
ui_print("Patching done");
show_progress(0.476000, 3);

ui_print("Using CHMOD 644 or rw r r");
ui_print("Uploading Stage 1 to diagnose which set perm broken");
set_perm(0,0,0644, "/system/framework/framework-res.apk");

ui_print("Uploading Stage 2 To diagnose which set perm broken");
set_perm(0,0,0644, "/system/usr/keylayout/Generic.kl");
show_progress(0.789000, 4);

ui_print("Unmounting system...");
run_program("/sbin/busybox", "umount", "/system");
show_progress(0.930000, 5);

ui_print("Cleaning Up...");
show_progress(0.999999, 6);
ui_print("Installation done..........");
ui_print("Now your s4 hardware keys should be back to normal");

It works all the way up to the UI PRINT Uploading Stage 1 to diagnose which set perm broken. Then it just stops with status 7 error.

I am finally requesting assistance or guidance on where to fix this problem. or HOW TO to be accurate.