Repository navigation
Run without secure storage plugin - #1
Merged
simonhamp merged 6 commits intoOct 16, 2026
Merged
Conversation
composer setup:free copies composer.json and composer.lock to composer.free.*, drops plugins.nativephp.com and removes nativephp/mobile-secure-storage from the copy, then installs from it. Every other package keeps its locked version. The copies are generated, so they can't drift, and git ignores them. The SecureStorage facade is part of nativephp/mobile. The plugin only adds the native side that answers its bridge calls, and the tests fake those, so the whole suite runs without it.
DeviceKey called the SecureStorage facade itself. It now takes a KeyStore, and the only one is the Keychain, which calls the same facade. Nothing changes yet. The next commit adds a second store for builds without the Secure Storage plugin.
Without the plugin, nothing answers SecureStorage.Get on a device, so onboarding stopped at "could not read the device key". DEVNULL_KEY_STORE picks the store. It defaults to the Keychain when the plugin is installed and to a file in storage encrypted with APP_KEY when it isn't. APP_KEY ships in the app, so the file is only for running it without a plugin licence, never for release builds. Tests always use the Keychain, so they fake the same bridge calls with or without the plugin.
The README covers composer setup:free, the encrypted-file key store and DEVNULL_KEY_STORE. native:run copies the app and runs composer install on the copy, and that install inherits COMPOSER, so building takes the same COMPOSER=composer.free.json prefix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nativephp/mobile-secure-storageis a paid plugin, socomposer installfails for anyone without aplugins.nativephp.comlicence, and they can't run the app or its tests. This adds a way to run it without the plugin. Nothing changes for anyone who has it, including CI and release builds.What changes
composer setup:freeinstalls from a generated copy ofcomposer.jsonandcomposer.lock(composer.free.*, git-ignored) with the plugin and its repository removed. Every other package keeps its locked version. Scripts aren't part of the lock hash, socomposer.lockis untouched.DeviceKeyreads and writes through aKeyStore.KeyStores\KeychaincallsSecureStorageexactly as before.KeyStores\EncryptedFilekeeps the seed instorage/app/private/keys, encrypted withAPP_KEY.DEVNULL_KEY_STORE=keychain|fileoverrides it.COMPOSER=composer.free.json php artisan native:run ios.Why this works
The
SecureStoragefacade ships innativephp/mobile. The plugin only adds the native side that answers its bridge calls. Without it, the PHP side runs fine. Only the device can't answer, and onboarding stopped at "could not read the device key". The file store fills that gap.Safety
APP_KEYships in the app, so the file store only keeps the seed out of plain text. It's for simulators, not releases, and release builds always have the plugin.DEVNULL_KEY_STORE=keychain, so the existing Keychain tests run the same with or without the plugin.Testing
composer setup:freefrom an emptyvendor/with no plugin credentials. It installed everything else at the locked versions.tests/Feature/Devnull/EncryptedFileKeyStoreTest.phpcover the file store and the store choice.COMPOSER=composer.free.json php artisan native:run ios.