Skip to content

An open-source cross-platform alternative to AirDrop

fix: sign msix helper

Tien Do Nam4fd3fabd2006
diff --git a/.github/workflows/build_exe_test.yml b/.github/workflows/build_exe_test.yml
index e606319f..210002d7 100644
--- a/.github/workflows/build_exe_test.yml
+++ b/.github/workflows/build_exe_test.yml
@@ -38,9 +38,50 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
+ # The MSIX publisher must match the subject of the signing certificate.
+ # The manifests in the repo carry the release certificate subject; test-signing
+ # uses SignPath's self-issued test certificate, so patch both manifests here.
+ - name: Patch MSIX publisher for test certificate
+ run: |
+ $subject = 'CN=Test certificate for ''LocalSend [OSS]'''
+ $manifest = 'support\build\msix\AppxManifest.xml'
+ $exeManifest = 'app\windows\localsend_app.exe.manifest'
+ (Get-Content $manifest -Raw) -creplace 'Publisher="[^"]+"', ('Publisher="' + $subject + '"') | Set-Content $manifest -Encoding utf8
+ (Get-Content $exeManifest -Raw) -creplace 'publisher="[^"]+"', ('publisher="' + $subject + '"') | Set-Content $exeManifest -Encoding utf8
+
- name: Build MSIX helper
run: '& ''C:\Program Files (x86)\Windows Kits\10\App Certification Kit\makeappx.exe'' pack /o /d support\build\msix /nv /p app\windows\localsend_msix_helper.msix'
+ # The sparse package needs its own signature (Add-AppxPackage rejects unsigned packages)
+ - name: Upload unsigned MSIX helper
+ id: unsigned-msix
+ uses: actions/upload-artifact@v6
+ with:
+ name: windows-msix-helper-unsigned
+ path: app\windows\localsend_msix_helper.msix
+ if-no-files-found: error
+
+ - name: Sign MSIX helper (SignPath)
+ uses: signpath/github-action-submit-signing-request@v2
+ with:
+ api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
+ organization-id: ${{ vars.SIGNPATH_ORG_ID }}
+ project-slug: localsend
+ signing-policy-slug: test-signing
+ artifact-configuration-slug: msix-helper
+ github-artifact-id: ${{ steps.unsigned-msix.outputs.artifact-id }}
+ wait-for-completion: true
+ output-artifact-directory: signed/msix-helper
+
+ - name: Replace MSIX helper with signed version
+ run: Copy-Item -Force signed\msix-helper\localsend_msix_helper.msix app\windows\localsend_msix_helper.msix
+
+ - name: Verify MSIX signature
+ continue-on-error: true
+ run: |
+ $signtool = Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\10.*\x64\signtool.exe' | Select-Object -Last 1
+ & $signtool.FullName verify /pa /v app\windows\localsend_msix_helper.msix
+
- name: Dependencies
working-directory: app
run: flutter pub get
diff --git a/.github/workflows/build_zip_test.yml b/.github/workflows/build_zip_test.yml
index 21aa932a..d7a409db 100644
--- a/.github/workflows/build_zip_test.yml
+++ b/.github/workflows/build_zip_test.yml
@@ -67,6 +67,7 @@ jobs:
run: |
Remove-Item build/windows/x64/runner/Release/localsend_msix_helper.msix
Remove-Item build/windows/x64/runner/Release/install_msix_helper.ps1
+ Remove-Item build/windows/x64/runner/Release/localsend_app.exe.manifest
# The SignPath artifact configuration expects "LocalSend-*-windows-x86-64.zip" containing "localsend_app.exe"
- name: Zip compiled files
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 404c82dc..8a5b37ef 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -377,6 +377,7 @@ jobs:
run: |
Remove-Item build/windows/x64/runner/Release/localsend_msix_helper.msix
Remove-Item build/windows/x64/runner/Release/install_msix_helper.ps1
+ Remove-Item build/windows/x64/runner/Release/localsend_app.exe.manifest
# The SignPath artifact configuration expects "LocalSend-*-windows-x86-64.zip" containing "localsend_app.exe"
- name: Zip compiled files
@@ -436,6 +437,38 @@ jobs:
- name: Build MSIX helper
run: '& ''C:\Program Files (x86)\Windows Kits\10\App Certification Kit\makeappx.exe'' pack /o /d support\build\msix /nv /p app\windows\localsend_msix_helper.msix'
+ # The sparse package needs its own signature (Add-AppxPackage rejects unsigned packages);
+ # signing the surrounding installer does not cover it. Sign before "flutter build windows"
+ # so CMake bundles the signed msix into the Release directory.
+ - name: Upload unsigned MSIX helper
+ id: unsigned-msix
+ uses: actions/upload-artifact@v6
+ with:
+ name: windows-msix-helper-unsigned
+ path: app\windows\localsend_msix_helper.msix
+ if-no-files-found: error
+
+ - name: Sign MSIX helper (SignPath)
+ uses: signpath/github-action-submit-signing-request@v2
+ with:
+ api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
+ organization-id: ${{ vars.SIGNPATH_ORG_ID }}
+ project-slug: localsend
+ signing-policy-slug: release-signing
+ artifact-configuration-slug: msix-helper
+ github-artifact-id: ${{ steps.unsigned-msix.outputs.artifact-id }}
+ wait-for-completion: true
+ output-artifact-directory: signed/msix-helper
+
+ - name: Replace MSIX helper with signed version
+ run: Copy-Item -Force signed\msix-helper\localsend_msix_helper.msix app\windows\localsend_msix_helper.msix
+
+ - name: Verify MSIX signature
+ continue-on-error: true
+ run: |
+ $signtool = Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\10.*\x64\signtool.exe' | Select-Object -Last 1
+ & $signtool.FullName verify /pa /v app\windows\localsend_msix_helper.msix
+
- name: Dependencies
working-directory: app
run: flutter pub get
diff --git a/app/windows/localsend_app.exe.manifest b/app/windows/localsend_app.exe.manifest
index 9463a005..725449e9 100644
--- a/app/windows/localsend_app.exe.manifest
+++ b/app/windows/localsend_app.exe.manifest
@@ -2,8 +2,8 @@
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="0.0.0.0" name="localsendapp" />
<msix xmlns="urn:schemas-microsoft-com:msix.v1"
- publisher="CN=Tien Do Nam, O=Tien Do Nam, S=Sachsen, C=DE"
- packageName="com.flutter.localsendapp"
+ publisher="CN=SignPath Foundation, O=SignPath Foundation, C=US, S=DE, L=Lewes"
+ packageName="LocalSend.App"
applicationId="localsendapp"
/>
</assembly>
diff --git a/support/build/msix/AppxManifest.xml b/support/build/msix/AppxManifest.xml
index d8849cef..85633984 100644
--- a/support/build/msix/AppxManifest.xml
+++ b/support/build/msix/AppxManifest.xml
@@ -21,8 +21,8 @@
xmlns:com2="http://schemas.microsoft.com/appx/manifest/com/windows10/2"
xmlns:com3="http://schemas.microsoft.com/appx/manifest/com/windows10/3"
IgnorableNamespaces="uap3 desktop">
- <Identity Name="11157TienDoNam.LocalSend" Version="1.14.0.0"
- Publisher="CN=Tien Do Nam, O=Tien Do Nam, S=Sachsen, C=DE" ProcessorArchitecture="x64" />
+ <Identity Name="LocalSend.App" Version="1.14.0.0"
+ Publisher="CN=SignPath Foundation, O=SignPath Foundation, C=US, S=DE, L=Lewes" ProcessorArchitecture="x64" />
<Properties>
<DisplayName>LocalSend MSIX Helper</DisplayName>
<PublisherDisplayName>Tien Do Nam</PublisherDisplayName>
diff --git a/support/scripts/compile_windows_exe-inno.iss b/support/scripts/compile_windows_exe-inno.iss
index 5bf61cfd..39766c72 100644
--- a/support/scripts/compile_windows_exe-inno.iss
+++ b/support/scripts/compile_windows_exe-inno.iss
@@ -98,4 +98,4 @@ Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChang
Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command Add-AppxPackage .\localsend_msix_helper.msix -ExternalLocation $(Get-Location)"; WorkingDir: {app}; Flags: nowait postinstall
[UninstallRun]
-Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command Remove-AppxPackage $(Get-AppxPackage com.flutter.localsendapp)"; WorkingDir: {app}; Flags: nowait
+Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command Get-AppxPackage LocalSend.App | Remove-AppxPackage"; Flags: nowait runhidden