diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23797cd..17598dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: jobs: build: runs-on: ${{ matrix.os }} + environment: Release strategy: matrix: @@ -49,7 +50,7 @@ jobs: - name: Installing codesign certificates if: matrix.os == 'macos-latest' - uses: apple-actions/import-codesign-certs@v2 + uses: apple-actions/import-codesign-certs@v3 with: p12-file-base64: ${{ secrets.APPLE_CERT_DATA }} p12-password: ${{ secrets.APPLE_CERT_PASSWORD }} @@ -124,6 +125,7 @@ jobs: npm install - name: Package app + shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} APPLE_ID: ${{ secrets.APPLE_ID }} @@ -138,13 +140,6 @@ jobs: dmg_file=$(find . -name "*.dmg" -type f) new_dmg_file=$(echo $dmg_file | sed 's/arm64/apple-silicon/') mv $dmg_file $new_dmg_file - - - name: Codesign dmg - if: matrix.os == 'macos-latest' - run: | - cd out/make - dmg_file=$(find . -name "*.dmg" -type f) - codesign --timestamp --verbose --sign "Developer ID Application" $dmg_file - id: relinfo uses: pozetroninc/github-action-get-latest-release@master diff --git a/.gitignore b/.gitignore index 6995ea7..f4c1ed9 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,5 @@ build/ # Sentry Config File .sentryclirc + +.sign-env.sh diff --git a/backend/include/RemoteData.hpp b/backend/include/RemoteData.hpp index 3b224da..7482dd8 100644 --- a/backend/include/RemoteData.hpp +++ b/backend/include/RemoteData.hpp @@ -1,3 +1,4 @@ +#pragma once #include #include #include diff --git a/backend/include/Shared.hpp b/backend/include/Shared.hpp index 3c56528..bf45f2c 100644 --- a/backend/include/Shared.hpp +++ b/backend/include/Shared.hpp @@ -32,7 +32,7 @@ #define API_SERVER_PORT 49080 -constexpr semver::version VERSION = semver::version { 1, 0, 2, semver::prerelease::beta, 6 }; +constexpr semver::version VERSION = semver::version { 1, 0, 2, semver::prerelease::beta, 7 }; // NOLINTNEXTLINE const std::string CLIENT_NAME = std::string("TrackAudio-") + VERSION.to_string(); diff --git a/backend/include/sdkWebsocketMessage.hpp b/backend/include/sdkWebsocketMessage.hpp index 2484944..d8df60e 100644 --- a/backend/include/sdkWebsocketMessage.hpp +++ b/backend/include/sdkWebsocketMessage.hpp @@ -108,10 +108,8 @@ class Station { // Example of kTxBegin message: // @type the type of the message -// @value the frequencies which are being transmitted on -// JSON: {"type": "kTxBegin", "value": {"pFrequenciesHz": [123000000, 118000000]}} +// JSON: {"type": "kTxBegin", "value": {}} // Example of kTxEnd message: // @type the type of the message -// @value the frequencies which were being transmitted on -// JSON: {"type": "kTxEnd", "value": {"pFrequenciesHz": [123000000, 118000000]}} \ No newline at end of file +// JSON: {"type": "kTxEnd", "value": {}} \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index f6049fa..76d554a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -12,7 +12,7 @@ }, "types": "types/index.d.ts", "scripts": { - "build": "cmake-js compile -B Release && node custom_build.mjs && npm pack", + "build": "cmake-js compile -B Release -p 8 && node custom_build.mjs && npm pack", "format": "clang-format -i include/**.hpp && clang-format -i include/**.h && clang-format -i src/**.cpp" }, "cmake-js": { diff --git a/backend/src/main.cpp b/backend/src/main.cpp index 11a8be9..38e7be1 100644 --- a/backend/src/main.cpp +++ b/backend/src/main.cpp @@ -281,6 +281,7 @@ void SetPtt(const Napi::CallbackInfo& info) } bool state = info[0].As().Value(); + mClient->SetPtt(state); } diff --git a/backend/src/sdk.cpp b/backend/src/sdk.cpp index 12c5f3a..0ff64ac 100644 --- a/backend/src/sdk.cpp +++ b/backend/src/sdk.cpp @@ -94,31 +94,33 @@ void SDK::handleAFVEventForWebsocket(sdk::types::Event event, } if (event == sdk::types::Event::kTxBegin) { - auto allRadios = mClient->getRadioState(); - std::vector allTxRadioFreqs; - for (const auto& [freq, state] : allRadios) { - if (state.tx) { - allTxRadioFreqs.push_back(freq); - } - } + // auto allRadios = mClient->getRadioState(); + // std::vector allTxRadioFreqs; + // for (const auto& [freq, state] : allRadios) { + // if (state.tx) { + // allTxRadioFreqs.push_back(freq); + // } + // } nlohmann::json jsonMessage = WebsocketMessage::buildMessage(WebsocketMessageType::kTxBegin); - jsonMessage["value"]["pFrequenciesHz"] = allTxRadioFreqs; + // jsonMessage["value"]["pFrequenciesHz"] = allTxRadioFreqs; this->broadcastOnWebsocket(jsonMessage.dump()); + return; } if (event == sdk::types::Event::kTxEnd) { - auto allRadios = mClient->getRadioState(); - std::vector allTxRadioFreqs; - for (const auto& [freq, state] : allRadios) { - if (state.tx) { - allTxRadioFreqs.push_back(freq); - } - } + // auto allRadios = mClient->getRadioState(); + // std::vector allTxRadioFreqs; + // for (const auto& [freq, state] : allRadios) { + // if (state.tx) { + // allTxRadioFreqs.push_back(freq); + // } + // } nlohmann::json jsonMessage = WebsocketMessage::buildMessage(WebsocketMessageType::kTxEnd); - jsonMessage["value"]["pFrequenciesHz"] = allTxRadioFreqs; + // jsonMessage["value"]["pFrequenciesHz"] = allTxRadioFreqs; this->broadcastOnWebsocket(jsonMessage.dump()); + return; } if (event == sdk::types::Event::kFrequencyStateUpdate) { diff --git a/forge.config.ts b/forge.config.ts index 3197cf7..ad5e6ea 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -17,11 +17,25 @@ const canNotarize = process.env.APPLE_NOTARIZATION_PASSWORD && process.env.APPLE_TEAM_ID; +console.log("isMaking", isMaking); +console.log("canNotarize", canNotarize); + const config: ForgeConfig = { packagerConfig: { name: "TrackAudio", asar: true, - osxSign: isMaking ? {} : undefined, + osxSign: isMaking + ? { + optionsForFile: (filePath) => { + // Here, we keep it simple and return a single entitlements.plist file. + // You can use this callback to map different sets of entitlements + // to specific files in your packaged app. + return { + entitlements: "scripts/entitlements.plist", + }; + }, + } + : undefined, osxNotarize: canNotarize ? { appleId: process.env.APPLE_ID || "", @@ -57,7 +71,7 @@ const config: ForgeConfig = { { name: "@electron-forge/maker-dmg", config: { - icon: "resources/AppIcon/AppIcon.icns" + icon: "resources/AppIcon/AppIcon.icns", }, }, { diff --git a/package-lock.json b/package-lock.json index 28466a5..ba77b3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "trackaudio", - "version": "1.0.2-beta.6", + "version": "1.0.2-beta.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "trackaudio", - "version": "1.0.2-beta.6", + "version": "1.0.2-beta.7", "license": "MIT", "dependencies": { "@electron-forge/plugin-auto-unpack-natives": "^7.4.0", @@ -5730,7 +5730,6 @@ "integrity": "sha512-PkhEPFdpYcTzjAO3gMHZ+map7g2+xCrMDedo/L1i0ir2BRXvAB93IkTJX497U6Srb/09r2cFt+k20VPNVCdw3Q==", "dev": true, "hasInstallScript": true, - "license": "MIT", "dependencies": { "@electron/get": "^2.0.0", "@types/node": "^20.9.0", @@ -16433,7 +16432,7 @@ "node_modules/trackaudio-afv": { "version": "1.0.0", "resolved": "file:backend/trackaudio-afv-1.0.0.tgz", - "integrity": "sha512-inW+ZJQ5/GWUMoOMVhUmS5mxUU7lBGtYc07/2rjlGvllKqkpxD8VOeWC4qUzWGVbAQySuR8th46To3r0LEL1rw==", + "integrity": "sha512-+XaHcllqGapl6VqtqFjR3XY6qWcFmWgt9bjX9pSfj8ya1Q0uIMcFcc8uK5/tJJZKIp1dsoYTYU1U40F5527log==", "dependencies": { "bindings": "^1.5.0", "node-addon-api": "^1.1.0" diff --git a/package.json b/package.json index 276581b..01f8e36 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "trackaudio", "productName": "TrackAudio", - "version": "1.0.2-beta.6", + "version": "1.0.2-beta.7", "description": "A next generation Audio-For-VATSIM ATC Client for macOS, Linux and Windows", "main": ".webpack/main", "scripts": { diff --git a/scripts/entitlements.plist b/scripts/entitlements.plist new file mode 100644 index 0000000..a31141a --- /dev/null +++ b/scripts/entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.device.audio-input + + com.apple.security.device.bluetooth + + + \ No newline at end of file diff --git a/src/app/components/MiniModeToggleButton.tsx b/src/app/components/MiniModeToggleButton.tsx new file mode 100644 index 0000000..6d478e7 --- /dev/null +++ b/src/app/components/MiniModeToggleButton.tsx @@ -0,0 +1,38 @@ +import React, { useCallback } from "react"; +import { Fullscreen, FullscreenExit } from "react-bootstrap-icons"; + +interface MiniModeToggleButtonProps { + showRestoreButton: boolean; +} + +const MiniModeToggleButton: React.FC = ({ + showRestoreButton, +}) => { + const toggleMiniMode = useCallback(() => { + window.api.toggleMiniMode().catch((error: unknown) => { + console.error(error); + }); + }, []); + + return ( + + ); +}; + +export default MiniModeToggleButton; diff --git a/src/app/components/mini.tsx b/src/app/components/mini.tsx index bf81441..dbaa529 100644 --- a/src/app/components/mini.tsx +++ b/src/app/components/mini.tsx @@ -1,11 +1,21 @@ -import React from "react"; +import React, { useState } from "react"; import useRadioState from "../store/radioStore"; +import MiniModeToggleButton from "./MiniModeToggleButton"; const Mini: React.FC = () => { const [radios] = useRadioState((state) => [state.radios]); + const [isHovered, setIsHovered] = useState(false); return ( -
+
{ + setIsHovered(true); + }} + onMouseLeave={() => { + setIsHovered(false); + }} + >
{radios .filter((r) => r.rx) @@ -15,7 +25,9 @@ const Mini: React.FC = () => { - {radio.callsign !== "MANUAL" ? radio.callsign : radio.humanFrequency} + {radio.callsign !== "MANUAL" + ? radio.callsign + : radio.humanFrequency} :{" "} { ); })}
+
+ +
); }; diff --git a/src/app/components/navbar.tsx b/src/app/components/navbar.tsx index 9ecb866..f5930a6 100644 --- a/src/app/components/navbar.tsx +++ b/src/app/components/navbar.tsx @@ -11,7 +11,7 @@ import { } from "../helpers/CallsignHelper"; import useUtilStore from "../store/utilStore"; import { Configuration } from "../../config"; -import { FullscreenExit } from "react-bootstrap-icons"; +import MiniModeToggleButton from "./MiniModeToggleButton"; const Navbar: React.FC = () => { const [showModal, setShowModal] = useState(false); @@ -205,16 +205,7 @@ const Navbar: React.FC = () => { onWheel={handleRadioGainMouseWheel} value={radioGain} > - + {platform === "linux" && (