如何处理 Android 中丢失的 KeyStore 密码?

发布于 2024-11-08 16:13:49 字数 204 浏览 0 评论 0原文

我忘记了我的密钥库密码,我真的不知道该怎么办(我不能或不会为此给出任何借口)。我想更新我的应用程序,因为我刚刚修复了一个错误,但现在不可能了。如果我使用相同的密钥库但创建新密钥会发生什么?我是否仍然能够更新应用程序?如果不可能,我该如何向用户提供有关更新版本的信息?

如果有人遇到过这样的问题或遇到过麻烦,您可以提供什么建议来帮助解决这种情况?幸运的是,它是一个免费的应用程序。

I have forgotten my Keystore password and I don't really know what to do anymore (I can't or won't give any excuses for it). I want to update my app because I just fixed a bug but it's not possible anymore. What happens if I use the same Keystore but create a new key? Would I still be able to update the app and if it's not possible, how can I go about giving information to users about the updated version?

If anybody has had a problem like this or has come across troubles, what advice can you give to help remedy the situation? Fortunately, it is a free app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(30

轻拂→两袖风尘 2024-11-15 16:13:50

我自己就遇到了这个问题 - 幸运的是我能够在 Gradle 的一些临时文件中找到密码。以防万一有人登陆这里:

尝试查找此文件

..Project\.gradle\2.4\taskArtifacts\taskArtifacts.bin

or

.gradle/3.5/taskHistory/taskHistory.bin
.gradle/5.1.1/executionHistory/executionHistory.bin
.gradle/caches/5.1.1/executionHistory/executionHistory.bin
.gradle/5.1.1/executionHistory/executionHistory.bin
.gradle/3.5/taskHistory/taskHistory.bin
.gradle/2.10/taskArtifacts/taskArtifacts.bin

并搜索

storePassword

它以明文形式存在。一般来说,如果您至少记住了密码的一部分,请尝试搜索包含此子字符串的文件,希望您能找到一些东西。

想把它扔在这里,也许它最终会对某人有所帮助。


编辑: 从评论中添加了新的见解,只是为了更加明显。
编辑 2: 添加了评论中报告的更多位置。

感谢 Vivek Bansal、Amar Ilindra 和 Uzbekjon 提供的这些信息。

Just encountered this problem myself - luckily I was able to find the password in some Gradle's temporary file. Just in case anyone lands here:

try looking for this file

..Project\.gradle\2.4\taskArtifacts\taskArtifacts.bin

or

.gradle/3.5/taskHistory/taskHistory.bin
.gradle/5.1.1/executionHistory/executionHistory.bin
.gradle/caches/5.1.1/executionHistory/executionHistory.bin
.gradle/5.1.1/executionHistory/executionHistory.bin
.gradle/3.5/taskHistory/taskHistory.bin
.gradle/2.10/taskArtifacts/taskArtifacts.bin

and search for

storePassword

It was there in cleartext. In general, if you do remember at least a part of your password, try searching for a file containing this substring and hopefully you will fish out something.

Wanted to throw it out here, maybe it will eventually help someone.


Edit: Added new insight from comments, just to be more visible.
Edit 2: Added some more locations reported in comments.

Thanks to Vivek Bansal, Amar Ilindra and Uzbekjon for these.

坏尐絯℡ 2024-11-15 16:13:50

请参阅此链接

不幸的是,但是当您丢失密钥库或密钥库的密码时,您的应用程序将被孤立。您唯一能做的就是使用新密钥将您的应用程序重新提交到市场。

始终备份您的密钥库并将密码写在安全的位置。

See this link

It's unfortunate, but when you lose your keystore, or the password to your keystore, your application is orphaned. The only thing you can do is resubmit your app to the market under a new key.

ALWAYS backup up your keystore and write the passwords down in a safe location.

指尖上得阳光 2024-11-15 16:13:50

野蛮是你最好的选择!

这是一个帮助我解决问题的脚本:

https://code。 google.com/p/android-keystore-password-recover/wiki/HowTo

您可以选择为其提供密码可能包含的单词列表,以便快速恢复(对我来说它工作时间<1秒)

Brute is your best bet!

Here is a script that helped me out:

https://code.google.com/p/android-keystore-password-recover/wiki/HowTo

You can optionally give it a list of words the password might include for a very fast recover (for me it worked in <1 sec)

只有影子陪我不离不弃 2024-11-15 16:13:50

如果提供了错误的密码,即使只有一次,它会在下次尝试时不断提示:

密钥库被篡改或密码不正确。

即使您提供了正确的信息。我试了好几次了,也许是某种保护。
关闭导出向导并使用正确的密码再次启动它,现在它可以工作了:)

