Can I modify an existing one by simply dropping in updated bootscreen files, rosie.apk, etc.. and signing the existing rom zip?
Any good guides on how to do one if not, and/or how to use Flipz kitchen tool to create a rom?
Ceger
I am pretty sure if you sign the file and you modify it after that you will have to resign it. At least thats how it goes for other things that are similar that I deal with.
Kcarpenter said:
I am pretty sure if you sign the file and you modify it after that you will have to resign it. At least thats how it goes for other things that are similar that I deal with.
Click to expand...
Click to collapse
I understand that, just wondering if I can add new files and they will move or does some master script need to be updated to know to move the files. In other words, is it done by directory or by file?
For example, if I add some apps to /data/app in the zip will they be there on the phone when I install the ROM zip, etc.. More specifically, I have added an alternate boot sequence. The rom does not have a boot1.gif. If I add the new sequence with XML, will the boot1.gif be installed as well or do I need to update something that directs the install of the ROM to move that file or is it automatic as the folder is moved over?
Ceger
Ceger said:
I understand that, just wondering if I can add new files and they will move or does some master script need to be updated to know to move the files. In other words, is it done by directory or by file?
For example, if I add some apps to /data/app in the zip will they be there on the phone when I install the ROM zip, etc.. More specifically, I have added an alternate boot sequence. The rom does not have a boot1.gif. If I add the new sequence with XML, will the boot1.gif be installed as well or do I need to update something that directs the install of the ROM to move that file or is it automatic as the folder is moved over?
Ceger
Click to expand...
Click to collapse
I have found that the easiest thing to do is just put the files that you want to use to replace the old ones into a signed zip and then flash just those files I have tried altering a rom file with no success
wtphoto said:
I have found that the easiest thing to do is just put the files that you want to use to replace the old ones into a signed zip and then flash just those files I have tried altering a rom file with no success
Click to expand...
Click to collapse
Oh well, was trying to have a one step zip. I guess I can make at least have a 2 step process which is better than 4-5.
Thanks,
Ceger
Yes you can modify just about anything in the rom and flash your zip as long as it is signed and the update script is correct. I always make all my changes to a rom before flashing it so i do not have to flash several different things etc.
The update script is located in RomName\META-INF\com\google\android\
Lets look at a very simple update script to show you what i mean.
In this update script it is to write something to /system
example:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
We see here that whatever is in the system folder within the signed zip will be written to the phone
in this case i am writing /system/app/mobiledefense.apk
That will be the only file written to the phone and will be written to /system/app
The update script is not specific to every file so you can have 1 thing in the system folder or 100 and it will write everything in there.
One thing that many people mess up on is not using a update-script file when they sign a .zip file. The recovery has to know what to flash or it will not flash anything.
So the answer is yes you can change many things and then flash the signed update.zip file.
Not everything can be done this way but most things will work.
But for example changing the boot sceen can be done even if the file names are different as long as the folder structure stays the same and the .XML file is the correct one for the boot screen. I opened the .zip of a rom deleted everything out of the boot screen folder and dropped in all the files from the nexus one hero hybrid boot screen re signed the zip and everything flashed perfect. I changed many other things as well in the .zip like rosie.apk, sound files, lockscreen files, busybox files, added apps to /system/app and just resigned the zip and everything flashed the way i wanted it to and works perfect.
The way to correctly zip a file is to extract the zip modify what you want then select everything inside the zip right after you open the folder and the highlight everything select add to archive and then zip it up now sign that .zip
so say you extract the ROM and it is named Rom123 now you will have a folder named Rom123 open that folder and select everything file or folder in there and then hit add to archive that will make another zip right there called Rom123.zip pull that zip out to the desktop and sign that zip file and thats it.
I Know that is confusing as it is late as hell and i am tired but wanted to answer this real quick.
zippy-man said:
Yes you can modify just about anything in the rom and flash your zip as long as it is signed and the update script is correct. I always make all my changes to a rom before flashing it so i do not have to flash several different things etc.
The update script is located in RomName\META-INF\com\google\android\
Lets look at a very simple update script to show you what i mean.
In this update script it is to write something to /system
example:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
We see here that whatever is in the system folder within the signed zip will be written to the phone
in this case i am writing /system/app/mobiledefense.apk
That will be the only file written to the phone and will be written to /system/app
The update script is not specific to every file so you can have 1 thing in the system folder or 100 and it will write everything in there.
One thing that many people mess up on is not using a update-script file when they sign a .zip file. The recovery has to know what to flash or it will not flash anything.
So the answer is yes you can change many things and then flash the signed update.zip file.
Not everything can be done this way but most things will work.
But for example changing the boot sceen can be done even if the file names are different as long as the folder structure stays the same and the .XML file is the correct one for the boot screen. I opened the .zip of a rom deleted everything out of the boot screen folder and dropped in all the files from the nexus one hero hybrid boot screen re signed the zip and everything flashed perfect. I changed many other things as well in the .zip like rosie.apk, sound files, lockscreen files, busybox files, added apps to /system/app and just resigned the zip and everything flashed the way i wanted it to and works perfect.
The way to correctly zip a file is to extract the zip modify what you want then select everything inside the zip right after you open the folder and the highlight everything select add to archive and then zip it up now sign that .zip
so say you extract the ROM and it is named Rom123 now you will have a folder named Rom123 open that folder and select everything file or folder in there and then hit add to archive that will make another zip right there called Rom123.zip pull that zip out to the desktop and sign that zip file and thats it.
I Know that is confusing as it is late as hell and i am tired but wanted to answer this real quick.
Click to expand...
Click to collapse
Perfect, just what I was looking for.
Thank you, just made my day!
Ceger
So here I have noticed issue with using vrtheme on new 4.3 MJ2 and seeking some Linux expert help to solve it.
work around
Simply using vrtheme causing FCs, SO i have changes the destination to see outcome file structure.
-All changes we have applied through vrtheme applied to output file. but icons get changed to android icon.
-Now if you move that output file to other destination using root explorer then also it regenerates original icons and we can use as final apk ready to push to System/app
-Again if we giving same command through recovery, it doesn't works
-Also copying with terminal emulator with cat command, it regenerates original structure. again same command using recovery fails to do it.
May be recovery issue??
here is log cat along with used vrtheme script.
dr.ketan said:
So here I have noticed issue with using vrtheme on new 4.3 MJ2 and seeking some Linux expert help to solve it.
work around
Simply using vrtheme causing FCs, SO i have changes the destination to see outcome file structure.
-All changes we have applied through vrtheme applied to output file. but icons get changed to android icon.
-Now if you move that output file to other destination using root explorer then also it regenerates original icons and we can use as final apk ready to push to System/app
-Again if we giving same command through recovery, it doesn't works
-Also copying with terminal emulator with cat command, it regenerates original structure. again same command using recovery fails to do it.
May be recovery issue??
Click to expand...
Click to collapse
doc, am not a linux expert, but i tried to inject your black aosp vrtheme files into the apk and flash them from cwm, it kills the wifi and have to wipe and reflash the whole rom. so, perhaps you want to put more attention to it.
waiting for your aosp theme and thanks a lot.
Wifi issue will be solved by reflashing recovery
I can show you temporary solution.
Just change path of pushing files to other from System/app then 1. you want get FCc bcoz it is not in system/app
2. Now from where you have defined destination from there move to some pther place with root explorer, now you will be able to see icons, once icons are correct you can pust to system/app.
dr.ketan said:
Wifi issue will be solved by reflashing recovery
I can show you temporary solution.
Just change path of pushing files to other from System/app then 1. you want get FCc bcoz it is not in system/app
2. Now from where you have defined destination from there move to some pther place with root explorer, now you will be able to see icons, once icons are correct you can pust to system/app.
Click to expand...
Click to collapse
sorry doc, but i cannot understand what you mean.
do you mean i should change the flashing path (in the script)? or do you mean i should copy the apks manually into the system/app by root explorer? if you mean the later, i can do, but the first one i don't.
i can see all the icons, just the wifi would not start after i flashed the modified apks through cwm flash. what do you mean by reflashing recovery?
Ok making clear again who want to use vrtheme
1.Change path in vrtheme installertheme.sh from system/app to other (e.g. just system)
2.Now when you flash vrtheme, you won't see any changes in system bcoz all apps will be in system and not in System/app.
3. Manually cut all app with root explorer from system to SDcard
4. Now you can see correct icons of all appl after moving to sdcard.
5.Now move those apk to system/app OR System/framework, where it should be.
6.Enjoy all the changes now in system
7.By this process you will lose wifi and you have to reflash recovery to get it back.
PS : For AOSP for MJ2 I have made it with same method above and uploading, Once uploaded will post to MJ2 thread, you have to simply flash that file. without doing anything above.
dr.ketan said:
Ok making clear again who want to use vrtheme
1.Change path in vrtheme installertheme.sh from system/app to other (e.g. just system)
2.Now when you flash vrtheme, you won't see any changes in system bcoz all apps will be in system and not in System/app.
3. Manually cut all app with root explorer from system to SDcard
4. Now you can see correct icons of all appl after moving to sdcard.
5.Now move those apk to system/app OR System/framework, where it should be.
6.Enjoy all the changes now in system
7.By this process you will lose wifi and you have to reflash recovery to get it back.
PS : For AOSP for MJ2 I have made it with same method above and uploading, Once uploaded will post to MJ2 thread, you have to simply flash that file. without doing anything above.
Click to expand...
Click to collapse
will just wait for your file then. dont want to mess my setup again. spent too much time experimenting with it today. lucky it's saturday in my country...
ok then wait 10 min.
EDIT : AOSP theme for MJ2 ROM Posted to MJ2 thread post#2
Doc.
I just came across thia issue thread discussion.
Surprised to see vrtheme issues.
I think it is worth trying morphing instead of vrtheme.
If it fails, then it is not a recovery issue..m
It might be android 4.3 security files that I noticed in /system...
I will dig in further and check...
Thx for sharing this discussion thread. :thumbup:
wesamothman said:
Doc.
I just came across thia issue thread discussion.
Surprised to see vrtheme issues.
I think it is worth trying morphing instead of vrtheme.
If it fails, then it is not a recovery issue..m
It might be android 4.3 security files that I noticed in /system...
I will dig in further and check...
Thx for sharing this discussion thread. :thumbup:
Click to expand...
Click to collapse
Already fixed that (at least in my MJ2 rom)
vrtheme works perfect on framework-res.apk and secsettings.apk
Hey,
since I'm flashing nightlies on a regular basis and also want to use my own custom /system/build.prop file, there are a few ways to accomplish both things as easy as possible:
Backing up /system/build.prop through a script in /system/addon.d
Flashing my own file using a zip after every update
Restoring previous build.prop using a Editor app and reboot
Manually change or add every desired entry and reboot
For most of you one of these ways should absolutely do the trick, but my problem was either things like build version, date, etc. got stuck at my custom file's one or I had to reboot after manually updating it, which got really annoying after several times.
So I decided to create my own flashable zip which works as follows:
Somewhere on the device is a simple text file in which are all those entries that shall be changed,added to or removed from /system/build.prop (In my case it's /sdcard/tweak.prop)
After mounting /system and /data (not if they are already) and setting write permissions to /system/build.prop the zip extracts a shell script to /tmp/tweakprop.sh
It This script scans the text file (aborts if not found) and looks for changed, new or unwanted entries in /system/build.prop in order to apply them. Changed entries will be overridden, new ones will be added, unwanted get removed and entries existing in /system/build.prop but not in your personal file will be ignored
When tweaking is done, it just removes /tmp/tweakprop.sh and unmounts /system and /data (only if they weren't mounted before) and reverts /system/build.prop's permissions to rw-r--r--
-> (See content of example.txt for more detailed examples and syntax!)
Using this method, you can not only forget about manually updating versions and/or lame reboots after updates for changes to take effect, but also edit your personal text file at any time without root rights beeing required. Once set up to be flashed after every update, your /system/build.prop is always tweaked as you wish and looks like a stock one (ROM version, etc. under About Phone).
The zip flashes well on all recoveries. Make sure your tweak.prop file ends with an empty line, otherwise the last line will be ignored!
I hope some of you can use this zip, it's free to modify. If you have any suggestions, let me know.
This project has been moved to a git repo at https://notabug.org/kl3/tweakprop. Please refer to it in the future to get updates as this is much easier for me to maintain. Upcoming changelog can be found here.
Changelog
Changelog
version 0.1:
initial release
version 0.2:
ignore lines in personal file not matching a valid entry pattern (someVAR=someVAL) to not mess up /system/build.prop and support personal structuring inside the file like "# media tweaks #", "# dalvik section #", etc.
code cleaned up
version 0.2.1:
typo fixed in line 24 of tweakprop.sh so the if-statement asks for the correct file (thanks to the_pirate_predator)
version 0.3:
changed the while-loop to get it's input directly from sed, which makes a second buffer file obsolete
version 0.3.5:
example.txt provided as tweak.prop template
ignore lines beginning with # or being empty
version 0.4:
instead of a fixed path, the personal file gets searched on internal storage (file name can be set in the script) so you can put your file anywhere - no more problems with /sdcard/ or /sdcard/0/ on different devices
personal file must not be empty, otherwise script aborts#
only override really different entry values in order to prevent "... value of someVAR overridden" spam in recovery log
version 0.4.5:
fixed last line of personal file being ignored due to deleting all empty lines before
speed up search for personal file, now looking on internal storage and even on external SD card if nothing was found before (ext. SD neither gets checked if present, nor mounted or unmounted, just trying to search on it silently)
version 0.4.5a:
same as 0.4.5a, but personal file is inside the zip and gets extracted to /tmp/tweak.prop, no need to have one on the internal storage
version 0.4.6(a):
output not shown in TWRP fixed, now works as it should
version 0.5:
code cleanup: everything's now in the update-binary, resulting in much less code and faster execution time
output to recovery should now work on all device-recovery combinations
version 0.5.1:
lines beginning with ! will be removed globally
little code-cleanup
version 0.5.2:
lines beginning with @ will append the string after | to values of existent entries
slight changes in code structure
version 0.5.3:
lines beginning with $ will change the value to the string after | only if the entry already exists, hence $telephony.lteCdmaDevice|1 is nothing but a more explicit approach of telephony.lteCdmaDevice=1, as the first one will only make changes but no new entries
version 0.5.4:
the build.prop file can now be backed up before editing using a BACKUP= line, see example.txt for details
tiny bug fixed
version 0.5.4a:
tweak.prop file (example.txt) is included, no personal file on your device's storage is used. Edit the zip's content before flashing!
version 0.5.9(a):
Error handling fixed, script properly exits now if anything failes and won't make further changes
More verbose output
Date and tweak.prop version added to backup files to keep track of them
Special characters like / are now escaped and handled correctly by sed
Slight changes in coding style as it's good practise
Click to expand...
Click to collapse
Such Awesome, much appreciate i wanted to make one too, but never got the time to.
Sent from my Xperia V using XDA Premium 4 mobile app
What should my text file look like if I just want to add one line of text at the end of my build.prop? For example,
qemu.hw.mainkeys=0
to activate softkeys on a device with capacitive buttons?
Thanks
Sent from my XT912 using Tapatalk
Need some information
I need explanation for the following lines of code.
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
## abort execution if $tweaks not found
if [ ! -e $tweaks ]
then
ui_print "ERROR: Personal file not found. No changes were made."
ui_print "Script aborted. Check file path and flash again."
exit 0
fi
## read only lines matching any valid entry pattern (someVAR=someVAL), e.g.
## net.bt.name=Android, omni.device=n7100, url.legal=http://www ...
sed '/.*=.*/!d' $tweak > /tmp/tweak.prop
tweaks=/tmp/tweak.prop
You are giving a condition loop without even declaring the variable "tweaks" at first. You have declared only after the loop ends. Then that means, the code in the loop never executes. I think this is a small mistake you did with the code. Make sure you correct those.
But else, a great work!! :good: :good:
Sorry, but stick to one variable, "tweak", or "tweaks".
Otherwise, its a very simple, yet efficient algorithm. :good:
jonwgee said:
What should my text file look like if I just want to add one line of text at the end of my build.prop? For example,
qemu.hw.mainkeys=0
to activate softkeys on a device with capacitive buttons?
Click to expand...
Click to collapse
Just a simple text file containing your mentioned line. Any other empty or non-entry lines will be ignored by my script anyway.
the_pirate_predator said:
I need explanation for the following lines of code.
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
## abort execution if $tweaks not found
if [ ! -e $tweaks ]
then
ui_print "ERROR: Personal file not found. No changes were made."
ui_print "Script aborted. Check file path and flash again."
exit 0
fi
## read only lines matching any valid entry pattern (someVAR=someVAL), e.g.
## net.bt.name=Android, omni.device=n7100, url.legal=http://www ...
sed '/.*=.*/!d' $tweak > /tmp/tweak.prop
tweaks=/tmp/tweak.prop
You are giving a condition loop without even declaring the variable "tweaks" at first. You have declared only after the loop ends. Then that means, the code in the loop never executes. I think this is a small mistake you did with the code. Make sure you correct those.
But else, a great work!! :good: :good:
Click to expand...
Click to collapse
You're right. It's a typo, I'm correcting it now. Thanks for your advice.
thewisenerd said:
Sorry, but stick to one variable, "tweak", or "tweaks".
Otherwise, its a very simple, yet efficient algorithm. :good:
Click to expand...
Click to collapse
I use a second buffer file that is a cleaned version of the original one. If I find a smarter way, I will.
I was searching for something like this for ages.
But i have a nob question! lol
I need to create a text file with all the lines i want to add to my built.prop file, so where I put the text file? And i have to give a certain name to that file or any name will do?
Hugo
oguh said:
I need to create a text file with all the lines i want to add to my built.prop file, so where I put the text file? And i have to give a certain name to that file or any name will do?
Click to expand...
Click to collapse
My script searches for a file called tweak.prop located at your internal storage (storage/emulated/0/tweak.prop or sdcard/tweak.prop or sdcard/0/tweak.prop), but you can freely change the line
PHP:
tweak=/sdcard/0/tweak.prop
to any path you want your personal file to be.
klenamenis said:
My script searches for a file called tweak.prop located at your internal storage (storage/emulated/0/tweak.prop or sdcard/tweak.prop or sdcard/0/tweak.prop), but you can freely change the line
PHP:
tweak=/sdcard/0/tweak.prop
to any path you want your personal file to be.
Click to expand...
Click to collapse
Thx for the quick response, and for your great work.
hugo
Sorry but i don't get it.
i need to create a txt file called tweak.prop and place it where i want, for example /sdcard/tweak.prop
after extracting the tweakprop-0.3.zip for editing the line /tmp/tweakprop.sh
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/tweak.prop
zipping meta-inf and tmp folder and finally flashing this zip.. am i doing something wrong ?
because it takes no changes.
got this line in tweak.prop at /sdcard/tweak.prop
Code:
ro.sf.lcd_density=400
sorry, i really dont get it.
bnbagiz said:
Sorry but i don't get it.
i need to create a txt file called tweak.prop and place it where i want, for example /sdcard/tweak.prop
after extracting the tweakprop-0.3.zip for editing the line /tmp/tweakprop.sh
Code:
## your personal file with tweaks and custom entries/values
tweak=/sdcard/tweak.prop
zipping meta-inf and tmp folder and finally flashing this zip.. am i doing something wrong ?
because it takes no changes.
Click to expand...
Click to collapse
As my script already shows, changing the path to /sdcard/0/tweak.prop again should do the trick.
I just want to change my DPI with this. What do I need to change in your default tweak.prop to be able to do that?
Click thanks if I helped you.
Sent from my SM-N900W8 using XDA Premium mobile app
Code:
klenamenis said:
As my script already shows, changing the path to /sdcard/0/tweak.prop again should do the trick.
Click to expand...
Click to collapse
did not work ! :/ you mean changing the path for the tweak.prop in the unzipped tweakprop.sh in /tmp/, aren't you ?
Code:
build=/system/build.prop
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
---------- Post added at 02:41 PM ---------- Previous post was at 02:34 PM ----------
sauron82 said:
I just want to change my DPI with this. What do I need to change in your default tweak.prop to be able to do that?
Click thanks if I helped you.
Sent from my SM-N900W8 using XDA Premium mobile app
Click to expand...
Click to collapse
that is what i am trying to do
you need to change the line
Code:
ro.sf.lcd_density="value you like to have, i.e. 400"
bnbagiz said:
Code:
did not work ! :/ you mean changing the path for the tweak.prop in the unzipped tweakprop.sh in /tmp/, aren't you ?
Code:
build=/system/build.prop
## your personal file with tweaks and custom entries/values
tweak=/sdcard/0/tweak.prop
Click to expand...
Click to collapse
Yes, that's what I meant. Then just try any other path. I guess the internal storage's path is a device specific thing. Which device do you? I would try locating your personal file at /system as this path exists on all devices/ROMs.
klenamenis said:
Yes, that's what I meant. Then just try any other path. I guess the internal storage's path is a device specific thing. Which device do you? I would try locating your personal file at /system as this path exists on all devices/ROMs.
Click to expand...
Click to collapse
I am using a LG G2 Intern. D802
PAC-Man ROM (but thing thats irrelevant)
so if i place my tweak.prop in /system/ i need to edit the path in tweakprop.sh right ?
edit:
personal file is in /system/tweak.prop
editting tweakprop.sh line to
/system/tweak.prop
does not work don't get it .. sounds so simple, actually it is, but i don't know what i am doing wrong
bnbagiz said:
that is what i am trying to do you need to change the line
Code:
ro.sf.lcd_density="value you like to have, i.e. 400"
Click to expand...
Click to collapse
I know that, but where do I put it in the provided tweak.prop? What do I remove from the provided tweak.prop so that's the only change? I really don't know what any of this code actually means. Thanks to the OP for providing this, but instructions aren't very clear.
Click thanks if I helped you.
Sent from my SM-N900W8 using XDA Premium mobile app
You're my hero.So tired of changing build.prop values every time I try a different ROM. :good:
bnbagiz said:
edit:
personal file is in /system/tweak.prop
editting tweakprop.sh line to
/system/tweak.prop
does not work don't get it .. sounds so simple, actually it is, but i don't know what i am doing wrong
Click to expand...
Click to collapse
Hm.. Which recovery? Maybe it's a problem with the updater-script doesn't get executed correctly. Sadly, I have no possibilities to test those scenarios.
sauron82 said:
I know that, but where do I put it in the provided tweak.prop? What do I remove from the provided tweak.prop so that's the only change? I really don't know what any of this code actually means. Thanks to the OP for providing this, but instructions aren't very clear.
Click to expand...
Click to collapse
I didn't provide any personal file. If you only want to change this line, create a file called tweak.prop containing only this line and place it right on your internal storage.
Sent from my GT-N7100 using Tapatalk
bnbagiz said:
I am using a LG G2 Intern. D802
PAC-Man ROM (but thing thats irrelevant)
so if i place my tweak.prop in /system/ i need to edit the path in tweakprop.sh right ?
edit:
personal file is in /system/tweak.prop
editting tweakprop.sh line to
/system/tweak.prop
does not work don't get it .. sounds so simple, actually it is, but i don't know what i am doing wrong
Click to expand...
Click to collapse
If you put it in /system/ it'll get erased when you flash a new nightly anyways, as most .zip scripts wipe the /system partition... So... it would be best to keep it on the SD card.