Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

Like Tree4Likes
  • 3 Post By UnderWhat?
  • 1 Post By stringtokenizer

 
 
LinkBack Thread Tools
Old September 3rd, 2009, 01:31 PM  
Member
Thread Author (OP)
 
Join Date: Aug 2009
Posts: 181
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 36 Times in 1 Post
Default [How-To] Signing ROMs

Hello everyone!

This quick guide will teach you how to sign ROMs!

WARNING : YOU WILL NEED AT LEAST A BASE KNOWLEDGE OF HOW TO USE COMMAND PROMPT.


The knowledge of signing ROMs can prove useful to anyone! By knowing how to sign ROMs, you can modify your favorite ROM to add or delete APKs, so when you flash the ROM your favorite apps will be present! Or you can delete apps you don't use so they will not be installed when flashing the ROM!


Before starting, you need a couple of things. First you will need Java SE Development Kit and Java SE Runtime Environment . You can download them HERE.

After you have downloaded and installed both, you will need a very useful tool made by someone at XDA-Developers (if you know who it is please let me know).

Download this tool (attached) and unzip everything inside of it into one common folder. I personally unzipped everything into my Android SDK folder.


Signing
Now run the autosign.bat. You will have to go through commands 1(Set PATH variable for SDK) ,2 (Set CLASSPATH variable for signing tool) and 3 (Install registry entries). They are very easy to use and just follow the instructions. If you are asked to confirm and/or replace a file, always select yes!

Now you are finally ready to sign! There are two options to sign the .zip

1)Find the ROM (.zip) and right click and select "Resign Zip". If you use this option a command prompt box should quickly appear and disappear.

OR

2) Using the Autosign.bat, select option 4, and then write the directory and file name of the ROM. For example,

D:\Android\ROMs\YourROMHere.zip

It will hang for a bit at the part where it says "signing", and then it should say something along the lines of "Successfully completed if no errors above"

If this helped you, comment below!
Attached Files
File Type: zip AutoSign.zip (25.4 KB, 10279 views)
nenebear, wps and chalermpol like this.

UnderWhat? is offline  
Last edited by UnderWhat?; September 3rd, 2009 at 01:36 PM.
The Following 36 Users Say Thank You to UnderWhat? For This Useful Post:
alberto13 (May 31st, 2010), cattleprod (January 15th, 2011), chko (August 17th, 2011), chunlongyuan (February 21st, 2012), darkyy92 (October 14th, 2010), DbLoCk3NiNe (February 29th, 2012), dsmryder (March 18th, 2012), EGAcls (March 17th, 2012), haiduongbk (January 5th, 2012), jshealton (April 24th, 2011), Kaliend (June 23rd, 2012), khoailang2500 (September 13th, 2010), lonelysky (August 30th, 2011), masachan (May 20th, 2010), mikebills (February 8th, 2012), Miroid (January 24th, 2011), nenebear (August 16th, 2011), nickislauw (August 21st, 2010), nmt8112 (May 29th, 2010), oedex (March 4th, 2012), Omegapsy (November 1st, 2011), paallday (February 21st, 2012), pesiran (September 7th, 2010), progster (January 21st, 2014), qbking77 (April 25th, 2011), ranpreetbhatia (July 19th, 2011), rayt (August 5th, 2013), Snake X (May 24th, 2012), srhodes (December 21st, 2012), T2noob (May 7th, 2010), vanemburghj (May 23rd, 2012), xtreme35967 (July 15th, 2010)
sponsored links
Old September 13th, 2009, 01:05 PM  
G1/Cliq Guide
 
NiNi's Avatar
 
Join Date: Sep 2009
Location: Florida
Posts: 126
 
Device(s):
Carrier: Not Provided

Thanks: 21
Thanked 5 Times in 2 Posts
Send a message via AIM to NiNi Send a message via Yahoo to NiNi Send a message via Skype™ to NiNi bellaitaliana09
Default

this was made by JesusFreke

Quote:
Originally Posted by Stericson View Post
JesusFreke was kind enough to build a custom signing tool for me that would allow me to right click on an apk and resign it from there. I am posting it here for others to use as well. Note that this is a courtesy of JF, so thank him for it. I cannot stress how much time this has saved me and will save you.
sorry here is more info

