Thứ Bảy, 6 tháng 4, 2019

Thay đổi mật khẩu releasekey.jks khi quên mật khẩu

Bước 1: Cài Java SE Development Kit 8u201
Bước 2: Cấu hình biến môi trường:
 Nhấn phím Windows -  gõ env - chọn Edit the system environment variables
Ở mục tab Advanced - Enviroment Variables - User variable tìm mục Path và chọn EDIT - NEW:
 Gõ vào đường dẫn bin ví dụ: C:\Program Files\Java\jdk1.8.0_201\bin rồi OK
Chạy CMD gõ javac nhấn enter
Bước 3: Reset Keystore password:
  1. Download the zip file here.
  2. Install JAVA into your computer
  3. Keep all the files(the keystore, extracted java files) in one folder
  4. Open Command Prompt there. (Shift + RightClick)
  5. Run javac ChangePassword.java
  6. Run java ChangePassword <keystore file> <new keystore file>
javac ChangePassword.java
java ChangePassword oldkey.jks newkey.jks
 7. Enter a password when asked. Remember the new password for the new jks file.

Bước 4: Tìm tên keystore alias ()
I finally could figure the issue out.
To get the Key Alias: I copied the keytool.exe and my keystore file into C:\Program Files\Java\jdk1.7.0_71\bin folder. Then from command prompt I wrote: (jks/keystore is extension)
keytool -list -v -keystore <name>.keystore
or if another extension
keytool -list -v -keystore <name>.jks
It will also ask for keystore password then. Then it will show you the key alias and Certificate fingerprints and other info.
Then I again tried to Generate Signed Apk for the project, I provided keystore, keystore password, key alias and provided the same password. Then it asks for master password, I tried with the same and it failed. With the reset option I reset the master password here.