-
Notifications
You must be signed in to change notification settings - Fork 94
fdroid: nuke self signing and make builds reproducible #20807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,45 @@ pipeline { | |
| } | ||
| } | ||
|
|
||
| stage('Sign') { | ||
| steps { | ||
| script { | ||
| /* Auto-selects release keystore on release/nightly, PR keystore otherwise. */ | ||
| def keystore = creds.androidKeystorePrefix() | ||
| withCredentials([ | ||
| file( | ||
| credentialsId: "${keystore}-file", | ||
| variable: 'KEYSTORE_PATH' | ||
| ), | ||
| string( | ||
| credentialsId: "${keystore}-pass", | ||
| variable: 'KEYSTORE_PASSWORD' | ||
| ), | ||
| usernamePassword( | ||
| credentialsId: "${keystore}-key-pass", | ||
| usernameVariable: 'KEYSTORE_ALIAS', | ||
| passwordVariable: 'KEYSTORE_KEY_PASSWORD' | ||
| ), | ||
| ]) { | ||
| /* apksigner is provided by the fdroid agent image (fdroid/Dockerfile). | ||
| * The F-Droid build emits a zipaligned, unsigned APK, so signing | ||
| * in place is sufficient. Passwords are passed via env: provider | ||
| * to keep them off the process command line. */ | ||
| sh ''' | ||
| set +x | ||
|
Comment on lines
+116
to
+121
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we could just wrap it into a script too. What was wrong with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with using a single use keystore is that Fdroid will use our signed apk as part of their releases ( if we enable reproducible builds as part of the manifest ). If we regenerate keystore each time users won't be able to update the app since it would have been signed each time with different key.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What? Surely that's wrong. F-Droid sign releases they build themselves with their own key. It wouldn't make sense otherwise.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incase you enable "reproducible builds" this is the new procedure I guess. see comment by Lliacon : https://gitlab.com/fdroid/fdroiddata/-/merge_requests/32193#note_3351802215 |
||
| apksigner sign \ | ||
| --ks "${KEYSTORE_PATH}" \ | ||
| --ks-pass "env:KEYSTORE_PASSWORD" \ | ||
| --ks-key-alias "${KEYSTORE_ALIAS}" \ | ||
| --key-pass "env:KEYSTORE_KEY_PASSWORD" \ | ||
| "${STATUS_FDROID_APK}" | ||
| apksigner verify --verbose "${STATUS_FDROID_APK}" | ||
| ''' | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| stage('Upload') { | ||
| steps { | ||
| script { | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,11 @@ $(STATUS_GO_LIB): | |
| @echo "Building status-go mobile library" | ||
| @mkdir -p $(LIB_PATH) | ||
| ifeq ($(OS),android) | ||
| # Reproducibility flags for status-go (GOFLAGS,CGO_CFLAGS,CGO_CXXFLAGS,GOMODCACHE): | ||
| GOFLAGS="-trimpath -buildvcs=false" \ | ||
| GOMODCACHE="$(BUILD_PATH)/.gomodcache" \ | ||
| CGO_CFLAGS="-ffile-prefix-map=$(HOME)=." \ | ||
| CGO_CXXFLAGS="-ffile-prefix-map=$(HOME)=." \ | ||
| CC="$(CC)" $(MAKE) -C ../vendor/status-go statusgo-android-library \ | ||
| ARCH=$(ARCH) \ | ||
| ANDROID_NDK_ROOT="$(ANDROID_NDK_ROOT)" \ | ||
|
|
@@ -43,6 +48,10 @@ ifeq ($(OS),android) | |
| GO_GENERATE_CMD="go generate" \ | ||
| SHELL=/bin/sh | ||
| else ifeq ($(OS),ios) | ||
| GOFLAGS="-trimpath -buildvcs=false" \ | ||
| GOMODCACHE="$(BUILD_PATH)/.gomodcache" \ | ||
| CGO_CFLAGS="-ffile-prefix-map=$(HOME)=." \ | ||
| CGO_CXXFLAGS="-ffile-prefix-map=$(HOME)=." \ | ||
|
Comment on lines
+51
to
+54
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs comment too. |
||
| $(MAKE) -C ../vendor/status-go statusgo-ios-library \ | ||
| ARCH=$(ARCH) \ | ||
| IPHONE_SDK="$(IPHONE_SDK)" \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try not to provide credentials in Jenkinsfiles. Use our jenkins lib for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why not use
fdroid/generate-keystore.shas we did before?