• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

One Click Apk Signer... Easiest Apk Signing Ever

Search This thread

ASimmons

Retired Recognized Developer
May 4, 2010
1,003
112
Tampa Bay
So I see people have trouble using apk manager, apk tool or the signing tool. This solves that simple double click the one_click_signer.cmd and give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned.

You'll need java in your class path for this to work orrr alter the script to point to where java is on your machine.
 

Attachments

  • one_click_signer.zip
    407.4 KB · Views: 99,463

bk718

Senior Member
Jun 23, 2007
741
55
Charlotte, NC
hopefully this one works for me.. java has been in my class path for others, but could never figure out where things went wrong...
 

ASimmons

Retired Recognized Developer
May 4, 2010
1,003
112
Tampa Bay
I can answer any Java question you have... class path, Mem settings

Sent from my PC36100 using XDA App
 

jb789

Senior Member
Nov 6, 2009
393
87
Mmm... desiccant
...give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned...
Maybe others would work with proper tweaking of environment variables, but One Click Signer is the first solution that worked for me! However, I could not get it to work by providing any name & path such as C:\myapp.apk or even what the prompt literally asks for- myapp.apk C:\. What finally worked through trial & error was to just have the apk in the same directory as one_click_signer.cmd and specify ONLY the apk name (as in myapp.apk). I'm not positive, but spaces in paths or file names are probably best avoided as well.
 

scandiun

Senior Member
Jul 12, 2010
1,870
970
Thank you so much man I can now test my app skipping google's requirements.
 
Last edited:
S

savagecube

Guest
very useful. I had problems signing apks and this did the trick.
 

TwinAdk

Senior Member
Mar 15, 2011
960
324
OnePlus 6
Hello.

Very nice tutorial, i just find it easier to do it like this:

1. Download the rar and extract the lib folder somewhere
2. Copy your APK or ZIP to the lib folder
3. Press shift and rightclick in the folder (not on a file) - select "open command prompt here"
4. To sign a file: java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 <APK OR ZIP NAME> <APK OR ZIP NAME> (example java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 myfile.apk myfile.apk
5. To zipalign the file: zipalign -f 4 <APK OR ZIP NAME> <APK OR ZIP NAME> (example: zipalign -f 4 myfile.apk myfile.apk)

Done!

The reason for this approch is that you are 100% sure it will work, because you are working directly in the directory.
 

ranf

Senior Member
May 21, 2012
251
122
Linux:
Code:
[email protected]:~/android/apktool$ cat one_click_signer/one_click_signer.sh 
export EnableDelayedExpansion # dunno what that does

if [ -z $1 ]; then
    echo "usage: $0 xxx.apk"
    exit 2
fi
ROM=$1
cp $ROM x$ROM

cd lib
# sign the rom
java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ../$ROM ../x$ROM
# zip align
./zipalign -f 4 ../x$ROM  ../signed-$ROM
cd ..
rm x$ROM
copy zipalign from ~/android-sdk-linux_x86/tools/
 
Last edited:

mewtwo07

Senior Member
Jan 14, 2011
78
9
sh-06d nerv only Docomo launcher Rom oficial

Hello good friends and found the files in the official ROM released for the phone sh-06d nerv only here you will find all the content of the wallpapers Ringtones equipment and just about anything to have hope and someone decides to port it to other teams in this community so great there are people who really like to share their knowledge and would love to work together to carry this Rom for other teams doing well and something that many users have asked seen shouting greetings and look forward to your support here I left the Link http://tieba.baidu.com/p/2012713251
 

maheshn.n28

New member
Oct 5, 2013
1
0
I am new to android i dont know any thing please help

So I see people have trouble using apk manager, apk tool or the signing tool. This solves that simple double click the one_click_signer.cmd and give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned.

You'll need java in your class path for this to work orrr alter the script to point to where java is on your machine.




for this post i want say that i have a java installed in my windows xp can any one send me a video tutorial on how to use one click signer.
my email id is [email protected]

---------- Post added at 11:23 AM ---------- Previous post was at 11:19 AM ----------

So I see people have trouble using apk manager, apk tool or the signing tool. This solves that simple double click the one_click_signer.cmd and give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned.

You'll need java in your class path for this to work orrr alter the script to point to where java is on your machine.





You'll need java in your class path

What does that mean i have a java installed on xp please help or send a video.
 

Adiroid Mohite

New member
Oct 11, 2013
2
0
easiest way is to just drag apk file into one click dailog box. .and press enter......it will do the rest itself....i wish unity 4+ were also open sourcd...:(
 

xavmdq

Member
Nov 21, 2008
13
2
The script only works if you put apk/zip in script folder. I rewrote the script. Open the cmd file and replace all text with this one:

Code:
@ECHO off
setlocal EnableDelayedExpansion
SET SCRIPT_PATH=%0
SET SCRIPT_PATH=%SCRIPT_PATH:"=%
echo %SCRIPT_PATH% | FIND ":" > nul
IF %ERRORLEVEL%==1 SET SCRIPT_PATH=%CD%\%SCRIPT_PATH%
FOR /F "delims=\ tokens=*" %%G IN ('echo %SCRIPT_PATH%') DO SET SCRIPT_PATH=%%~dpG
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%
	
if NOT "%1"=="" goto seguir
echo Enter full path and filename of the apk/zip to sign or drag&drop file to this window:
SET /P rom=----^>? 
call :separar "%ROM%"
goto seguir2
:seguir
call :separar "%1"
:seguir2
echo Copying "%ruta%%archivo%" to "%ruta%temp-%archivo%"
copy "%ruta%%archivo%" "%ruta%temp-%archivo%">nul

set olddir=%cd%

cd /d "%SCRIPT_PATH%\lib"
echo Signing "%ruta%temp-%archivo%"
java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 "%ruta%temp-%archivo%" "%ruta%temp-%archivo%"

echo Zip aligning "%ruta%temp-%archivo%" to "%ruta%signed-%archivo%"
zipalign -f 4 "%ruta%temp-%archivo%"  "%ruta%signed-%archivo%"

del "%ruta%temp-%archivo%"

cd /d "%olddir%"

goto fin

:separar
set ruta=%~dp1
set archivo=%~nx1
goto :eof

:fin


This works in the folllowing cases:
- Calling script from command line (from any drive/folder)
- Calling it from Windows (Explorer/Run/etc)

And you can pass apk/zip in the following ways:
- Drag&drop file to the console window
- Passing file as an argument
- Manually writing full path and filename to file

Bye and sorry for my english.
 

greatricky

Senior Member
Sep 17, 2010
66
7
Chittagong
PLAY STORE SAYS ::

Upload failed

You uploaded an APK that is signed with a restricted certificate. You need to upload an APK signed with your own certificate.


PLEASE UPDATE THE CERTIFICATE FILES :(
 

malaysia_sWat

Member
Feb 12, 2013
40
3
Perak
Right-Click Menu?

I created .reg file to add this "apksign one click" to mouse right click menu (when i click r-click on apk, will give me sign apk).
SEE the BOLD part..i get the menu but it dont work i got error...later ill show you

Code:
@echo off
color 0a

:: relaunch self elevated
ver|find /i "XP">nul||whoami /all|find "S-1-16-12288">nul
IF %ERRORLEVEL% NEQ 0 (
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B
)

java -version >nul 2>&1||echo Error: Java is not found&&echo Please install JRE first &&echo.&&echo Existing..&&pause&&exit

:: remove menu handlers installed by other apps
reg add "HKCR\.apk" /f /ve /t REG_SZ /d ""
reg delete "HKCU\Software\Classes\.apk" /f >nul 2>&1
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.apk" /f >nul 2>&1

reg add "HKCR\.apk\DefaultIcon" /f /ve /t REG_SZ /d "%~dp0tools\apk.ico"
reg add "HKCR\.apk\shell\decompile" /f /ve /t REG_SZ /d "Browse Java Code of APK"
reg add "HKCR\.apk\shell\decompile\command" /f /ve /t REG_SZ /d "\"%~dp0tools\decompile.cmd\" \"%%1\""
reg add "HKCR\.apk\shell\disassemble" /f /ve /t REG_SZ /d "Disassemble APK and Decode Resources"
reg add "HKCR\.apk\shell\disassemble\command" /f /ve /t REG_SZ /d "\"%~dp0tools\disassemble.cmd\" \"%%1\""
reg add "HKCR\.apk\shell\install" /f /ve /t REG_SZ /d "Install APK to Phone"
reg add "HKCR\.apk\shell\install\command" /f /ve /t REG_SZ /d "\"%~dp0tools\install.cmd\" \"%%1\""
[U]reg add "HKCR\.apk\shell\signapk" /f /ve /t REG_SZ /d "Sign the Apk"
reg add "HKCR\.apk\shell\signapk" /f /ve /t REG_SZ /d "\"%~dp0tools\oneclickapksigner.cmd\" \"%%1\""[/B][/U]
reg add "HKCR\folder\shell\recompile" /f /ve /t REG_SZ /d "Recompile APK from Disassembly"
reg add "HKCR\folder\shell\recompile\command" /f /ve /t REG_SZ /d "\"%~dp0tools\buildapk.cmd\" \"%%1\""

:: remove entries left from old versions
reg delete "HKCR\jarfile\shell\decompile" /f >nul 2>&1

pause
 

Top Liked Posts

  • There are no posts matching your filters.
  • 49
    So I see people have trouble using apk manager, apk tool or the signing tool. This solves that simple double click the one_click_signer.cmd and give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned.

    You'll need java in your class path for this to work orrr alter the script to point to where java is on your machine.
    6
    Hello.

    Very nice tutorial, i just find it easier to do it like this:

    1. Download the rar and extract the lib folder somewhere
    2. Copy your APK or ZIP to the lib folder
    3. Press shift and rightclick in the folder (not on a file) - select "open command prompt here"
    4. To sign a file: java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 <APK OR ZIP NAME> <APK OR ZIP NAME> (example java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 myfile.apk myfile.apk
    5. To zipalign the file: zipalign -f 4 <APK OR ZIP NAME> <APK OR ZIP NAME> (example: zipalign -f 4 myfile.apk myfile.apk)

    Done!

    The reason for this approch is that you are 100% sure it will work, because you are working directly in the directory.