In case a wrong password is provided, even just once, it keeps saying on next attempts:

Keystore tampered with or password incorrect.

Even when you provide the correct one. I tried it several times, maybe it's some kind of protection.
Close the export wizard and start it again with the correct password, now it works :)

冷心人i 2024-11-15 16:13:50

转到任务历史记录

最后我花了两天时间找到了解决方案...

按照以下步骤操作:

  1. 转到项目
  2. 在 .gradle 中找到你的 gradle 版本文件夹,在我的情况下它是 4.1 (参考图片)
  3. 展开 4.1 文件夹,然后在任务历史文件夹中您将找到taskHistory.bin 文件。
  4. 在 android studio 本身中打开 taskHistory.bin 文件。
  5. 搜索“.storePassword”..这就是您的密钥库密码。

这对我来说确实很有效。

试试这个,祝你编码愉快!

Go to taskHistory

Finally i found the solution after spending two days...

Follow these steps:

  1. Go to project
  2. In .gradle find your gradle version folder in my case it was 4.1 (Refer pic)
  3. expand the 4.1 folder and then in taskHistory folder you will find taskHistory.bin file.
  4. Open taskHistory.bin file in android studio itself.
  5. Search for ".storePassword" .. That's it you got your keystore password.

This really worked to me.

Try this and happy coding!!!

倾听心声的旋律 2024-11-15 16:13:50

解决方案 2019(Windows、Android Studio 3.3、gradle 4.10):

此解决方案仅在之前标记了“记住密码”复选框的情况下才有效。

首先,taskArtifacts.bin 不适用此版本的 gradle 存在,idea.log 显示密码的星号。这是过去的解决方案,对我不起作用。

我在哪里找到了明文密码:C:\Users\{username}\AndroidStudioProjects\{project}\app\build\intermediates\signing_config\release\out\signing-config.json

密钥:mStorePassword 和 mKeyPassword。

我真的希望它对其他人有帮助。

SOLUTION 2019 (Windows, Android Studio 3.3, gradle 4.10):

This solution only works if "Remember password" checkbox was previously marked.

First of all taskArtifacts.bin don't exist for this version of gradle and idea.log shows asterisks for passwords. This was old days solutions that doesn't worked to me.

Where I found the clear text passwords: C:\Users\{username}\AndroidStudioProjects\{project}\app\build\intermediates\signing_config\release\out\signing-config.json

Keys: mStorePassword and mKeyPassword.

I really hope it helps someone else.

猫九 2024-11-15 16:13:50

在 MAC 上启动控制台实用程序并向下滚动到 ~/Library/Logs -> AndroidStudio ->idea.log.1(或任何旧的日志编号)
然后我搜索“keystore”,它应该出现在日志中的某个位置。

原始问题:链接

On a MAC launch Console utility and scrolled down to ~/Library/Logs -> AndroidStudio ->idea.log.1 (or any old log number)
Then I searched for "keystore" and it should appear somewhere in the logs.

Original question: link

十雾 2024-11-15 16:13:50

事实上,丢失密钥库密码并不是问题。
您可以使用下面的 keytool 命令创建一个新的密钥库并为其设置新密码。您不需要原始密钥库密码:

keytool -importkeystore -srckeystore path/to/keystore/with/forgotten/pw \
-destkeystore path/to/my/new.keystore

出现提示时,为您的 new.keystore源密钥库密码(您可以使用该密码)创建密码丢失)只需按Enter即可。
您将收到有关未检查完整性的警告,并且您将获得与原始密钥库相同的新设置的密码。

这样做的原因是密钥库密码仅用于提供密钥库的完整性,与私钥相反,它不会用它加密数据密码,它实际上使您的私钥保持加密状态。

请注意,您必须知道您的私钥密码才能对您的应用进行签名。好吧,如果它与忘记的密钥库密码相同,那么您可以像@Artur的答案一样诉诸暴力。

这种方法一直对我有用。

In fact, losing thekeystore password is not a problem.
You can create a new keystore and set a new password for it with the keytool command below. You don't need original keystore password for it:

keytool -importkeystore -srckeystore path/to/keystore/with/forgotten/pw \
-destkeystore path/to/my/new.keystore

When prompted, create password for your new.keystore and for source keystore password (which you lost) just hit Enter.
You will get warning about integrity not checked, and you will get your new.keystore identical to original with newly set password.

The reason this works is keystore password is only used to provide integrity of the keystore, it does not encrypt data with it, in contrast to private key password, which actually keeps your private key encrypted.

Please note, that you must know your private key password to sign your apps. Well, if it is same as forgotten keystore password then you can resort to bruteforce as in @Artur's answer.

This approach always worked for me.

