Use this script to generate keys to sign your ROMS
git clone https://github.com/xenxynon/keygen
./keygen/keygen.shYou can specify a custom directory or use the default (~/.android-certs).
β― Use this sample subject? (/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/emailAddress=android@android.com) (Y/n): y
β Using sample subject.- Use a predefined sample subject (recommended for quick setup)
- Or manually enter details (Country, State, Organization, etc.)
- You can choose to password-protected the keys or generate them without a password (recommended).
π Generating keys in: /home/user/.android-certs
ββββββββββββββββββββββββββββββββββββββββββββββ
π Generating: platform... β Done.
π Generating: media... β Done.
π Generating: verity... β Done.
β All keys generated successfully!A keys.mk file is automatically created.
To use it, add the following to your device tree or vendor makefile:
include <your/key/path>/keys.mk- Script not executable?
chmod +x keygen/keygen.sh
- Make sure dependencies are installed. The script requires openssl, python basic shell utilities.
- If build fails due to keys, check that the generated keys are correctly referenced in your build configuration.