From d2506df67745079bb063f4382553b09f89ba8401 Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Thu, 10 Apr 2025 12:23:42 -0400 Subject: [PATCH 1/7] Create test builds on pr --- .github/workflows/pr-test-build-linux.yml | 71 +++++++++++++++++++++ .github/workflows/pr-test-build-macos.yml | 57 +++++++++++++++++ .github/workflows/pr-test-build-windows.yml | 70 ++++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 .github/workflows/pr-test-build-linux.yml create mode 100644 .github/workflows/pr-test-build-macos.yml create mode 100644 .github/workflows/pr-test-build-windows.yml diff --git a/.github/workflows/pr-test-build-linux.yml b/.github/workflows/pr-test-build-linux.yml new file mode 100644 index 0000000..2542dcd --- /dev/null +++ b/.github/workflows/pr-test-build-linux.yml @@ -0,0 +1,71 @@ +name: pr-test-build-linux + +permissions: + contents: write + +on: + pull_request: + branches: + - main + +jobs: + pr-test-build-linux: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '>=1.24' + check-latest: true + cache: false + + - name: Install packages + run: | + sudo apt install -y gcc xorg-dev libgtk-3-dev libgl1-mesa-dev libglu1-mesa wget + + - name: Install dependencies + run: | + cd src + go mod download + + - name: Build + run: | + cd src + go build -v -ldflags="-s -w" -o Picocrypt Picocrypt.go + env: + CGO_ENABLED: 1 + GOAMD64: v1 + + - name: Package as .deb + run: | + wget https://github.com/user-attachments/files/16136712/Picocrypt.zip + python -m zipfile -e Picocrypt.zip Picocrypt + cp src/Picocrypt Picocrypt/Picocrypt/usr/bin/picocrypt-gui + VERSION=$(cat VERSION) + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Version: $VERSION" >> Picocrypt/Picocrypt/DEBIAN/control + echo "Version=$VERSION" >> Picocrypt/Picocrypt/usr/share/applications/picocrypt.desktop + cd Picocrypt + dpkg-deb -Zxz --build --root-owner-group Picocrypt + + - name: Prepare to upload artifacts + run: | + mkdir out + mv src/Picocrypt out + mv Picocrypt/Picocrypt.deb out + rm -rf src + rm -rf Picocrypt + mv out/Picocrypt . + mv out/Picocrypt.deb . + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: pr-test-build-linux-ONLY-FOR-TESTING + path: | + Picocrypt + Picocrypt.deb + if-no-files-found: error + compression-level: 9 diff --git a/.github/workflows/pr-test-build-macos.yml b/.github/workflows/pr-test-build-macos.yml new file mode 100644 index 0000000..8591c76 --- /dev/null +++ b/.github/workflows/pr-test-build-macos.yml @@ -0,0 +1,57 @@ +name: pr-test-build-macos + +permissions: + contents: write + +on: + pull_request: + branches: + - main + +jobs: + pr-test-build-macos: + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '>=1.24' + check-latest: true + cache: false + + - name: Install packages + run: | + brew install glfw glew + + - name: Install dependencies + run: | + cd src + go mod download + + - name: Build + run: | + cd src + go build -v -ldflags="-s -w" -o Picocrypt Picocrypt.go + env: + CGO_ENABLED: 1 + + - name: Package as .app in a .dmg + run: | + mv dist/macos/Picocrypt.app.zip . + unzip -d Picocrypt.app Picocrypt.app.zip + rm Picocrypt.app.zip + mv src/Picocrypt Picocrypt.app/Contents/MacOS/Picocrypt + mkdir out + cp -R Picocrypt.app out + hdiutil create Picocrypt.dmg -volname Picocrypt -fs APFS -format UDZO -srcfolder out + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: pr-test-build-macos-ONLY-FOR-TESTING + path: | + Picocrypt.dmg + if-no-files-found: error + compression-level: 9 diff --git a/.github/workflows/pr-test-build-windows.yml b/.github/workflows/pr-test-build-windows.yml new file mode 100644 index 0000000..44bb4da --- /dev/null +++ b/.github/workflows/pr-test-build-windows.yml @@ -0,0 +1,70 @@ +name: pr-test-build-windows + +permissions: + contents: write + +on: + pull_request: + branches: + - main + +jobs: + pr-test-build-windows: + runs-on: windows-2025 + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '>=1.24' + check-latest: true + cache: false + + - name: Install dependencies + run: | + cd src + go mod download + + - name: Build + run: | + cd src + go build -v -ldflags="-s -w -H=windowsgui -extldflags=-static" -o 1.exe Picocrypt.go + env: + CGO_ENABLED: 1 + GOAMD64: v1 + + - name: Add icon, manifest, and version info + shell: pwsh + run: | + Invoke-WebRequest -OutFile reshacker_setup.zip https://github.com/user-attachments/files/18878075/reshacker_setup.zip + Expand-Archive -DestinationPath reshacker_setup reshacker_setup.zip + reshacker_setup/reshacker_setup.exe /SILENT + Start-Sleep -Seconds 60 + Invoke-Expression "& `"$Env:P`" -open src/1.exe -save src/2.exe -action addoverwrite -res images/key.ico -mask `"ICONGROUP,MAINICON,`"" + Start-Sleep -Seconds 30 + Invoke-Expression "& `"$Env:P`" -open src/2.exe -save src/3.exe -action addoverwrite -res images/key.ico -mask `"ICONGROUP,GLFW_ICON,`"" + Start-Sleep -Seconds 30 + Invoke-Expression "& `"$Env:P`" -open src/3.exe -save src/4.exe -action addoverwrite -res dist/windows/manifest.xml -mask `"MANIFEST,1,`"" + Start-Sleep -Seconds 30 + Invoke-Expression "& `"$Env:P`" -open dist/windows/versioninfo.rc -save resources.res -action compile" + Start-Sleep -Seconds 30 + Invoke-Expression "& `"$Env:P`" -open src/4.exe -save src/5.exe -action addoverwrite -res resources.res" + Start-Sleep -Seconds 30 + env: + P: "C:\\Program Files (x86)\\Resource Hacker\\ResourceHacker.exe" + + - name: Compress with upx + shell: pwsh + run: | + Invoke-WebRequest -OutFile upx.zip https://github.com/user-attachments/files/15894908/upx-4.2.4-win64.zip + Expand-Archive -DestinationPath upx upx.zip + upx/upx-4.2.4-win64/upx.exe --lzma --brute -o src/Picocrypt.exe src/5.exe + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: pr-test-build-windows-ONLY-FOR-TESTING + path: src/*.exe + if-no-files-found: error + compression-level: 9 From 55ec72864e941fd39e0c43fcc40b285988d73aaa Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Thu, 10 Apr 2025 12:27:49 -0400 Subject: [PATCH 2/7] Only show info/warnings if status is "Ready" If not, it's probably showing some error message which would happen after starting encryption, so user would've already seen the info/warning status --- src/Picocrypt.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Picocrypt.go b/src/Picocrypt.go index 2c2cc0a..3587e44 100644 --- a/src/Picocrypt.go +++ b/src/Picocrypt.go @@ -781,21 +781,27 @@ func draw() { return "Process" }()).Size(giu.Auto, 34).OnClick(onClickStartButton), giu.Custom(func() { + if mainStatus != "Ready" { + giu.Style().SetColor(giu.StyleColorText, mainStatusColor).To( + giu.Label(mainStatus), + ).Build() + return + } if temporaryZip && externalDst { giu.Style().SetColor(giu.StyleColorText, YELLOW).To( giu.Label("Warning: unencrypted temp files will be created"), ).Build() } else if temporaryZip { giu.Style().SetColor(giu.StyleColorText, WHITE).To( - giu.Label(mainStatus + " (info: will create temporary files)"), + giu.Label("Ready (info: will create a temporary zip file)"), ).Build() } else if externalDst { giu.Style().SetColor(giu.StyleColorText, WHITE).To( - giu.Label(mainStatus + " (info: target may be an external drive)"), + giu.Label("Ready (info: target may be an external drive)"), ).Build() } else { giu.Style().SetColor(giu.StyleColorText, mainStatusColor).To( - giu.Label(mainStatus), + giu.Label("Ready"), ).Build() } }), From f429f1b1eeb8f4589bbbaf7c7b298411f7bc2094 Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Thu, 10 Apr 2025 12:29:10 -0400 Subject: [PATCH 3/7] README.md: remove installer link Maybe will add in a future release, but not for 1.48 --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 2b15221..ecf5b3e 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ Picocrypt is a very small (hence Pico), very simple, yet very secure encr ## Windows Picocrypt for Windows is as simple as it gets. To download the latest, standalone, and portable executable for Windows, click here. If Microsoft Defender or your antivirus flags Picocrypt as a virus, please do your part and submit it as a false positive for the betterment of everyone. -If you use Picocrypt frequently, you can download an installer here for easier launching. It does not require any admin permissions to install and it also bundles a software OpenGL renderer for compatibility, so if the portable executable isn't working, this installer likely will. - ## macOS Picocrypt for macOS is very simple as well. Download Picocrypt here, open the container, and drag Picocrypt to your Applications. You may need to manually trust the app from a terminal and control-click on the app if macOS prevents you from opening it: ``` From 9287fca7b72fad93be223b4968c33726f29c6a74 Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Thu, 10 Apr 2025 12:33:21 -0400 Subject: [PATCH 4/7] Remove future section from changelog The golang.org/x/crypto -> stdlib migration done in Go 1.24 is not a simple find and replace as some types changed. Will stick with golang.org/x/crypto for the foreseeable future. --- Changelog.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index 3a088ad..fffc47f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,8 +1,3 @@ -# Future -