明天过后 2024-11-15 16:13:50

我觉得我需要回答这个问题,因为这不能只是在评论中。
就像 @ElDoRado1239 在他的答案中所说(不要忘记给他的答案投票;)

  • 寻找 ..Project\。 gradle\2.4\taskArtifacts\taskArtifacts.bin 在我的例子中是在 ..Project\.gradle\2.2.1\taskArtifacts\taskArtifacts.bin 因为我使用 gradle 2.2。 1
  • 然后像 @Moxet Khan 在评论中所说的那样查找 storePassword...在我的例子中是在 signingConfig.storePassword t my.forgoten.password—signingConfig.keyAlias 行

希望能帮助别人!

I feel I need to make it an answer because this could not be just in comments.
Like @ElDoRado1239 says in his answer (dont forget to upvote his answer ;)

  • Looks for ..Project\.gradle\2.4\taskArtifacts\taskArtifacts.bin in my case was in ..Project\.gradle\2.2.1\taskArtifacts\taskArtifacts.bin because I use gradle 2.2.1
  • Then look for storePassword like @Moxet Khan says in comments...in my case was at line signingConfig.storePassword¬í t my.forgoten.password—signingConfig.keyAlias

Hope help somebody else!!!

握住我的手 2024-11-15 16:13:50

获取密钥库密码的最简单方法

project_folder\app\build\intermediates\signing_config\release\out\signing-config.json

查看此文件
signing-config.json 中搜索 StorePassword

{"mName":"externalOverride","mStoreFile":"C:\\Users\\dAvInDeR\\Desktop\\KEYSTORE\\keystore.jks","mStorePassword":"1234@#abcd","mKeyAlias":"uploadkey","mKeyPassword":"1234@#abcd","mStoreType":"jks","mV1SigningEnabled":false,"mV2SigningEnabled":false}

希望对您有所帮助。

更新日期:2022 年 9 月
它不适用于最新版本

The simplest way to get a keystore password

project_folder\app\build\intermediates\signing_config\release\out\signing-config.json

Check out this file
search for StorePassword in signing-config.json

{"mName":"externalOverride","mStoreFile":"C:\\Users\\dAvInDeR\\Desktop\\KEYSTORE\\keystore.jks","mStorePassword":"1234@#abcd","mKeyAlias":"uploadkey","mKeyPassword":"1234@#abcd","mStoreType":"jks","mV1SigningEnabled":false,"mV2SigningEnabled":false}

Hope fully it will help you.

Update: Sep 2022
It won't work with the latest version

老旧海报 2024-11-15 16:13:50

幸运的是,我从 Android studio 日志中找到了丢失的密码以及密钥库路径和别名。

如果您运行的是基于 linux / Unix 的机器。

请导航到其中的 Library Logs 目录

cd ~/Library/Logs/

如果您还记得用于构建最新版本 APK 的 android studio 版本, 。导航到该目录,

例如:cd AndroidStudio1.5/,

您将在其中找到日志文件。在任何日志文件(idea.log)中
您将找到您的密钥库

凭据示例

-Pandroid.injected.signing.store.file=/Users/myuserid/AndroidStudioProjects/keystore/keystore.jks, 
-Pandroid.injected.signing.store.password=mystorepassword, 
-Pandroid.injected.signing.key.alias=myandroidkey, 
-Pandroid.injected.signing.key.password=mykeypassword,

我希望这对 Android Studio 用户有所帮助

Fortunately, I found my lost password along with the keystore path and alias name from my Android studio logs.

if you are running linux / Unix based machines.

Navigate to Library Logs directory

cd ~/Library/Logs/

in there if you remember your android studio version which you used to build the last release APK. Navigate to that Directory

ex : cd AndroidStudio1.5/

In there you will find the log files. in any of the log files (idea.log)
you will find your keystore credentials

example

-Pandroid.injected.signing.store.file=/Users/myuserid/AndroidStudioProjects/keystore/keystore.jks, 
-Pandroid.injected.signing.store.password=mystorepassword, 
-Pandroid.injected.signing.key.alias=myandroidkey, 
-Pandroid.injected.signing.key.password=mykeypassword,

I hope this helps for Android Studio users

满身野味 2024-11-15 16:13:50

可能有点晚了,但肯定会对某人有所帮助
如果您记得某些内容,您可以搜索密码,否则请尝试搜索

signingConfig.storePassword

如果您忘记了关键别名,您也可以在这里找到
搜索类似 signingConfig.keyAlias 的内容

Project.gradle\3.3\taskArtifacts\taskArtifacts.bin

希望它能帮助别人

It may be bit late but it will help someone for sure
You can search password if you remember something otherwise try searching like

