add workaround for jpackage issue where mime-info is not generated on linux
What changed, and why it matters
This commit adds a build-system workaround so that Linux installers for the Sparrow Wallet correctly register file types (like .psbt Bitcoin transaction files) and URI handlers (like bitcoin: payment links) with the desktop environment. It is a packaging fix, not a code change that affects wallet security or user funds.
No security action required; treat as a normal build/packaging improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch registers a new Gradle copy task, copyMimeInfo, that runs during jpackage builds on non-headless Linux and places sparrowwallet-Sparrow-MimeInfo.xml into the jpackage output lib directory. The XML file declares MIME types for .psbt, .txn, and .asc files plus x-scheme-handler entries for bitcoin, auth47, and lightning URIs. This compensates for a jpackage bug where mime-info is not generated automatically on Linux.
Changed components
build.gradlesrc/main/deploy/package/linux/sparrowwallet-Sparrow-MimeInfo.xmlInspect captured patch +34 / −0
diff --git a/build.gradle b/build.gradle
index b93ad6c..97fc3f2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -280,6 +280,9 @@ jlink {
if(os.linux) {
tasks.jlink.finalizedBy('addUserWritePermission', 'copyUdevRules')
tasks.jpackageImage.finalizedBy('prepareResourceDir')
+ if(!headless) {
+ tasks.jpackage.dependsOn('copyMimeInfo')
+ }
} else {
tasks.jlink.finalizedBy('addUserWritePermission')
}
@@ -315,6 +318,13 @@ tasks.register('prepareResourceDir', Copy) {
}
}
+tasks.register('copyMimeInfo', Copy) {
+ mustRunAfter tasks.jpackageImage
+ from('src/main/deploy/package/linux')
+ into(layout.buildDirectory.dir('jpackage/Sparrow/lib'))
+ include('sparrowwallet-Sparrow-MimeInfo.xml')
+}
+
static def getDirectorySize(File directory) {
long size = 0
if(directory.isFile()) {
diff --git a/src/main/deploy/package/linux/sparrowwallet-Sparrow-MimeInfo.xml b/src/main/deploy/package/linux/sparrowwallet-Sparrow-MimeInfo.xml
new file mode 100644
index 0000000..6467316
--- /dev/null
+++ b/src/main/deploy/package/linux/sparrowwallet-Sparrow-MimeInfo.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/psbt">
+ <comment>Partially Signed Bitcoin Transaction</comment>
+ <glob pattern="*.psbt"/>
+ </mime-type>
+ <mime-type type="application/bitcoin-transaction">
+ <comment>Bitcoin Transaction</comment>
+ <glob pattern="*.txn"/>
+ </mime-type>
+ <mime-type type="application/pgp-signature">
+ <comment>ASCII Armored File</comment>
+ <glob pattern="*.asc"/>
+ </mime-type>
+ <mime-type type="x-scheme-handler/bitcoin">
+ <comment>Bitcoin Scheme URI</comment>
+ </mime-type>
+ <mime-type type="x-scheme-handler/auth47">
+ <comment>Auth47 Authentication URI</comment>
+ </mime-type>
+ <mime-type type="x-scheme-handler/lightning">
+ <comment>LNURL URI</comment>
+ </mime-type>
+</mime-info>
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.