How to Sign an Already Compiled Apk
create a key using
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
then sign the apk using :
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
check here for more info
how to sign a already compiled apk?
Use haibision apk signer from github
How to correctly re-compile an apk file?
The following is for your reference
Compile, decompile and sign APK using apktool utility.
Download latest apktool version.
Download the batch file and aapt.exe.
Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder.
Open command prompt.
Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe.
Now, you need to install the file using the " IF " command.
Type the following command.
apktool if name-of-the-app.apk
For decompiling use the command "d". The "d" stands for decompile.
apktool d name-of-the-app.apk
After the app is correctly decompiled, a new folder will be created in the same folder where you placed your app. This contains all the xml's and smali files which can be edited for different mode's.
To recompile the app use the following command " B ". The "b" simply means recompile.
apktool b name-of-the-app-folder
The final modded app will be in the "dist" folder located inside the original app folder created by apktool.
Signing the apk
open a new command prompt and change into the sign-apk directory using cmd
move the modified-unsigned apk into this folder
then type the following command -
java -jar signapk.jar certificate.pem key.pk8 path-of-the-folder-contaning-the-apk.apk path-of-the-new-signed-apk.apk
Once compiled, the signed apk will be found in the same folder.
Can I re-sign an .apk with a different certificate than what it came with?
try this
1) Change the extension of your .apk to .zip
2) Open and remove the folder META-INF
3) Change the extension to .apk
4) Use the jarsigner and zipalign with your new keystore.
hope it helps
How to sign an android apk file
The manual is clear enough. Please specify what part you get stuck with after you work through it, I'd suggest:
https://developer.android.com/studio/publish/app-signing.html
Okay, a small overview without reference or eclipse around, so leave some space for errors, but it works like this
- Open your project in eclipse
- Press right-mouse - > tools (android tools?) - > export signed application (apk?)
- Go through the wizard:
- Make a new key-store. remember that password
- Sign your app
- Save it etc.
Also, from the link:
Compile and sign with Eclipse ADT
If you are using Eclipse with the ADT
plugin, you can use the Export Wizard
to export a signed .apk (and even
create a new keystore, if necessary).
The Export Wizard performs all the
interaction with the Keytool and
Jarsigner for you, which allows you to
sign the package using a GUI instead
of performing the manual procedures to
compile, sign, and align, as discussed
above. Once the wizard has compiled
and signed your package, it will also
perform package alignment with
zip align. Because the Export Wizard
uses both Keytool and Jarsigner, you
should ensure that they are accessible
on your computer, as described above
in the Basic Setup for Signing.To create a signed and aligned .apk in
Eclipse:
- Select the project in the Package Explorer and select File >
Export.Open the Android folder, select Export Android Application, and click
Next.The Export Android Application wizard now starts, which will guide
you through the process of signing
your application, including steps for
selecting the private key with which
to sign the .apk (or creating a new
keystore and private key).- Complete the Export Wizard and your application will be compiled,
signed, aligned, and ready for
distribution.
How to sign a modded apk on mac with apktool
Got my solution- I use keytool, Jarsigner and zipalign from JDK by using following commands in terminal
To generate keystore
keytool -genkey -v -keystore my-keystore.keystore -alias name_alias -keyalg RSA -validity 10000
To sign an apk
jarsigner -verbose -keystore <path of my-keystore.keystore> <path of apk> name_alias
To zip align an apk
zipalign -f -v 4 <your.apk > <your_aligned.apk>
Cannot install an already COMPILED & SIGNED Apk file
On some emulators, release build does not work. Don't worry, go ahead and upload on PlayStore. Btw you can test it on real device though.
For your new question:
It should work on on devices with api levels from 16 to 27. Release builds should always be tested on real devices.
Release the app as alpha on PlayStore and ask your people to test it.
Related Topics
Updating Android UI Using Threads
Difference Between /Res and /Assets Directories
Android Textwatcher.Aftertextchanged VS Textwatcher.Ontextchanged
Android Set Up Volley to Use from Cache
Using the Recyclerview with a Database
How to Do Http Authentication in Android
How to Strip or Escape HTML Tags in Android
Android Startcamera Gives Me Null Intent and ... Does It Destroy My Global Variable
Ffmpeg for a Android (Using Tutorial: "Ffmpeg and Android.Mk")
How to Start an Activity from a Service
Android Failed to Start Emulator:Cannot Run Program
Android 5.0 Android:Elevation Works for View, But Not Button
How to Request Permissions from a Service in Android Marshmallow
What Is "Android.R.Layout.Simple_List_Item_1"
Eclipse Error "Adb Server Didn't Ack, Failed to Start Daemon"
How to Apply a Style to All Buttons of an Android Application