signingConfig.storePassword

also if you forgot key alias you can find here that also
search something like signingConfig.keyAlias

Project.gradle\3.3\taskArtifacts\taskArtifacts.bin

Hope it will help someone

蝶…霜飞 2024-11-15 16:13:50

在花了将近一天的时间研究在 Android Studio 中恢复丢失的密钥库密码的可能选项之后。我发现了以下 4 种可能的方法:

  1. 使用 AndroidKeystoreBrute找回您的密码。当您部分忘记密码并且您的脑海中仍然有一些密码提示时,此方法非常有用。

  2. 如果您之前使用同一台计算机发布了该应用程序(您找到了密钥库密码),您也可以通过 Android Studio 日志文件检索它。参考如下目录:

    Mac OSX

    <块引用>

    ~/Library/Logs/AndroidStudio/idea.log.1

    Linux(可能的位置)

    <块引用>

    /home/用户名/AndroidStudio/system/log

    Windows(可能的位置)

    <块引用>

    C:\Users\用户名\AndroidStudio\system\log

    并在文件内搜索Pandroid.injected.signing.key.password。如果您之前使用与当前正在查看的 Android Studio 版本相同的版本签署了应用程序,您将看到密码。

  3. 您还可以通过项目的.gradle目录找回密码。寻找以下路径

    <块引用>

    project_directory/.gradle/2.4/taskArtifacts/taskArtifacts.bin。

    注意:这似乎不适用于较新版本的 Gradle(2.10 及更高版本)。

  4. 如果上述解决方案均不起作用,那么您可以尝试此解决方案,但对于此解决方案,您还必须有 Android Studio IDE 应用程序或它的首选项,其中您的项目密钥库密码已提前保存(在签署应用程序时使用“记住密码”选项)。您可以从以下路径获取 IDE 首选项:

    Mac OSX

    <块引用>

    ~/Library/Logs/AndroidStudio/idea.log.1

    Linux(可能的位置)

    <块引用>

    /home/用户名/AndroidStudio

    Windows(可能的位置)

    <块引用>

    c:\user\用户名\.AndroidStudio

    如果您有旧版 Android Studio IDE,则只需使用旧版 Android Studio IDE,或者将旧版 IDE 的首选项导入到新版 IDE 中,并将密钥库文件放在您上次签名并保存密码时所在的路径中。

    通过这种方式,一旦您打开项目并尝试“构建”->“生成签名 APK”并从旧位置选择密钥库文件。它将自动检索密码并继续生成签名的APK以供发布。

    成功生成发布 APK 后,您可以按照前面提到的选项 2 从日志文件中检查最近生成的发布 APK 的密码。

After spending almost a day in researching the possible options for recovering the lost keystore password in Android Studio. I found the following 4 possible ways to do it:

  1. Use AndroidKeystoreBrute to retrieve your password. This method is quite useful when you partially forgot your password means you still have some hints of your password in your mind.

  2. You can also retrieve it through Android Studio log files if you have previously released the app(for which you finding the keystore password) with the same machine. Refer to the following directory:

    Mac OSX

    ~/Library/Logs/AndroidStudio/idea.log.1

    Linux (Possible Location)

    /home/user_name/AndroidStudio/system/log

    Windows (Possible Location)

    C:\Users\user_name\AndroidStudio\system\log

    and search for Pandroid.injected.signing.key.password inside the file. You gonna see the password if you have previously signed the app with the same Android Studio version in which you are looking currently.

  3. You can also retrieve the password through .gradle directory of your project. Look for the following path

    project_directory/.gradle/2.4/taskArtifacts/taskArtifacts.bin.

    Note: This doesn't seem to work for newer versions of Gradle (2.10 and above).

  4. If none of the above solutions works then you can try this one but for this one also you must have Android Studio IDE app or It's preferences in which your project keystore password have been saved earlier (Using the Remember password option at the time of signing the app). You can get the IDE preferences from the following path:

    Mac OSX

    ~/Library/Logs/AndroidStudio/idea.log.1

    Linux (Possible Location)

    /home/user_name/AndroidStudio

    Windows (Possible Location)

    c:\user\username\.AndroidStudio

    Just use the older Android Studio IDE if you have or import the preferences of the old IDE into new IDE and also put the keystore file in the same path where it was previously when you had signed it and save the password last time.

    In this way once you open the project and try the Build->Generate Signed APK and select the keystore file from the older location. It will automatically retrieve the password and continue to generate the signed APK for release.

    Once the release APK generates successfully you can follow the option 2 mentioned earlier to check your password from you log file for the recently generated release APK.

合久必婚 2024-11-15 16:13:50

