Wednesday, January 22, 2014

Resolving Unsigned AIR Runtime.apk



This might be a basic thing on working with any devices nowadays. But keep get me stuck for a while just to install AIR Runtime from AIR Runtime SDK into Android emulator.

If you don't already know, AIR SDK brings its runtime packaged for your emulator in this place

/AIRSDK/runtimes/air/android/emulator/Runtime.apk

But installing this runtime into emulator using this command

$ ./adb install Runtime.apk 

Will result in this fail notice

Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

Its all is only a problem with signing. Early AIR SDK packages comes up with a signed runtime. But the latter ones is not signed yet. So I guess people at Adobe might think that signing an apk file is a basic thing for every Android developer out there.

As for me, it means more things to learn. If you doesn't already know, you can continue to read.

Firstly, create your keystore ready.
$ keytool -genkey -keystore mykeystore.keystore -alias andi

And fill all the asked data as you wanted it to be.

Once you get your keystore ready, now sign that Runtime.apk file you get from AIR SDK.

$ jarsigner -keystore ./mykeystore.keystore ./Runtime.apk andi

And start the installation on your machine

$ ./adb install Runtime.apk 

If you still get this notice

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

Then you'll need to remove that already installed old AIR runtime, or just put -r before .apk file name

$ ./adb install -r Runtime.apk

All takes time in less than a minute if you already know what to do, but spend me almost two hour to get it done.

For a more complete reference for this signing thingy, you can go here: https://www.owasp.org/index.php/Signing_jar_files_with_jarsigner


No comments:

Post a Comment