Skip to main content
August 25, 2012
Question

How to convert keystore (from native android project) to .p12 to use with AIR project?

  • August 25, 2012
  • 2 replies
  • 2723 views

Due to the advancements with adobe AIR, I'm really excited to be finishing up a HUGE update of an old project that was originally made with native android.

But, i've hit a brick wall with 2 issues, and it would be terrible if all the work i've done in AIR was for nothing...

First, how do I convert the keystore I previously used (from native android project) to .p12 to use with AIR project? (on a mac)

Second, how do I remove the "air." that gets automatically appended onto the front my android package name? I plan to use a captive runtime, so it's not really needed at all, and I can't upload it like this as an update because it will think it's a different app.

Please help so I can continue using air for all my projects from now on!

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
August 25, 2012

JDK has a tool that can convert a keystone to P12. I haven't used it, but try reading this page:

http://www.herongyang.com/PKI/Digital-Signature-Convert-KeyStore-File-to-PKCS12-File.html

Here is an article on how to remove the air. prefix:

http://helpx.adobe.com/air/kb/opt-out-air-application-analytics.html

August 29, 2012

Thanks for the reply!

So I'm going through this guide..

http://helpx.adobe.com/air/kb/opt-out-air-application-analytics.html

I followed all the steps, made all the adjustments to the androidmanifest.xml like it asks.

But when i get to the stap that says

"Run the following command to create the resource file for the updated AndroidManifest.xml:"

I run this..

    "/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platform-tools/aapt" package -f -M AndroidManifest.xml -F resources.arsc -I "/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platforms/android-8/android.jar" -S ./res

But I keep getting the same error

    ./res/layout/expandable_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/expandable_multiple_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/main.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/multiple_file_selection_panel.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/ssl_certificate_warning.xml:1: error: Error parsing XML: not well-formed (invalid token)

The guide doesn't say anything about these xml files, and im not sure what to do with these ore how to handle them.

If i go into the res/layout folder, and just delete these (i know theyre for my layout and i need them, but im just saying i deleted them for the sake of a test)

I was able to get through the rest of the steps in the guide fine, make an apk, and put it on my phone...only to find out the app will crash the moment you try to run it.

So my question is, does anyone with any experience re-packaging an android application know how I might get around this or take care of the errors with the xml files in the layout folder?

Thanks!!

EDIT to note something i've tried:

So, earlier in the guide they have me use thing thing called the "AXMLPrinter2.jar" to make the AndroidManifest.xml readable so i can edit it.

I run something like this:

    java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" AndroidManifest.xml > AndroidManifest.xml.bk

This makes a new file "AndroidManifest.xml.bk" and i can edit that.

So, I was thinking with all of these layout xml files, maybe I could run this "AXMLPrinter2.jar" on them and then edit them. Because right now if you open them they're not human readable, and its hard for me to work on them if they're not...

But when i do the same command I did on the AndroidManifest.xml i just get blank files...

I tried

    java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" main.xml > main.xml.bk

Just get a blank file.

So, i think the issue might be with these just not being re-formatted to human readable.