Quote:
Originally Posted by Stericson View Post
I have made a batch file that will automate the entire process of setting up to use the signing tool made by JF. This batch file will set the CLASSPATH, set the PATH, install the registries, and will even allow you to sign files manually if you wish. I plan on building onto this batch file to include other things. However, for the moment, it will only include what you see here.
NiNi is offline  
Last edited by NiNi; September 13th, 2009 at 01:08 PM.
The Following User Says Thank You to NiNi For This Useful Post:
Old October 4th, 2009, 06:25 PM  
New Member
 
Join Date: Oct 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

first off. Thank you sooooo much for this guide!! but i still cant get it working. it kinda sucks. I dl'd the autosign.zip and then extracted all to my sdk. i didnt put it in its own folder. I think thats what you meant unless it needs its own folder? second you cant install jdk and jre side by side. Well for me any way?? Next i did make sure the registry edit worked and the path was set. but is the path supposed to be for user variables or system variables?? i have sdk setup and i def know my adb cmd's not new to that. just java stuff is kinda giving me a headache. i have the eclipse installed for app development and that seems to work fine. any input?? o im using vista 32b also.
rockin_mod is offline  
Old November 8th, 2009, 05:55 PM  
New Member
 
Join Date: Nov 2009
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,
does someone has a solution without using windows?
I'm looking for signing under ubuntu linux.

Many Thanks for your hints

Roman
banzro is offline  
Old November 8th, 2009, 06:18 PM  
New Member
 
Join Date: Nov 2009
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Wink Found solution under Linux!

Quote:
Originally Posted by banzro View Post
Hello,
does someone has a solution without using windows?
I'm looking for signing under ubuntu linux.

Many Thanks for your hints

Roman

java -jar /opt/android/tools/tools/signapk.jar /opt/android/tools/tools/testkey.x509.pem /opt/android/tools/tools/testkey.pk8 update.zip signed-update.zip

Have a nice day
banzro is offline  
Old November 11th, 2009, 05:32 AM  
New Member
 
Join Date: Nov 2009
Posts: 12
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

can't open /sdcard/mojhero-2.0.5.zip (bad)
Installation aborted
7ymekk is offline  
Old December 4th, 2009, 08:51 AM  
New Member
 
Join Date: Dec 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default error

I followed each one of your steps. I get an error when trying to install the signed zip. "Can't find update script" Can anyone please help me with this. thank you
dub08 is offline  
Last edited by dub08; December 4th, 2009 at 08:55 AM.
Old January 9th, 2010, 05:33 PM  
New Member
 
Join Date: Jan 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by dub08 View Post
I followed each one of your steps. I get an error when trying to install the signed zip. "Can't find update script" Can anyone please help me with this. thank you

I had the same thing happen, you probably zipped the folder containing boot.img META-INF, Data and System. You need to open up the folder and zip the 4 items in there and then sign.
scepterr is offline  
Old January 11th, 2010, 07:56 AM  
New Member
 
Join Date: Jan 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

I create zip with files then try to sing. Open autosing.bat and make all steps and when i sing then file is missing ?
nixdorf is offline  
Old January 27th, 2010, 12:47 AM  
New Member
 
Join Date: Sep 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you have the new key to sign to by pass the new hboot?
thanks
thihaz is offline  
sponsored links
Old April 28th, 2010, 04:02 PM  
New Member
 
Join Date: Apr 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by dub08 View Post
I followed each one of your steps. I get an error when trying to install the signed zip. "Can't find update script" Can anyone please help me with this. thank you
i'm having the same issue any help please.
networx2002 is offline  
Old April 28th, 2010, 08:28 PM  
New Member
 
Join Date: Apr 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by scepterr View Post
I had the same thing happen, you probably zipped the folder containing boot.img META-INF, Data and System. You need to open up the folder and zip the 4 items in there and then sign.
So i need to zip all the folders inside the rom
networx2002 is offline  
Old May 20th, 2010, 03:32 AM  
New Member
 
Join Date: Dec 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi guys, try this out.

1.) Download it and upzip to a folder (eg, c:\auto-sign\)
2.) Copy your rom's update.zip into c:\auto-sign\ folder.
3.) Double click on the Sign.bat, it will signing the update.zip automatically.

Cheers !
Attached Files
File Type: zip Auto-sign.zip (9.8 KB, 1130 views)
dyygtfx likes this.
stringtokenizer is offline  
Old July 1st, 2010, 02:13 AM  
New Member
 
Join Date: Jul 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Help!

I hate resurrecting this old thread, but I'm having trouble.

