[Q] edit build.prop with flashable zip - HTC EVO 3D

im made a flashable zip but i need it to be able to edit some lines in the build.prop and edit a line in /system/customize/mns/default.xml can that be done i seen a zip for the evo 4g that did it but how to on the evo 3d can someone help pls

oakieville said:
im made a flashable zip but i need it to be able to edit some lines in the build.prop and edit a line in /system/customize/mns/default.xml can that be done i seen a zip for the evo 4g that did it but how to on the evo 3d can someone help pls
Click to expand...
Click to collapse
As far as I know, your only real option is to include the edited build.prop/default.xml in your flashable zip. Obviously, this would make your mod ROM (and ROM version) specific, however.
If you can find the evo 4g zip that you're referring to, and link it here, I may be able to figure out how they had done it for you

Its the metrodroid script http://www.uploadking.com/NVX96MXX1R they do it with a .sh file they link to in the updater-script then the .sh runs a .sql file i dont need the .sql part tho

I might be able to help with a workaround flashable, depending on what you're editing in the build prop. What are you trying to edit? Like what lines exactly?

oakieville said:
Its the metrodroid script http://www.uploadking.com/NVX96MXX1R they do it with a .sh file they link to in the updater-script then the .sh runs a .sql file i dont need the .sql part tho
Click to expand...
Click to collapse
The "sed" command used in their script is the stream editor command. From your limited explanation in your OP, it seems like this would be what you'd need. If you want, I could probably make a script for you, but I'd need you to pm me exactly which line(s) need changed/what you're trying to accomplish. I'm at work for the next two and a half hours, but I could maybe get to it after work tonight.
I also may need your entire zip if you want me to set up the updater script too. I'm not incredibly experienced in scripting, but I can fake it till I make it

Vinchenzop said:
The "sed" command used in their script is the stream editor command. From your limited explanation in your OP, it seems like this would be what you'd need. If you want, I could probably make a script for you, but I'd need you to pm me exactly which line(s) need changed/what you're trying to accomplish. I'm at work for the next two and a half hours, but I could maybe get to it after work tonight.
I also may need your entire zip if you want me to set up the updater script too. I'm not incredibly experienced in scripting, but I can fake it till I make it
Click to expand...
Click to collapse
He sent me a PM with all the lines, so let me know if you get one too. I told him of the magic of a local.prop in /data/local and how you can override any line in the build.prop so long as it doesn't begin with ro. Part of it was a default.xml which of course can be edited and then put in the zip - easy. It's the ro (read-only) lines that I can't help with, since I'm no script maker. I told him freeza knew how, since I used a freeza .sh script on my heroc to get bootsound on aosp ROMs. Cool to see people still being helpful around here

I have a flashable zip that will edit anything in the build.prop file. At work till midnight, but I'll shoot it your way in the morning.
Sent from my PG86100 using XDA App

Originally Posted by oakieville
im trying to edit these lines
ro.cdma.home.operator.alpha=sprint
gsm.sim.operator.alpha=sprint
gsm.operator.alpha=sprint
ro.cdma.home.operator.numeric=310120
gsm.sim.operator.numeric=310120
gsm.operator.numeric=310120
ro.product.brand=sprint
ro.product.brand=sprint(YES THERE ARE TWO OF THESE)
and make them this
ro.cdma.home.operator.alpha=MetroPCS
gsm.sim.operator.alpha=MetroPCS
gsm.operator.alpha=MetroPCS
ro.cdma.home.operator.numeric=310027
gsm.sim.operator.numeric=310027
gsm.operator.numeric=310027
ro.product.brand=metropcs
ro.product.brand=metropcs
i also need to edit /system/customize/mns/default.xml
this line
<item name="MMS_Msg_Size_Choose">5M</item>
and make it this
<item name="MMS_Msg_Size_Choose">500k</item>
can you help thanks
Well, for anything in the build prop that DOESN'T start with ro (read only), you can add the lines you want into local.prop in /data/local and it will override the lines in build prop, and since it's in /data it will survive flashovers. You probably need to create the local.prop file.
For the xml you can change those lines in yours and then copy the modded file into a flashable zip.
The duplicate line is unnecessary and you can simply delete it (using an sh).
Unfortunately the only way to modify ro lines in the bp is with the sh method you mentioned and i don't know how to do those. But freeza does, so send a pm to him/her.
Please copy paste this response into the thread so others may benefit from the info.
Peace

il Duce said:
He sent me a PM with all the lines, so let me know if you get one too. I told him of the magic of a local.prop in /data/local and how you can override any line in the build.prop so long as it doesn't begin with ro. Part of it was a default.xml which of course can be edited and then put in the zip - easy. It's the ro (read-only) lines that I can't help with, since I'm no script maker. I told him freeza knew how, since I used a freeza .sh script on my heroc to get bootsound on aosp ROMs. Cool to see people still being helpful around here
Click to expand...
Click to collapse
You know me Luke...always trying to help someone. I'll try to write him the script, then maybe post it here, for others benefit (of knowledge)

unCoRrUpTeD said:
I have a flashable zip that will edit anything in the build.prop file. At work till midnight, but I'll shoot it your way in the morning.
Sent from my PG86100 using XDA App
Click to expand...
Click to collapse
unCoRrUpTeD always ftw

