So, here's my problem.. I have created a package to be flashed from recovery (update.zip). It works.
I open the file update-script in the \META-INF\com\google\android\ directory with notepad. I add the line "copy_dir PACKAGE:data DATA:", re-zip and flash. I get a syntax error when flashing, no matter which recovery I use. I go back into the script delete the line I just added, to make it THE EXACT same script it was when it worked, and I still get the syntax error.
Now I'm frustrated and I can't figure out what's going on. Any ideas?
I could be wrong, but sounds like you're using something like Wordpad that's causing the issue. Google Notepad++, one of the most awesome editors IMO.
I'm only using windows notepad. :/
I'll try google notepad when I get home tonight.. does the encoding matter? It's saved as ANSI.
Thanks for the help, bro
Related
First of all: I'M SORRY FOR ASKING THIS!
But, I'm trying to edit some drawables in the framework-res and in a couple other apk's but my problem is resigning them. I followed this tutorial http://www.androiddevelopment.org/tag/apk/
I changed the .apk to .zip to open it and access the drawables but when I open the .zip file it opens it in another folder, not like winrar or whatever for windows. So after I edit what I need and recompress the file, I can't change it back to .apk. So I try signing the apk as a .zip but the signing tool thinks it's a update.zip and signs it that way.
Basically, is anyone able to successfully resign apk's on a mac? If so, how?
Thanks
make sure you rezip the files inside the folder, then either sign that zip or open the info window (command+i) and rename the extension to apk there.
circa85 said:
make sure you rezip the files inside the folder, then either sign that zip or open the info window (command+i) and rename the extension to apk there.
Click to expand...
Click to collapse
Yeah I just figured out I have to open the info window to rename to .apk. And now the signing goes smoothly.
This thread is a waste, sorry, I'm an idiot.
Actually, I'm still having an issue. Here is an example of what happens:
Say I rename framework-res.zip to framework-res.apk (after editing, and recompressing) and then I use the signing tool to sign framework-res.apk. If I change it back to .zip and decompress it, there are two files in it. There is a folder called "framework-res" and a folder called "META-INF". Nothing else. The AndroidManifest.xml is inside the framework-res folder. This happens with every apk I try to sign
what are u using to sign apk's on mac? I was tryin to get this working long time ago but gave up. them I found the method using automator and it resigns them but idk if it actually wrks. i tried editing stuff resigning and flashing but i got like 770 files unsigned. unless I just didn't know how to resign an update.zip properly..
jroid said:
what are u using to sign apk's on mac? I was tryin to get this working long time ago but gave up. them I found the method using automator and it resigns them but idk if it actually wrks. i tried editing stuff resigning and flashing but i got like 770 files unsigned. unless I just didn't know how to resign an update.zip properly..
Click to expand...
Click to collapse
I'm using the script in the tutorial I posted in the original post
The script just uses the Jarsigner tool. So I'm using Jarsigner to sign my apks
Oh ok. I might have to try this out. Question: what is the proper way of signing an update.zip after u edited framework.Res or. Apks? I'm confused when it comes to that. Must u resign every single file in the. Zip for it to work?
I went as far as rebuilding the apk, but not sure how to resign. I tried to install anyway without signing, but the installer hangs while checking for version and gives network error after some time. I found a http://code.google.com/p/signapk and tried to use it on mac, but seems like it needs to be run on android itself. When I tried to run it on android, I get permission error, though I did a chmod +x as su. Could you give some more details on where to get the tool and use it?
Hello!
So, some guys tested my bat-script and they reported that it works! So i create a new thread..
All you need is a java installation (i think jdk, becuase you need the jar binary) and adb! You have to edit the bat file and
set the 2 variables to the directory.
The other variables (sed, smali, baksmali, dexopt-wrapper) are in the package, so you shouldnt change it.
If anything necessary is not found, the script will not start!!
Attention: If you run the bat file, be sure your mobile is NOT IN STANDBY!! You have to be in normal mode (not recovery or sth) and the screen turned on!
So not in lockscreen/standby mode, because otherwhise SuperUser does not popup and ask for root-rights.
When you dont allow root-rights you will see a permission error during the script and this is bad (it will ask you 2-3 times for root rights).
I made this script, so everyone can look at the commands (not hiding inside an exe file which could do anything).
Here is the link: http://rapidshare.com/files/420586328/install_lockscreen.zip
Windows verion needs to be on rapidshare/filehoster, because i have put the sed binary + dll into it (you need it for windows and autopatching the .smali file)
Just download the bat script and edit it with an editor (notepad++ or jedit or just notepad) and set the ADB variable to adb.exe and JAVA_DIR to the JDK-directory (not including \bin - just the main-directory).
Tested successfully on my JM5 and some other user with JM8 and someone with JH2!
4 things todo (not for running the script, just for the future ):
1. create script for linux/mac os usage (shouldnt be so hard, but i have not so much time currently..)
2. auto-create an update.zip with the original android.policy.odex/.jar file for errors (because you cannot change this file if the phone cannot boot - su segmentation fault)
3. if /system/xbin/dd is not here or if it is missing the "conv=notrunc" option, the script should abort
4. create a version for deodexed mobiles/firmwares.
I dont have a clue, how to create an update.zip, so if anyone of you could give me a little help, i would be very happy
And i dont have a deodexed mobile, so someone should tell me the difference, so i can make a different script or the script should autodetect it.
Big thanx to Ateisti for found this solution: http://forum.xda-developers.com/showthread.php?t=779803
If you like my work you can buy me a beer (but you dont have to ): Beer via paypal
menu button fix included or not?
When someone would tell me what this is, then i can insert it in the script
Ateisti talk about it at the end of the first post of his thread
Found it
- By default, the menu button will also unlock the screen. To disable this behavior, you have to modify /res/values-hdpi-v4/bools.xml in /system/framework/framework-res.apk, and change the value of <bool name="config_disableMenuKeyInLockScreen">false</bool> to true. Can also be done by modifying code.
But, i have disabled WidgetLocker and just the AndroidLockscreen now..
I can hit so many times i want the menu button, the lockscreen will never be released..
I have JM5 (2.1). Maybe this is there different?
I will make on the weekend a linux version of the script and then i will also enable this feature..
thE_29 said:
When someone would tell me what this is, then i can insert it in the script
Click to expand...
Click to collapse
There is also a way to do this from the android.policy smali files. I did it on my UGJH2.
go into "android.policy\com\android\internal\policy\impl\LockScreen.smali"...
Do a search for "return v4" and change it to "return v6" (this should be within the method ".method private shouldEnableMenuKey()Z", closer to the ".end method" line.)
To add it to your script, have it change this at the same time as the other file you edit and bingo, no more menu button unlock....
didn't work here.
thank god you made a backup folder
JHJP8, not de-odexed.
Hi im working on creating some boot animations. Ive got the files ready, but i cant figure out how to put them into a flashable .zip.
I flashed this file thunderbolt boot animation and it worked so i figured if i just replaced my animation and audio it would work but i get an error saying "e:update script not found" or something along those lines.
Id like to know if there is an easy way to create a "template" were i just copy my animation into a folder and zip it, or if there is a program that will package it for me including the script/etc.
Any input or guide on how to make these boot animations flashable .zip's would be great, thanks.
Eat it iPhone said:
Hi im working on creating some boot animations. Ive got the files ready, but i cant figure out how to put them into a flashable .zip.
I flashed this file thunderbolt boot animation and it worked so i figured if i just replaced my animation and audio it would work but i get an error saying "e:update script not found" or something along those lines.
Id like to know if there is an easy way to create a "template" were i just copy my animation into a folder and zip it, or if there is a program that will package it for me including the script/etc.
Any input or guide on how to make these boot animations flashable .zip's would be great, thanks.
Click to expand...
Click to collapse
Thats weird it didn't work. Should. Maybe it wasn't re-packaged correctly.
Try the one attached.
CCallahan said:
Thats weird it didn't work. Should. Maybe it wasn't re-packaged correctly.
Try the one attached.
Click to expand...
Click to collapse
Thanks ill try it out, just dont have the time right now.
If you cant figure it out i'll give you a guide tomorrow when i'm off my iPad .
did you rezip it correctly?
I ran into this trouble, I forget what it is, but you have to zip the files a certain way or they will not work. I don't remember the settings anymore, but just creating a regular zip file won't work.
There is a good guide to making your own update script on xda somewhere. Just search the entire site. If i'm just flashing something simple like a theme or boot animation sometimes I just use someone else's flashable zip and replace the necessary files. I can't remember off the top of my head, but iirc there are two folders you want to keep from someone else's zip. Meta-inf which is basically the signature files and something else which contains the script. If you dissect someone's zip it should be obvious what the other folder you want to keep is. You will find the update script in one of the sub folders, and if you want you can open it with a text editor and get an idea of how the script works.
If you need more info I can help you more when I get to my computer.
Sent from my PC36100 using XDA App
dkdude36 said:
If you cant figure it out i'll give you a guide tomorrow when i'm off my iPad .
Click to expand...
Click to collapse
Id appreciate a guide either way, id rather learn to do it myself than use someone else's. No rush as i cant really approach this til the weekend.
Eat it iPhone said:
Id appreciate a guide either way, id rather learn to do it myself than use someone else's. No rush as i cant really approach this til the weekend.
Click to expand...
Click to collapse
ok, here it goes.
first, figure out where you want to push your file. i'd reccomend pushing manually in recovery to make sure the file itself works. then, using a tool like 7zip (pc) or betterzip (mac) create a file structure that matches the one on the phone. for example, if you wanted a boot animation to be put in system/customize/resource, make a folder system, customize in that, resource in that, and the bootanimation.zip inside that. now you have the main part. next, make a folder in the root of the zip called META-INF (caps counts) inside that, com, inside that, google, and inside that, android. thats /META-INF/com/google/android/. inside android, you need to place in an update-script. i'd reccomend taking one from another zip and just editing it becasue i still have not figured out a way to make that type of file (unix exec) from scratch. open it up in a .txt editor like notepad++ (pc) or coda (mac) and write your script. here is the baisic script for copying the directory system on the zip to system on the phone (like flashing a boot animation).
copy_dir PACKAGE:system SYSTEM:
CAPS COUNT AND MAKE SURE YOU HAVE AN ENTER AT THE END. IF YOU DO NOT HAVE AN ENTER AT THE END (TO MAKE IT TWO LINES INSTEAD OF ONE, LIKE ISSUEING A COMMAND) THEN IT WILL NOT WORK AT ALL ( E:SYNTAX ERROR IN UPDATE-SCRIPT IS THE ERROR YOU WILL GET)
so put this file into the folder android, and zip it. make sure it is in store only, compatibility mode, if you have such options. then, use an auto signer (or just say zip is not signed and make sure to put sig verification off) to sign the zip. flash, and watch your work magically appear.
the update-script i showed is written in amend. i have no idea how to write in edify bcuz it is much more complicated with the binary and stuff. so dont flash with cwm 3.0+.
good luck. ask if you have any questions.
hello will this methed work on like adding some personal apps you want to be on your rom?
im trying to make my own rom trying to try new this out and i was going around taken lil apps tht other roms hads like hulu, mastermind mirror, ect and i dont think i zip it correctly cause when i check the inside of the zip folder the other file is still not zip and i am sure that is a problem right ??? ps im using cwm 3.0 is tht a problem ?
i use this meth...
ok, here it goes.
first, figure out where you want to push your file. i'd reccomend pushing manually in recovery to make sure the file itself works. then, using a tool like 7zip (pc) or betterzip (mac) create a file structure that matches the one on the phone. for example, if you wanted a boot animation to be put in system/customize/resource, make a folder system, customize in that, resource in that, and the bootanimation.zip inside that. now you have the main part. next, make a folder in the root of the zip called META-INF (caps counts) inside that, com, inside that, google, and inside that, android. thats /META-INF/com/google/android/. inside android, you need to place in an update-script. i'd reccomend taking one from another zip and just editing it becasue i still have not figured out a way to make that type of file (unix exec) from scratch. open it up in a .txt editor like notepad++ (pc) or coda (mac) and write your script. here is the baisic script for copying the directory system on the zip to system on the phone (like flashing a boot animation).
copy_dir PACKAGE:system SYSTEM:
CAPS COUNT AND MAKE SURE YOU HAVE AN ENTER AT THE END. IF YOU DO NOT HAVE AN ENTER AT THE END (TO MAKE IT TWO LINES INSTEAD OF ONE, LIKE ISSUEING A COMMAND) THEN IT WILL NOT WORK AT ALL ( E:SYNTAX ERROR IN UPDATE-SCRIPT IS THE ERROR YOU WILL GET)
so put this file into the folder android, and zip it. make sure it is in store only, compatibility mode, if you have such options. then, use an auto signer (or just say zip is not signed and make sure to put sig verification off) to sign the zip. flash, and watch your work magically appear.
the update-script i showed is written in amend. i have no idea how to write in edify bcuz it is much more complicated with the binary and stuff. so dont flash with cwm 3.0+.
i only have 1 thing to say first switch to amon ra amon ra is 1000 times better than clockwordmod
how do i switch?? lol also what if i unroot my phone would tht be a problem?
Jcki4 said:
how do i switch?? lol also what if i unroot my phone would tht be a problem?
Click to expand...
Click to collapse
go here and download the PC36IMG.zip and follow the directions
http://forum.xda-developers.com/showthread.php?t=705026.
as for setting up a rom unzip one to see how it's set up, i have changed a few things in some and zipped it back up and signed it but never built one, sorry couldnt be more help
Hello fellas.
Back in the day, if I wanted to keep my dpi setting of 280 after flashing a new nightly (talking CM now), I just made a local.prop with the modified line and put it in /data.
Since, I think, CM10, though, local.prop doesn't get loaded, so I have to manually change build.prop.
I know a solution to this would be just keeping the same build.prop and flashing it after the rom (I already have a zip with the modifications I like that I flash after each nightly), but I don't really want to keep an old build.prop. What I want is to juat modify the line through my zip, so it stays updated while I don't have to modify the line every single day.
I found very quickly that I can use this line:
sed -i 's/ro.sf.lcd_density=320/ro.sf.lcd_density=280/g' /system/build.prop
to get the job done, and it does indeed work if I run it using the terminal. The problem is, I can't get it to work in recovery.
Having very little experience with programming, I'm just trying stuff to see if it works. I treid directly including the like line in the updater-script, didn't have too much hope for that.
I also tried including another simple file with this code:
#!/sbin/sh
sed -i 's/ro.sf.lcd_density=320/ro.sf.lcd_density=280/g' /system/build.prop
that I then extract and run, as I've seen in threads in the forum, but still doesn't work. The file gets extracted, but it doesn't work
I even tried to do it in a userinit script form, just to see if the rom loaded it on boot, but nope.
This is pretty friggin' simple to do, and I'm sure I'm probably making a silly noob mistake, but I just don't have any experience with this kind of code, so if someone can tell me how to make my zip run that very simple line, I'd much appreciate it.
Thanks.
Ok, after moar and moar and moar search, I finally found a script that does the job.
Problem solved.
yay
yay
Hi,
can you please provide your solution. I'm also trying to edit values in build.prop.
I tried to do via init.d script. The script is fine but / system seems to be read only when executing script at startup.
So it would be great if you can reply how you did it (maybe complete other way).
Thanks in advanced!
This is the post in question.
Swiftkey'd from my GNexus
Perfect, thanks a lot! I already found a workaround via an init.d script but this looks very promissing....
Sent from my XT894 using xda app-developers app
It's very useful.
I just included it in my after-nightly zip, so everything becomes automated with cyandelta.
Swiftkey'd from my GNexus
Hi,
So how do I edit AND add lines to build.prop from recovery ZIP?
Easy solution
Or maybe using just the updater-script and this code (this should also work on every rom)
run_program("/sbin/sh", "-c", "sed -i 's:ro.sf.lcd_density=.*:ro.sf.lcd_density=280:' /system/build.prop");
Click to expand...
Click to collapse
You can change 280 to another value if you want.
..
Molitro said:
Hello fellas.
Back in the day, if I wanted to keep my dpi setting of 280 after flashing a new nightly (talking CM now), I just made a local.prop with the modified line and put it in /data.
Since, I think, CM10, though, local.prop doesn't get loaded, so I have to manually change build.prop.
I know a solution to this would be just keeping the same build.prop and flashing it after the rom (I already have a zip with the modifications I like that I flash after each nightly), but I don't really want to keep an old build.prop. What I want is to juat modify the line through my zip, so it stays updated while I don't have to modify the line every single day.
I found very quickly that I can use this line:
sed -i 's/ro.sf.lcd_density=320/ro.sf.lcd_density=280/g' /system/build.prop
to get the job done, and it does indeed work if I run it using the terminal. The problem is, I can't get it to work in recovery.
Having very little experience with programming, I'm just trying stuff to see if it works. I treid directly including the like line in the updater-script, didn't have too much hope for that.
I also tried including another simple file with this code:
#!/sbin/sh
sed -i 's/ro.sf.lcd_density=320/ro.sf.lcd_density=280/g' /system/build.prop
that I then extract and run, as I've seen in threads in the forum, but still doesn't work. The file gets extracted, but it doesn't work
I even tried to do it in a userinit script form, just to see if the rom loaded it on boot, but nope.
This is pretty friggin' simple to do, and I'm sure I'm probably making a silly noob mistake, but I just don't have any experience with this kind of code, so if someone can tell me how to make my zip run that very simple line, I'd much appreciate it.
Thanks.
Click to expand...
Click to collapse
Sir can you tell me what to do to change ro.product.name if same phone in different regions is having different ro.product.name so that the build.prop for every phone that's installed.