All I'm doing, is taking a ROM I like, using 7-Zip to add a few apk to the apps folder, remove a few, and put .bak on the tail of a few I want to disable....

I then tried changing the zip name to update.zip, and ran the .bat... and it created the update_signed.zip file.... but when I try to load it with Clockwork recovery, I get the "Can't find update script" message.

I don't know what I'm doing wrong
Fulle is offline  
Old July 1st, 2010, 02:45 AM  
New Member
 
Join Date: Jul 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah hell, nevermind... I figured it out. Something I was doing somehow added a duplicate folder into the file structure.... guess that's what happens when you try to do new things when you're too sleepy....
Fulle is offline  
Old October 21st, 2010, 02:32 AM  
New Member
 
Join Date: Oct 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI
thanks
sodino is offline  
Old November 5th, 2010, 06:42 PM  
New Member
 
Join Date: Oct 2010
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

Well I'm glad you brought attention back to this thread lol... I used stringtokenizer's file and changed the .zip parts to .apk so I could sign and app and it said it worked but I can't get it to install on my phone... Anyone offer some help?
StuntinX is offline  
Old December 22nd, 2010, 02:33 AM  
New Member
 
Join Date: Jun 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

just found it today,
might be useful
[TOOL] ROM Cleaner for CWM Roms V# 0.5.1 - xda-developers
BoyPower is offline  
Old January 8th, 2011, 11:00 PM  
New Member
 
Join Date: Jan 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

awsome now I'm signing Roms great
androidfreakpr is offline  
Old July 22nd, 2011, 11:14 PM  
New Member
 
Join Date: Jul 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

help please
after signing update_rom
when I tried to flash it in my phone this messages appear
" E:Can't find update script "

please I need help
almudhi is offline  
sponsored links
Old August 26th, 2011, 06:17 AM  
New Member
 
Join Date: Aug 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You!!
kenhong is offline  
Old September 26th, 2011, 06:07 AM  
New Member
 
Join Date: Sep 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank U
frankyangim is offline  
Old October 30th, 2011, 07:31 PM  
New Member
 
Join Date: Oct 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thx finally managed 2 sing my rom under win xp
UtCollector is offline  
Old December 5th, 2011, 02:32 AM  
New Member
 
Join Date: Dec 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Thank You.

Thank You.
elka is offline  
Old February 8th, 2012, 09:28 PM  
New Member
 
Join Date: Oct 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you so much!! Just signed (successfully, after a few attempts-user error) my first rebuild! Copying last of the files back to SD now (full wipe of everything in progress, figured best time to attempt this as well). Still remains to be seen if I screwed anything up in the process, or if the zip flashes correctly, or at all (running ILWT Rom-G2), Though I have no doubts it's signed properly! Will begin a new post with update should it NOT work or have any issues(though they'd likely be attributable to me) to seek further assistance in correcting any issues/errors. If ya don't see me soon, it all went well!
mikebills is offline  
Old February 20th, 2012, 12:17 AM  
New Member
 
Join Date: Feb 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Thank you so much

I had lot of trouble signing. anyways now its all done . thanks to you
wonderfull job
keep doing things like this
Garry Savieo is offline  
Old March 8th, 2012, 10:30 AM  
New Member
 
wilbso1234's Avatar
 
Join Date: Oct 2011
Posts: 7
 
Device(s): xperia x8 (running My own ROM i made)
Carrier: Not Provided

Thanks: 1
Thanked 1 Time in 1 Post
Default

will this work for linux mint?
wilbso1234 is offline  
Old March 21st, 2012, 03:13 AM  
New Member
 
Join Date: Mar 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks
417408223 is offline  
Old April 4th, 2012, 05:29 PM  
New Member
 
Join Date: Apr 2012
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

could sign but my X19I still said unsigned
br33 is offline  
Old April 4th, 2012, 05:34 PM  
New Member
 
Join Date: Apr 2012
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

after signing update.zip, put in /mnt/sdcard apply update from sdcard
E:signature verification failed

i can't install recovery;img too, no device found with bm drivers

shit!
br33 is offline  
sponsored links
Old October 4th, 2012, 09:08 PM  
wps
New Member
 
Join Date: Oct 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

it very userful for me, thanks!
wps is offline  
Old October 8th, 2012, 09:08 AM  
New Member
 
dyygtfx's Avatar
 
Join Date: Oct 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

对我来说很被挖掘出来,谢谢!

