AndroidKeyStore icon indicating copy to clipboard operation
AndroidKeyStore copied to clipboard

示範如何使用 Android KeyStore System 來加解密字串,並存入 SharedPreference

AndroidKeyStore

EncryptedSharedPreferences 終於在 2021 年 6 月推出正式版,建議可以直接使用 EncryptedSharedPreferences。

一個小範例展示如何使用 Android KeyStore System 來加/解密字串,並存入 SharedPreferences.

結果

成功建置之後,你應該會看到如下的結果:

教學

更詳細部分,請至我的部落格觀看教學文章:

使用 KeyStore 儲存敏感性資料