Skip to content

Commit

Permalink
fix(android): generate debug.keystore if not present and use it as fa…
Browse files Browse the repository at this point in the history
…llback for release config
  • Loading branch information
n0izn0iz committed Nov 28, 2019
1 parent 96d9dc7 commit b9d5ffa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/packages/berty-app/Makefile
Expand Up @@ -46,7 +46,7 @@ $(PWD)/ios/Podfile: $(PWD)/node_modules
cat $< > $@

deps.android: export PWD := $(PWD)
deps.android: deps $(PWD)/node_modules/react-native/react.gradle.orig
deps.android: deps $(PWD)/node_modules/react-native/react.gradle.orig $(if $(filter $(config), development), $(HOME)/.android/debug.keystore)

$(PWD)/node_modules/react-native/react.gradle.orig: $(PWD)/patch/react.gradle.patch
@echo "patching file $(patsubst %.orig, %, $@)"
Expand Down
5 changes: 5 additions & 0 deletions js/packages/berty-app/android/app/build.gradle
Expand Up @@ -168,6 +168,11 @@ android {
storePassword BERTY_RELEASE_STORE_PASSWORD
keyAlias BERTY_RELEASE_KEY_ALIAS
keyPassword BERTY_RELEASE_KEY_PASSWORD
} else {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion js/packages/storybook-mobile/Makefile
Expand Up @@ -39,8 +39,13 @@ run.storybook.android: deps.storybook.mobile $(PWD)/android/app/debug.keystore
$(PWD)/android/app/debug.keystore: $(HOME)/.android/debug.keystore
cp $< $@

# https://coderwall.com/p/r09hoq/android-generate-release-debug-keystores
$(HOME)/.android/debug.keystore:
keytool -list -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android
keytool -genkey -v -keystore $@ -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
# The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format
keytool -importkeystore -srckeystore $@ -srcstorepass android -destkeystore $@ -deststoretype pkcs12
# Check keystore
keytool -list -v -alias androiddebugkey -storepass android -keystore $@

.PHONY: run.storybook.mobile
run.storybook.mobile: run.storybook.ios run.storybook.android
Expand Down

0 comments on commit b9d5ffa

Please sign in to comment.