Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 41 additions & 20 deletions .github/workflows/build-and-sign-dmg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jobs:
-scheme ${{ env.SCHEME }} \
-configuration ${{ env.CONFIGURATION }} \
-archivePath "$RUNNER_TEMP/${{ env.APP_NAME }}.xcarchive" \
-destination 'generic/platform=macOS' \
ARCHS="arm64 x86_64" \
ONLY_ACTIVE_ARCH=NO \
archive

- name: Export App
Expand Down Expand Up @@ -138,24 +141,49 @@ jobs:

echo "✅ Application re-signed successfully"

- name: Verify Code Signatures
if: ${{ env.BUILD_CERTIFICATE_BASE64 != '' }}
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
- name: Verify Universal Binary and Code Signatures
run: |
echo "🔍 Verifying main application signature..."
codesign --verify --verbose "$RUNNER_TEMP/export/${{ env.APP_NAME }}.app"
echo "🏗️ Verifying Universal Binary Architecture..."
APP_BINARY="$RUNNER_TEMP/export/${{ env.APP_NAME }}.app/Contents/MacOS/${{ env.APP_NAME }}"
if [[ -f "$APP_BINARY" ]]; then
echo "📊 Binary architectures:"
lipo -archs "$APP_BINARY"

if lipo -archs "$APP_BINARY" | grep -q "arm64" && lipo -archs "$APP_BINARY" | grep -q "x86_64"; then
echo "✅ Universal binary confirmed: Contains both ARM64 and x86_64"
else
echo "❌ Warning: Binary may not be universal"
lipo -detailed_info "$APP_BINARY"
fi
fi

echo "🔍 Verifying framework signature..."
# Check framework architecture if it exists
FRAMEWORK_PATH="$RUNNER_TEMP/export/${{ env.APP_NAME }}.app/Contents/Frameworks/OpenMultitouchSupportXCF.framework"
if [[ -d "$FRAMEWORK_PATH" ]]; then
codesign --verify --verbose "$FRAMEWORK_PATH"
FRAMEWORK_BINARY="$FRAMEWORK_PATH/Versions/A/OpenMultitouchSupportXCF"
if [[ -f "$FRAMEWORK_BINARY" ]]; then
echo "📊 Framework architectures:"
lipo -archs "$FRAMEWORK_BINARY"
fi
fi

echo "🔍 Deep verification with online validation..."
codesign --verify --deep --strict --verbose=2 "$RUNNER_TEMP/export/${{ env.APP_NAME }}.app"

echo "✅ All signature verifications passed"
# Only verify signatures if certificates are available
if [[ -n "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" ]]; then
echo "🔍 Verifying main application signature..."
codesign --verify --verbose "$RUNNER_TEMP/export/${{ env.APP_NAME }}.app"

echo "🔍 Verifying framework signature..."
if [[ -d "$FRAMEWORK_PATH" ]]; then
codesign --verify --verbose "$FRAMEWORK_PATH"
fi

echo "🔍 Deep verification with online validation..."
codesign --verify --deep --strict --verbose=2 "$RUNNER_TEMP/export/${{ env.APP_NAME }}.app"

echo "✅ All signature verifications passed"
else
echo "ℹ️ Skipping signature verification (no certificates provided)"
fi

- name: Notarize App
if: ${{ env.BUILD_CERTIFICATE_BASE64 != '' && env.APPLE_ID != '' }}
Expand Down Expand Up @@ -253,19 +281,13 @@ jobs:

Transform your MacBook's trackpad into a precise digital weighing scale!

## Credits
**Original repository:** https://github.com/KrishKrosh/TrackWeight
**Created by:** Krish Shah (@KrishKrosh)

This build is from the fork at https://github.com/Rohithzr/TrackWeight

## Installation
1. Download the DMG file below
2. Open the DMG and drag TrackWeight.app to your Applications folder
3. Run the app and follow the setup instructions

## Requirements
- macOS 13.0 or later
- macOS 13.0 or later (Ventura or newer)
- MacBook with Force Touch trackpad (2015 or newer MacBook Pro, 2016 or newer MacBook)

## Usage
Expand All @@ -274,7 +296,6 @@ jobs:
3. While maintaining finger contact, put your object on the trackpad
4. Apply minimal pressure while maintaining contact to get the weight

