Copy link to clipboard
Copied
A few years ago I published an Android app using Adobe AIR. Now I've created a new version of the app with a different technology (HaxeFlixel / OpenFL) which uses native C++ code.
The certificate I used for the AIR version is in "p12" format, and it seems that I need to use "jks" format. I tried using a p12 to jks converter I found online, which seemed to work, but when I try to submit the app I get an error saying that the certificates don't match.
Any suggestions on how I can update the app with a non-AIR app? Is it possible? Thanks in advance.
Just for the record, I was able to solve the problem by removing the certificate from the apk, and signing it again with the jks certificate, with jarsigner. I basically followed this: http://stackoverflow.com/questions/3267216/can-i-re-sign-an-apk-with-a-different-certificate-than-what-it-came-with So the problem had something to do with how the app was signed, not the certificate.
Copy link to clipboard
Copied
The issue may be the app id. If your non-AIR version is com.company.appname then the AIR version is most likely air.com.company.appname. which therefore doesn't match. You could try changing your new version's app id to match the AIR version.
Copy link to clipboard
Copied
I don't think that's the problem, since I put the same package name in the xml, but I'll double-check.
Copy link to clipboard
Copied
The package name in the XML shows without the "air" part. If you're doing a non-AIR app and its ID is the same as the AIR app XML value, then the final ID is different.
What is the Google Play URL for the exiting version?
Copy link to clipboard
Copied
Yes, I checked the real package name. The Google Play URL for the app is the following:
G-Switch - Android Apps on Google Play
The package name would be air.GSwitch, correct?
I've been trying to find out what the package name is directly from the new apk, to check if it was saved correctly, with aapt (I followed online help), but it gives me an error saying that there's no manifest file, which is odd.
Copy link to clipboard
Copied
I've never seen someone get away with just having one word as an app id, but you did. Look at the URL though, the app id that you submitted is 'air.GSwitch'. Try setting your new version to have an app id of air.GSwitch as well.
Copy link to clipboard
Copied
Haha, is there something wrong with having just one word? I admit I didn't really know what I was doing at the time, I would of put my site name if it were today.
But yeah, I put the exact same package name. I have this at the start of the new AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:versionCode="1002000" android:versionName="1.2.0" package="air.GSwitch">
Copy link to clipboard
Copied
I think the idea of having more words in the app id is to make sure it's unique. Imagine if you and someone else used an app id of 'chess', there would certainly be a clash one day. Having 'com.mycompanyname.chess' would certainly not clash with someone making a chess game using their own company name in the app id. I know Switch isn't likely to be used on its own by anyone, so you're most likely safe.
Was the package value 'air.GSwitch' before I suggested you make it that, or did you just change it?
Copy link to clipboard
Copied
Ok I see, yeah I guess I got lucky.
The package name was already "air.GSwitch", I did not change it now.
Copy link to clipboard
Copied
I thought your new tool wasn't AIR. I wonder why it still added 'air'.
It could be worth asking the OpenFL community how anyone else handles the problem of getting a JKS that matches the P12 for the AIR version. Or try a more complex conversion rather than use an online tool. This article might help:
Copy link to clipboard
Copied
In the new tool I can define the package name, so I just named it "air.GSwitch".
Ok, thanks for the link, I will try that out. If it doesn't work I'll try asking in the OpenFL forums.
Copy link to clipboard
Copied
I'm still having trouble with this, I asked in the OpenFL forums but nobody responded.
I converted the p12 file to JKS from the site you suggested (I think I've actually tried it before), and the file was created successfully, the apk compiled fine with the JKS file, but when I try to update the app for Google Play it says "Upload failed
You uploaded an APK that is signed with a different certificate to your previous APKs. You must use the same certificate. Your existing APKs are signed with the certificate(s) with fingerprint(s):"
When I try to sign with the original p12 file, I get the error "Invalid keystore format"
I noticed that for the AIR app, I also had a file called SelfSigned.pfx, which I think was used to create the p12 certificate? Can this have something to do with the problem? I even tried using this pfx file to sign the app, which didn't work either.
Copy link to clipboard
Copied
Just for the record, I was able to solve the problem by removing the certificate from the apk, and signing it again with the jks certificate, with jarsigner. I basically followed this: http://stackoverflow.com/questions/3267216/can-i-re-sign-an-apk-with-a-different-certificate-than-wh... So the problem had something to do with how the app was signed, not the certificate.