[Q] How do I write an update script? - Epic 4G Q&A, Help & Troubleshooting

How Do I make an updater.script to flash a zip through recovery that flashes framework, system/apps, data/apps, and bootanimations into CM9 alpha5?

deciple said:
How Do I make an updater.script to flash a zip through recovery that flashes framework, system/apps, data/apps, and bootanimations into CM9 alpha5?
Click to expand...
Click to collapse
Just take an existing script like my KGBlues CM9 theme and make all the right directories and put your files in there. Then remove the files from the theme.
Sent from my SPH-D700 using xda premium

What kenny said unless you want to write your own commands to mount system and have it rewrite what your trying to replace. If you know linux coding its not too hard or if you take a look at someone elses updater..and follow the commands you can edit the ui_print to what ever you want . Id say go look at shanes updater script...cuz his will mount everything unmount and wipe caches...I think.
Sent From My SPH-D700 Running Android 4.0

Ok, I looked at booth of their scripts and what do I add for flashing boot animation.zips? Also do I need yo add anything to write to data/app?
Sent from my SPH-D700 using xda premium

deciple said:
Ok, I looked at booth of their scripts and what do I add for flashing boot animation.zips? Also do I need yo add anything to write to data/app?
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
If the script says anything like rewrite or has "rw" look at it and duplicate but change the directory such as it may say rw /system/app change the last folder to /system/media.
Sent From My SPH-D700 Running Android 4.0
In my updater script this will mount the system and will replace the /system/framework, /system/app, /system/media.
which is usually for themes the framework-res.apk, the systemui.apk, and the bootanimation.zip.
If you want it to replace /data/app then look at the previous commands and edit the directory to delete your desired app and the next command it will extract it and you need to create that folder and place the app and make sure the command is rewritten to that directory. Hope this helps.
For example you want to add XDA.apk then you would do this.
run_program("/sbin/busybox", "mount", "/data");
delete("/data/app/XDA.apk");
package_extract_dir("data", "/data");
run_program("/sbin/busybox","unmount","/data")
Now its correct sorry I forgot /data is where apps are.

That's pretty cool, thanks, that helps big time.
Sent from my SPH-D700 using xda premium

deciple said:
That's pretty cool, thanks, that helps big time.
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
Plus if you use the script from my theme it mounts system already.
Sent from my SPH-D700 using xda premium

kennyglass123 said:
Plus if you use the script from my theme it mounts system already.
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
That's part if this code
It mounts the directory this case being the /data
Sent From My SPH-D700 Running Android 4.0

so if i wanted to rewrite nv/nvm file what woull it look like?how would i start the script?please help,ty

Test
XDA Premium

................
XDA Premium

Related

[REQ] How to make a themed apk flashable through CWM

I have been theming apps and system apps and sticking them in with a theme I downloaded and flashing the whole theme in CWM. Can anyone point me in the right direction to flash just the new apk I themed and flash it over my theme?
Sent from my SPH-D700 using XDA Premium App
Your asking how to make flashable zips right
If so I would like to know how as well
Sent from my SPH-D700 using XDA Premium App
I know a script of some sort is required for this, but my knowlege in this is also limited. I'm learning on what little time I have myself, and this is something that I would need to learn sooner or later as well
Sent from my SPH-D700 using XDA App
gtuansdiamm said:
Your asking how to make flashable zips right
If so I would like to know how as well
Sent from my SPH-D700 using XDA Premium App
Click to expand...
Click to collapse
Here's kinda a cheat method.
You can use a theme or any other cwm3 flashable app.
Open the zip with 7zip
In the root of the zip you will see a folder named META-INF, leave this alone for now.
Next you will need a folder named "system" if you want it to overwrite an existing app, or if you don't want it to be easily over written.
Inside that folder create a folder named "app".
If the is a lib file that goes with it also create a folder named "lib".
Place your apk in the app folder, and .so file in the lib folder if applicable.
Now go to the root of the zip and go to \META-INF\com\google\android\ and extract the update.script (it will probably be set up right, but just in case) and open it with notepad++ or similar app.
Make sure these line are in the script.
Code:
run_program("/sbin/mount", "/dev/block/stl9", "/system");
run_program("/sbin/mount", "/dev/block/stl10", "/data");
run_program("/sbin/mount", "/dev/block/stl11", "/cache");
delete_recursive("/cache");
package_extract_dir("system", "/system");
delete_recursive("/data/dalvik-cache");
This will wipe the cache and dalvik.
I've attached an empty zip
I will give it a try, thanks shane
Sent from my SPH-D700 using XDA Premium App
Seems hard I'll just do what o have been doing all along
Take somebodies zip and change the flies to my own
Sent from my SPH-D700 using xda premium
gtuansdiamm said:
Seems hard I'll just do what o have been doing all along
Take somebodies zip and change the flies to my own
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
You can use that empty one I posted. It has the folders and update.script built in it.
@Shane can pls look at this ported theme I made for EG22 to see if everything is correct?