对于其他可能遇到此问题的人,我想分享一个可能适合您或浏览本文的其他人(例如我自己)的答案。

我正在使用 Eclipse 并在其中为 1.0 版本创建了我的密钥库。快进 3 个月了,我想更新到 1.1。当我在 Eclipse 中选择 Export... 并选择该密钥库时,我记得的所有密码都不起作用。每次它都会说“密钥库被篡改或密码不正确。”它已经到了我准备在其上运行暴力程序的程度,只要我能忍受(一周左右) )尝试让它发挥作用。

幸运的是,我在 Eclipse 之外签署了未签名的 .apk 文件。瞧 - 它成功了!我的密码一直都是正确的! 我不知道为什么,但是即使我的密码正确,通过“导出”菜单在 Eclipse 中签名也会报告错误。

因此,如果您收到此错误,请执行以下步骤(采取的步骤)来自 Android 文档),帮助您为您的 apk 做好准备市场。

注意:要从 Eclipse 获取未签名的 apk:右键单击项目 >安卓工具>导出未签名的应用程序

  1. 使用密钥库签署未签名的 apk 文件

    a.打开管理员cmd提示符并转到“c:\Program Files\Java\jdk1.6.0_25\bin”或您拥有的任何版本的java(您已在其中复制了未签名的apk文件和密钥库)

    b.在 cmd 提示符下,将密钥库文件和未签名的 apk 放在同一目录中,键入以下命令:jarsigner -keystore mykeystorename.keystore -verbose unsigned.apk myaliasnamefromkeystore

    c.它会说:“输入密钥库的密码:”。输入它并按回车键。

    d. ===>成功看起来像这样:

    添加:META-INF/MANIFEST.MF
    ...
    签名:classes.dex
    

    e.未签名的版本会被就地覆盖,因此您的签名 apk 文件现在与未签名的文件具有相同的文件名

  2. 使用 ZipAlign 压缩签名的 apk 文件以便在市场上分发

    a.打开管理命令提示符并转到“c:\AndroidSDK\tools”或安装 Android SDK 的任何位置

    b.输入此命令:zipalign -v 4signed.apksignedaligned.apk

    c. ===>成功看起来像这样:

    验证signedaligned.apk的对齐方式(4)
    50 META-INF/MANIFEST.MF(确定 - 压缩)
    ...
    1047129classes.dex(正常 - 压缩)
    验证成功
    

    d.签名和对齐的文件位于signedaligned.apk(您在上一个命令中指定的文件名)

========>准备提交到市场

For anyone else who may run across this, I wanted to share an answer that may be the case for you or for others browsing this article (like myself).

I am using Eclipse and created my keystore in it for my 1.0 release. Fast forward 3 months and I wanted to update it to 1.1. When I chose Export... in Eclipse and chose that keystore, none of my passwords that I could remember worked. Every time it said "Keystore tampered with or password incorrect." It got to a point where I was getting ready to run a brute force program on it for as long as I could stand (a week or so) to try to get it to work.

Luckily, I to sign my unsigned .apk file outside of Eclipse. Voila - it worked! My password had been correct the entire time! I'm not sure why, but signing it in Eclipse through the Export menu was reporting an error even when my password was correct.

So, if you're getting this error, here are my steps (taken from Android documentation) to help you get your apk ready for the market.

NOTE: To get unsigned apk from Eclipse: Right-click project > Android Tools > Export Unsigned Application

  1. Sign unsigned apk file with keystore

    a. open administrator cmd prompt and go to "c:\Program Files\Java\jdk1.6.0_25\bin" or whatever version of java you have (where you have copied the unsigned apk file and your keystore)

    b. at cmd prompt with keystore file and unsigned apk in same directory, type this command: jarsigner -keystore mykeystorename.keystore -verbose unsigned.apk myaliasnamefromkeystore

    c. it will say: "Enter Passphrase for keystore:". Enter it and press Return.

    d. ===> Success looks like this:

    adding: META-INF/MANIFEST.MF
    ...
    signing: classes.dex
    

    e. the unsigned version is overwritten in place, so your signed apk file is now at the same file name as the unsigned one

  2. Use ZipAlign to compact the signed apk file for distribution in the market

    a. open admin cmd prompt and go to "c:\AndroidSDK\tools" or wherever you installed the Android SDK

    b. enter this command: zipalign -v 4 signed.apk signedaligned.apk

    c. ===> Success looks like this:

    Verifying alignment of signedaligned.apk (4)
    50 META-INF/MANIFEST.MF (OK - compressed)
    ...
    1047129 classes.dex (OK - compressed)
    Verification succesful
    

    d. the signed and aligned file is at signedaligned.apk (the filename you specified in the previous command)

