Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db1f15f981 | ||
|
|
db58a5c048 | ||
|
|
00978b096b | ||
|
|
73d81216bb |
2
.gitignore
vendored
@@ -3,3 +3,5 @@ xcuserdata/
|
|||||||
DerivedData/
|
DerivedData/
|
||||||
build/
|
build/
|
||||||
Build/
|
Build/
|
||||||
|
dist/
|
||||||
|
.signing.env
|
||||||
|
|||||||
@@ -1,51 +1,61 @@
|
|||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_16x16.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "16x16"
|
"size" : "16x16"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_16x16@2x.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "16x16"
|
"size" : "16x16"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_32x32.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "32x32"
|
"size" : "32x32"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_32x32@2x.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "32x32"
|
"size" : "32x32"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_128x128.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "128x128"
|
"size" : "128x128"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_128x128@2x.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "128x128"
|
"size" : "128x128"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_256x256.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "256x256"
|
"size" : "256x256"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_256x256@2x.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "256x256"
|
"size" : "256x256"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_512x512.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "512x512"
|
"size" : "512x512"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"filename" : "icon_512x512@2x.png",
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "512x512"
|
"size" : "512x512"
|
||||||
|
|||||||
BIN
Assets.xcassets/AppIcon.appiconset/icon_128x128.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_16x16.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_256x256.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_32x32.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_512x512.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
BIN
Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
Assets/dmg_background.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
3
NOTES.md
@@ -3,5 +3,6 @@
|
|||||||
dynamic Data
|
dynamic Data
|
||||||
static Data
|
static Data
|
||||||
|
|
||||||
move source to /src. like iKeyMon before
|
|
||||||
add a merker for "reboot required"
|
add a merker for "reboot required"
|
||||||
|
Add dmg download option for macOS
|
||||||
|
Add versioning
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ open iKeyMon.xcodeproj
|
|||||||
|
|
||||||
### Local release build
|
### Local release build
|
||||||
|
|
||||||
Use the helper script to produce a zipped `.app` in `dist/`:
|
Use the helper script to produce distributables in `dist/`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./scripts/build_release.sh
|
./scripts/build_release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
It cleans previous artifacts, builds the `Release` configuration, and drops `iKeyMon-<version>.zip` into the `dist` folder (ignored by git).
|
It cleans previous artifacts, builds the `Release` configuration, and drops both `iKeyMon-<version>.zip` and `iKeyMon-<version>.dmg` into the `dist` folder (ignored by git). To enable codesigning + notarization, copy `signing.env.example` to `.signing.env`, fill in your Developer ID identity, Apple ID, team ID, and app-specific password. The script sources that file locally (it remains gitignored) and performs signing/notarization when the values are present.
|
||||||
## 📦 License
|
## 📦 License
|
||||||
|
|
||||||
MIT — see [LICENSE](LICENSE) for details.
|
MIT — see [LICENSE](LICENSE) for details.
|
||||||
|
|||||||
@@ -6,9 +6,20 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
#if os(macOS)
|
||||||
|
import AppKit
|
||||||
|
#endif
|
||||||
|
|
||||||
@main
|
@main
|
||||||
struct iKeyMonApp: App {
|
struct iKeyMonApp: App {
|
||||||
|
init() {
|
||||||
|
#if os(macOS)
|
||||||
|
if let customIcon = NSImage(named: "AppIcon") {
|
||||||
|
NSApplication.shared.applicationIconImage = customIcon
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
MainView()
|
MainView()
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
52A9B79F2EC8E7EE004DD4A2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 52A9B7872EC8E7EE004DD4A2 /* Assets.xcassets */; };
|
52A9B79F2EC8E7EE004DD4A2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 52A9B7872EC8E7EE004DD4A2 /* Assets.xcassets */; };
|
||||||
52A9B8222EC8FA8A004DD4A2 /* CHANGELOG.md in Resources */ = {isa = PBXBuildFile; fileRef = 52A9B8212EC8FA8A004DD4A2 /* CHANGELOG.md */; };
|
52A9B8222EC8FA8A004DD4A2 /* CHANGELOG.md in Resources */ = {isa = PBXBuildFile; fileRef = 52A9B8212EC8FA8A004DD4A2 /* CHANGELOG.md */; };
|
||||||
|
52A9B9722ECF751C004DD4A2 /* signing.env.example in Resources */ = {isa = PBXBuildFile; fileRef = 52A9B9712ECF751C004DD4A2 /* signing.env.example */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
52A9B7882EC8E7EE004DD4A2 /* iKeyMon.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = iKeyMon.entitlements; sourceTree = "<group>"; };
|
52A9B7882EC8E7EE004DD4A2 /* iKeyMon.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = iKeyMon.entitlements; sourceTree = "<group>"; };
|
||||||
52A9B8212EC8FA8A004DD4A2 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
|
52A9B8212EC8FA8A004DD4A2 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
|
||||||
52A9B8BA2ECA35FB004DD4A2 /* NOTES.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = NOTES.md; sourceTree = "<group>"; };
|
52A9B8BA2ECA35FB004DD4A2 /* NOTES.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = NOTES.md; sourceTree = "<group>"; };
|
||||||
|
52A9B9712ECF751C004DD4A2 /* signing.env.example */ = {isa = PBXFileReference; lastKnownFileType = text; path = signing.env.example; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||||
@@ -47,12 +49,13 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
52A9B8BE2ECB68B5004DD4A2 /* Sources */,
|
52A9B8BE2ECB68B5004DD4A2 /* Sources */,
|
||||||
52A9B8BA2ECA35FB004DD4A2 /* NOTES.md */,
|
|
||||||
52A9B7872EC8E7EE004DD4A2 /* Assets.xcassets */,
|
52A9B7872EC8E7EE004DD4A2 /* Assets.xcassets */,
|
||||||
52A9B7882EC8E7EE004DD4A2 /* iKeyMon.entitlements */,
|
52A9B7882EC8E7EE004DD4A2 /* iKeyMon.entitlements */,
|
||||||
52A9B8F72ECB6B8A004DD4A2 /* Preview Content */,
|
52A9B8F72ECB6B8A004DD4A2 /* Preview Content */,
|
||||||
5203C24E2D997D2800576D4A /* Products */,
|
5203C24E2D997D2800576D4A /* Products */,
|
||||||
52A9B8212EC8FA8A004DD4A2 /* CHANGELOG.md */,
|
52A9B8212EC8FA8A004DD4A2 /* CHANGELOG.md */,
|
||||||
|
52A9B8BA2ECA35FB004DD4A2 /* NOTES.md */,
|
||||||
|
52A9B9712ECF751C004DD4A2 /* signing.env.example */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -131,6 +134,7 @@
|
|||||||
files = (
|
files = (
|
||||||
52A9B8222EC8FA8A004DD4A2 /* CHANGELOG.md in Resources */,
|
52A9B8222EC8FA8A004DD4A2 /* CHANGELOG.md in Resources */,
|
||||||
52A9B79F2EC8E7EE004DD4A2 /* Assets.xcassets in Resources */,
|
52A9B79F2EC8E7EE004DD4A2 /* Assets.xcassets in Resources */,
|
||||||
|
52A9B9722ECF751C004DD4A2 /* signing.env.example in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -279,6 +283,7 @@
|
|||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_KEY_CFBundleIconName = AppIcon;
|
||||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -306,6 +311,7 @@
|
|||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_KEY_CFBundleIconName = AppIcon;
|
||||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ BUILD_DIR="$ROOT_DIR/build"
|
|||||||
ARTIFACTS_DIR="$ROOT_DIR/dist"
|
ARTIFACTS_DIR="$ROOT_DIR/dist"
|
||||||
SCHEME="iKeyMon"
|
SCHEME="iKeyMon"
|
||||||
PROJECT="iKeyMon.xcodeproj"
|
PROJECT="iKeyMon.xcodeproj"
|
||||||
|
CREDENTIALS_FILE="$ROOT_DIR/.signing.env"
|
||||||
|
|
||||||
|
if [[ -f "$CREDENTIALS_FILE" ]]; then
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
source "$CREDENTIALS_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf "$BUILD_DIR" "$ARTIFACTS_DIR"
|
rm -rf "$BUILD_DIR" "$ARTIFACTS_DIR"
|
||||||
mkdir -p "$ARTIFACTS_DIR"
|
mkdir -p "$ARTIFACTS_DIR"
|
||||||
@@ -15,6 +21,7 @@ xcodebuild \
|
|||||||
-scheme "$SCHEME" \
|
-scheme "$SCHEME" \
|
||||||
-configuration Release \
|
-configuration Release \
|
||||||
-derivedDataPath "$BUILD_DIR" \
|
-derivedDataPath "$BUILD_DIR" \
|
||||||
|
CODE_SIGNING_ALLOWED=NO \
|
||||||
clean build
|
clean build
|
||||||
|
|
||||||
APP_PATH="$BUILD_DIR/Build/Products/Release/iKeyMon.app"
|
APP_PATH="$BUILD_DIR/Build/Products/Release/iKeyMon.app"
|
||||||
@@ -23,6 +30,27 @@ if [[ ! -d "$APP_PATH" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${CODESIGN_IDENTITY:-}" ]]; then
|
||||||
|
echo "🔏 Codesigning app with identity: $CODESIGN_IDENTITY"
|
||||||
|
codesign \
|
||||||
|
--deep \
|
||||||
|
--force \
|
||||||
|
--options runtime \
|
||||||
|
--timestamp \
|
||||||
|
--entitlements "$ROOT_DIR/iKeyMon.entitlements" \
|
||||||
|
--sign "$CODESIGN_IDENTITY" \
|
||||||
|
"$APP_PATH"
|
||||||
|
else
|
||||||
|
echo "⚠️ Skipping codesign (CODESIGN_IDENTITY not set)."
|
||||||
|
fi
|
||||||
|
|
||||||
|
STAGING_DIR=$(mktemp -d)
|
||||||
|
mkdir -p "$STAGING_DIR"
|
||||||
|
cp -R "$APP_PATH" "$STAGING_DIR/"
|
||||||
|
ln -s /Applications "$STAGING_DIR/Applications"
|
||||||
|
mkdir -p "$STAGING_DIR/.background"
|
||||||
|
cp "$ROOT_DIR/Assets/dmg_background.png" "$STAGING_DIR/.background/background.png"
|
||||||
|
|
||||||
VERSION=$(xcodebuild \
|
VERSION=$(xcodebuild \
|
||||||
-project "$ROOT_DIR/$PROJECT" \
|
-project "$ROOT_DIR/$PROJECT" \
|
||||||
-scheme "$SCHEME" \
|
-scheme "$SCHEME" \
|
||||||
@@ -37,6 +65,21 @@ zip -r "$ARTIFACTS_DIR/$ZIP_NAME" "$(basename "$APP_PATH")"
|
|||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
DMG_NAME="iKeyMon-${VERSION}.dmg"
|
DMG_NAME="iKeyMon-${VERSION}.dmg"
|
||||||
hdiutil create -volname "iKeyMon" -srcfolder "$APP_PATH" -ov -format UDZO "$ARTIFACTS_DIR/$DMG_NAME"
|
hdiutil create -volname "iKeyMon" -srcfolder "$STAGING_DIR" -ov -format UDZO "$ARTIFACTS_DIR/$DMG_NAME"
|
||||||
|
|
||||||
echo "✅ Build complete. Artifact: $ARTIFACTS_DIR/$ZIP_NAME"
|
if [[ -n "${NOTARY_APPLE_ID:-}" && -n "${NOTARY_TEAM_ID:-}" && -n "${NOTARY_PASSWORD:-}" ]]; then
|
||||||
|
echo "📝 Submitting DMG for notarization..."
|
||||||
|
xcrun notarytool submit "$ARTIFACTS_DIR/$DMG_NAME" \
|
||||||
|
--apple-id "$NOTARY_APPLE_ID" \
|
||||||
|
--team-id "$NOTARY_TEAM_ID" \
|
||||||
|
--password "$NOTARY_PASSWORD" \
|
||||||
|
--wait
|
||||||
|
xcrun stapler staple "$ARTIFACTS_DIR/$DMG_NAME"
|
||||||
|
else
|
||||||
|
echo "⚠️ Skipping notarization (NOTARY_* variables not set)."
|
||||||
|
fi
|
||||||
|
rm -rf "$STAGING_DIR"
|
||||||
|
|
||||||
|
echo "✅ Build complete. Artifacts:"
|
||||||
|
echo " - $ARTIFACTS_DIR/$ZIP_NAME"
|
||||||
|
echo " - $ARTIFACTS_DIR/$DMG_NAME"
|
||||||
|
|||||||
4
signing.env.example
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID1234)"
|
||||||
|
NOTARY_APPLE_ID="appleid@example.com"
|
||||||
|
NOTARY_TEAM_ID="TEAMID1234"
|
||||||
|
NOTARY_PASSWORD="app-specific-password"
|
||||||