Make a flashable zip for a system file change

SO I have done some tireless searching but have not found any the answer, So I figured I would give it a shot here.
JonMayer over in the CM7 thread found the solution to the (at least to me) annoying issue of not being able to adjust call volume. The solution in is here http://forum.xda-developers.com/showpost.php?p=20337874&postcount=3914
I was going to try to make a flashable zip for this so it would be a simple fix instead of having to change the system file. Its really just overlaying a file with 2 value changes. but all of the guides i see on making flashable zips are for apk's and themes and such...Can anyone point me in the right direction??
If you pre-edit the file just take a simple zip like my circle battery mod, and using Windows explorer with jzip (should be built in) you open the zip, make the directory structure exactly as listed and put your file where it belongs. It will replace the file on your phone when you flash it.
So in otherwords under system in the zip you will click it, delete the app folder, right click and add new folder usr, then click that and add new folder keylayout, click that and add the file to that.
kennyglass123 said:
If you pre-edit the file just take a simple zip like my circle battery mod, and using Windows explorer with jzip (should be built in) you open the zip, make the directory structure exactly as listed and put your file where it belongs. It will replace the file on your phone when you flash it.
So in otherwords under system in the zip you will click it, delete the app folder, right click and add new folder usr, then click that and add new folder keylayout, click that and add the file to that.
Click to expand...
Click to collapse
Awesome! That's kind of what I was thinking, but want sure. I am going to give it a shot !
Edit: do I have to resign the zip?
Sent from my SPH-D700 using xda premium
adamdelozier said:
Awesome! That's kind of what I was thinking, but want sure. I am going to give it a shot !
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
I make flashables that way all the time. Saves a lot of FC issues.
Just out of curiosity, has anyone seen this/use it? http://forum.xda-developers.com/showthread.php?t=1248486
Sent from my SPH-D700 using xda premium
Ceelos09 said:
Just out of curiosity, has anyone seen this/use it? http://forum.xda-developers.com/showthread.php?t=1248486
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
i will be checking this out tomorrow!
Sent from my SPH-D700 using xda premium
adamdelozier said:
i will be checking this out tomorrow!
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
Give us a report on it Adam.
Sent from my SPH-D700 using XDA App
kennyglass123 said:
Give us a report on it Adam.
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
will do. kind of excited to start checking out the development end of things. but with a 7 week old AND a 7 year old, time its pretty short!
Sent from my SPH-D700 using xda premium
adamdelozier said:
will do. kind of excited to start checking out the development end of things. but with a 7 week old AND a 7 year old, time its pretty short!
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
Family first man! I am happy with my swap method but interested in learning more about the scripts used.
Sent from my SPH-D700 using XDA App
kennyglass123 said:
Give us a report on it Adam.
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
SO, the tool looks good, very simple and gives you both the edify and amend options for the scripter. I think my issue is because I am on CM7 and the files sytsem is MTD, I have not been able to figure out the mountpoint, in order to mount the system folder as R/W. I keep getting status 6 errors and it wont flash. I hjave spent about 2 hours on this this morning and am stumped. I even got the updater script from the CM7 install to see if i could find it there, but all I am seeing is mount ("yaffs2", "MTD", "system", "/system) and that isnt working. The version attached is using the mount script I found here - http://forum.xda-developers.com/showthread.php?t=994940 but in that thread it doesn't show the mount point for the Epic 4G.
Again, all I am trying to accomplish here is to overlay the qwerty.kl file with the one in my zip. having this much trouble with just this small zip, makes me have even MORE appreciation for the ones putting these ROMS together!
I have attached the mess here to see if anyone could take a look and help an aspiring developer out
The mount point for /system on yaffs2 is /dev/block/mtdblock2
So you would do:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock2 /system
And to remount as read only when you're done (not sure its necessary?) Replace the rw with ro:
mount -o ro,remount -t yaffs2 /dev/block/mtdblock2 /system
xBTx said:
The mount point for /system on yaffs2 is /dev/block/mtdblock2
So you would do:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock2 /system
And to remount as read only when you're done (not sure its necessary?) Replace the rw with ro:
mount -o ro,remount -t yaffs2 /dev/block/mtdblock2 /system
Click to expand...
Click to collapse
Awesome!! I will give that a try now.
adamdelozier said:
Awesome!! I will give that a try now.
Click to expand...
Click to collapse
Actually, those are terminal commands. From CWM you can do (so in the updater script):
mount("yaffs2", "MTD", "system", "/system")
And:
unmount("/system")
xBTx said:
Actually, those are terminal commands. From CWM you can do (so in the updater script):
mount("yaffs2", "MTD", "system", "/system")
And:
unmount("/system")
Click to expand...
Click to collapse
I noticed that and was converting it. Thanks again!
Sent from my SPH-D700 using xda premium
adamdelozier said:
I noticed that and was converting it. Thanks again!
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
You're very welcome.
xBTx said:
Actually, those are terminal commands. From CWM you can do (so in the updater script):
mount("yaffs2", "MTD", "system", "/system")
And:
unmount("/system")
Click to expand...
Click to collapse
So I am still getting status 6
Code:
ui_print("Preparing to update");
# mounting system as r/w - ATTENTION - set the the mount point
# to the proper for your device! Example mountr command is
# mounting system for Samsung GT-I5800 aka Galaxy 3
mount("yaffs2", "MTD", "system", "/system");
ui_print("Installing volume control while screen off..");
# copy system content to the system directory on your device
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Done! You may now reboot your phone and enjoy the experience ;-P");
Use notepad++ to save the updater script. See if that helps.
xBTx said:
Use notepad++ to save the updater script. See if that helps.
Click to expand...
Click to collapse
When I do that, it saves it as a text file. Is that OK?
Man, this is some frustrating sh*t! Lol!
Sent from my SPH-D700 using xda premium
adamdelozier said:
When I do that, it saves it as a text file. Is that OK?
Man, this is some frustrating sh*t! Lol!
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
If you open up your zip and drag the updater script to your desktop, right click and hit "Edit with Notepad++" then you can edit it and save it, and it won't add the extension.
xBTx said:
If you open up your zip and drag the updater script to your desktop, right click and hit "Edit with Notepad++" then you can edit it and save it, and it won't add the extension.
Click to expand...
Click to collapse
Its a no go man. No matter what I do, I get a Status 6 error in CWM. I think I quit for now. I have been screwing around with this on and off for 6 hours! Maybe I am just stupid today!!
I was just doing some more digging. Could it be the update-binary that is screwing it up? The files I am using are from a BML zip???
Edit: I guess not...I just took the update-binary from the CM7 ROM package and still getting that stupid status 6...

[Mod] Disable Led Lights

Hi
If you want to disable led lights in bottom of phone, you need only a Root Explorer , go here:
/sys/class/leds/button-backlight
open this file ( brightness ) in text editor and change 1 to 0 , now save the file, it should turn off your led lights.
but it effect untill your phone is on after restart it goes back to defaults.
May be you can make script to apply at boot.
Make a zip that pushes the edited file into the system, perhaps i can make it
Sent from my HTC Sensation
iok1 said:
Make a zip that pushes the edited file into the system, perhaps i can make it
Sent from my HTC Sensation
Click to expand...
Click to collapse
Would be awesome , i can do that too if you'd like
Sent from my GT-S5660 using xda premium
please do that, thanks
i think it is no use.
中国人正在尝试提高!
(translation:Chinese people are trying to improve themselves!)
Thanks! On stock it was very annoying!
useful for at night, when reading with my dimmed screen
how do i edit button-backlights,it just show me a folder and when i opens that folder my root explorer crashes and then force closes.
muzaffarhassan64 said:
how do i edit button-backlights,it just show me a folder and when i opens that folder my root explorer crashes and then force closes.
Click to expand...
Click to collapse
Hold press on it and press edit
Sent from my GT-S5660 using xda premium
Thatgrass said:
Would be awesome , i can do that too if you'd like
Sent from my GT-S5660 using xda premium
Click to expand...
Click to collapse
if you can please do that ,i am waiting for your job.
Taka random meta inf folder and grab the file place it at system/lib
Modify updaterscript
Mount and extract system
Create .zip
test if it works
Done
Sent from my GT-S5660 using xda premium
muzaffarhassan64 said:
how do i edit button-backlights,it just show me a folder and when i opens that folder my root explorer crashes and then force closes.
Click to expand...
Click to collapse
Mine had an error opening it. Copy to SD card edit and out back and it works
Sent from my GT-I9300 using XDA

[GUIDE] ODEX any 4.1.1 JB ROM from official OTA

This will essentially odex all files in your /system/framework and it will do it straight from the Android UI via my personal favorite app ... this is good because it frees up memory, makes UI transitions cleaner, and reduces DVM size.
NOTE: DO NOT TRY TO ODEX YOUR /SYSTEM/APP/ DIRECTORY THEN TRY TO ODEX USING THIS METHOD. YOU WILL HAVE A BAD DAY. 0_o framework must me odexed before system apps
1. download the odex.zip here --> PURPLE
2. extract all files with a file explorer, i prefer root explorer or fx file explorer
3. place the extracted folder and all of it's contents in /data/local/tmp ... so you should have /data/local/tmp/odex/+(misc files in new odex directory)
4. give the new directory and ALL contents FULL permissions - full read, write, and execute perms. You will need to set them all individually. the odex folder, and all contents. your file explorer, if it has taken you this far, should be able to accomplish this. Also, mount your system as writeable as well!
5. download this app TERMINAL EMULATOR dont worry it is free. open the app
Type the following commands - each new line should be executed with the enter key:
su (hit enter, it will ask for root)
/data/local/tmp/odex/odex (hit enter, you will see
you will see a bunch of outputs. there will be a message when it is done (honestly, like 10 seconds if that) saying something like "enjoy your hybrid ROM"
type "reboot recovery" (without the quotes)
device will boot into recovery immediately after you hit enter...
wipe cache and dalvik cache once more each, and reboot your device. PROFIT :good:
*Disclaimer - I don't take donations, just hit the thanks button, and the thanks button for anybody I mention in my thread.
typing su in doesn't request root permission. I am definitely rooted, not sure what's going on.
EDIT: Got it, the su was working but I didn't realize that it might just change from $ to # instead of asking for permission. I also had to grant not just the directory, but all of the files in the odex folder full permission, which might have just been a reading comprehension error on my part. Worked flawlessly after that. On Infamous 2.2
deadpass said:
typing su in doesn't request root permission. I am definitely rooted, not sure what's going on.
EDIT: Got it, the su was working but I didn't realize that it might just change from $ to # instead of asking for permission. I also had to grant not just the directory, but all of the files in the odex folder full permission, which might have just been a reading comprehension error on my part. Worked flawlessly after that. On Infamous 2.2
Click to expand...
Click to collapse
your super user app is probably set by default to allow access. also, i will update the OP to be a little more clear about setting the perms on the directory AND it's contents.
thanks
Forgot to mention that you have to mount your system to writeable.
Sent from my SGH-T999 using xda app-developers app
---------- Post added at 09:32 PM ---------- Previous post was at 09:18 PM ----------
Oh and the old odexme.apk works fine for odexing jb roms.
Sent from my SGH-T999 using xda app-developers app
TarHeelTrigger said:
Forgot to mention that you have to mount your system to writeable.
Sent from my SGH-T999 using xda app-developers app
---------- Post added at 09:32 PM ---------- Previous post was at 09:18 PM ----------
Oh and the old odexme.apk works fine for odexing jb roms.
Sent from my SGH-T999 using xda app-developers app
Click to expand...
Click to collapse
Ah, yes. I need sleep. Lol
So... shouldn't I see "odex" files in /system/app?
So what's the difference between this and the app that does it automaticly?
Sent from my SGH-T999 using xda app-developers app
I'll wait for the app
Sent from my SGH-T999 using xda premium
scifan said:
So... shouldn't I see "odex" files in /system/app?
Click to expand...
Click to collapse
I don't see the .odex files either...
Sent from my SGH-T999
scifan said:
So... shouldn't I see "odex" files in /system/app?
Click to expand...
Click to collapse
Nabeel10 said:
I don't see the .odex files either...
Sent from my SGH-T999
Click to expand...
Click to collapse
This Odex's the files in your /system/framework
NOT /system/app
WarlockW said:
This Odex's the files in your /system/framework
NOT /system/app
Click to expand...
Click to collapse
Ok, that explains a few things... I'd expected the /system/app folder to also be odexed
Think I restored from Nandroid because I couldn't tell what changed....
Sent from my SGH-T999 using Tapatalk 2
scifan said:
So... shouldn't I see "odex" files in /system/app?
Click to expand...
Click to collapse
No, you shouldn't, because this odexes /system/framework/* not /system/app/*.all
Also, please for the love of hot Asian women people... please read the directions carefully in the OP lol...
If you have used the odex me app... don't use this method... if you odex your system apps, THEN try to odex framework after, you will have issues.
cobraboy85 said:
No, you shouldn't, because this odexes /system/framework/* not /system/app/*.all
Also, please for the love of hot Asian women people... please read the directions carefully in the OP lol...
If you have used the odex me app... don't use this method... if you odex your system apps, THEN try to odex framework after, you will have issues.
Click to expand...
Click to collapse
Understood. Don't odex system apps BEFORE odexing framework, but can we odex system apps AFTER odexing /system/framework? Or better yet, is there any reason to odex system apps after odexing /system/framework?
Thanks in advance for your reply!
__McB__ said:
Understood. Don't odex system apps BEFORE odexing framework, but can we odex system apps AFTER odexing /system/framework? Or better yet, is there any reason to odex system apps after odexing /system/framework?
Thanks in advance for your reply!
Click to expand...
Click to collapse
Yes after you odex your framework you can odex system apps.
The main thing about odexing is your apps load faster and it frees up memory in your /data/ partition because you are removing a good chunk of dalvik cache.
Also does improve performance just a tick, by that I mean general UI responsiveness is improved.
Thanks!
just for the sgh3 or would any work like sgh2?
wondering if this would work for the s2 :fingers-crossed:
DAD12345 said:
wondering if this would work for the s2 :fingers-crossed:
Click to expand...
Click to collapse
No it won't.
Boot class path is different.
But if you change that part in the script it will work.
Will this work on all jb roms. Like 4.2 or is it just for s3 4.1?
sent via note 2 in boss mode @ quad core 1.9ghz
Didn't work for me and the dude was so rude that I asked really made me like unfollow him
Sent from my SGH-T989 using xda app-developers app
It didn't really work, and I gave full permissions as well, should I try again?
Sent from my SGH-T999

Stock SystemUI for verizon[SOLVED]

I forgot to backup my systemui and need it back. Can't figure how to get it from Google factory image. I need the factory 4.2.2 odex version. Thanks
Sent from my Galaxy Nexus using xda app-developers app
To get it from the factory image, you need to mount system.img (filesystem aka fs is ext4) to some folder, you'll then be able to see the contents of the /system partition and copy systemui back to the device, setting permissions right.
Sent from my Nexus
I'm kinda lost. Can this be done on phone or windows.
Sent from my Galaxy Nexus using xda app-developers app
I found some ext4 and ext2 programs got it extracted in windows thanks.
Good. Please post the name of the program you used to mount the system.img for future reference, edit the thread title to include [SOLVED], and report the thread for closing. Thanks.
Solved
Here's the link to the thread I used for extracting my system.img.
http://forum.xda-developers.com/showthread.php?t=2294909
Troy

Categories

Resources