[SCRIPT/HOW-TO] Sign files with terminal (Ubuntu) - G1 Android Development

sign files with a right click (Ubuntu) (Thanks Amon_RA)
-----------------------------------------------------------------------------------------------------------------
This little novice, 2-line script will help you sign update.zip files directly from any terminal window if you have the Android SDK set up on your machine. It might be pointless to some, but I thought it would be a nice idea to share.
Navigate to your Android SDK directory.
Create a folder and name it "sign".This is where you will put the update.zip that you want to sign.​
Download the attached testsign.jar file [extract from zip] and move it to the new /sign directory in your Android SDK.
Navigate to your /tools directory and Right-Click > Create Document > Empty File.
Give it a name without extension.example: sign​
Right-Click > Open with "Text Editor" and add the following:Change the directories according to your setup.
#!/bin/sh
java -classpath /AndroidSDK/sign/testsign.jar testsign /AndroidSDK/sign/update.zip /AndroidSDK/sign/update-signed.zip
Click to expand...
Click to collapse
Give it executable permissions with the terminal -
Code:
cd /YOUR-SDK-DIRECTORY/tools/
chmod a+x sign
Now you can simply drop the update.zip to your /sign directory and from the terminal type:
Code:
sign
and it will sign it without having to add the long command yourself.
Of course you can edit the script to fit your needs.
---- Optional ----
By making a link (right-click > Make Link) of your /sign directory and adding it to your Desktop, you can drag and drop update.zip directly to this link and sign. This save you some time in the signing process and you have access to it from your Desktop.
---- Optional ----
Thank you Cyanogen for this reply.

mods, please sticky this as i'm sure many will find this very informative

Perfect howto, just works like a charm Thanks to the author!

Thank you so much! Just started using ubuntu in a VM. Think you could write up a guide on setting up eclipse? That'd be absolutely super. Thanks again lol. Helped me sign files + set up the sdk. Great work.

