I decompiled an APK using APKTool 2.0 Beta 9 and then rebuilt all without doing changes to the sources.
Then I rebuilt the APK using this command:
java -jar apktool.jar build myfolder myapk.apk
But I cannot install the generated APK file on my phone. It tells me:
Application not installed.
Am I missing something ?
I even didn't change the code.
Your new recompiled apk is not signed and according to the rules, you cannot install unsigned apk.
One good thing which I like is that you can self sign the apk file.
You will have to use "Keytool" for generating your own certificate.
Here is the command :
keytool –genkey –v -keystore [nameofkeystore] –alias [your_keyalias] –keyalg RSA –keysize 2048 –validity [numberofdays]
This will ask you few things, just fill it appropriately.
Once the certificate is generated, use "jarsigner" for signing your apk.
jarsigner –verbose –sigalg MD5withRSA –digestalg SHA1 –keystore [name of your keystore] [your .apk file] [your keyalias]
Now try installing your new apk file and everything should work fine.
EDIT - I am using keytool and jarsigner commands directly as I have set their paths in PATH variable. In your case, you will have to traverse to "bin" folder of the jdk directory.
/bin/
You need to resign the regenerated APK file using jarsigner:
$ jarsigner -verbose -keystore my-release-key.keystore HelloWorld.apk alias_name
Related
After I got a signed result I tried to install the .apk file, what failed (output)
I deployed the .apk file
apktool d x.apk
then made some chagnes and rebuild the .apk using
apktool b x.app
I've download root.crt and class3.crt and updated the ca-certificate
created the ca-certificate on my name and use the ca-certificate to signed the .apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my_release_key.keystore /root/home/Desktop/x/dist/x.apk john_release_key
I have installed jdk and jre version 1.8.0_121
But the .apk file wasn't installed.
how to go through the problem?
My game is developed by Unity3d, I need to encrypt the DLL in APK.I add the following steps in build pipeline:
unzip the APK file
encrypt the managed dlls and replace with modified libmono.so (same Unity version, same ABI)
zip & jarsigner & zipalign
jarsigner -verbose -keystore debug.keystore -signedjar "%1"_unaligned.apk "%1".apk %alias%
zipalign -f 4 "%1"_unaligned.apk "%1"_release.apk
The resulting APK can install, but dies immediately after startup, no useful logcat, any helps?
I build an app for android and I already export it to apk, can I change its version code if it's already exported? How can I do that?
I lost the backup code and I only have the update one and need to get back at first one, the only thing I can do is to increase version code from the apk backup and then my app will upgrade (while actually downgrade) automatically
You need to open apktool.yml
from there you can modify the version code
Yes, use [this link][1] it explains many things over there. I will copy paste it:
Tools:
apktool — tool for reverse engineering Android apk files. In this case we are using to extract files from apk and rebuild.
keytool — Java tool for creating keys/certs, that comes with the JDK.
jarsigner Java tool for signing JAR/APK files, that comes with the JDK.
zipalign — archive alignment tool, that comes with the Android SDK.
Instructions:
apktool d my_application.apk
Change versionCode in apktool.yml.
apktool b my_application
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application/dist/my_application.apk alias_name
jarsigner -verify -verbose -certs my_application/dist/my_application.apk
zipalign -v 4 my_application/dist/my_application.apk my_application/dist/my_application-aligned.apk
But to be honest, i still couldn't manage it, Google Play Store says "ERROR: MIN_SIG_SCHEME_FOR_TARGET_SDK_NOT_MET: Target SDK version 30 requires a minimum of signature scheme v2; the APK is not signed with this or a later signature scheme", so i don't guarrantee you that it will work but you can give it a try.
[1]: https://medium.com/#sandeepcirusanagunla/decompile-and-recompile-an-android-apk-using-apktool-3d84c2055a82
you can do the followings
decompile the apk
update the versioncode in manifest
again recompile the apk
you can use apktool
It's simple:
You need to,
Download the apk (Under release management on google play
console and go to Artifact Library)
Decompile the apk
Update the versioncode in manifest
Recompile the apk
I have an APK file name : Splash.apk.
First i decode it using apktool
apk d Splash.apk
Then i edit Manifest, XML. Finally I export project to APK file name : EditedSpash.apk.
apk b Splash
When i run EditedSpash.apk on emulator. I got error. Do you explain it for me ?
adb install EditedSplash.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
you should sign to apk before install.
1)keytool -genkey -keystore (name).keystore -validity 10000 -alias (name) -keyalg rsa
2)answer some question (ex:name, company...
3)after make keystore file,you combine apk and ketstore
if these file are located same directory
jarsigner -keystore (name).keystore -verbose LunarLander.apk (name)
apk size increase 2kb+;
after this install apk to avd
Please specify how are you generating the apk file becausw to generate the apk file we need to generate it using certifiate it may be debug certificate or the release certificate if the generated apk dont have any of them will through the error so generate the apk using eclipse it will automatically generate the apk file using debug certificate.
How can I check that an Android apk is signed with a release and not debug cert?
Use this command, (go to java < jdk < bin path in cmd prompt)
$ jarsigner -verify -verbose -certs my_application.apk
If you see "CN=Android Debug", this means the .apk was signed with the debug key generated by the Android SDK
(means it is unsigned), otherwise you will find something for CN.
For more details see: http://developer.android.com/guide/publishing/app-signing.html
Use console command:
apksigner verify --print-certs application-development-release.apk
You could find apksigner in ../sdk/build-tools/24.0.3/apksigner.bat. Only for build tools v. 24.0.3 and higher.
Also read google docs: https://developer.android.com/studio/command-line/apksigner.html
The easiest of all:
keytool -list -printcert -jarfile file.apk
This uses the Java built-in keytool app and does not require extraction or any build-tools installation.
Use this command : (Jarsigner is in your Java bin folder goto java->jdk->bin path in cmd prompt)
$ jarsigner -verify my_signed.apk
If the .apk is signed properly, Jarsigner prints "jar verified"
Run this command in Terminal - if you have Android Studio.
$ /Applications/Android\ Studio.app/Contents/jre/Contents/Home/bin/keytool -printcert -jarfile example.apk
Not a signed jar file
unzip apk
keytool -printcert -file ANDROID_.RSA or keytool -list -printcert -jarfile app.apk to obtain the hash md5
keytool -list -v -keystore clave-release.jks
compare the md5
https://www.eovao.com/en/a/signature%20apk%20android/3/how-to-verify-signature-of-.apk-android-archive
Using keytool or jarsigner may not work for you. You need to first understand how signing works. See here.
If your min API is lower than 24, v1 signing will be included in apk (inside META_INF). And because of that, these two tools will "poop out" your cert keys.
If using min API 24 or higher, v1 signing will be excluded (unless you enable it on your own in build.gradle). In this case keytool or jarsigner don't work. They will output Not a signed jar file or jar is unsigned. To verify v2+ signature, you should use apksigner instead.
keytool -printcert -jarfile base.apk