This is a .sh file that is run by the updater-script (in the meta folder) when an update.zip is flashed. It uses a shell script to tell the phone to target the build.prop, find the "to be edited" lines and changes them to the new value. I modded the one that was part of the zip linked earlier in the thread for oak's specific needs
Code:
#!/sbin/sh
mount system
mount data
sed 's/^ro.cdma.home.operator.numeric.*/ro.cdma.home.operator.numeric=310027/g' /system/build.prop > /tmp/build.prop
mv /tmp/build.prop /system/build.prop
sed 's/^ro.cdma.home.operator.alpha.*/ro.cdma.home.operator.alpha=MetroPCS/g' /system/build.prop > /tmp/build.prop
mv /tmp/build.prop /system/build.prop
sed 's/^gsm.sim.operator.alpha.*/gsm.sim.operator.alpha=MetroPCS/g' /system/build.prop > /tmp/build.prop
mv /tmp/build.prop /system/build.prop
sed 's/^gsm.sim.operator.numeric.*/gsm.sim.operator.numeric=310027/g' /system/build.prop > /tmp/build.prop
mv /tmp/build.prop /system/build.prop
sed 's/^gsm.operator.alpha.*/gsm.operator.alpha=MetroPCS/g' /system/build.prop > /tmp/build.prop
mv /tmp/build.prop /system/build.prop
sed 's/^gsm.operator.numeric.*/gsm.operator.numeric=310027/g' /system/build.prop > /tmp/build.prop
mv /tmp/build.prop /system/build.prop
sed 's/^ro.product.brand.*/ro.product.brand=metropcs/g' /system/build.prop > /tmp/build.prop
mv /tmp/build.prop /system/build.prop
The following line needs to be added to the updater-script before the system and data are unmounted (usually one of the last couple of lines in the updater-script), to tell the phone to run the *.sh script.
Code:
run_program("metropcs.sh");
I'll send you the file you need via pm Oakieville
The "sed" command used in the script is the command to edit the stream. It will find the line(s) with the specified target, and change them to reflect the user's desire

There's no need to move the file. Just take that line out and remove all the > tmp/build.prop. It will just edit the build.prop
Sent from my PG86100 using XDA App

unCoRrUpTeD said:
There's no need to move the file. Just take that line out and remove all the > tmp/build.prop. It will just edit the build.prop
Sent from my PG86100 using XDA App
Click to expand...
Click to collapse
Can you still upload your generic script tonight though? Hoping to use it myself

unCoRrUpTeD said:
There's no need to move the file. Just take that line out and remove all the > tmp/build.prop. It will just edit the build.prop
Sent from my PG86100 using XDA App
Click to expand...
Click to collapse
Thanks for the tip man. I'm not extremely experienced in scripting. Like I said in a previous post, I just edited a file that was linked earlier in the post to include the "ro.product.brand". Since the first part was done including the move and the > tmp/build.prop setup, I just left it all the same for uniformity and figured it may be easier for inexperienced users to understand what the script is doing, since it more or less explains itself.
Does it look correct though uncorrupt? I don't want to give oak a bad file

And uncorrupted, are you referring to just do it this way?
Code:
#!/sbin/sh
mount system
mount data
sed 's/^ro.cdma.home.operator.numeric.*/ro.cdma.home.operator.numeric=310027/g' /system/build.prop
sed 's/^ro.cdma.home.operator.alpha.*/ro.cdma.home.operator.alpha=MetroPCS/g' /system/build.prop
sed 's/^gsm.sim.operator.alpha.*/gsm.sim.operator.alpha=MetroPCS/g' /system/build.prop
sed 's/^gsm.sim.operator.numeric.*/gsm.sim.operator.numeric=310027/g' /system/build.prop
sed 's/^gsm.operator.alpha.*/gsm.operator.alpha=MetroPCS/g' /system/build.prop
sed 's/^gsm.operator.numeric.*/gsm.operator.numeric=310027/g' /system/build.prop
sed 's/^ro.product.brand.*/ro.product.brand=metropcs/g' /system/build.prop

After relooking at the file, I noticed a few errors in the script...
first...
Code:
#!/sbin/sh
This line was changed to
Code:
#!/bin/sh
since "sh" is located in /system/bin not "sbin"
Removed the mount system and mount data, since the updater script will already do this.
Upon advice of uncorrupted and viper, removed the
Code:
> /tmp/build.prop
mv /tmp/build.prop /system/build.prop
. Viper says using that line would actually wipe the build prop every time it appears in the script.

