Hey I was wondering if anyone could create a batch file that will allow me to drag a file inside and it will automatically sign it and create a new file with the same filename + "-signed".
the command is:
Code:
java -classpath testsign.jar testsign file.zip file-signed.zip
cheers.
sorry didnt read properly..
Please use the search function.
For this time only though
http://forum.xda-developers.com/showpost.php?p=3175518&postcount=2
Related
BuildOS appear with a message: 1c866f27-3fc5-4c9d-a159-9fd4175b8980.rgu Already exist. Now you think just delete the duplicate file but there's no file only 1 in the /temp map. Does someone know how i can get off this error ?
simply use the package creator in order to generate a new GUID name intsead of this one ...
I was wondering if ther was a way to browse the img files created when you make a Nandroid backup. I sorta forgot t make a backup of swype.apk before I themed it with Metamorph. It looks nice and all but I want the OG handy in case I get tired of looking at it. Thanks guys.
Samsung Epic 4g
unyaffs
please do a search next time (even just google something like, "extract nandroid img files"
http://code.google.com/p/unyaffs/downloads/list
made for linux, but if you know a bit of c, you can probably change it to work with windows, maybe I will do that if I have some time this week.
********OR********
http://jiggawatt.org/badc0de/android/unyaffs-x86-win.zip
or http://www.4shared.com/get/fgryPnPx/unyaffs-windows.html
for windows..... instructions below apply for both
if not included in the zips above, cygwin1.dll is included as an attachment of this reply.
open up a command line, in windows vista/7 just press start and then type cmd press enter and change the directory to the folder with the unyaffs and the img in it. in xp press start>run>cmd... then the same
the usage is: unyaffs /path/to/img
example:
(if unyaffs.exe and system.img are both in c:\temp)
"c:\temp> unyaffs system.img"
note: the '/' is the way linux determines the pathname of a file and since it is built using cygwin(a file allowing for windows) it is preferrable that the path to the actual file is in unix POSIX format ie: / instead of \ between folders and files.
*********WARNING************
this will extract to directory that unyaffs binary is in.
Thanks. Good to know and have. Also sorry for not searching.
Samsung Epic 4g
Since I never found any good tutorials for me to enable the crt animation on the galaxy ace (or maybe there are some and im just stupid) I decided to make a tutorial of my own. NOTE : this is the way i did it and it worked so it should also work for you.
WARNING : THIS METHOD INVOLVES MODIFYING YOUR FRAMEWORK-RES.APK FILE, IF YOU DON'T WISH TO POTENTIALLY HAVE TO RE-FLASH YOUR STOCK ROM THEN TURN BACK NOW.. YOU HAVE BEEN WARNED
Anyway to the point.
Prerequisites :
[*] A galaxy ace
[*]A PC
[*] Enabled USB debugging on your phone - Go to settings-->applications-->development and check USB debugging
[*] Your phones USB cable so you can connect it to your PC and the proper drivers installed - or a SD card slot in your PC
(If your on your stock rom just connect to Samsung kies and install the drivers from the menu options, im pretty sure its under tools)
[*]A rooted Ace - http://forum.xda-developers.com/showthread.php?t=1282011
[*] CWM recovery - I have attached it. To flash it boot in recovery (Hold power and home button when you see samsung logo let go of home button). Then select apply update from sd card
[*]Root explorer on the ace - Can be obtained from the Google play store for free
[*]Knowledge of how to navigate through a command prompt environment - http://www.watchingthenet.com/how-to-navigate-through-folders-when-using-windows-command-prompt.html
[*] 7zip - http://www.7-zip.org/download.html
[*]apktools - I've attached an archive of it extract it to any location you want (The C:\ folder would be preferable because then theres less command prompt navigating to do)
[*] A text editor - Notepad will do
[*] Android SDK - (Optional and Recommended) : In case we fail and cant navigate with our phone (But we wont fail hopefully ). Can be downloaded here - http://developer.android.com/sdk/index.html
Ok Assuming we meet all the requirements
Step 1 : Get a copy of your framework-res.apk on your sd card. Do this by starting up root explorer on your phone, navigate to system - framework, scroll down and you should see framework-res.apk. Keep your finger pressed on it and you should see some options, select copy. Now press back twice and find the sdcard folder. Paste it anywhere you want (I made a folder for it so its easier to manage).
Step 2 : : Connect your phone up to your PC:
If you have sd card slots in your PC then unmount your sdcard from your phone by going to settings-SD card and Phone storage , take out your SD card and stick it in the SD card adapter that you should have gotten with your phone and stick that in the SD card slot in your PC
If you don't have an SD card slot then simply connect your phone to your PC via USB. When you connect it you should get a notification saying that the USB is connected, if you didn't you may need to install the drivers. On your phone drag down the notification bar and tap on "USB connected" and then tap "Connect storage to PC"
Step 3 : Now that your phone or SD card is connected you will need to navigate to where you put your framework-res.apk. cut it and paste it to a folder on your computer of your choice (somewhere easy to find). Now make a copy of it (yes that was not a typo we will need the original copy of framework-res if we fail, but we shouldnt fail). Anyway copy and paste it to the folder that you extracted "apktools". So for me that was "C:\Android\apktool" Yes i made a folder called android in C (easier to manage).
Step 4 : Now that we have a copy of framework-res.apk in the apktools folder we can modify it to enable the crt animation (at this point you can choose to disconnect your phone or SD card from your PC and connect it later or leave it in). Now we need to start up command prompt. This is where our years of command prompt navigating come into place . At this moment you should see "C:\Users\<Your Username>", you will need to navigate to where you extracted apktools, if you extracted it in "C:\" or somewhere else easy then this should be a walk in the park for you. If you extracted in "C:\" just type "cd C:\" then "cd apktool" and your there. For others, well....Go on to step 5 in a couple minutes
At the end of it you should see something like "C:\.......\apktool" (not the dots obviously)
Step 5 : now that you have framework-res.apk in the folder where you extracted apktools and you have command prompt open lets get started. First we will need to install framework to your system so we can compile correctly. To do this type "apktool if framework-res.apk" in command prompt. If you were successful you should see something like "I : Framework installed to C:\......."
Step 6: We will now need to decompile framework-res.apk. To do this type "apktool d framework-res.apk framework1". If it decompiled succesfully then there should be a folder called "framework1" where you extracted apktool.
Step 7 : Now we get to make that modification we need. Click on "framework1" --> "res" -- > "values". Find a file called "bools.xml" right click on it and click edit. Now we are looking for this line :
<bool name="config_animateScreenLights">true</bool>. Once you have found it change "<bool name="config_animateScreenLights">true</bool>" to "<bool name="config_animateScreenLights">false</bool>" now we save it (Do not click "save as" just click save)
Step 8 we will now need to recompile framework-res.apk. So open up the handy dandy command prompt and type "apktool b framework1 framework-res-new.apk". If all went well you should see a file called "framework-res-new.apk (Dont worry about all the writing in the command prompt window you saw, if you saw any). framework1 is the folder with our edited file
" NOTE: We are NOT using framework-res-new.apk as our new framework-res.apk IT WILL NOT WORK
Step 9 : This is where we are going to use 7zip. You have to open your original apk (the one we copy pasted into the apktool folder) with 7zip. right click on "framework-res.apk". Click "Open" and a window should show up check the box that says to open with a list of installed programs. You will need to browse to the folder you installed 7zip and click on "7zFM", then click "Ok". Now that we have our original "framework-res.apk" open in 7zip need to navigate to the "framework1" folder. Click on "Build -->apk" and there should be a file called "resources.arsc". Drag and drop this file in the 7zip window. You should get a confirmation box. Click "Ok" (There is already one in the 7zip window, the one we are dragging and dropping will replace it).
Step 10: Once we have replaced the "resources.arsc" file we can close the 7zip window. Now heres where the android SDK comes in handy. The rest of this tutorial will be split up into 2 parts; People with the android SDK and people without it
People with Android SDK
NOTE : you have the USB cable to your phone then you can continue on with this, if you only have the SD card however you will need to go to the "People without Android SDK" section to continue.
You will need to copy and paste the "framework-res.apk" (The one in the apktool folder) to the "platform-tools" folder in the android sdk folder. If you installed it in the default location it should be here - "C:\Program Files (x86)\Android\android-sdk\platform-tools", if you have copy pasted it in the "platform-tools" folder you should see a file called "adb"("adb" is a file located in the platform-tools folder).
Now connect your phone to your PC and boot your phone in recovery mode. Select mounts and storage and select mount/system.
Open up command prompt and navigate to the "platform-tools" folder where you pasted "framework-res.apk". Your command prompt window should look something like this : "C:\.....\platform-tools". Now to make sure your phone is connected properly type in "adb devices", you should see your device under list of attached devices. Now that your phone is in recovery mode, you have the "framework-res.apk" in your "platform-tools" folder and you have mounted the system type in
Code:
adb shell mv system/framework/framework-res.apk system/framework/framework-res.old
This will make a backup of your original "framework-res.apk". Then type
Code:
adb push framework-res.apk system/framework
This will replace your original "framework-res.apk" with the one you modified. Once that is done, unmount/system, clear the cache partition and clear the dalvik cache (select "advanced -->clear dalvik cache") and then reebot the system. This will take a few minutes because we cleared the dalvik cache so please be patient. We are not done yet.
If your phone is not responding once you reboot it then you will need to boot in recovery, connect your phone to your PC, mount/system, open up command prompt and type
Code:
adb shell rm system/framework/framework-res.apk
adb shell mv system/framework/framework-res.old system/framework/framework-res.apk
reboot
(Personally this has never happened to me but these commands will replace your old "framework-res.apk, so your phone will start responding) You may need to repeat the steps to get your CRT animation working because something in your framework-res.apk probably screwed up (again its just a hunch as it has never happened to me)
If your phone is responding or you repeated the steps to get it responding then you can follow these steps. Once the phone has rebooted Open up root browser and navigate to "system-->framework" and change the permissions of framework-res.apk to "rw-r--r--".Then find your build.prop file, highlight it and click edit (you may want to make a backup of it first). Find the line that says "debug.sf.hw= 1 and add a "#" at the front so it looks like this "#debug.sf.hw= 1" essentially you are just commenting the line out. Were almost done. Go to "Settings-->Display-->Animation" and check "All animations" And then reboot your phone. Once your phone is rebooted enjoy your new CRT animation. If it worked for you dont forget to press the "thanks" button
People without Android SDK
If you were directed here from "People with android SDK" because you didnt have the USB cable then stick your sd card in the computer using the adapter (please tell me you have the adapter..)
WARNING : IF THIS METHOD DOES NOT WORK AND YOUR PHONE DOESNT RESPOND YOU MAY NEED TO RE-FLASH A STOCK ROM THEN GO BACK TO A CUSTOM ROM IF YOU HAVE ONE, YOU MAY WISH TO TURN BACK AND ABANDON TRYING TO GET THE CRT ANIMATION, BUT ASSUMING YOU HAVE FOLLOWED THE STEPS PROPERLY IT SHOULD WORK PLUS YOU HAVE COME THIS FAR
If you have your USB cable then connect your phone up to the computer (Im assuming you know how to do this now). locate the "framework-res.apk file in the "apktool" folder the copy/paste it anywhere on your SD card ( i made a folder for it). Make sure you have a backup of the original framework-res.apk. Now that you have the modified framework-res.apk in your SD card open up root browser, find your modified framework-res.apk and move it to "system-->framework", it will replace the original one, so be sure to have a backup then change the permissions of framework-res.apk to "rw-r--r--". Once this is done go into "system" and find your build.prop file, highlight it and click edit (you may want to make a backup of it first). Find the line that says "debug.sf.hw= 1 and add a "#" at the front so it looks like this "#debug.sf.hw= 1" essentially you are just commenting the line out. Were almost done. Go to "Settings-->Display-->Animation" and check "All animations" And then reboot your phone. Once your phone is rebooted enjoy your new CRT animation. If it worked for you dont forget to press the "thanks" button
A special thanks to the following threads and forums for helping me help you
http://androidforums.com/esteem-all-things-root/520917-guide-how-properly-decompile-recompile-apks-apktool.html
http://forum.xda-developers.com/showthread.php?t=1185231&page=4
http://forum.xda-developers.com/showthread.php?t=1225565
If you have any questions or it didnt work please post them and ill try answer them to the best of my slightly noobish ability
Actually we already have same thread here :-? why did u re-post again? and I feel this guide is more complicated :-< sr but just my own feeling.
wait we do? i couldnt find it thats why i made a guide
Eh?!
I though
Open up root browser and navigate to "system-->framework" and change the permissions of framework-res.apk to "rw-r--r--".Then find your build.prop file, highlight it and click edit (you may want to make a backup of it first). Find the line that says "debug.sf.hw= 1 and add a "#" at the front so it looks like this "#debug.sf.hw= 1" essentially you are just commenting the line out. Were almost done. Go to "Settings-->Display-->Animation" and check "All animations" And then reboot your phone. Once your phone is rebooted enjoy your new CRT animation.
is enough?
EJ98 said:
I though
Open up root browser and navigate to "system-->framework" and change the permissions of framework-res.apk to "rw-r--r--".Then find your build.prop file, highlight it and click edit (you may want to make a backup of it first). Find the line that says "debug.sf.hw= 1 and add a "#" at the front so it looks like this "#debug.sf.hw= 1" essentially you are just commenting the line out. Were almost done. Go to "Settings-->Display-->Animation" and check "All animations" And then reboot your phone. Once your phone is rebooted enjoy your new CRT animation.
is enough?
Click to expand...
Click to collapse
Im not understanding your question
Well honestly, there's one better tutorial out there, anyways good effort!
Congratulations, but i dont have courage to do it.
Don't work in my Galaxy Ace. When I put the mod framework-res.apk in phone, this made a reboot and never boot again.
I made a restore with CWM and the phone back from dead
Note a problem when I do the recompile, the final file turns out only with 3MB and the original have 6MB. Is the problem?
Sorry my english
ghostrat said:
Don't work in my Galaxy Ace. When I put the mod framework-res.apk in phone, this made a reboot and never boot again.
I made a restore with CWM and the phone back from dead
Note a problem when I do the recompile, the final file turns out only with 3MB and the original have 6MB. Is the problem?
Sorry my english
Click to expand...
Click to collapse
First of all i am very sorry for my late reply been very busy with tests and stuff. What happened was you didnt put the resources.arsc file into your original apk. If you still have the original and the modded apk open up your modded apk with 7zip (it should be called framework-res-new.apk) and find a file called "resources.arsc", open up your original framework-res.apk and drag and drop the resources.arsc file from the modded apk into the original framework-res.apk, put the original framework-res.apk into your phone in the appropriate folder, enable all animations from settings-->display and reboot, you should now have the crt animation
It worked for me but I had to restart the phone after editing the build.prop file. thanks given to you.
getting this error @ step#8
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Chito>cd..
C:\Users>cd..
C:\>cd apktool
The system cannot find the path specified.
C:\>cd android/apktool
C:\android\apktool>apktool if framework-res.apk
I: Framework installed to: C:\Users\Chito\apktool\framework\1.apk
C:\android\apktool>apktool d framework-res.apk framework1
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
C:\android\apktool>apktool b framework1 framework-res-new.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\android\apktool\framework1\res/layout-sw600d
p
invalid resource directory name: C:\android\apktool\framework1\res/layout-w600dp
invalid resource directory name: C:\android\apktool\framework1\res/values-h720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Chito\AppData\Local\Temp\A
PKTOOL7712514577009503253.tmp, -x, -S, C:\android\apktool\framework1\res, -M, C:
\android\apktool\framework1\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\Chito\AppData\Local\Temp\APKTOOL7712514577009503253.tmp, -x, -S, C:\android
\apktool\framework1\res, -M, C:\android\apktool\framework1\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
Step 7 : Now we get to make that modification we need. Click on "framework1" --> "res" -- > "values". Find a file called "bools.xml" right click on it and click edit. Now we are looking for this line :
<bool name="config_animateScreenLights">true</bool>. Once you have found it change "<bool name="config_animateScreenLights">true</bool>" to "<bool name="config_animateScreenLights">false</bool>" now we save it (Do not click "save as" just click save)
Click to expand...
Click to collapse
It working on s5830.
Thank you.
Hello ,
How can I make CWM flashable zip ?
I'm making mod but I can't make flashable zip
Example : I made icon pack for Contacts , mms, video player. Carry the system folder manually. And set permissions. This is very exhausting. I want to make flashable zip.Please make detailed guide. If you help me I would be happy. Thank you.
Arnadel said:
Hello ,
How can I make CWM flashable zip ?
I'm making mod but I can't make flashable zip
Example : I made icon pack for Contacts , mms, video player. Carry the system folder manually. And set permissions. This is very exhausting. I want to make flashable zip.Please make detailed guide. If you help me I would be happy. Thank you.
Click to expand...
Click to collapse
Scripts for creating flashable zips and signing apk/zip files
Just wanted to share a few scripts that I have created for making things a little bit easier. These are bash scripts so they are only going to be functional in a bash shell such as Linux or OS X. If you're running on Windows then you might be able to execute these in Cygwin but I don't know that for certain. You could simply run the same commands in a DOS prompt. You might have to change syntax a little and manually execute them, but the basic process is the same.
I'm going to assume that you are familiar with adb. If not, go learn about it -- download the Android SDK, install the platform-tools, and make sure you can use it! You will probably want it to be in your PATH variable so that you can execute it at any time from a command line.
The next thing you will need is apktool installed, so that you can extract and build .apk files. This can be found here:
http://code.google.com/p/android-apktool/
Now we can move on to using these scripts. There are three files included inside of the scripts.zip file attached to this post. The zip file contains the following:
1. signit: This script will sign a .zip file or a .apk file. If you send in a .apk file as an argument then it will also zipalign the file. It uses testkeys to sign files. 2. createzip: This script will create a skeleton zip file for you. It will print out some instructions to help guide you with the creation. 3. update-binary: This file will never change. It's an interpreter for Edify scripts -- which is what YOU will be writing! You need to include an Edify script inside of the zip file so that recovery knows what exactly you want it to do. This file should be carried around inside of each zip as it converts your Edify script into something that recovery can actually understand and execute.
You will need to make sure that signit and createzip are executable. I would just use chmod +x on them.
The fourth and final thing you need is testsign.jar. You can get it here:
http://code.google.com/p/zen-droid/d...n.jar&can=2&q=
If you look at the top of the createzip/signit script you will see that the the variable binLoc gets set to /usr/local/bin. What this means is that you should place all four of the above files into that location. If you don't like /usr/local/bin then just change the binLoc variable to point to some other directory where you will store these 4 files, and make sure that directory is in your PATH variable.
We'll start by just modifying some images in a single file. For example, let's modify the battery icons in /system/framework/framework-res.apk. I'm not going to add or remove any icons that didn't previously exist, I'm simply going to change a few of them. If you really want to get into modifying some files then you will need to decompile the file in order to change any corresponding XML files (sidetrack -- if you're curious then look in res/drawable at the following 3 files: stat_sys_battery.xml, stat_sys_battery_charge.xml, zzz_stat_sys_battery_1.xml). I'm going to throw this step into the instructions, not because it's necessary here, but because it's a good idea to know how to do it anyway. So let's try and modify our icons!
The basic steps would be something like what I outline below. Before you try this I suggest you make a full backup in recovery just in case something goes wrong. I have reviewed the steps below several times and even walked through them to make sure they are correct so they should work for you.
1. Get the apk file:
Code: $ adb pull /system/framework/framework-res.apk
Copy this file somewhere safe because we are going to push it back to the phone later (you probably won't want to keep the edits we make in step 3 below indefinitely).
2. Decompile it with apktool:
Code: $ apktool d framework-res.apk
3. Update the necessary files:
Step 2 should have unpacked the file into a folder named framework-res. We want to update the necessary files inside of it. The battery icons are all stored res/drawable-hdpi. Navigate to that directory and look for files like stat_sys_battery_*.png. These are the images that get displayed while your phone is running on battery power. The charging images are stat_sys_battery_charge_anim*.png. If you have a set of icons that you want to use then simply paste those icons in and overwrite the existing ones. You can move on to the next step.
If you don't already have images lined up then we can just modify some existing ones to verify that your changes worked. I'll assume you have the stock MikG battery icons (or some way of knowing what your current charge level is) so take note of what your current charge level is, and then modify a few of those images around that area. For example, if your phone is currently at 65% then maybe you will want to modify stat_sys_battery_charge_anim66.png, stat_sys_battery_charge_anim67.png, stat_sys_battery_charge_anim68.png, etc. Just open up these files in GIMP, Photoshop, or whatever. Don't change their size but just change something -- maybe change the color from white to green. Or you could just draw some lines on them. Just make some changes that will be noticeable and then save the files.
4. Package it back up:
Code: $ apktool b framework-res framework-res.apk
5. Sign it using the signit script:
Code: $ signit framework-res.apk
6. Create a skeleton zip file using the createzip script:
Code: $ createzip system/framework framework-res.apk
Note that the createzip script accepts 2 arguments. The first is the directory where the file needs to go, and the second is the name of the .apk file. If you wish, you can run the script without any arguments and it will prompt you for the values. In either case it will give you instructions for what to do next. Here is an example in interactive mode (values that I typed in are highlighted in blue):
Code: $ createzip Please enter the directory that your apk file will go in Example: system/framework system/framework Please enter the apk file to put into this zip Example: framework-res.apk framework-res.apk Creating appropriate directory structure Directory structure complete. A sample updater-script file has been created for you. This sample script will push a file to the /system mount point.
Next steps: 1. If necessary, modify the file /home/gamblor/Desktop/scripts/zip/META-INF/com/google/android/updater-script
2. When script is complete then zip up the directory and sign it: $ cd zip $ zip -r name.zip * $ signit name.zip
7. Make the actual zip file:
Zip up the directory in a recursive fashion using the exact instructions supplied by the script. Note that the createzip script will build a sample updater-script file for you, which says to mount /system and push the files over to it (since that's what most flashable zips do anyway). For this reason, you shouldn't actually need to modify that script at all for the purposes of this tutorial. It doesn't do anything fancy like scroll text across the screen, but it should do the trick to get the file installed. Feel free to open it up with a text editor and see what it does. It will also copy the file framework-res.zip to the appropriate location so everything is in place and we can create our actual zip:
Code: $ cd zip $ zip -r battery-icons.zip * $ signit battery-icons.zip
8. Flash it like you would any other file:
At this point you should have a file named battery-icons-signed.zip. Copy that file to your sdcard and then reboot into recovery and flash it (remember to backup first, if you haven't already). If everything goes well then you should be able to reboot and then check the battery icons for the percentage level that you modified. If everything went well then you should see your modified icons. Congratulations!
As a side note, if you're making mods for yourself and don't plan on creating a flashable zip (or maybe not just yet), you can easily just push the file in adb. This saves you from having to make a zip file, sign it, copy it to your zip card, reboot, and then flash from recovery. So you can just replace step 6 above with the following commands and stop after this:
Code: $ adb remount $ adb shell stop $ adb push framework-res.apk /system/framework $ adb shell start
Obviously since this post was supposed to demonstrate creating a zip file, I included those instructions. But pushing stuff in adb is a shortcut if you're just looking to test things out on a single phone and don't want to waste time dropping into recovery. Remember that file that I told you save away in step 1? Well, if you want to restore your battery icons so that some of them don't have weird colors/marks on them then cd into the directory where you saved the original file away, and then just run the 4 commands above. It should replace the file with the original one, thus setting the battery icons back to the way they were before you ever ran any of the commands above.
So something very simple. Just a little batch file I made but I thought is useful.
NOTE: The point of this batch file is to be able to sign apk's and zips from anywhere in any of your directories, without needing to have the signapk.jar and key files in the same directory. It will not perform any magic and sign system apps with the system signature, or non-system apps with the system signature.
This will sign whatever you give to it...just put it somewhere that is in your path and edit the line that says this:
Code:
set signdir=[U][B]C:\eclipse-adt\cmdtools[/B][/U]
Change C:\eclipse-adt\cmdtools to the path of wherever your signapk.jar file is (your keys should be in that same folder, named publickey.x509.pem and privatekey.pk8).
Example:
Code:
set signdir=[U][B]C:\bill\android\signing-tools[/B][/U]
Anyway, usage for the batch file is as follows (also tells you usage if you pass no parameters to the batch file, e.g. just call signapk).
Code:
Signapk.bat: Sign files from anywhere
Usage: signapk inFile [outfile]
Examples:
signapk mod1.zip [implicit 2nd parameter of mod1-signed.zip]
signapk mod1.zip finalMod.zip
signapk frameworkTW.apk softkeyHack.apk
First example will output a mod1-signed.zip as the signed version of mod1.zip.
Second example will output finalMod.zip as the signed version of mod1.zip.
Third example will output fsoftkeyHack.apk as the signed version of frameworkTW.apk.
Note that if you only pass ONE parameter to the batch file (e.g. the file to sign), then the output file will ALWAYS be named <fileName>-signed.<extension>, as mod1.zip created a mod1-signed.zip output in the example above.
So yeah. Very simple, but I was getting tired of copying my files to my signapk directory and then copying back...so just thought I should share.
If you don't feel like downloading the file, you can create it yourself by copying the content from here: pastebin.com/u6Zj3rsH and pasting it into a file named "<FILE_NAME_HERE>.bat".
Download:
Code:
e1d7016e1b56aa32824974125a424869 *signapk.zip
Awesome man. I've heard in the past that there were methods to sign any apk. Just never knew how. Great share. :thumbup:
Sent from my SPH-L710 using Xparent Skyblue Tapatalk 2
No no, you're misunderstanding...this is to sign from anywhere without need the signapk.jar to be in the folder of the file you are trying to sign.
This will not allow you to sign system apps and such, but there are tricks to get the right signature on those (such as copying the META-INF folder from the original, signed system app zip [an apk is essentially a specialized zip file] to the newly compiled system app zip)
So if I unzipped a ROM on C:\ROM and edited it, zipped it again, but have this file in my Downloads folder, I can sign it so it will flash?
I have no idea what I'm doing.