0

I publisted an app on the play store about two years ago, 2014. Used Eclipse to complete it and it's still published on play store. I just found a folder with the old apk and the file.keystore is there. Don't think I have the original project as the computer i created it on died. Just lucky I moved some folders over to my new computer and found the keystore.

Basically I have created a new app in Android Studio and was wondering if it's possible to retrieve the info from the old file.keystore and use that in my new Android Studio App / keystore - name.jks

I haven't tried updating an app before and don't know how to get the right info from the old Eclipse file.keystore and put it into my new Android Studio app or name.jks file. Can it be done?

I opened the old name.keyystore in Keystore Explorer, it asked me for a password which I got past after a few trys, anything else I need to do? What info do I need?

Has anone done this that can help?

Thanks in advance

EMar
  • 61
  • 1
  • 9

1 Answers1

0

You should be goood so long as you know the password to the keystore. You just need to set up Gradle to sign it (full documentation here).

In your app/build.gradle:

android {
    signingConfigs {
        release {
            storeFile file('../file.keystore')
            storePassword 'passwordHere'
            keyAlias 'aliasHere'
            keyPassword 'passwordHere'
        }
    }
}
James McCracken
  • 15,488
  • 5
  • 54
  • 62
  • The keystore password lets me access the old name.keystore in Keystore Explored But do i need to get the key password also? and alias? Or do i just generate a new signed app and put the path to the old keystore? with the info above? – EMar Sep 30 '16 at 23:20
  • I do think you need the key password and alias as well. More info here: http://stackoverflow.com/a/5724912/868492 – James McCracken Sep 30 '16 at 23:25
  • I have the old name.keystore file opened in Keystore Explorer, is the alias the entery name? – EMar Oct 01 '16 at 02:43
  • I think I did it, I clicked Build > Create signed APK, I obviously must have used the same password for keystore and alias password because when I tried to generate the apk, it said no alias with that name, so kept trying with different aliase's until it said APK's generated successfully. So it would only generate the apk with my old eclipse keystore when I imputted the correct keystore password, alias and key password? – EMar Oct 01 '16 at 04:52
  • If you just add the keystore information to gradle then run the gradle release it should work – James McCracken Oct 01 '16 at 05:30
  • Yes and it does run, it also created a signed apk with the old keystore file, it wouldn't create the signed apk if I had the wrong info? The only problem I have now is renaming the package again, has to be the same as the old app right? it says there's already a com file. Can't create file c:\user\me\app\build\generated\source\release\com. file already exists. – EMar Oct 01 '16 at 09:27
  • You define your package in the `build.gradle` file too. It's your `applicationId`. – James McCracken Oct 01 '16 at 14:53
  • In the new app, I rename 3 folders under the java directory to (name.ie.radio) Select folder I want to rename, click Show Options Menu, untick Compact Empty Middle Packages, right click my folder & select Refactor > Rename > Rename Package. Worked the first time, I renamed my app in Android Studio. Now I want to rename new app package again to the same name as my old app (com.name.radio) so I tried setting new package name to com, but it doesn't allow me, saying that file already exists. no point in trying to rename it in the build.gradle yet? [Snaggy link example](https://snag.gy/Utezng.jpg) – EMar Oct 01 '16 at 22:50
  • Should I delete the com folder at: \app\build\generated\source\r\release – EMar Oct 02 '16 at 00:26
  • You can refactor the package name via Android Studio and it will do all of the hard work for you. If you have a separate problem from what is posted in this question, you should post another. – James McCracken Oct 02 '16 at 05:35
  • That's the problem, it won't let me refactor if I use "com" as it already exists.. Started a new thread: http://stackoverflow.com/questions/39821487/trying-to-rename-a-package-in-android-studio-but-says-file-com-already-exists – EMar Oct 02 '16 at 20:58