i tried it with the second file vinchenzop sent and it still dont work this is my update-script
ui_print("*************************************************");
ui_print("* *");
ui_print("* *");
ui_print("* HTC EVO 3D *");
ui_print("* METROPCS MMS FIX *");
ui_print("* 2.08.651.2 *");
ui_print("* by -OAKIEVILLE * *");
ui_print("* *");
ui_print("* *");
ui_print("*************************************************");
show_progress(1.000000, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/data");
ui_print("Metroizing system...");
delete("/system/app/mms.apk");
delete("/system/app/mms.odex");
delete("/system/app/Mms.apk");
delete("/system/app/Mms.odex");
delete("/system/app/MMS.apk");
delete("/system/app/MMS.odex");
package_extract_dir("system", "/system");
ui_print("done...");
ui_print("Metroizing data...");
delete("/data/data/com.android.providers.telephony/databases/telephony.db");
delete_recursive ("/data/data/com.android.mms");
delete("/data/dalvik-cache/[email protected]@[email protected]");
delete("/data/dalvik-cache/[email protected]@[email protected]");
delete("/data/dalvik-cache/[email protected]@[email protected]");
package_extract_dir("data", "/data");
run_program("metropcs.sh");
unmount("/system");
unmount("/data");
ui_print("done...");
ui_print("*************************************************");
ui_print("* *");
ui_print("* *");
ui_print("* u've been Metroized *");
ui_print("* oakieville style *");
ui_print("* E.S.O.V *");
ui_print("* *");
ui_print("* *");
ui_print("* *");
ui_print("*************************************************");
set_progress(1.000000);
do you see anything wrong there
also you guy are awesome for all this help

What folder is metropcs.sh in. You have to extract the file. I would extract it to /tmp and then chmod it and then run /tmp/metropcs.sh
I'll try and upload my script tonight if I can locate it tonight. Been through a couple if computers and hard drives, but I should have at least one online, too.
Sent from my PG86100 using XDA App

unCoRrUpTeD said:
What folder is metropcs.sh in. You have to extract the file. I would extract it to /tmp and then chmod it and then run /tmp/metropcs.sh
I'll try and upload my script tonight if I can locate it tonight. Been through a couple if computers and hard drives, but I should have at least one online, too.
Sent from my PG86100 using XDA App
Click to expand...
Click to collapse
Metropcs.sh is on the root of my zip

FIRST: The location of shell in recovery should be /sbin/sh. But when you are booted into the ROM it will be /system/bin/sh. Recovery and the ROM are 2 seperate partitions and setup.
SECOND: The script linked WILL NOT add the lines you want if it doesn't exist in the build.prop to begin with.
I removed some things from this as it was used for something else. I haven't tested it but all I did was remove some extra things that were in it and renamed some things.
First thing to note is that in the updater-script you need to extract the files. We will get to that in a second. There are 2 files that are used. Create a folder inside the zip called tmp. Inside the tmp folder should be 2 files. The first one is called mytweaks.sh and the second one is called misc.
mytweaks.sh
Code:
#!/sbin/sh
bp="/system/build.prop"
busybox mount /system
busybox mount /data
if [ -f /system/build.prop.bak ];
then
rm -rf $bp
cp $bp.bak $bp
else
cp $bp $bp.bak
fi
echo " " >> $bp
echo "# unCoRrUpTeD build.prop editor" >> $bp
echo " " >> $bp
for mod in misc;
do
for prop in `cat /tmp/$mod`;do
export newprop=$(echo ${prop} | cut -d '=' -f1)
sed -i "/${newprop}/d" /system/build.prop
echo $prop >> /system/build.prop
done
done
misc
Code:
dalvik.vm.startheapsize=24m
windowsmgr.max_events_per_sec=60
ro.product.multi_touch_enabled=true
ro.product.max_num_touch=2
keyguard.no_require_sim=true
debug.sf.hw=1
ro.opengles.version=131072
ro.default_usb_mode=2
ro.qualcomm.proprietary_obex=false
ro.display.width=320
ro.display.height=960
ro.telephony.call_ring.delay=1000
ro.mot.eri.losalert.delay=1000
There should be no reason to mess with mytweaks.sh unless "#!/sbin/sh" needs to be changed.
Inside the misc file you can delete what I have posted and add the lines you want to add or modify in the build.prop. Make sure that each setting is on it's own line.
The script should run through each line and if it found a line that has the same text before the "=" it will remove that line and then add the contents of misc to the bottom of the build.prop file. This way, even if the line is not present in the build.prop it will still be added.
Now back to the updater script. You will need to extract the tmp folder so that you can access the files. Add the following lines in the updater-script
updater-script
Code:
package_extract_dir("tmp", "/tmp");
set_perm(0, 0, 0777, "/tmp/mytweaks.sh");
run_program("/tmp/mytweaks.sh", "mytweak");
Attached is the zip with everything setup.
The script also creates a backup of the original build.prop in /system/build.prop.bak just in case there is a problem.

Related

My update for AIO Automatic Installation Script

Hello, Im useing this script http://forum.xda-developers.com/showthread.php?t=951274 to install JIT, DualTouch, etc.
I have some update for .sh script.
In JIT installation part:
Code:
echo "Backing up build.prob file"
busybox cp -f /system/build.prop /system/build.prop.stock
echo "Copying build.prop to /system/"
busybox cp -f data/jit/build.prop /system/build.prop
Here script rename system build.prop file to build.prop.stock and copy new build.prop from script folder to system.
And in JIT deinstallation part:
Code:
echo "Copying libraries and build.prop to /system/"
...
busybox cp -f data/jit/disable/build.prop /system/build.prop
And here script copy new build.prop from script folder to system.
BUT!
In deinstallation we need to get back our stock build.prop what was renamed in installation part!
So, i suggest to change
Code:
busybox cp -f data/jit/disable/build.prop /system/build.prop
to
Code:
busybox mv -f system/build.prop.stock system/build.prop
to rename build.prop.stock to build.prop.
And why did we copy/past this build.prop files? Why we cant copy stock build.prop and edit it this way:
Code:
echo "#DEVICE_PROVISIONED=1" >> /system/build.prop
echo "dalvik.vm.heapsize=30m" >> /system/build.prop
echo "#kernel.log=default" >> /system/build.prop
echo "dalvik.vm.execution-mode=int:jit" >> /system/build.prop
What do you think?
And sorry, I cant post this to Development forum because I have < 10 posts.
Iam searching in Google for help and so i find your Post here.
Maybe u can help me a bit.
I have a GalaxyNexus.
I have a Build.prop with and one without Tablet Mode.
I like to use sometimes TabletMode and sometimes not.
I think with a Script like u use here i can change what build.prop to use.
Lets say i have the "build.prop" with TabletMode and a "build.prop.stock" without that Mode.
How can i make it possible to activate the .stock and dissable the TabletMode. And then again the other way arround. ???

[TUT] adding shell script to your rom

I understood how it do it so I'm posting here for people like me who search this forum for the same reason, first you just have to add the shell script which you want to execute, in your Rom . Add it where meta-inf and system folders are present i.e, the root of the Rom folder . Then you just have to add few lines to the updater-script to run the shell script just once while just flashing the Rom . For example to run a shell script called autoroot.sh only once while flashing the Rom , the lines to be added to the updater-script are,
#this line copies the shell script from the Rom's zip package to the temporary directory in the phone
package_extract_file("autoroot.sh", "/tmp/autoroot.sh");
#setting permission for the shell script to execute it . 777 permission is set to avoid any discrepancy while executing the script. The script will get deleted automatically on next boot as it it placed in the temporary folder.
set_perm(0, 0, 0777, "/tmp/autoroot.sh");
#the script is being executed by issuing the following command in the updater-script.
run_program("/tmp/autoroot.sh");
#to make sure that the script was executed properly you can add a line in the shell script at last , to create a file and display few text in it which you want. By this way you can understand if there is a file created at the directory defined in the script then the script ran perfectly otherwise the script didn't get executed as expected. For example,
echo "autoroot.sh was executed successfully" >> /data/local/tmp/autorootlog.txt
#here the autorootlog.txt file will be created and inside that autoroot.sh was executed successfully will be displayed.
REMEMBER THE ABOVE LINE HAS TO BE INSERTED IN THE SHELL SCRIPT ITSELF ALL THE OTHER LINES HAS TO BE ADDED TO THE UPDATER-SCRIPT WHICH IS PRESENT IN META-INF FOLDER .
Always edit the updater-script as well as shell scripts using notepad++ and keep the eol conversion to Unix format and save . (eol conversion can be found in the edit menu of notepad ++) always add a empty line at the end of scripts and updater-script .
I'm just a noob trying to learn something about linux and android . Just post your questions here. I'll answer if I have the proper knowledge about it.
Thanks for spending your valuable time in reading my post
Sent from my smultron using xda app-developers app

[TUT] [for NOOB] editing updater-script for noobs!

Hi friends of XDA,
I created this tutorial especially for noobs who would like to know how the clockworkmod uses the .zip
file and what and all goes into the process of flashing a .zip file and mainly about the format and syntax used in updater-script.
first is first!
#include
/*
* I am not responsible for bricked devices, dead SD cards or
* thermonuclear war.
* do some research if you have any concerns.
* YOU are choosing to make these modifications.
* yes, i copied this disclaimer from FXP because it is cool and i am lazy!
*/
now what is the updater-script and update-binary present in the META-INF>com>google>android in any flashable zip package?
1. updater-script - it is just a text file which contains all the commands which tells the clockworkmod what to do with the given
zip file. the updater-script is written in the edify scripting language.
2. update-binary - it is a binary which is requiered by the clockworkmod to translate the human readable format of the updater-
script to machine readable format for execution of the updater-script in our device.
exploring the updater-script:
now let's start exploring the updater-script !
1. open the updater script with notepad++ (strongly recommended)
2. now i will try and explain commands generally used in the updater-script,
assert(getprop("ro.product.device") == "ST15i" || getprop("ro.build.product") == "ST15i" ||
getprop("ro.product.device") == "ST15a" || getprop("ro.build.product") == "ST15a" ||
getprop("ro.product.device") == "smultron" || getprop("ro.build.product") == "smultron");
the above bunch of lines checks the device model to confirm that the zip file is flashed on the device
for which it is specifically created for. These bunch of lines are very important because it prevents
flashing of zip file which is not intended for the device hence avoiding any problems due to flashing
the wrong zip. for example the above lines checks for the value of "ro.product.device" and
"ro.build.product"in the build.prop file of the already existing rom in the device, if any of the three
defined values ST15i, ST15a, smultron are found it will continue with the next line of updater-script
otherwise flashing gets aborted with error in getprop.
format("yaffs2", "MTD", "system", "/system");
the above command explains itself, it is used to format the specified partition
syntax explanation:
format - the main command to direct the cwm to format using the following parameters
"yaffs2" - filesystem type used in the device
"MTD" - type of the partition used in the file system
"system" - name of the partition to be formatted
"/system" - location of the partition to be formatted
ui_print("Format Completed");
the above command is also self explanatory, it directs the cwm to display the following text
enclosed in double quotes in the user interface (display).
after succesful formatting it displays "Format Completed" in the device screen.
mount("yaffs2", "MTD", "system", "/system");
the mount command directs the cwm to mount the following file system and the following partition
the syntax is just as explained in the format command except that this command mounts the
defined partition whereas the format command formats the defined partition.
let's review what we have done till now,
1. we have checked the device to confirm that this is the device for which we created the zip.
2. we have formatted the system partition of the device.(this is only done when a new complete rom is being flashed, for flashing mods you
should never format the system partition!)
3. we have mounted the system partition of the device.
now let's continue,
package_extract_dir("system", "/system");
this command searches for the directory (folder) named "system" in the root of the zip file and
copies all the content of the "system" folder from the zip file into the "/system" partition
which is already mounted by the previous mount command.
remember the structure of the file system in the zip file and the "/system" partition of the device must be always identical.
for eg., you have created a mod by editing the systemUI.apk and you want to flash it, the system UI.apk resides in "/system/app"
so the structure of the file system in the update zip should be "/system/app/systemUI.apk"
ie., the update zip should contain folder named "system" at the root of it and folder named "app" inside the "system" folder and the
modded "systemUI.apk" must be placed inside the "app" folder.
package_extract_file("autoroot.sh", "/tmp/autoroot.sh");
this command searches for the file named "autoroot.sh" in the root of the zip file and
copies the file to "/tmp" folder and names it as "autoroot.sh" (here it does not change the name)
symlink("mksh", "/system/bin/sh");
the above command creates a symlink.
okay, now let's see about symlinks,
symlink is nothing but shortcuts, for example if a file is requiered in two different places instead of copy pasting the file
in two different locations, the file is copied to one of the two locations and in the other location a shortcut to the file(symlink)
is created. the source and the symlink can have different names (actually this is the prime use of symlinks).
to explain in a noob friendly manner,
take the above symlink, it creates a shortcut(symlink) for the command "mksh" and places it in the path of the operating system.
the shortcut(symlink) directs to the file "/system/bin/sh" , so whenever the os gets a request to execute the "mksh" command, the actual
binary that gets excuted will be "/system/bin/sh" .
creating symlinks saves a lot of space because instead of copying the whole file and placing it in requiered places we are just
creating shortcuts which directs to the source file which can be placed anywhere in the file system (generally placed in the path of the os).
set_perm_recursive(0, 0, 0755, 0644, "/system");
the above command is used to set permission recursively for the files and folders present inside a folder (in this case for "/system" folder).
syntax explanation:
0 - uid - it defines that the following permission is set for the user id 0 .
0 - gid - it defines that the following permission is set for the group id 0 .
0775 - dirmode - it defines that 0775 permission to set to directories contained within the specified directory.
0644 - filemode - it defines that 0644 permission to set to files contained within the specified directory.
"/system" - target directory to set the above mentioned permissions.
set_perm(0, 3003, 06755, "/system/bin/ip");
the above command is used to set permission for a individual file (in this case for "/system/bin/ip" file).
syntax explanation:
0 - uid - it defines that the following permission is set for the user id 0 .
3003 - gid - it defines that the following permission is set for the group id 3003 .
06775 - it defines that 06775 permission to set to the specific file.
"/system/bin/ip" - target file to set the above mentioned permissions.
run_program("/tmp/autoroot.sh");
remember the file autoroot.sh from package_extract_file command?
that file is supposed to be a shell script, the above command directs cwm to execute the "autoroot.sh" shell script present in "/tmp" folder.
unmount("/system");
the unmount command directs the cwm to unmount the following partition
the syntax is just as explained in the mount command except that this command unmounts the
defined partition whereas the mount command mounts the defined partition.
Okay now going into slightly complex and/or not widely used updater-script commands,
Ifelse
Syntax:
Ifelse(condition),(do_this),(else_do_this);
Example:
ifelse mount("yaffs2", "MTD", "system", "/system") == "system", ui_print("Mounted!"), ui_print("Mount Failed!");
Ifelse command can be explained simply as asking the system to do something based on the result of a condition.
From the example:
The ifelse command would attempt to mount the MTD partition named "system" to "/system".
If the mounting process succeeds (the condition), the script will display "Mounted!", else it will display "Mount Failed!"
abort()
It just abort's the script execution
Note: it is usually paired with some other command for example the getprop command or with ifelse.
Independently specifying abort() in the updater-script will kill the script abruptly right there so use this command carefully.
ALWAYS LEAVE A BLANK LINE AT THE END OF THE update-script (if the code contains 50 lines then 51 lines should be visible
in the notepad++ including a blank line after the end of the script)
ALWAYS REMEMBER TO SET THE EOL (end of line) CONVERSION OF updater-script
IN UNIX FORMAT BEFORE SAVING (notepad++ > edit > EOL conversion > UNIX format)
the above mentioned commands are just basic edify scripting commands which are generally used in updater-script.
for detailed scripting and coding in edify scripting language check out the following sources:
source of update-binary
introdution to edify
http://forum.xda-developers.com/wiki/Edify_script_language
scratchpad-documenting-edify-commands-for-android-updater-scritps
http://forum.xda-developers.com/showthread.php?t=1290062
HIT THANKS IF I HAVE HELPED YOU!
Nice tut bro
bandarigoda123 said:
Nice tut bro
Click to expand...
Click to collapse
thanks friend
Great piece of work buddy.... :good:
This is good for me:beer:
Sent from my HTC EVO 3D X515m using xda app-developers app
What l must to change here? I got error 7
Sent from my HTC EVO 3D X515m using xda app-developers app
analoncarkg said:
What l must to change here? I got error 7
Sent from my HTC EVO 3D X515m using xda app-developers app
Click to expand...
Click to collapse
Have you set the eol conversion to Unix format as described?
Have you left a blank line as described?
Make sure that Cyanogenmod Rom is for your device. Then try flashing again.
If the above mentioned steps fails and you still get a status 7 error or assert failed error then make SURE that the Rom is really specific for your device and remove the first three lines from the script
Remove lines starting From "assert" to "smultron");
Make sure that after removing the above specified three lines there is no blank line at the start of the script And flash again
Usually status 7 errors are due to bad formatting of the updater-script or in rare cases it is due to corrupted or incomplete download of the Rom.
hit thanks if I've helped!
sent from my smultron
here are some more commands if you like:
sleep();
show_progress(1.0, "1000"); more on this here: http://forum.xda-developers.com/showthread.php?t=1290062
if/ then/ endif; syntax
iONEx said:
here are some more commands if you like:
sleep();
show_progress(1.0, "1000"); more on this here: http://forum.xda-developers.com/showthread.php?t=1290062
if/ then/ endif; syntax
Click to expand...
Click to collapse
Thanks iONEX I knew them before but didn't add sleep and show_progress because they are just mere cosmetic changes and don't serve any serious purpose anyways I'll add them after understanding and testing
And about if/then/endif/ifelse , generally they are used rarely in updater-script but I'll add them anyways after understanding testing!
Thanks!
hit thanks if I've helped!
sent from my smultron
If anyone is interested in the source of the update-binary, I've added the link to it in the first post
hit thanks if I've helped!
sent from my smultron
Hello! How exactly should I write in the updater-script if I need to make the system folder rewriteable and then delete the existing framework-res.apk from system/framework and then copy a new framework-res.apk from the .zip file, then change the permissions of it and finally make the system folder write-only again?
My "idea" is something like this:
1. Content of the updater-script:
ui_print("Please wait...");
mount("MTD", "system", "/system");
delete("/system/framework/framework-res.apk");
package_extract_dir("system", "/system");
set_perm(0, 0, 04755, "/system/framework/framework-res.apk");
ui_print("Done");
unmount("/system");
2. Make a signed .zip file that would contain:
- system\framework\framework-res.apk
- META-INF\com\google\android\updater-script
3. Run the .zip from memory card via recovery
Would it work like this?
Note: My phone is bricked because of framework-res.apk and USB debugging is off, so this is the only way I could unbrick it.
You must have a unmodified updater-script in your meta-inf folder right?? Paste the "mount" command syntax here. It must be in the first few lines.
#pitchblack5691#
Actually I don't. I have to create it from scratch.
No. . . You need a meta-inf folder to work with which contains the signature files and a update-binary to create a flashable zip.
#pitchblack5691#
I only created those folders and an updater-script file and then I packed it & signed it using Update Zip Packager 3.0. The only update-binary file that I have is the one that's included with Update Zip Packager.
Code:
mount("MTD", "system", "/system");
ui_print("started. . . .");
delete("/system/framework/framework-res.apk");
package_extract_dir("system", "/system");
set_perm(0, 0, 0644, "/system/framework/framework-res.apk");
unmount("/system");
ui_print("finished");
This should work and you need a meta-inf folder extracted from some flashable zip. You can't create a meta-inf folder from scratch without using signature files and update-binary.
EDIT: what you said above will work. You either should have a meta-inf folder with signature files or a signing software.
And you don't have to give 755 permissions to an app because even though they are apps, technically they are not executed and only read from so no need for 755 permission. 644 permission should suffice and it's the default permission for a system app. . . 755 permissions is only useful for executable binaries and scripts.
#pitchblack5691#
I've just tried it. It returns this error:
...
Installing update...
E:Error in /tmp/sideload/package.zip
(Status 2)
Installation aborted.
E:Can't find misc
What does it mean please?
What code exactly you are using in the updater-script?? Paste the full code and paste the name of files present in the zip file in a hierarchical order.
#pitchblack5691#
The .zip contains these files:
Code:
META-INF\CERT.RSA
META-INF\CERT.SF
META-INF\MANIFEST.MF
META-INF\com\google\android\update-binary
META-INF\com\google\android\updater-script
system\framework\framework-res.apk
The code of updater-script:
Code:
mount("MTD", "system", "/system");
ui_print("started. . . .");
delete("/system/framework/framework-res.apk");
package_extract_dir("system", "/system");
set_perm(0, 0, 0644, "/system/framework/framework-res.apk");
unmount("/system");
ui_print("finished");
Bootloader unlocked?? Custom kernel?? Or installed cwm in a bootloader locked phone??? Looks like your cwm is not working properly. . .
#pitchblack5691#