alritewhadeva said:
Thank you so much! Just started using ubuntu in a VM. Think you could write up a guide on setting up eclipse? That'd be absolutely super. Thanks again lol. Helped me sign files + set up the sdk. Great work.
Click to expand...
Click to collapse
Well, setting up eclipse is fairly simple!
download Eclipse
unzip it any directory/AndroidSDK/Eclipse | /home/wddglr/Apps/Eclipse​
set up the ADT following the information in this page: [http://developer.android.com/sdk/1.5_r3/installing.html]

wddglr said:
Well, setting up eclipse is fairly simple!
download Eclipse
unzip it any directory/AndroidSDK/Eclipse | /home/wddglr/Apps/Eclipse​
set up the ADT following the information in this page: [http://developer.android.com/sdk/1.5_r3/installing.html]
Click to expand...
Click to collapse
Ah thank-you. I'll PM you if i run into any problems if thats okay. I'm a noob with ubuntu just set it up yesterday.

i love you man j/k
THANK UUUUUUUUUU so much man

if you use lots of different named update zips.
This is step 6
#!/bin/sh
echo -n "Source Zip Filename : "
read input
echo -n "Output Zip Filename : "
read output
java -classpath /androidsdk/sign/testsign.jar testsign /androidsdk/sign/"$input" /androidsdk/sign/"$output"
echo "Finished signing $input as $output"
Click to expand...
Click to collapse
Just input the source file and the output and it does the rest.
Was useful for me as I sign different zips.
Use as you wish, thanks to wddglr.

I don't know why I can never get this to work.
This is exactly what I see when I ls /AndroidSDK/sign:
[email protected]:~$ ls /AndroidSDK/sign
testsign.jar update.zip
[email protected]:~$ sign
Exception in thread "main" java.lang.NoClassDefFoundError: testsign
at gnu.java.lang.MainThread.run(libgcj.so.90)
Caused by: java.lang.ClassNotFoundException: testsign not found in gnu.gcj.runtime.SystemClassLoader{urls=[], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.90)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at gnu.java.lang.MainThread.run(libgcj.so.90)
Click to expand...
Click to collapse

Binary100100 said:
I don't know why I can never get this to work.
This is exactly what I see when I ls /AndroidSDK/sign:
[email protected]:~$ ls /AndroidSDK/sign
testsign.jar update.zip
Click to expand...
Click to collapse
I was wondering if you were you able to solve this? Becouse I'm getting the same.. I'm thinking it has something to do with jave. But not sure what I need to do to fix it.. thanks for any info ....

yea me toooo
edit i figured it out
Code:
# Right-Click > Open with "Text Editor" and add the following:
Change the directories according to your setup.
Quote:
#!/bin/sh
java -classpath [B]/AndroidSDK[/B]/sign/testsign.jar testsign /[B]AndroidSDK[/B]/sign/update.zip /AndroidSDK/sign/update-signed.zip
yeah that is not where my tools are lol

wddglr said:
sign files with a right click (Ubuntu) (Thanks Amon_RA)
-----------------------------------------------------------------------------------------------------------------
This little novice, 2-line script will help you sign update.zip files directly from any terminal window if you have the Android SDK set up on your machine. It might be pointless to some, but I thought it would be a nice idea to share.
Navigate to your Android SDK directory.
Create a folder and name it "sign".This is where you will put the update.zip that you want to sign.​
Download the attached testsign.jar file [extract from zip] and move it to the new /sign directory in your Android SDK.
Navigate to your /tools directory and Right-Click > Create Document > Empty File.
Give it a name without extension.example: sign​
Right-Click > Open with "Text Editor" and add the following:Change the directories according to your setup.​
Give it executable permissions with the terminal -
Code:
cd /YOUR-SDK-DIRECTORY/tools/
chmod a+x sign
Now you can simply drop the update.zip to your /sign directory and from the terminal type:
Code:
sign
and it will sign it without having to add the long command yourself.
Of course you can edit the script to fit your needs.
---- Optional ----
By making a link (right-click > Make Link) of your /sign directory and adding it to your Desktop, you can drag and drop update.zip directly to this link and sign. This save you some time in the signing process and you have access to it from your Desktop.
---- Optional ----
Thank you Cyanogen for this reply.
Click to expand...
Click to collapse
I tried every way I could, and as stupid as I am, I could not get it to work!!!
[email protected]:~$ sign
bash: sign: command not found
[email protected]:~$ cd /home/ccriffman/android/tools
[email protected]:~/android/tools$ sign
bash: sign: command not found
[email protected]:~/android/tools$ cd /home/ccriffman/android
[email protected]:~/android$ sign
bash: sign: command not found
[email protected]:~/android$ cd /sign
bash: cd: /sign: No such file or directory
[email protected]:~/android$ cd /home/ccriffman/android/sign
bash: cd: /home/ccriffman/android/sign: No such file or directory
[email protected]:~/android$ cd /tools
bash: cd: /tools: No such file or directory
[email protected]:~/android$ cd tools
[email protected]:~/android/tools$ sign
bash: sign: command not found
[email protected]:~/android/tools$ cd sign
bash: cd: sign: Not a directory
[email protected]:~/android/tools$ sign
bash: sign: command not found
[email protected]:~/android/tools$

joe v said:
I was wondering if you were you able to solve this? Becouse I'm getting the same.. I'm thinking it has something to do with jave. But not sure what I need to do to fix it.. thanks for any info ....
Click to expand...
Click to collapse
Yeah, I got it to work. The problem was with my Java.

testsign.jar in wrong spot
I got mine fixed. I had testsign.jar inside of the testsign folder inside the sign folder.
testsign.jar needs to be in the 'root' of the sign folder, or you need to modify the sign script to point to the correct location.

pconwell said:
I got mine fixed. I had testsign.jar inside of the testsign folder inside the sign folder.
testsign.jar needs to be in the 'root' of the sign folder, or you need to modify the sign script to point to the correct location.
Click to expand...
Click to collapse
..... damnit.
I did the same thing
======EDIT=======
Now I am getting this error:
sign
No command 'sign' found, did you mean:
Command 'bsign' from package 'bsign' (universe)
Command 'psign' from package 'radiance' (universe)
sign: command not found
Click to expand...
Click to collapse
Help?

I guess it means I've failed???

This script worked great, I really appreciate it. I did modify it a bit so that I don't have to necessarily sign update.zip every time. It is similar to the script posted on the first page, but rather than it asking for the input and output, you simply add parameters to the sign command. For example:
Code:
sign <input> <output>
See the code below, make sure you change the directory to where you have the sign folder located.
Code:
#!/bin/sh
java -classpath /opt/android/sign/testsign.jar testsign /opt/android/sign/$1 /opt/android/sign/$2
echo "Finished signing $1 as $2"
Hope this helps anyone.

An even better modification is to make it only take ONE parameter:
#!/bin/bash
mv $1 /tmp/$$-$1
java -classpath /opt/android/sign/testsign.jar testsign /tmp/$$-$1 $1
rm /tmp/$$-$1
Note that this form is also independent of the location of the archive to sign -- it is nicer to enter that particular directory and just run "sign file.zip".

You should really mention that the tools directory has to be added to $PATH..
Not everyone has this, if you don't then simply typing sign will not work

wedsxcrfv said:
You should really mention that the tools directory has to be added to $PATH..
Not everyone has this, if you don't then simply typing sign will not work
Click to expand...
Click to collapse
Well it should be correctly assumed that $PATH was correctly set when they installed the Android SDK, because if they followed the instructions provided by the SDK's documentation then it says to set the $PATH var in "~/.bashrc" or "~/.bash_profile".
From: http://developer.android.com/sdk/installing.html
On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:<your_sdk_dir>/tools
Click to expand...
Click to collapse

Related

[HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux

When I first attempted to install the SDK, I found tutorials that only had bits and pieces about the whole procedure. A lot of Google searches and hours of eye strain. I wanted to write a solid tutorial, but instead of publishing it in a personal blog, I chose to publish it here on xda-developers. This is the definite forum to come to if you are interested in Android/G1/HTC Dream development or costumization. I wrote this to make the enlarge the knowledge of this community.
!! THIS TUTORIAL IS FOR THE LATEST UBUNTU RELEASE: JAUNTY JACKALOPE 9.04 !!
!!START -------------------------------------- Optional Preparation --------------------------------------
This applies if you -
Are interested in installing Ubuntu for the first time.
Are/will be reinstalling Ubuntu from scratch.
Want to keep your SDK installation easy to reach.
Want to keep things nice and clean.
And your machine -
Has a second hard drive.
Has free space for another small partition.
This procedure will make things easier during installation of the SDK and in the long run. Hopefully you've read about partitions. If you are dualbooting, please read this first to get an idea of what you're doing.
While installing Ubuntu and on the Prepare Disk Space screen (partition editor), select "Specify partitions manually (Advanced)"
On the Create Partition dialog, select the following options:
Type for the new partition: Primaryor Logical if you're dualbooting and know what you are doing.​
New partition size in megabytes: 5120MB (5GB) might work. BUT:
ccyrowski said:
It should be noted that if you ever plan on compiling kernels and/or cupcake ROM's you will NEED ubuntu8.04. You'll also need at least 10GB.
Click to expand...
Click to collapse
Location for the new partition: Beginning
Use as: Ext4 or Ext3Filesystem doesn't matter. (?)​
Mount point: /AndroidSDKEnter this manually​
Complete Ubuntu installation as usual.
-------------------------------------- Optional Preparation -------------------------------------- END!!​
You will now install the SDK.​
!!START -------------------------------------- Installing Android SDK --------------------------------------
Installing the SDK is the easiest of all.
Download the SDK.169.9 MB [http://developer.android.com/sdk/download.html?v=android-sdk-linux_x86-1.5_r3.zip]​
Right-click and select Extract Here.
Move the contents of the android-sdk-linux_x86-1.5_r3 directory to your desired location.If you followed Optional Installation, move the contents to your /AndroidSDK directory in the root of your filesystem.​
Close directory window.
-------------------------------------- Installing Android SDK -------------------------------------- END!!​
You will now set up your bashrc file and UDEV to recognize your HTC Device.​
!!START -------------------------------------- ADB + FASTBOOT --------------------------------------
The Android Debug Bridge (adb) is one of the tools that will help you the most when you run into flashing problems or running shell commands directly from your machine. UDEV will not recognize your G1 out of the box, but we will configure it with some rules so it can connect.
We will work with /AndroidSDK as the location of your sdk. If this is not your setup, I think you're smart enough to figure it out.
Editing .bashrc file to use tools from /AndroidSDK/tools/ directory -
Go to your home folder.Example: /home/wddglr/​
Press Control + H to view hidden files.
Look for your .bashrc file and double click to open it with gedit.
Add the following lines to the top of the file:
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
IMPORTANT NOTE
savethechicken said:
This is the way that I have my .bashrc file setup. For those having problems with it not recognizing the adb as a command try this...
Code:
export PATH=$PATH:/AndroidSDK/tools
I removed the {} around ${PATH} and it is working if I had them on it would say that it didn't recognize the command. Removed them and all works well.
Click to expand...
Click to collapse
Setting up UDEV to recognize HTC Device -
Type the following into a terminal (Applications > Accessories > Terminal):
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
Now add the following line to the blank file:
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Click save and close.
To restart udev, open up a terminal and enter:
Code:
sudo /etc/init.d/udev restart
Setting up fastboot -
Download this fastboot binary from http://android-dls.com.130.4 KB [http://android-dls.com/files/linux/fastboot]​
Once downloaded to your desktop, right click and select Properties.
Navigate to the Permissions tab and configure the following option:Execute: [√] Allow executing file as program​
Click Close.
Move the fastboot bianary to your /AndroidSDK/tools/ directory.
Reboot.
-------------------------------------- ADB + FASTBOOT -------------------------------------- END!!​Now you can use adb and fastboot directly from any terminal. If you chose to do the Optional Preparation, you can now save your Eclipse Workspace and your downloaded/custom ROMs/Themes in this new /AndroidSDK directory keeping things easier to reach and safe from evil disk errors or other mishaps!!! :O​If you are having problems, send me a PM. I will be happy to help.
*applaudes* awesome. Should be added to helpful threads.
very nice! perhaps add a "(How-To)" prefix to thread??
Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"
I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?
nicholasbithell said:
Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"
I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?
Click to expand...
Click to collapse
it does not exist, you will make it.
do the command as stated above.
Code:
gksu gedit /etc/udev/rules.d/51-android.rules
Damn you beat me to it!
I was just thinking earlier about doing this same "How-To" guide, I was surprise to see it posted just now.
Anyways, great job!
Can someone sticky this thread. Now I have ADB & fastboot on my Win7, Ubuntu, and OS X Partition. Thank you wddglr.
bravo...linux rocks even better now!...
Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.
The onlything that is not clear and/or confuses me is
Setting up the udev to recognize the device.
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.
savethechicken said:
Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.
The onlything that is not clear and/or confuses me is
Setting up the udev to recognize the device.
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.
Click to expand...
Click to collapse
It happens to me also from time to time. especially when i reboot and want to go into adb while the device is rebooting. although that file, 51-adndroid.rules, is what helped me get adb to recognize the device. the guide on developer.android.com talked about 50-android.rules but after a few deep searches i found this: http://groups.google.com/group/android-developers/browse_thread/thread/1d3488c601243686
Okay A few questions for you....
First I fixed the whole "couldnt find the (51-android.rules) file now I am having issues with executing ADB!
When in terminal this is what I get...
"[email protected]:/home/nick# /AndroidSDK/tools/adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:/home/nick#"
and I also noticed something different from when I start terminal the first lines now state
"bash: : command not found
[email protected]:~$"
I dont remember the first line ever being there, but I could be mistaken!
Any help would be greatly appreciated!
Edit: You state creating "Mount point: /AndroidSDK" During Installation, and what I did was Just place my AndroidSDK at root so it is at "/AndroidSDK". I dont know if this makes a difference.
I am actually running ubuntu 8.10 ha! I just tried to update But I keep getting errors! is there anything I can change to get this to work on ubuntu 8.10?
nicholasbithell said:
First I fixed the whole "couldnt find the (51-android.rules) file now I am having issues with executing ADB!
When in terminal this is what I get...
"[email protected]:/home/nick# /AndroidSDK/tools/adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:/home/nick#"
and I also noticed something different from when I start terminal the first lines now state
"bash: : command not found
[email protected]:~$"
Edit: You state creating "Mount point: /AndroidSDK" During Installation, and what I did was Just place my AndroidSDK at root so it is at "/AndroidSDK". I dont know if this makes a difference.
I am actually running ubuntu 8.10 ha! I just tried to update But I keep getting errors! is there anything I can change to get this to work on ubuntu 8.10?
Click to expand...
Click to collapse
okay, a few things -
seems like your .bashrc file isn't setup right (?)
make sure that the two lines you inserted into it are on separate line
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
because maybe export PATH=${PATH}:/AndroidSDK/tools got commented on accident if you copy pasted.
When copying your SDK to the root of your filesystem, did you copy it as your own user or as root? you can use:
Code:
gksu nautilus
to copy system files with complete root privileges.
What exactly are you trying to update, Ubuntu or ... ? There shouldn't be a difference to get this working on 8.10, the only thing that seemed to change was the 51-android.rules file. Maybe this can help -
renaming it to 50-android.rules with
Code:
gksu nautilus
and deleting any backups (use CTRL+H to view hidden files).
restarting udev using:
Code:
sudo /etc/init.d/udev restart
Remember this is for 9.04, not 8.10. I hope this helps.
wddglr said:
okay, a few things -
seems like your .bashrc file isn't setup right (?)
make sure that the two lines you inserted into it are on separate line
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
because maybe export PATH=${PATH}:/AndroidSDK/tools got commented on accident if you copy pasted.
When copying your SDK to the root of your filesystem, did you copy it as your own user or as root? you can use:
Code:
gksu nautilus
to copy system files with complete root privileges.
What exactly are you trying to update, Ubuntu or ... ? There shouldn't be a difference to get this working on 8.10, the only thing that seemed to change was the 51-android.rules file. Maybe this can help -
renaming it to 50-android.rules with
Code:
gksu nautilus
and deleting any backups (use CTRL+H to view hidden files).
restarting udev using:
Code:
sudo /etc/init.d/udev restart
Remember this is for 8.10, not 9.04. I hope this helps.
Click to expand...
Click to collapse
Okay this is how I moved my "AndroidSDK" Folder to root....
[email protected]:~$ su
Password:
[email protected]:/home/nick# mv /home/nick/Desktop/AndroidSDK /
[email protected]:/home/nick#"
And I went to the bashrc file and it is entered in there correctly.
This is still what I get even after restarting Udev...
" bash: : command not found
[email protected]:~$ adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:~$ su
Password:
[email protected]:/home/nick# adb
bash: adb: command not found"
Edit: This is what my .bashrc file looks like, well the top part of it anyways....
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
Okay your .bashrc is setup right and it's recognizing adb and its directory.
I would say it's something to do with permissions. since you moved it under su, you are not the owner so i would say that you'd have to change the permissions of /AndroidSDK
you can do that with -
Code:
gksu nautilus
Navigate to /
Right click on /AndroidSDK and select Properties
Click on Permissions tab
Select your user account as the owner
hopefully now it will function correctly
wddglr said:
Okay your .bashrc is setup right and it's recognizing adb and its directory.
I would say it's something to do with permissions. since you moved it under su, you are not the owner so i would say that you'd have to change the permissions of /AndroidSDK
you can do that with -
Code:
gksu nautilus
Navigate to /
Right click on /AndroidSDK and select Properties
Click on Permissions tab
Select your user account as the owner
hopefully now it will function correctly
Click to expand...
Click to collapse
I dont understand what this line does...
"gksu nautilus"
when i type it in it asks me for my administrative password and then after i put it in it hangs for a sec and then back to...
bash: : command not found
[email protected]:~$ gksu nautilus
[email protected]:~$
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
wddglr said:
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
Click to expand...
Click to collapse
I dont have Nautilus as a file browser I have Thunar I believe.
Then gksu thunar
wddglr said:
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
Click to expand...
Click to collapse
For permissions it says that I am the owner and the group (I=Nick) for Others it says Read and Write, Access says Read and write. So it seems it has all the right permissions. Any other Ideas?
Partitioning HD
First off, thank you for this thread, it's most excellent. I have a question that is slightly off topic, but not so much. I have Ubuntu 9.04 installed on my recovery partition. This partition is only 10 GB, while I have Vista on my main. I have almost 100 GB free on my main drive, and what I want to know is, if I resized my partitions to give more space to Ubuntu, how would it affect my comp? (if at all). And which OS should I be on while resizing, Ubuntu or Vista?

Question about signing

Using autosign in Win7 and get an error about Java not being an internal or external command. How can one resolve this?
zeroplace said:
Using autosign in Win7 and get an error about Java not being an internal or external command. How can one resolve this?
Click to expand...
Click to collapse
From the sounds of it either you dont have java installed or its path not set on your pc.
Droid Heaven said:
From the sounds of it either you dont have java installed or its path not set on your pc.
Click to expand...
Click to collapse
Thank you Droid. I will check those out. I figured I would get a smart a** comment or someone saying search. Thank you for not being like most. Will let you know.
Looks like everything is setup properly. I even tried reinstalling Java. Still getting the same error. Im stumped.
ok i was getting lots of errors
go to system properties (windows key+pause break shortcut)
then advanced then choose enviroment variables
then classpath click and edit
make sure the path goes directly to the testsign.jar mine is ;.;C:\Users\SI\Desktop\AutoSign\testsign.jar
the select path and edit same again this one goes to your autosign folder
mine is ;.;C:\Users\SI\Desktop\AutoSign
also download Auto-Sign v0.65(do a search)unrar
put your .zip rom in folder named as update.zip
select autosign.exe select update.zip from drop down and click autosign
hope this helps
Make sure "java.exe" is in your PATH evironment variable.
Open a command prompt and type "java.exe"
If it says 'java.exe' is not recognized ....
Then you have not set your PATH environment correctly.
I found a easier alternative to using autosign.bat for signing files.
You still need the file "testsign.jar" but you don't have to modify your CLASSPATH environment variable.
Just make sure the testsign.bat and testsign.jar are together in a directory that is also in your path.
Just copy the following code to a batch file named "testsign.bat":
Code:
@echo off
if "%1"=="" goto usage
if not exist "%1" goto notfound
ECHO.
ECHO **************
ECHO Signing File!
ECHO **************
ECHO.
java -classpath "%~dp0testsign.jar" testsign %1
ECHO.
ECHO File signed successfully if no Errors above.
ECHO.
goto end
:notfound
echo.
echo Error, File not found "%1"
echo.
goto end
:usage
echo.
echo Error in script usage. The correct usage is:
echo %0 [FileToSign.zip]
echo.
echo You may also simply drag and drop a file onto this batch file in Windows Explorer.
echo.
:end
pause

[Q] Unable to run adb on Mac OSX 10.4.11

Downloaded and extracted the SDK from Android's website. Copied the path to my $PATH and when I run 'adb' I get this:
dyld: Symbol not found: ___stack_chk_guard
Referenced from: /Users/Brainchild/Desktop/android-sdk-mac_x86/platform-tools/adb
Expected in: /usr/lib/libSystem.B.dylib
Trace/BPT trap
Click to expand...
Click to collapse
I've searched and nothing I find either works or is relevant. I've no idea what to do from here.
himom said:
Downloaded and extracted the SDK from Android's website. Copied the path to my $PATH and when I run 'adb' I get this:
I've searched and nothing I find either works or is relevant. I've no idea what to do from here.
Click to expand...
Click to collapse
Can you clearly explain what you did? Are you trying to create a variable to run ADB in terminal without having to write the whole path down?
if so do this:
cd ~
pico bash .bash_profile
type:
export PATH${PATH}:/where you smacked your sdk (should end with platform-tools)
control-x
Y
Close terminal and restart
Should work magical wonders and awesomeness.
himom said:
Downloaded and extracted the SDK from Android's website. Copied the path to my $PATH and when I run 'adb' I get this:
I've searched and nothing I find either works or is relevant. I've no idea what to do from here.
Click to expand...
Click to collapse
Type
Code:
cd /Users/Brainchild/Desktop/android-sdk-mac_x86/platform-tools/adb
Hit enter.
Then type an adb command with your device plugged in your computer. Make sure to put a "./" with no quotes or spaces before any adb or fastboot command.
It should look something like this:
Code:
./adb remount
Hit enter. It should say "remount successful" if it does than you are good. If not than let us know

[GUIDE] ADB on Ubuntu

This will setup ADB to work on Ubuntu with your Transformer Tablet.
Step 1: Download the Android SDK.
Step 2: Unzip the Android SDK to /home.
Step 3: Next we will add the SDK to your path, substitue the example will the path to the tools folder of your SDK.
Example Path:
export PATH=/home/USER/android-sdk/tools/:$PATH
Click to expand...
Click to collapse
Step 4: To make 99-android.rules, run the following command.
sudo gedit /etc/udev/rules.d/99-android.rules
Click to expand...
Click to collapse
Step 5: Add the following lines:
#Transformer
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0b05", MODE="0666", OWNER="USER"
Click to expand...
Click to collapse
Step 6: Save the file.
Step 7: To restart udev, run the following command.
sudo restart udev
Click to expand...
Click to collapse
Step 8: Run the following commands:
adb kill-server
adb start-server
adb devices
Click to expand...
Click to collapse
If device is saying 'no permissions', go to step 5 and add those lines to the other .rules files in /etc/udev/rules.d.
Great guide! You could add step three to ~/.profile or /etc/profile (no dot) to make it permanent at each login. You don't need to add it to both profiles. The /etc/profile is for every one that logs on, ~/.profile is just for your ID.
Also, if you are editing the rules files, you might as well add support for APX mode.
Code:
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0955", ATTRS{idProduct}=="7820", MODE="0666"
You probably don't need the product ID.
EDIT: Not sure why the "no permissions" problem would come up, but I suspect it is because of conflicts with other rules in /lib/udev/rules.d/ You want to make changes in /etc/udev/... The rule with the highest number takes precedence. I think specifying the product ID will prevent conflicts too.
Hi thanks for the help, finally I get my adb working with my Transformer thanks to your .rules file (alwways kept me telling i had no permissions).
Perhaps, there is something I think you should specify for newbies:
Step 3: Open terminal and run the following commands.
export PATH=/home/USER/android-sdk/tools/:$PATH
Click to expand...
Click to collapse
Its important to exactly tell ubuntu where adb is.
In my case its not at TOOLS folder, its been move reciently to /android-sdk-linux_x86/platform-tools/
sylar666 said:
Hi thanks for the help, finally I get my adb working with my Transformer thanks to your .rules file (alwways kept me telling i had no permissions).
Perhaps, there is something I think you should specify for newbies:
Its important to exactly tell ubuntu where adb is.
In my case its not at TOOLS folder, its been move reciently to /android-sdk-linux_x86/platform-tools/
Click to expand...
Click to collapse
It was an example path, you have to give the actual location of your sdk because it may vary.
Sorry if I'm missing something obvious, but doesn't the SDK download off the Google site (linked above) not include adb by default?
I've had to go into the actual program:
Code:
cd /home/USER/[B]Android-SDK[/B]/tools/
./android
(substitute the bold for whatever your SDK directory is called)
Then via the GUI:
- click the Available packages menu option
- click the arrow on Android Repository
- choose to install Android SDK Platform-tools, revision X package
Then once the platform-tools package is installed, you can make sure it's in your path as well as "Tools" (shown in original post). I do this in my .bashrc file (in your home directory):
Code:
export PATH=/home/USER/[B]Android-SDK[/B]/platform-tools/:$PATH
(again, the replace the bold with your SDK directory)
Depending on how you do this, the adb command should now work in a terminal by typing 'adb'. If you put the path in your .bashrc or profile, you might like to run the command 'exec bash' first then try.
Confirmed to work on Arch (get it from the AUR) and just did it tonight on Ubuntu 11.04 x86-64. And thanks for the guide, OP Took me ages to work the udev rules out when I first got my TF. Hopefully this helps someone in the same position in the future.

Auto APK/ZIP Signer in Windows

Hi XDA.
I have created automatic version of this One Click Signer:
(Click to thanx here FIRST! ->) http://forum.xda-developers.com/showthread.php?t=822388 (<- Click to thanx here FIRST!)
This version Works for Quantum of files at same time.
There are two DIRs:
Input - move here all APK and ZIP files to sign.
Output - here comes Signed APKs and ZIPs.
How to use?
1. Download auto-sign.zip from this thread.
2. Unzip it.
3. Run once autosign.bat.
4. Now, Input and Output folders was created.
5. Move all your Unsigned APK and ZIP files into Input folder.
6. Run autosign.bat again.
7. Wait until CMD windows closes.
8. Now you have Signed Your APKs and ZIPs in Output folder.
Click to expand...
Click to collapse
If you think, that is virus, or any harmful file,
you can right click on any .bat or .cmd file, and use EDIT option.
Here you can see all code, that files do.
Thanx to ASimmons, and dont forget to hit "Thanks!" button on his thread too! (link above)
Sorry for my BAD English.
//ANY PROBLEMS?
1. Output DIR is empty.
- move your auto-sign folder to root of C: drive, maybe run it as administrator.
2. Files are in output folder, but not signed
- check if you have Java Runtime SE Library, try to reinstall it.
if you have 64 bit system, and 64 bit Java, try to install 32 bit java too.
Thanks, gouster3.
Very easy to use Signer. However, using it to create an 'update.zip' package for my tablet was unsuccessful due to the 'zipalign' step at the end. So I reversed the steps as follows in "do2.cmd", then it was accepted (although this way the ZIP isn't fully aligned) :
Code:
setlocal EnableDelayedExpansion
@ECHO off
SET rom=%1
copy !rom! x!rom!
cd lib
rem zip align
zipalign -f 4 ..\x!rom! ..\signed-!rom!
rem sign the rom
java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ..\signed-!rom! ..\signed-!rom!
cd ..\
del x!rom!
Joe.

Categories

Resources