[英]How do I import a CA certificate into Android 4.4.2 in the emulator?
I tried both DER and PEM formats.我尝试了 DER 和 PEM 格式。 I tried using the file extensions crt, cer, p12, pem but nothing of them get imported.我尝试使用文件扩展名 crt、cer、p12、pem,但没有导入。 I went into Settings > Security > Install from SD card and it takes me to the Downloads page.我进入“设置”>“安全”>“从 SD 卡安装”,它会将我带到“下载”页面。 I have the certificates listed but when I click on them, nothing happens.我列出了证书,但是当我点击它们时,没有任何反应。
Updated to add: I ended up going back to 4.3.更新添加:我最终回到了 4.3。 It works fine in that.它在这方面工作得很好。
Background: I also had the same problem you described and it seems to be an android emulator 4.4.2 bug which occurs when you don't import the certificate first thing ie when you don't follow the exact steps above.背景:我也遇到了您描述的相同问题,这似乎是一个 android 模拟器 4.4.2 错误,当您不首先导入证书时,即当您不遵循上述确切步骤时,就会发生该错误。
This question is old, but still persists.这个问题很老了,但仍然存在。 Hopefully this will help some other developers who still need to add a certificate to their emulator.希望这将有助于其他一些仍然需要向他们的模拟器添加证书的开发人员。
Download the certificate using any of the various methods.使用各种方法中的任何一种下载证书。 I emailed myself the certificate from my computer, turned on the emulator, ran gmail and downloaded the certificate to the emulator through gmail.我从我的电脑上将证书通过电子邮件发送给自己,打开模拟器,运行 gmail 并通过 gmail 将证书下载到模拟器。
Depending on your settings, you may be prompted to accept the certificate as soon as its downloaded.根据您的设置,下载证书后可能会提示您接受该证书。 Others may be able to find the certificate file using a files program where simply executing it will install the certificate.其他人可能能够使用文件程序找到证书文件,只需执行它即可安装证书。
But for those who can't, here's the sure-fire method.但对于那些不能的人,这里是万无一失的方法。
You should get a Toast saying that the CA certificate was installed.你应该得到一个 Toast,说 CA 证书已安装。
This is for an emulator running Android R .这是针对运行Android R的模拟器。 Good luck!祝你好运!
With your limited description, I'll try to help as much as I can.由于您的描述有限,我会尽力提供帮助。
Ensure your problematic AVD (4.4 I assume) has available storage space.确保有问题的 AVD(我假设为 4.4)有可用的存储空间。 Try best to ensure it is a clean AVD with nothing extra installed.尽量确保它是一个干净的 AVD,没有安装任何额外的东西。
Place your cert in the root /sdcard/ and install at: Settings -> Security -> Install from SD card将您的证书放在根目录 /sdcard/ 并安装在:设置 -> 安全 -> 从 SD 卡安装
Avoid installation of certs with the same name but different formats.避免安装名称相同但格式不同的证书。
Problem with *.p12 files (pkcs12): *.p12 文件 (pkcs12) 的问题:
at: Settings -> Security -> Install from SD card the *.p12 files are grayed out.在:设置 -> 安全 -> 从 SD 卡安装 *.p12 文件是灰色的。 When I download the file via webserver and try to open it, android say me "Can't open" Same with *.pem files.当我通过网络服务器下载文件并尝试打开它时,android 说我“无法打开”与 *.pem 文件相同。 I tried it with 4.4.2 and 4.4.4.我用 4.4.2 和 4.4.4 试过了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.