[Q] scripts for change build.prop

hi
i need a script for edit build.prop
i want a script that change lines and add them if they don't exist
http://forum.xda-developers.com/showpost.php?p=19093919&postcount=20
http://forum.xda-developers.com/showpost.php?p=25977898&postcount=15
but i can't understand why they don't work
i find this way and this works good with gscript but not work from cwm
simple sed method:
Code:
#!/bin/bash
sed -i '/linetobereplaced/c\replacedline.' /system/build.prop
please help

[GUIDE][VRTheme-MOD][How-To] Make your TW VR-Theme flash on 4.4 and 4.3 from one zip

Android Version Check for Touch Wiz VR-Theme Install on 4.4 & 4.3 Based Roms
As you may know, since Android has updated to 4.4 KK, some files have been moved to new folders and file names have been changed making it a pain to install your old TW 4.3 VR-Theme on a 4.4 Rom. The main change I've seen is the addition of System/Priv-App. I'm going to show you how to make a script to put into your updater-script to check which version of Android the user is running, and how to modify the files so that it will install either, the files for a 4.4 based rom theme, or a 4.3 and earlier based rom theme all from the same zip. This essentially requires a 4.4 theme and your original 4.3 theme but will auto detect which one needs flashed. It will not convert your 4.3 to a 4.4 theme.
The files we will need to alter are:
Updater-script
VRtheme Folder itself (will be duplicated and one renamed)
Installtheme.sh (located inside VRTheme folder will also be renamed and modified in the duplicated folder)
System and Data apps (If your using them, will need to be duplicated and renamed)
Let's get started!
You can do these in any order but I'll go through it the way it all played out in my brain!
First, In the 4.4 VRtheme zip, I modified the updater script-located in META-INF/com/google/android/updater-script
by adding a Rom detection code just after the "mount" process, see RED text
If the user is running a 4.4 Rom the code will skip down to the bottom and install the theme files for 4.4, See the bottom Red text
None of these files need to be changed as long as you set up the original VRtheme folders to install the 4.4 theme. Just add your themed files into the folders as normal and it will flash
*IF* the code detects user is not running 4.4 (setup to work with anything other than 4.4 at this time so it will flash to 4.3,4.2 etc.)
It will complete the ifelse statement with what you instruct it to do. Which, in this case, we tell it to extract and install vrtheme4.3 and the installtheme4.3.sh which are the duplicated and renamed VRtheme folder and installtheme.sh file. See Blue Text
Code:
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/dalvik");
[COLOR="Red"]ui_print(" Version Check For Theme Install");
ui_print(" By DroidMissionary");
ui_print("");
ui_print(" Checking Android Version");
# Check build version so we know which theme package to install 4.4 or earlier
ifelse(
is_substring("4.4", file_getprop("/system/build.prop","ro.build.version.release")),
(
ui_print(" Android 4.4 ROM detected");
ui_print(" Applying 4.4 Theme");
ui_print(" ");
),[/COLOR]
[COLOR="Blue"] (
ui_print(" *** Pre 4.4 Rom Detected ***");
ui_print(" ");
ui_print(" Applying 4.3 and Earlier Theme");
ui_print(" ");
ui_print(" Theming In Process");
ui_print(" ");
package_extract_dir("vrtheme4.3", "/sdcard/vrtheme4.3");
set_perm(0, 0, 0755, "/sdcard/vrtheme4.3/installtheme4.3.sh");
set_perm(0, 0, 0755, "/sdcard/vrtheme4.3/zip");
set_perm(0, 0, 0755, "/sdcard/vrtheme4.3/cleanup.sh");
set_perm(0, 0, 0755, "/sdcard/vrtheme4.3/zipalign");
run_program("/sdcard/vrtheme4.3/installtheme4.3.sh");
run_program("/sdcard/vrtheme4.3/cleanup.sh");
[COLOR="DarkOrange"]package_extract_dir("system4.3", "/system");[/COLOR]
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/busybox", "umount", "/dalvik");
run_program("/sbin/busybox", "umount", "/sdcard");
)
);
[/COLOR]
[COLOR="Red"]package_extract_dir("vrtheme", "/sdcard/vrtheme");
set_perm(0, 0, 0755, "/sdcard/vrtheme/installtheme.sh");
set_perm(0, 0, 0755, "/sdcard/vrtheme/zip");
set_perm(0, 0, 0755, "/sdcard/vrtheme/cleanup.sh");
set_perm(0, 0, 0755, "/sdcard/vrtheme/zipalign");
run_program("/sdcard/vrtheme/installtheme.sh");
run_program("/sdcard/vrtheme/cleanup.sh");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
ui_print("Additional files copied");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/busybox", "umount", "/dalvik");
run_program("/sbin/busybox", "umount", "/sdcard");
ui_print("Thanks for using VillainTheme Flasher");[/COLOR]
Second, I opened the 4.3/4.2 Theme and renamed the VRTheme folder to VRtheme4.3.
Do this also for the system and data folders if you are using them, in this case only system was used so I renamed it to system4.3
The modified system folder is called out in the Blue section above. See orange text ABOVE for the 4.3 system folder call out.
After you have them renamed, add them into you main zip file with the original VTtheme folders that contain the 4.4 theme.
This will keep them separated and allow you to call them out individually in the install-script and installtheme.sh
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
From here, I opened VrTheme4.3 folder and renamed installtheme.sh to installtheme4.3.sh. This way I would know which one it's for
Now that it is renamed, we need to go in and modify sections of the installtheme.sh that call out for the VRTheme folder. Since this is for the 4.3 theme, we will locate these call outs and simply add 4.3 to the end of VRTheme through-out the file. See Green Text for modified names
Code:
#!/sbin/sh
# Copyright VillainROM 2011. All Rights Reserved
# cleanup from last time
[ -d /sdcard/vrtheme-backup ] && rm -r /sdcard/vrtheme-backup
# we need to first go through each file in the "app" folder, and for each one present, apply the modified theme to the APK
# let us copy each original APK here first.
echo "Processing /system/app/"
busybox mkdir -p /sdcard/vrtheme-backup/system/app
busybox mkdir -p /sdcard/[COLOR="Green"]vrtheme4.3[/COLOR]/apply/system/app
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/system/app/
for f in $(ls)
do
echo "Processing $f"
cp /system/app/$f /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/app/
cp /system/app/$f /sdcard/vrtheme-backup/system/app/
done
echo "Backups done for system apps"
# repeat for /system/framework now
[ -d /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/system/framework ] && framework=1 || framework=0
if [ "$framework" -eq "1" ]; then
echo "Processing /system/framework"
busybox mkdir -p /sdcard/vrtheme-backup/system/framework
busybox mkdir -p /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/framework
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/system/framework
for f in $(ls)
do
echo "Processing $f"
cp /system/framework/$f /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/framework/
cp /system/framework/$f /sdcard/vrtheme-backup/system/framework/
done
echo "Backups done for frameworks"
fi
# repeat for /data/app now
[ -d /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/data ] && dataapps=1 || dataapps=0
if [ "$dataapps" -eq "1" ]; then
echo "Processing /data/app/"
busybox mkdir -p /sdcard/vrtheme-backup/data/app
busybox mkdir -p /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/data/app
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/data/app/
for f in $(ls)
do
echo "Processing $f"
cp /data/app/$f /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/data/app/
cp /data/app/$f /sdcard/vrtheme-backup/data/app/
done
echo "Backups done for data apps"
fi
# for each of the system apps needing processed
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/app/
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/system/app/$f/
/sdcard/[COLOR="Green"]vrtheme4.3[/COLOR]/zip -r /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/app/$f *
done
echo "Patched system files"
if [ "$dataapps" -eq "1" ]; then
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/data/app/
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/data/app/$f/
/sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/zip -r /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/data/app/$f *
done
echo "Patched data files"
fi
if [ "$framework" -eq "1" ]; then
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/framework
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/system/framework/$f/
/sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/zip -r /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/framework/$f *
done
echo "Patched framework files"
fi
# and now time to zipalign
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/app/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/zipalign -f 4 $f ./aligned/$f
done
if [ "$dataapps" -eq "1" ]; then
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/data/app/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/zipalign -f 4 $f ./aligned/$f
done
fi
if [ "$framework" -eq "1" ]; then
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/framework/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/zipalign -f 4 $f ./aligned/$f
done
fi
# time to now move each new app back to its original location
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/app/aligned/
cp * /system/app/
chmod 644 /system/app/*
if [ "$dataapps" -eq "1" ]; then
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/data/app/aligned/
cp * /data/app/
chmod 644 /data/app/*
fi
if [ "$framework" -eq "1" ]; then
cd /sdcard/[COLOR="green"]vrtheme4.3[/COLOR]/apply/system/framework/aligned/
cp * /system/framework/
chmod 644 /system/framework/*
fi
# Do not remove the credits from this, it's called being a douche
echo "VillainTheme is done"
# we are all done now
That is it! After you have the 4.3 folders in place, renamed, and the install script/installtheme.sh calling out the correct folders, you are ready to flash!
Feel free to use any of my script in your theme zips, please just give credit and leave thanks​
Problems I ran into myself
The theme failed to install immediately upon starting to flash: My file was breaking when I unzipped the original, modified the files, and then re-zipped for some reason, to correct it, I modified the files then opened the original zip with 7zip file manager without un-zipping it, and pushed my files into the original zip overwriting the original. This allowed the original to flash with my modified files. It was acting like an improper signature on a decompiled/compiled apk.
Theme claimed it had installed but went quickly through the process and nothing installed:I need to modify the installtheme.sh to call out the proper 4.3 folders
I'd Like to give thanks to firstly, the most important factor @RockRatt
He allowed me to use his 4.4 theme template to build this Mod and is currently Helping me get my start in theming
All the Rom Devs
VRtheme system for the theme system of course
and
The XDA-Community
**Notes**
I am new to programming/ theming, really everything besides reading and replying to posts.
If you see an error or have a way to clean up or make things better please let me know, I'm always looking to improve​
Generic theme zip containing the Updater-script and Installtheme.sh - This theme zip is not however fully setup for installing on multiple platforms so just pull the two files and build your theme as shown in this post.
https://www.dropbox.com/s/ico5e9ouh15cu0d/MissionaryThemeScripts.zip
If anyone has ideas for other scripts, let me know and I'll work with you to make it happen
Great job and Thanks for working this out for me so I didn't have to post two different zips for each theme. I just posted up the full 4.2/4.3--4.4.2 vr theme for a test on my thread. Hopefully I will get a few testers. Again Great job and Thank you
Sent From My Spiderman,Ironman,Red,Dark Blue,Green, GreyedOut BadAss Themed I337
RockRatt said:
Great job and Thanks for working this out for me so I didn't have to post two different zips for each theme. I just posted up the full 4.2/4.3--4.4.2 vr theme for a test on my thread. Hopefully I will get a few testers. Again Great job and Thank you
Sent From My Spiderman,Ironman,Red,Dark Blue,Green, GreyedOut BadAss Themed I337
Click to expand...
Click to collapse
No problem buddy! I'll head over and grab a zip and test it out for ya, Thanks again for everything.
Well done!
Just saved me a ton of time..
:laugh:
Very interesting. I'm in the process of converting 4.3 to 4.4.2 themes. I will give your method a spin....
Nice work bro.
Haters Make Me Famous
Deviant Team Member
The Sickness said:
Very interesting. I'm in the process of converting 4.3 to 4.4.2 themes. I will give your method a spin....
Nice work bro.
Haters Make Me Famous
Deviant Team Member
Click to expand...
Click to collapse
Thanks man, it just pulls from the two different locations in the zip automatically depending on which version it detects so keep your 4.3 folder the same and add a 4.4 folder with all the renamed images etc. And just change the folder names in the updater-script to match your folder names. The script is for the community so use at your leisure, just give me a shout out :thumbup:
Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
ghostshel said:
Well done!
Just saved me a ton of time..
:laugh:
Click to expand...
Click to collapse
The Sickness said:
Very interesting. I'm in the process of converting 4.3 to 4.4.2 themes. I will give your method a spin....
Nice work bro.
Haters Make Me Famous
Deviant Team Member
Click to expand...
Click to collapse
Would either of you like me to send you "generic" updater-script instead of having to mod it all the way through yourselves?
Droidmissionary said:
Would either of you like me to send you "generic" updater-script instead of having to mod it all the way through yourselves?
Click to expand...
Click to collapse
Sure bro, that would save me some time
Haters Make Me Famous
Deviant Team Member
The Sickness said:
Sure bro, that would save me some time
Haters Make Me Famous
Deviant Team Member
Click to expand...
Click to collapse
https://www.dropbox.com/s/ico5e9ouh15cu0d/MissionaryThemeScripts.zip
I made a theme zip. These updater_scripts/Binary are touchy and tend to fail if I just copy certain parts so I usually just use 7 zip to pull the meta-inf folder out of the zip over to my theme folder then work on it from there. I'm probably just not smart enough to know how to work with them fully yet. The Updater-script and installtheme.sh are both in the zip. This file however is not fully setup for installing on multiple android versions yet due to the fact that I don't have the older theme folders in place but it does have the 2 important files. Let me know if this fails.
Droidmissionary said:
https://www.dropbox.com/s/ico5e9ouh15cu0d/MissionaryThemeScripts.zip
I made a theme zip. These updater_scripts/Binary are touchy and tend to fail if I just copy certain parts so I usually just use 7 zip to pull the meta-inf folder out of the zip over to my theme folder then work on it from there. I'm probably just not smart enough to know how to work with them fully yet. The Updater-script and installtheme.sh are both in the zip. This file however is not fully setup for installing on multiple android versions yet due to the fact that I don't have the older theme folders in place but it does have the 2 important files. Let me know if this fails.
Click to expand...
Click to collapse
Thanks bro....I will try em out tomorrow after work. My old butt is in bed lol
Haters Make Me Famous
Deviant Team Member
Droidmissionary said:
Would either of you like me to send you "generic" updater-script instead of having to mod it all the way through yourselves?
Click to expand...
Click to collapse
Heck yes. That works.
ghostshel said:
Heck yes. That works.
Click to expand...
Click to collapse
Check a couple posts earlier
Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
Droidmissionary said:
Check a couple posts earlier
Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Yea, I got it thanks!

Categories

Resources