Quote:
google translate:
Tapped for me, thank you!
dyygtfx is offline  
Last edited by lunatic59; October 8th, 2012 at 11:09 AM. Reason: translation
Old December 26th, 2012, 06:10 AM  
New Member
 
Join Date: Dec 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why not working for me? i have followed all the steps, sign successfull a zip rom. when i want to flash the signed rom i got "validade certification failed" what is the problem? please i need help, my tablet is dead
bkdscn is offline  
Old December 26th, 2012, 06:18 AM  
New Member
 
Join Date: Dec 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

感谢分享!

Quote:
google translate:

Thanks for sharing!
shandiandeng is offline  
Last edited by iowabowtech; December 26th, 2012 at 08:46 AM. Reason: language translation
Old March 21st, 2013, 02:45 AM  
New Member
 
Join Date: Mar 2013
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

can't AutoSign.zip (bad),why?
room_yunyun is offline  
Old September 23rd, 2013, 08:56 PM  
New Member
 
Join Date: Sep 2013
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

good
86229199 is offline  
Old November 18th, 2013, 06:44 AM  
RGU
New Member
 
Join Date: Oct 2013
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am doing R&D on FOTA(Firmware Update Over the Air) using Nexus 7-Wifi(grouper). For which I followed the following steps.

1. Downloaded the android source from source.android.com for v 4.2.2_r1 and v 4.3_r1
2. Downloaded the binaries for grouper, extract it to my source folder.
3. Then I compiled the source code using following commands.
i. source build/envsetup.sh
ii. lunch full_grouper-userdebug
iii. make -j8 dist
4. After few tries, I had success in compiling the source for Nexus 7(grouper).
5. I got following files in $out/source_4.2.2/dist folder
-----------------------------------------------
adb*
android-common-carousel.jar
android-common.jar
android-info.txt
android-support-v13.jar
android-support-v4.jar
android-support-v7-gridlayout.jar
build.prop
com.android.nfc_extras.jar
fastboot*
full_grouper-apps-eng.root.zip
full_grouper-emulator-eng.root.zip
full_grouper-img-eng.root.zip
full_grouper-ota-eng.root.zip
full_grouper-symbols-eng.root.zip
full_grouper-target_files-eng.root.zip
gpl_source.tgz
guava.jar
installed-files.txt
jsr305.jar
mkbootfs*
mkbootimg*
mkyaffs2image*
mp4parser.jar
package-stats.txt
ramdisk.img
signapk.jar
vendor_owner_info.txt
-----------------------------------------------
6. Then I generated my own keys using /development/tools/make_key tool for media, testkey, releasekey, shared, platform.
Assume my keys are locate at /keys folder.
7. Then I created a signed target zip file using following command.
/source/build/tools/releasetools/sign_target_files_apks -v -p ../host/linux-x86 -d /keys full_grouper-target_files-eng.root.zip signed_target_files.zip
8. From signed target zip file I create
/source/build/tools/releasetools/img_from_target_files -v -p ../host/linux-x86 signed_target_files.zip signed_img_from_target_files.zip
9. Then I flashed the signed_img_from_target_files.zip using fastboot command using the following script:
----------------------------------------------------------------------
fastboot oem unlock
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
fastboot reboot-bootloader
sleep 10
fastboot -w update signed_img_from_target_files.zip
----------------------------------------------------------------------
10. The device gets flashed well and is working, but I am getting an log while flashing in which it is unable to find boot.sig, system.sig and recovery.sig
11. Now the otacerts.zip file contains a testkey which is not the one that I signed it with.
file located at "/system/etc/security/otacerts.zip" on device.
12. Now since the otacerts.zip is signed with the default key it gives a mismatch error which I tried to flash an OTA update which is signed by the my custom key.

Now my doubt is:
How can I add boot.sig, recovery.sig and system.sig to signed_img_from_target_files.zip?
Is there anything I am doing wrong?
Does the recovery checks the current ROM keys from "/system/etc/security/otacerts.zip"?
What is the correct procedure to sign the OTA update?
RGU is offline  
 
Tags
sign rom

Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://androidforums.com/application-development/8665-how-signing-roms.html
Posted By For Type Date
Android????????????ROM??? This thread Refback March 28th, 2012 01:40 AM
[?] How do you "sign" a .zip file? - xda-developers This thread Refback January 8th, 2012 04:52 AM


All times are GMT -5. The time now is 11:42 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.