========> READY TO SUBMIT TO MARKETPLACE

浅暮の光 2024-11-15 16:13:50

令我惊讶的是没有人提到这一点,但您可以访问 Google Play 开发者支持,他们将与您一起创建新的上传密钥:

https://support.google.com/googleplay/android-developer/contact/otherbugs

我填写了一个问题,他们在 1 天内与我联系。

更新:按照他们的电子邮件说明后,我能够创建一个新的上传密钥,并在几天后启用!问题解决了。

I'm surprised no one has mentioned this, but you can go to Google Play developer support, and they will work with you to create a new upload key:

https://support.google.com/googleplay/android-developer/contact/otherbugs

I filled an issue, and they contacted me within 1 day.

Update: After following their email instructions I was able to create a new upload key, and it was enabled a few days later! Problem solved.

黑寡妇 2024-11-15 16:13:50

首先下载 AndroidKeystoreBrute_v1.05.jar,然后按照给定的图像操作。在此处输入图像描述

准备一个单词列表文件,例如(wordlist.txt),在该文件中给出提示,例如

密码提示:

users

Users

密码

密码

pa55word

密码

@

*

#

$

&

1

2

123

789

U 将获取您的密码。

First download AndroidKeystoreBrute_v1.05.jar and then follow the given image.enter image description here

prepare one wordlistfile like(wordlist.txt), in that file give your hint like

Password Hint:

users

Users

Password

password

pa55word

Password

@

*

#

$

&

1

2

123

789

U will get your password.

清君侧 2024-11-15 16:13:50

将其添加为另一种可能性。如果您碰巧在过去的某个时刻指定了签名配置,答案可能就在您的应用程序的 build.gradle 文件中:

signingConfigs {
    config {
        keyAlias 'My App'
        keyPassword 'password'
        storeFile file('/storefile/location')
        storePassword 'anotherpassword'
    }
}

您感到幸运吗?!

Adding this as another possibility. The answer may be right under your nose -- in your app's build.gradle file if you happened to have specified a signing configuration at some point in the past:

signingConfigs {
    config {
        keyAlias 'My App'
        keyPassword 'password'
        storeFile file('/storefile/location')
        storePassword 'anotherpassword'
    }
}

Do you feel lucky?!

忆离笙 2024-11-15 16:13:50

我立刻也遇到了同样的问题。
尽管通过 Google Play 进行应用程序签名,丢失密钥库或其密码并不像以前那样是大问题,但作为开发人员,我们仍然更愿意更改其密码并使用生成的密钥库文件,而无需等待几天谷歌来处理它。
(要通过 Google 处理此问题,请使用此链接提出请求)
要我们自己处理这个问题,
首先从此链接下载两个.java文件。
然后通过javac ChangePassword.java命令编译ChangePassword.java。
然后,您可以

java ChangePassword <oldKeystoreFileName.keystore> <newKeystoreFileName.keystore>

使用当前密钥库文件的路径/名称运行 Change oldKeystoreFileName.keystore ,并使用新生成的新密钥库文件的路径/名称运行 newKeystoreFileName.keystore
这将促进您

输入密钥库密码:

。只需输入您喜欢的任何内容即可:) 无需输入丢失的原始密码。然后输入带 * 的新密码

新密钥库密码:

  • 瞧,就是这样。这不会更改您的密钥库的校验和,也不会在应用签名或上传到 play.google 事件时出现任何问题。

I had the same problem at once.
Even though with App signing by Google Play, loosing keystore or it's password is not a big deal like earlier, Still as a developer we rather prefer to change it's password and use a generated keystore file without waiting for few days to google to handle it.
( To handle this issue with google use this link to make a request)
To handle this issue by ourselves,
First download two .java files from this link.
Then compile the ChangePassword.java by javac ChangePassword.java command.
Then after you may run

java ChangePassword <oldKeystoreFileName.keystore> <newKeystoreFileName.keystore>

Change oldKeystoreFileName.keystore with the path/ name of your current keystore file, and newKeystoreFileName.keystore with path/name for the new generated new keystore file.
This will promot you to

Enter keystore password:

. Just enter whatever you prefer :) no need to be the original password that lost. Then Enter the new password with *

new keystore password:

  • Voila, that's it. This won't change the checksum of your keystore and won't make any issues in app signing or uploading to play.google events.
耳钉梦 2024-11-15 16:13:50

如果您能够从 PC 构建应用程序,但您忘记了密码,则可以执行以下操作来找回密码:

方法 1:

在您的 build.gradle 中,添加 println MYAPP_RELEASE_KEY_PASSWORD 如下:

signingConfigs {
    release {
        if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
            storeFile file(MYAPP_RELEASE_STORE_FILE)
            storePassword MYAPP_RELEASE_STORE_PASSWORD
            keyAlias MYAPP_RELEASE_KEY_ALIAS
            keyPassword MYAPP_RELEASE_KEY_PASSWORD
            println MYAPP_RELEASE_KEY_PASSWORD
        }
    }
}

之后,运行 cd android && ./gradlew assembleRelease

方法 2:

运行 keytool -list -v -keystore 你的 <.keystore 文件路径> 例如 keytool -list -v -keystore 。 /app/my-app-key.keystore。

它会要求您输入密钥库密码:只需在此处按 Enter 键即可。您将能够找到映射到别名的名称:

然后,运行 grep -rn "" . 在你的终端中,你将能够看到你的signing.json文件,如下所示:

./app/build/intermediates/signing_config/release/out/signing-config.json

该文件将包含你的json格式的密码,密钥为“mKeyPassword”:“<你的密码>”

IF you're able to build your app from a PC, but you don't recall the password, here's what you can do to retrieve the password:

Method 1:

In your build.gradle, add println MYAPP_RELEASE_KEY_PASSWORD as below:

signingConfigs {
    release {
        if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
            storeFile file(MYAPP_RELEASE_STORE_FILE)
            storePassword MYAPP_RELEASE_STORE_PASSWORD
            keyAlias MYAPP_RELEASE_KEY_ALIAS
            keyPassword MYAPP_RELEASE_KEY_PASSWORD
            println MYAPP_RELEASE_KEY_PASSWORD
        }
    }
}

After that, run cd android && ./gradlew assembleRelease

Method 2:

Run keytool -list -v -keystore your <.keystore file path> e.g. keytool -list -v -keystore ./app/my-app-key.keystore.

It will ask for you to Enter keystore password: Just press enter key here. and you will be able to find mapped to Alias name:

Then, run grep -rn "<your alias name>" . in your terminal and you will be able to see your signing.json file as below:

./app/build/intermediates/signing_config/release/out/signing-config.json

The file will have your password in json format with key "mKeyPassword":" < your password > "

风和你 2024-11-15 16:13:50

解决方案 2018:如果您缺少密码或 jks 文件,请使用新的密钥库文件对应用进行签名。

1) 使用命令行(不是 android studio 构建菜单)创建新的 keystore.jks 文件

keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

Windows 示例:
“C:\ Program Files \ Android \ Android Studio \ jre \ bin \ keytool.exe”-genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore“C:\ keystore_new.jks”

2) 从新密钥库生成 .pem 文件

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks

Windows 示例:
"C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -export -rfc -alias upload -file "C:\upload_cert.pem" -keystore "C:\keystore_new.jks"

3) 使用此支持表单,设置“密钥库问题”并通过附件添加 .pem 文件:
https://support.google.com/googleplay/android-developer/contact/其他错误

4) 12-48h 您的新密钥库已启用。使用使用新密钥库签名的新 apk 在 Playstore 上更新您的应用程序:D

SOLUTION 2018: Sign app with new keystore file if you missing password or jks file.

1) Create new keystore.jks file with comand line (not android studio build menu)

keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

Windows example:
"C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore "C:\keystore_new.jks"

2) Generate a .pem file from new keystore

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks

Windows example:
"C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -export -rfc -alias upload -file "C:\upload_cert.pem" -keystore "C:\keystore_new.jks"

3) Use this support form, set "keystore problem" and with attachment add .pem file:
https://support.google.com/googleplay/android-developer/contact/otherbugs

4) 12-48h you new keystore is enabled. Update your app on playstore with new apk signed with new keystore :D

深海少女心 2024-11-15 16:13:50

打开 taskHistory.bin 并搜索 storePassword

Open taskHistory.bin and search for storePassword

岁月静好 2024-11-15 16:13:50

在 Ionic 中,我可以在这里找到它: /app/platforms/android/app/build/intermediates/signing_config/release/out/signing-config.json

也许这会对某人有所帮助。干杯。

In Ionic I was able to find it here: /app/platforms/android/app/build/intermediates/signing_config/release/out/signing-config.json

Maybe this will help someone. cheers.

时光清浅 2024-11-15 16:13:50

为了简化这里的事情,这个解决方案适用于 2020 年的 gradle 版本:5.4.1

打开文件:project\.gradle\5.4.1\executionHistory.bin

密钥存储密码:

搜索“storePassword”文本

密钥密码: >

搜索“keyAlias”文本

搜索后检查同一行或下一行中是否有密码。

Just to simplify things here, this solution works in 2020 for gradle ver: 5.4.1

Open the file: project\.gradle\5.4.1\executionHistory.bin