For more information, visit the [original repository](https://github.com/KrishKrosh/TrackWeight).
files: |
${{ runner.temp }}/${{ steps.version_info.outputs.dmg_name }}
draft: false
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The key insight is that trackpad pressure events are only generated when there's

## Requirements

- **macOS 13.0+** (for Open Multi-Touch Support library compatibility)
- **macOS 13.0+** (Ventura or later)
- **MacBook with Force Touch trackpad** (2015 or newer MacBook Pro, 2016 or newer MacBook)
- **App Sandbox disabled** (required for low-level trackpad access)
- **Xcode 16.0+** and **Swift 6.0+** (for development)
Expand Down Expand Up @@ -53,16 +53,6 @@ brew install --cask krishkrosh/apps/trackweight
3. Disable App Sandbox in the project settings (required for trackpad access)
4. Build and run the application

## Automated Builds

This repository includes a GitHub Actions workflow that automatically builds and packages the application into a signed DMG file. The workflow:

- Builds the Xcode project using the latest stable Xcode
- Signs the application (if signing certificates are configured)
- Creates a professional DMG with proper attribution
- Uploads the DMG as a release artifact
- Creates GitHub releases for tagged versions

For more information about setting up the build pipeline, see [.github/workflows/README.md](.github/workflows/README.md).

### Calibration Process
Expand Down
15 changes: 11 additions & 4 deletions TrackWeight.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -253,7 +254,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.5;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand All @@ -267,6 +268,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -311,9 +313,10 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.5;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
};
Expand All @@ -322,6 +325,7 @@
77292A942B931954001CA3F6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = TrackWeight/TrackWeight.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
Expand All @@ -338,8 +342,9 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.6;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.krishkrosh.trackweight;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -351,6 +356,7 @@
77292A952B931954001CA3F6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = TrackWeight/TrackWeight.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
Expand All @@ -367,8 +373,9 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.6;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.krishkrosh.trackweight;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
7 changes: 5 additions & 2 deletions TrackWeight/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ struct HomeView: View {
.padding(.vertical, 20)
.background(
RoundedRectangle(cornerRadius: 15)
.fill(Color.orange.opacity(0.05))
.stroke(Color.orange.opacity(0.2), lineWidth: 1)
.foregroundColor(Color.orange.opacity(0.05))
.overlay(
RoundedRectangle(cornerRadius: 15)
.stroke(Color.orange.opacity(0.2), lineWidth: 1)
)
)
.frame(maxWidth: 500)
}
Expand Down
36 changes: 31 additions & 5 deletions scripts/test-build-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"

echo ""
echo "Step 1: Building and Archiving App"
echo "=================================="
echo "Step 1: Building and Archiving App (Universal Binary)"
echo "====================================================="
xcodebuild \
-project TrackWeight.xcodeproj \
-scheme "$SCHEME" \
-configuration "$CONFIGURATION" \
-archivePath "$BUILD_DIR/$APP_NAME.xcarchive" \
-destination 'generic/platform=macOS' \
ARCHS="arm64 x86_64" \
ONLY_ACTIVE_ARCH=NO \
archive

echo ""
Expand Down Expand Up @@ -118,13 +121,36 @@ fi
fi

echo ""
echo "Step 2.5: Verifying Code Signatures"
echo "==================================="
echo "Step 2.5: Verifying Universal Binary and Code Signatures"
echo "========================================================"
echo "🏗️ Verifying Universal Binary Architecture..."
APP_BINARY="$BUILD_DIR/export/$APP_NAME.app/Contents/MacOS/$APP_NAME"
if [[ -f "$APP_BINARY" ]]; then
echo "📊 Binary architectures:"
lipo -archs "$APP_BINARY"

if lipo -archs "$APP_BINARY" | grep -q "arm64" && lipo -archs "$APP_BINARY" | grep -q "x86_64"; then
echo "✅ Universal binary confirmed: Contains both ARM64 and x86_64"
else
echo "❌ Warning: Binary may not be universal"
lipo -detailed_info "$APP_BINARY"
fi
fi

# Check framework architecture if it exists
FRAMEWORK_PATH="$BUILD_DIR/export/$APP_NAME.app/Contents/Frameworks/OpenMultitouchSupportXCF.framework"
if [[ -d "$FRAMEWORK_PATH" ]]; then
FRAMEWORK_BINARY="$FRAMEWORK_PATH/Versions/A/OpenMultitouchSupportXCF"
if [[ -f "$FRAMEWORK_BINARY" ]]; then
echo "📊 Framework architectures:"
lipo -archs "$FRAMEWORK_BINARY"
fi
fi

echo "🔍 Verifying main application signature..."
codesign --verify --verbose "$BUILD_DIR/export/$APP_NAME.app" || echo "⚠️ Main app signature verification failed"

echo "🔍 Verifying framework signature..."
FRAMEWORK_PATH="$BUILD_DIR/export/$APP_NAME.app/Contents/Frameworks/OpenMultitouchSupportXCF.framework"
if [[ -d "$FRAMEWORK_PATH" ]]; then
codesign --verify --verbose "$FRAMEWORK_PATH" || echo "⚠️ Framework signature verification failed"
fi
Expand Down