在Android4 4 2模擬器上安裝個人證書

2021-07-11 05:17:51 字數 1079 閱讀 5846

最近在andorid測試https, 需要安裝個人證書

發現檔案是灰的,不能選。有文章說是4.4的安全限制,不支援從external sdcard上安裝。嘗試設定pin登入再安裝依然失敗。

最後在github上找到解決方案.

1. 直接利用openssl生成cert檔案

# filename=`openssl x509 -in -hash -noout`
# openssl x509 -in>> $filename.0

# openssl x509 -in -text -fingerprint -noout >> $filename.0

# ls

e97664f4.0

此步可在linux上完成,沒有openssl的執行 yum install openssl-libs(沒有驗證)

2. 將生成的檔案push到裝置

a) 生成系統證書

adb shell mount -o remount,rw /system

adb push $filename.0 /system/etc/security/cacerts

如果adb裝在windows上先將$filename.0 copy下來

或b) 生成使用者級證書

adb shell mkdir /data/misc/keychain/cacerts-added

adb push

$filename.0 /data/misc/keychain/cacerts-added

3. settings -> security -> trusted credentials 檢查證書已經裝好了

在Windows Mobile模擬器上使用藍芽

大家知道,windows mobile 6.0 sdk自帶了cellular emulator和fake gps,使得我們可以在模擬器上除錯radio級的phone call和基於gps的地理位置應用。前幾天,一位mvpdmitry klionsky 撰寫了文章 bluetooth for micr...

在Windows Mobile模擬器上使用藍芽

家知道,windows mobile 6.0 sdk自帶了cellular emulator和fake gps,使得我們可以在模擬器上除錯radio級的phone call和基於gps的地理位置應用。前幾天,一位mvpdmitry klionsky 撰寫了文章 bluetooth for micro...

在模擬器上安裝APK檔案

注 最新的sdk裡,adb.exe已經從以前的tools資料夾搬到platformtools資料夾拉,所以不要在tools裡面找它咯。1 方法一 通過新建bat檔案,來實現安裝 新建乙個install apk.bat檔案如下,解析 就是到你sdk所在目錄下,找到platform tools資料夾下的...