Key Store password:

Search for "storePassword" text

For Key Password:

Search for "keyAlias" text

After search check for the password in the same line or the next line.

掩耳倾听 2024-11-15 16:13:50

有一种方法可以重置您的密码。

转到此链接,描述您的问题(忘记密钥库密码)并生成令牌。
https://support.google.com/googleplay/android-developer/contact/ otherbugs

如果您幸运的话,您将在 1 小时内获得重播。 (一般情况下最多需要2天)。

您将需要生成一个新密钥和 upload_certificate.pem 并将其发送到 google 进行重置。我们将通过邮件向您提供说明。

要生成 upload_certificate.pem,请转到 android studio 终端并输入:

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks

There is a way you can reset your password.

Go to this link, Describe your issue (Forgot KeyStore Password) and generate a token.
https://support.google.com/googleplay/android-developer/contact/otherbugs

If you are lucky then within 1 hour you will get a replay. (Generally, it takes up to 2 days).

You will need to generate a new key and upload_certificate.pem and send it to google to reset. Yow will be given instruction in the mail.

To generate upload_certificate.pem go to android studio terminal and type :

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks
感情洁癖 2024-11-15 16:13:50

如果您的两个密码不同,Android 暴力破解将不起作用,因此最好的选择可能是尝试

找到名为log.idea

在您的文件中 的文件
C:/users/您指定的帐户
然后你可能会发现在 android 文件夹中用记事本打开该文件 lpg.idea 然后使用记事本中的查找

选项搜索别名

你会发现密码和别名和别名密码已显示在那里

Android brute force will not work if your both the passwords are different so the best option might be like that try to find the file named as

log.idea

in your
C:/users/your named account
then you might found that in there in android folder open that file lpg.idea in notepad and then search for

alias

using find option in notepad you will find it that the password and alias and alias passwors has been shown there

若沐 2024-11-15 16:13:50

中找到了密码

C:\Users\{Username}\.AndroidStudio2.2\system\log\idea.txt

我在搜索

Pandroid.injected.signing.store.password

I have found the password in

C:\Users\{Username}\.AndroidStudio2.2\system\log\idea.txt

Search for

Pandroid.injected.signing.store.password
戏蝶舞 2024-11-15 16:13:50

转到项目的 .gradle 文件夹中的 taskhistory.bin 搜索密码,向下滚动直到找到密码

Go to taskhistory.bin in .gradle folder of your project search password scroll down till you find the password

并安 2024-11-15 16:13:50

今天2/2/2021,我可以在文件名“executionHistory.bin”中找到我的密码。
让你用notepad++打开并搜索关键keyPassword。请参阅下面的附图。

https://i.sstatic.net/NNHFA.png

Today 2/2/2021, I can find my pw in the file name "executionHistory.bin".
Let you open it by notepad++ and search for key keyPassword. See the attached picture below.

https://i.sstatic.net/NNHFA.png

如何视而不见 2024-11-15 16:13:50

或者,如果密码以前在 AndroidStudio 中使用过但您不记得了,您可以从 Mac 的钥匙串中检索密码。

步骤:

  1. 启动“钥匙串访问”
  2. 搜索 jetbrains
  3. 通过双击打开行。
  4. 在详细信息对话框中,单击显示密码。您必须再次输入登录信息才能解锁钥匙串。

田田!

Alternatively, if the password was previously used in AndroidStudio but you don't remember it, you can retrieve the passwords from your Mac's keychain.

Steps:

  1. Launch "Keychain Access"
  2. Search for jetbrains
  3. Open the rows by double clicking on them.
  4. In the details dialog, click on show password. You will have to enter your login again to unlock the keychain.

Tada!

栖竹 2024-11-15 16:13:50

无需使用暴力破解,简单的方法就是找到您的纯文本密码。

goto:

C:\Users\<your username>\AndroidStudioProjects\WhatsAppDP\.gradle\2.2.1\taskArtifacts

打开:

taskArtifacts.bin 

当您打开taskArtifacts.bin时,它可能看起来是加密的,不必担心多次搜索“.keyPassword”。然后您将找到纯文本形式的密码。它可能类似于:

signingConfig.keyPassword¬í t <your password>Æù

希望这有帮助。

No need to use brute force a simple way is to find your plain text password.

goto:

C:\Users\<your username>\AndroidStudioProjects\WhatsAppDP\.gradle\2.2.1\taskArtifacts

Open:

taskArtifacts.bin 

when you open taskArtifacts.bin might look encrypted, don't worry about that search for ".keyPassword" a couple times. Then you will find your password in plain text. It may resemble:

signingConfig.keyPassword¬í t <your password>Æù

Hope this was helpful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文