# Script help



## showcasemodr (Dec 31, 2011)

I'm messing with Script Manager to build a script that can unzip a rom file and then make changes and zip it back up. Essentially it's similar to the awesome RomKonverter tool built by ReidandKat, but the script could be ran on the phone instead of on a computer and having to transfer the rom to your phone.

Basically it takes a zipped rom, makes changes by replacing certain files, and then I want to zip it back up.

I've gotten most of the script to work such as unzippng and then copying and replacing certain files. However I can't get the zip command to work.

Does anybody know for sure if Android will zip a file back up, and if so what would be the command line/script prompts.

I've tried creating a zip file called "newrom.zip" from files located in the sdcard directory in a folder called "folder" using the following:

zip -r /storage/sdcard0/folder/newrom.zip /storage/sdcard0/folder/rom​
and I get a line in Script Manager that shows "/storage/sdcard0/folder/zip[4]: zip: not found"​
I guess I could just try using an app to zip up the files once my script is done, but that kind of defeats the purpose of one single script to do it all.


----------



## larryp1962 (Aug 31, 2011)

I haven't messed with a script manager before and your idea sounds great. I finally got my lap top set up for building Rom's now and have built a couple so far and they worked. They were for fascinate though. I've made some pre build edit changes that worked ( some didn't). I've got alot to learn.
But i was thinking of trying to make a script that will run during the build or before it completes, But that would mean different scripts for different carrier's.


----------



## hhp_211 (Nov 23, 2011)

The fascinate absolutely will zip files...
Is called compress,, though,, from a file manager,,, I'll do one and see if i can see what it's calling...


----------



## showcasemodr (Dec 31, 2011)

larryp1962 said:


> The fascinate absolutely will zip files...
> Is called compress,, though,, from a file manager,,, I'll do one and see if i can see what it's calling...


Thats what confuses me. I can get stuff to unzip but it won't zip back up.

What I do is I test my commands in the Terminal Emulator to make sure it works and then put that in my script, then run it and make sure it still works. So far I just haven't had any luck with any of the commands I've used to try and zip the files back up.


----------



## larryp1962 (Aug 31, 2011)

Since i haven't figured how to make all the changes for making everything rom specific per carrier like cspire showcase , thought it might easier to have a script to do it instead .. I may be wrong thinking this.. but it's alot harder to edit the rom pre-build than after it.s built.
Yeah this is defininately a new learning experance and all the help i can get would be appreciated.

Also im trying to learn so i can maybe i can support my upcoming phone from cspire


----------



## showcasemodr (Dec 31, 2011)

Well heres an update. I was able to do some digging on XDA and came across a zip binary for android. Placed it in /system/xbin and now runs the zip command.

However the deal breaker is that when it is zipping it always freezes my phone. I can see it going through the zip process but after about halfway it must get to intense and freezes.

I guess this ole phone wasn't meant for too much processing. It makes sense because when I unzip/zip roms on my computer it does take a little bit, and I have a decent processor in my desktop.

Oh well. I guess I can say I got the script to work but the phone just cant handle it


----------



## hhp_211 (Nov 23, 2011)

Well,,, i was thinking afterward,,, went looking and found that same command line zip file... But then i realized I'm using es file explorer which has zip feature built in,,, that what i use,,, super easy,,, not a script but easy to operate,, doesn't seem to suffer any kind of bad performance hit,,, also looked at root toolbox from jrummy,,,

Es file, looks like it calls a java function,, I'm not to good at reading the logcat to know...


----------



## showcasemodr (Dec 31, 2011)

hhp_211 said:


> Well,,, i was thinking afterward,,, went looking and found that same command line zip file... But then i realized I'm using es file explorer which has zip feature built in,,, that what i use,,, super easy,,, not a script but easy to operate,, doesn't seem to suffer any kind of bad performance hit,,, also looked at root toolbox from jrummy,,,
> 
> Es file, looks like it calls a java function,, I'm not to good at reading the logcat to know...


Yea after digging I saw some java/zip functions. But I am stupid and couldn't understand it. I imagine that would be the proper way to zip (versus copying a zip binary to xbin) but i'd have to make sure my script handled the function correctly, because it someone else were to run it the script would have to do everything.

Maybe I'll do some more tinkering, I'll try zipping with ES and see if that works better.


----------

