From b46b840e18050d7e331dbf6550f9de45ddf28e5c Mon Sep 17 00:00:00 2001 From: Daniel Zhang Date: Sun, 26 May 2024 21:24:47 -0400 Subject: [PATCH] Add instructions to generate java keystore copied from commit message packages/inputmethods/LatinIME c884b6631f5d13637167f6bc66bbb81e6a00bd8f Change-Id: Ie3d48041004930ca5e62c442778eb915fb99d257 Signed-off-by: Daniel Zhang Test: none --- target/product/security/README | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target/product/security/README b/target/product/security/README index 2b161bb0ee..1e015f00a2 100644 --- a/target/product/security/README +++ b/target/product/security/README @@ -37,3 +37,31 @@ input and prints a C structure to standard output: This is called by build/make/core/Makefile to incorporate the OTA signing keys into the recovery image. + +converting to java keystore for Android Studio +---------------------------------------------- + +Suppose we want to convert shared.pk8 and shared.x509.pem to shared.keystore. + + $ openssl pkcs8 -inform DER -nocrypt \ + -in build/make/target/product/security/shared.pk8 \ + -out shared.pem + $ openssl pkcs12 -export \ + -in build/make/target/product/security/shared.x509.pem \ + -inkey shared.pem -out shared.p12 \ + -password pass:android -name AndroidDebugKey + $ keytool -importkeystore -deststorepass android \ + -destkeystore shared.keystore -srckeystore shared.p12 \ + -srcstoretype PKCS12 -srcstorepass android + +The keystore can be used in build.gradle as follows. + +signingConfigs { + shared { + storeFile file("shared.keystore") + storePassword "android" + keyPassword "android" + keyAlias "AndroidDebugKey" + } +} +