npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

expo-keystore-manager

v1.0.2

Published

A comprehensive Expo config plugin for managing Android release keystore configuration

Readme

Expo Release Keystore Manager Plugin

A comprehensive Expo config plugin for managing Android release keystore configuration. This plugin automates the setup of release signing, ProGuard/R8 optimization, and keystore validation for your Expo/React Native Android apps.

Features

  • 🔐 Complete Keystore Configuration: Automatically configures Gradle properties and build scripts
  • Validation: Validates keystore configuration and file existence
  • 🛡️ ProGuard/R8 Support: Optional code obfuscation and optimization
  • 🔧 Flexible Configuration: Supports JKS, PKCS12, and BKS keystore types
  • 📝 Detailed Logging: Clear feedback during configuration process
  • 🛠️ Utility Functions: Helper functions for keystore management

Installation

npm install expo-keystore-manager
# or
yarn add expo-keystore-manager

Usage

Basic Configuration

Add the plugin to your app.json or app.config.js:

{
  "expo": {
    "plugins": [
      [
        "expo-keystore-manager",
        {
          "keystoreFile": "./android/app/my-release-key.keystore",
          "keystorePassword": "your-keystore-password",
          "keyAlias": "my-key-alias",
          "keyPassword": "your-key-password"
        }
      ]
    ]
  }
}

Advanced Configuration

{
  "expo": {
    "plugins": [
      [
        "expo-keystore-manager",
        {
          "keystoreFile": "./android/app/my-release-key.keystore",
          "keystorePassword": "your-keystore-password",
          "keyAlias": "my-key-alias",
          "keyPassword": "your-key-password",
          "storeType": "JKS",
          "enableProguard": true,
          "enableR8": true,
          "customProguardRules": "-keep class com.myapp.** { *; }"
        }
      ]
    ]
  }
}

Configuration Options

| Option | Type | Required | Default | Description | | --------------------- | ------- | -------- | ------- | -------------------------------- | | keystoreFile | string | ✅ | - | Path to your keystore file | | keystorePassword | string | ✅ | - | Password for the keystore | | keyAlias | string | ✅ | - | Alias of the key in the keystore | | keyPassword | string | ✅ | - | Password for the key | | storeType | string | ❌ | "JKS" | Keystore type (JKS, PKCS12, BKS) | | enableProguard | boolean | ❌ | true | Enable ProGuard/R8 minification | | enableR8 | boolean | ❌ | true | Enable R8 optimization | | customProguardRules | string | ❌ | - | Custom ProGuard rules to add |

Security Best Practices

Environment Variables

For security, use environment variables instead of hardcoding sensitive values:

// app.config.js
export default {
  expo: {
    plugins: [
      [
        "expo-keystore-manager",
        {
          keystoreFile: process.env.KEYSTORE_FILE,
          keystorePassword: process.env.KEYSTORE_PASSWORD,
          keyAlias: process.env.KEY_ALIAS,
          keyPassword: process.env.KEY_PASSWORD,
        },
      ],
    ],
  },
};

Password Strength

The plugin includes password validation. Ensure your passwords:

  • Are at least 8 characters long
  • Contain at least 3 of: uppercase, lowercase, numbers, special characters

Creating a Keystore

If you don't have a keystore yet, you can create one using the keytool command:

keytool -genkeypair -v -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias my-key-alias -keystore my-release-key.keystore

The plugin also provides a utility function to generate this command:

const { utils } = require("expo-keystore-manager");

const command = utils.generateKeytoolCommand({
  keystoreFile: "my-release-key.keystore",
  keyAlias: "my-key-alias",
  storeType: "JKS",
  validity: 10000,
  keySize: 2048,
  algorithm: "RSA",
});

console.log("Run this command to create your keystore:");
console.log(command);

What the Plugin Does

  1. Validates Configuration: Checks that all required fields are provided and validates password strength
  2. Sets Gradle Properties: Adds keystore configuration to gradle.properties
  3. Configures Build Script: Modifies app/build.gradle to use the signing configuration
  4. Sets up ProGuard: Creates default ProGuard rules and enables minification (if enabled)
  5. Provides Feedback: Logs progress and any issues during configuration

Gradle Properties Added

The plugin adds these properties to your gradle.properties:

MYAPP_RELEASE_STORE_FILE=path/to/your/keystore
MYAPP_RELEASE_KEY_ALIAS=your-key-alias
MYAPP_RELEASE_STORE_PASSWORD=your-keystore-password
MYAPP_RELEASE_KEY_PASSWORD=your-key-password
MYAPP_RELEASE_STORE_TYPE=JKS

Build Script Modifications

The plugin modifies your android/app/build.gradle to include:

android {
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
                storeType MYAPP_RELEASE_STORE_TYPE
            }
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

Troubleshooting

Common Issues

  1. Keystore file not found: Ensure the path in keystoreFile is correct relative to your project root
  2. Build fails with signing errors: Verify your keystore password and key alias are correct
  3. ProGuard issues: Check the generated proguard-rules.pro file and add custom rules if needed

Debug Mode

The plugin provides detailed logging. Check your terminal output when running expo prebuild for configuration details.

Utility Functions

The plugin exports utility functions for advanced usage:

const { utils } = require("expo-keystore-manager");

// Generate keystore configuration template
const template = utils.generateKeystoreTemplate("MyApp");

// Validate password strength
const validation = utils.validatePasswordStrength("mypassword");

// Generate keytool command
const command = utils.generateKeytoolCommand(config);

// Sanitize config for logging (hides passwords)
const sanitized = utils.sanitizeConfigForLogging(config);

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.