DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Mass APK-signer

  1. n00b.
    raidzero's Avatar
    Member #
    59181
    Join Date
    Apr 2010
    Location
    Denver, CO
    Posts
    1,054
    Liked
    4 times
    Twitter
    raidzero_
    Phone
    Samsung Nexus S 4G
    DroidForums.net Developer
    DroidForums.net Theme Developer
    Premium Member
    #1

    Mass APK-signer

    I made this because I wanted to sign all my apk's at once after being zipaligned. I share it because that's what I do..

    Directions: put your unsigned APK's in unsigned. run sign.bat, signed versions of apks will be in signed directory.

    Code:
    @ECHO OFF
    Title RZ Mass-APK signer
    
    
    cd unsigned 
    
    ECHO .apk's are now being signed. The signed versions will be in signed/
    echo.
    
    for /F "tokens=*" %%A in ('dir /b *.apk') do echo Now signing %%A.. && java -jar ..\signapk.jar ..\testkey.x509.pem ..\testkey.pk8 %%A ..\signed\%%A
    
    echo Done!
    
    PAUSE
    EXIT
    Hope it helps someone.

    Not sure where it should be posted so mods please move it where it belongs


    Warning from CVPCS:

    [13:04] <@cvpcs|work> beware
    [13:04] <@cvpcs|work> signing EVERYTHING with testkey is a BAD idea
    [13:04] <@cvpcs|work> some apks need to be signed with media/platform/shared keys
    [13:04] <@cvpcs|work> or they won't work
    Attached Files
    Last edited by raidzero; 07-20-2010 at 11:08 AM.

    "Success is going from failure to failure without loss of enthusiasm" - Winston Churchill
  2.  
     
     
     
  3. Junior Droid
    Drew408's Avatar
    Member #
    67482
    Join Date
    May 2010
    Posts
    18
    Phone
    Motorola Droid
    #2
    any idea on how this would be done in linux/ubuntu? any help would be greatly appreciated!
  4. n00b.
    raidzero's Avatar
    Member #
    59181
    Join Date
    Apr 2010
    Location
    Denver, CO
    Posts
    1,054
    Liked
    4 times
    Twitter
    raidzero_
    Phone
    Samsung Nexus S 4G
    DroidForums.net Developer
    DroidForums.net Theme Developer
    Premium Member
    #3
    Not sure, I do not have a linux machine handy but it'd look something liek this:

    Code:
    #!/bin/sh
    
    
    cd unsigned 
    
    ECHO apk's are now being signed. The signed versions will be in signed/
    echo
    
     ls *.apk | awk '{print$7}' > apklist
    
    while read apk; do echo Now signing $apk.. && java -jar ../signapk.jar ../testkey.x509.pem ../testkey.pk8 $apk ../signed\$apk < apklist
    
    echo Done!
    the awk statement will need to be adjusted to your environment

    "Success is going from failure to failure without loss of enthusiasm" - Winston Churchill
  5. Junior Droid
    Drew408's Avatar
    Member #
    67482
    Join Date
    May 2010
    Posts
    18
    Phone
    Motorola Droid
    #4
    Quote Originally Posted by raidzero View Post
    the awk statement will need to be adjusted to your environment
    I am pretty new to developing and Im afraid I dont know how to adjust awk...anywhere you can point me?

    From what i do know i created a script

    #!/bin/bash
    cd /unsigned
    find . -name "*.apk" -exec java -jar /home/andrew/sign/signapk.jar /home/andrew/sign/certificate.pem /home/andrew/sign/key.pk8 {} \;
    echo 'APKs signed';
    echo $?

    there are four apks in the folder and I recieve this


    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    APKs signed
    0

    Im thinking there is a problem with the input and output...i need to direct the -exec command to (input.apk) and (output.apk) of selected files... if that makes sense.

    I tried your script but i dont know how to set awk up

    another script was

    find . -name "*.apk" | xargs java -jar /home/andrew/sign/signapk.jar /home/andrew/sign/testkey.x509.pem /home/andrew/sign/testkey.pk8

    that didnt work neither. Thank you for the help!
  6. n00b.
    raidzero's Avatar
    Member #
    59181
    Join Date
    Apr 2010
    Location
    Denver, CO
    Posts
    1,054
    Liked
    4 times
    Twitter
    raidzero_
    Phone
    Samsung Nexus S 4G
    DroidForums.net Developer
    DroidForums.net Theme Developer
    Premium Member
    #5
    Quote Originally Posted by Drew408 View Post
    Quote Originally Posted by raidzero View Post
    the awk statement will need to be adjusted to your environment
    I am pretty new to developing and Im afraid I dont know how to adjust awk...anywhere you can point me?

    From what i do know i created a script

    #!/bin/bash
    cd /unsigned
    find . -name "*.apk" -exec java -jar /home/andrew/sign/signapk.jar /home/andrew/sign/certificate.pem /home/andrew/sign/key.pk8 {} \;
    echo 'APKs signed';
    echo $?

    there are four apks in the folder and I recieve this


    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    Usage: signapk [-w] publickey.x509[.pem] privatekey.pk8 input.jar output.jar
    APKs signed
    0

    Im thinking there is a problem with the input and output...i need to direct the -exec command to (input.apk) and (output.apk) of selected files... if that makes sense.

    I tried your script but i dont know how to set awk up

    another script was

    find . -name "*.apk" | xargs java -jar /home/andrew/sign/signapk.jar /home/andrew/sign/testkey.x509.pem /home/andrew/sign/testkey.pk8

    that didnt work neither. Thank you for the help!

    go to the directory with the apks and do
    Code:
    ls *.apk | awk '{print$7}'
    see which column of data is printed,. it will be the seventh one. if that is one with the file names then it should be okay, if not, change 7 to the correct column of data.

    "Success is going from failure to failure without loss of enthusiasm" - Winston Churchill
  7. Junior Droid
    Drew408's Avatar
    Member #
    67482
    Join Date
    May 2010
    Posts
    18
    Phone
    Motorola Droid
    #6
    I cd to my unsigned apk folder and perform

    ls *.apk | awk '{print$7}'
    then it returns this



    andrew@development-laptop:~/sign/unsigned$ ls *.apk | awk '{print$7}'

    andrew@development-laptop:~/sign/unsigned$

    The folder only contained one apk...the more apks i have in the folder the bigger the gap between...for example...

    andrew@development-laptop:~/sign/unsigned$ ls *.apk | awk '{print$7}'






    andrew@development-laptop:~/sign/unsigned$

    That is with six apks. something is happening but it is not showing up.

    when i manually enter your original code step by step, the terminal just hangs at a blinking cursor.
  8. n00b.
    raidzero's Avatar
    Member #
    59181
    Join Date
    Apr 2010
    Location
    Denver, CO
    Posts
    1,054
    Liked
    4 times
    Twitter
    raidzero_
    Phone
    Samsung Nexus S 4G
    DroidForums.net Developer
    DroidForums.net Theme Developer
    Premium Member
    #7
    post your output if just
    Code:
    ls *.apk
    awk is used in this case to only print the seventh column of data, there may not be seven columns, so it returns nothing.

    "Success is going from failure to failure without loss of enthusiasm" - Winston Churchill
  9. Junior Droid
    Drew408's Avatar
    Member #
    67482
    Join Date
    May 2010
    Posts
    18
    Phone
    Motorola Droid
    #8
    andrew@development-laptop:~/sign/unsigned$ ls *.apk
    AccountAndSyncSettings.apk
    that is with one apk


    andrew@development-laptop:~/sign/unsigned$ ls *.apk
    AccountAndSyncSettings.apk CalendarGoogle.apk ChromeToPhone.apk
    ApplicationsProvider.apk CalendarProvider.apk Contacts.apk
    BBToolkit.apk CameraGoogle.apk ContactsProvider.apk
    Bluetooth.apk CarHomeGoogle.apk DefaultContainerService.apk
    Browser.apk CarHomeLauncher.apk
    Calculator.apk CertInstaller.apk

    that is with 16 apks

    andrew@development-laptop:~/sign/unsigned$ ls *.apk | awk '{print$7}'
















    andrew@development-laptop:~/sign/unsigned$

    that is awk with 16 apks....more than 7.
    Thank you for the quick replies!
  10. n00b.
    raidzero's Avatar
    Member #
    59181
    Join Date
    Apr 2010
    Location
    Denver, CO
    Posts
    1,054
    Liked
    4 times
    Twitter
    raidzero_
    Phone
    Samsung Nexus S 4G
    DroidForums.net Developer
    DroidForums.net Theme Developer
    Premium Member
    #9
    ooh my mistake it should be
    Code:
    ls -l *.apk | awk '{print$N}'
    where N is the Nth column of data printed by ls

    "Success is going from failure to failure without loss of enthusiasm" - Winston Churchill
  11. Junior Droid
    Drew408's Avatar
    Member #
    67482
    Join Date
    May 2010
    Posts
    18
    Phone
    Motorola Droid
    #10
    andrew@development-laptop:~/sign/unsigned$ ls *.apk | awk '{print$0}'
    AccountAndSyncSettings.apk
    ApplicationsProvider.apk
    BBToolkit.apk
    Bluetooth.apk
    Browser.apk
    Calculator.apk
    CalendarGoogle.apk
    CalendarProvider.apk
    CameraGoogle.apk
    CarHomeGoogle.apk
    CarHomeLauncher.apk
    CertInstaller.apk
    ChromeToPhone.apk
    Contacts.apk
    ContactsProvider.apk
    DefaultContainerService.apk
    andrew@development-laptop:~/sign/unsigned$

    this is what happens when i use 0


    andrew@development-laptop:~/sign/unsigned$ ls *.apk | awk '{print$N}'
    AccountAndSyncSettings.apk
    ApplicationsProvider.apk
    BBToolkit.apk
    Bluetooth.apk
    Browser.apk
    Calculator.apk
    CalendarGoogle.apk
    CalendarProvider.apk
    CameraGoogle.apk
    CarHomeGoogle.apk
    CarHomeLauncher.apk
    CertInstaller.apk
    ChromeToPhone.apk
    Contacts.apk
    ContactsProvider.apk
    DefaultContainerService.apk
    andrew@development-laptop:~/sign/unsigned$

    this is with N...signing now...let you know
    does the 0 or N make a difference if it is giving me the same results?


    i will try fin
Page 1 of 2 12 LastLast

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Mass Texting?
    By bkmoose in forum New Member Introductions & Site Assistance
    Replies: 0
    Last Post: 07-18-2010, 06:06 PM
  2. Mass text msg
    By liam. in forum Android General Discussions
    Replies: 3
    Last Post: 06-07-2010, 08:00 AM
  3. App for leaving mass voicemail
    By coondogg97 in forum Android Applications
    Replies: 1
    Last Post: 02-10-2010, 08:13 PM
  4. how do I mass delete email...
    By jthompsn in forum Android General Discussions
    Replies: 4
    Last Post: 01-19-2010, 08:55 PM
  5. K9 email mass delete
    By GasGas332 in forum Android General Discussions
    Replies: 0
    Last Post: 01-17-2010, 12:27 PM

Search tags for this page

apk signer

,
apksigner
,
error: signapk.jar failed: return code
,

error: signapk.jar failed: return code 1

,
moto-signapk
,
online apk signer
,
sign apk online
,
signapk.jar
,
signapk.jar failed: return code 1
,

testkey.x509.pem

Click on a term to search our site for related topics.
Find us on Google+