Skip to content
Merged
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
204 changes: 204 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: iOS

# Public repositories run this automatically (standard runners are free there).
# The private development repository runs it only manually (macOS minutes count 10x
# against its quota): Actions > iOS > Run workflow after changes to iosApp/, iosMain
# or shared code that iosMain calls.
on:
push:
branches: [main, "codex/**"]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ios-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
linux:
if: github.event_name == 'workflow_dispatch' || github.event.repository.private == false
name: Linux Android regression
runs-on: ubuntu-24.04
timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: temurin
java-version: "21"
- name: Forbidden imports in shared commonMain
run: |
if grep -rE "^import (java|javax|android)\." shared/src/commonMain; then
echo "::error::shared/src/commonMain must not import java, javax or android"
exit 1
fi
- name: Strict tests, lint and debug build without Apple targets
run: >-
./gradlew --no-daemon --dependency-verification strict
testDebugUnitTest :shared:allTests lintDebug assembleDebug

simulator:
if: github.event_name == 'workflow_dispatch' || github.event.repository.private == false
name: ARM iOS simulator
runs-on: macos-15
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: temurin
java-version: "21"
- name: Verify Apple toolchain and select available iPhone deterministically
run: |
test "$(uname -m)" = arm64
sudo xcode-select -s /Applications/Xcode_16.4.app
test "$(xcodebuild -version)" = $'Xcode 16.4\nBuild version 16F6'
xcodebuild -version
mkdir -p artifacts/ios
xcrun simctl list devices available --json > artifacts/ios/simulators.json
python3 - <<'PY'
import json
import os
import re

with open("artifacts/ios/simulators.json", encoding="utf-8") as source:
inventory = json.load(source)
candidates = []
for runtime, devices in inventory["devices"].items():
match = re.fullmatch(r"com\.apple\.CoreSimulator\.SimRuntime\.iOS-(\d+)-(\d+)(?:-(\d+))?", runtime)
if not match or tuple(int(part or 0) for part in match.groups()) != (18, 5, 0):
continue
version = tuple(int(part or 0) for part in match.groups())
for device in devices:
if device.get("isAvailable") and device["name"].startswith("iPhone"):
candidates.append((version, device["name"], device["udid"]))
if not candidates:
raise SystemExit("No available iOS 18.5 iPhone simulator in the selected Xcode")
# Pinned iOS 18.5 for Xcode 16.4; stable name/UUID tie-break.
newest = max(item[0] for item in candidates)
_, name, identifier = min(item for item in candidates if item[0] == newest)
print(f"Selected {name}, iOS {newest}, {identifier}")
with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as output:
output.write(f"IOS_SIMULATOR_ID={identifier}\n")
PY
- name: Link static shared framework and run Kotlin Native tests
run: |
./gradlew --no-daemon --dependency-verification strict -Pnetkit.ios=true \
:shared:linkDebugFrameworkIosSimulatorArm64 :shared:iosSimulatorArm64Test
framework=shared/build/bin/iosSimulatorArm64/debugFramework/NetKitShared.framework
test -s "$framework/NetKitShared"
test -s "$framework/Headers/NetKitShared.h"
test -s "$framework/Modules/module.modulemap"
cp "$framework/Headers/NetKitShared.h" artifacts/ios/NetKitShared.h
{
ls -lR "$framework"
file "$framework/NetKitShared"
lipo -archs "$framework/NetKitShared" | grep -w arm64
} | tee artifacts/ios/framework.log
- name: Resolve only committed Swift package versions
run: |
lockfile=iosApp/NetKit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
test -s "$lockfile"
xcodebuild -resolvePackageDependencies -project iosApp/NetKit.xcodeproj -scheme NetKit \
-onlyUsePackageVersionsFromResolvedFile -disableAutomaticPackageResolution \
2>&1 | tee artifacts/ios/package-resolution.log
git diff --exit-code -- "$lockfile"
- name: Build simulator app with local ad-hoc signing
run: |
xcodebuild -project iosApp/NetKit.xcodeproj -scheme NetKit \
-configuration Debug -sdk iphonesimulator \
-destination "platform=iOS Simulator,id=$IOS_SIMULATOR_ID" \
-derivedDataPath build/ios-derived \
-resultBundlePath artifacts/ios/build.xcresult \
-onlyUsePackageVersionsFromResolvedFile -disableAutomaticPackageResolution \
CODE_SIGN_IDENTITY=- CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=YES \
build 2>&1 | tee artifacts/ios/build.log
- name: Build unsigned Release simulator app and reject UI export hook
run: |
./gradlew --no-daemon --dependency-verification strict -Pnetkit.ios=true \
:shared:linkReleaseFrameworkIosSimulatorArm64
xcodebuild -project iosApp/NetKit.xcodeproj -scheme NetKit \
-configuration Release -sdk iphonesimulator \
-destination "platform=iOS Simulator,id=$IOS_SIMULATOR_ID" \
-derivedDataPath build/ios-release-derived \
-resultBundlePath artifacts/ios/release-build.xcresult \
-onlyUsePackageVersionsFromResolvedFile -disableAutomaticPackageResolution \
CODE_SIGNING_ALLOWED=NO build 2>&1 | tee artifacts/ios/release-build.log
python3 - <<'PY'
from pathlib import Path

binary = Path("build/ios-release-derived/Build/Products/Release-iphonesimulator/NetKit.app/NetKit")
contents = binary.read_bytes()
if not contents:
raise SystemExit("Release app executable is empty")
if b"netkit-ui-capture-ssh-export" in contents:
raise SystemExit("Release app contains the DEBUG UI export hook")
print("PASS: Release app excludes the DEBUG UI export hook")
PY
git diff --exit-code -- iosApp/NetKit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
- name: Swift local transport integration and localized launch tests
run: |
xcodebuild -project iosApp/NetKit.xcodeproj -scheme NetKit \
-configuration Debug -sdk iphonesimulator \
-destination "platform=iOS Simulator,id=$IOS_SIMULATOR_ID" \
-destination-timeout 120 -parallel-testing-enabled NO \
-derivedDataPath build/ios-derived \
-resultBundlePath artifacts/ios/tests.xcresult \
-onlyUsePackageVersionsFromResolvedFile -disableAutomaticPackageResolution \
CODE_SIGN_IDENTITY=- CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=YES \
test 2>&1 | tee artifacts/ios/tests.log
git diff --exit-code -- iosApp/NetKit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
- name: Inspect local simulator signatures and entitlements
if: always()
run: |
products=build/ios-derived/Build/Products/Debug-iphonesimulator
mkdir -p artifacts/ios
: > artifacts/ios/defined-symbols.log
{
if [ -d "$products" ]; then
while IFS= read -r -d '' bundle; do
printf '\nBundle: %s\n' "$bundle"
if ! codesign --display --verbose=4 --entitlements - "$bundle" 2>&1; then
printf 'Signature inspection failed for this bundle.\n'
fi
printf '\nBundle: %s\n' "$bundle" >> artifacts/ios/defined-symbols.log
if executable=$(plutil -extract CFBundleExecutable raw -o - "$bundle/Info.plist" 2>> artifacts/ios/defined-symbols.log); then
case "$executable" in
'' | */*) printf 'Invalid bundle executable name; symbol inspection skipped.\n' >> artifacts/ios/defined-symbols.log ;;
*)
if ! nm -gU "$bundle/$executable" >> artifacts/ios/defined-symbols.log 2>&1; then
printf 'Defined-symbol inspection failed for this executable.\n' >> artifacts/ios/defined-symbols.log
fi
;;
esac
else
printf 'Bundle executable name unavailable; symbol inspection skipped.\n' >> artifacts/ios/defined-symbols.log
fi
done < <(find "$products" -type d \( -name '*.app' -o -name '*.xctest' \) -print0)
else
printf 'No simulator build products available for signature inspection.\n'
printf 'No simulator build products available for symbol inspection.\n' >> artifacts/ios/defined-symbols.log
fi
} | tee artifacts/ios/signatures.log
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: ios-simulator-results
path: |
artifacts/ios/
shared/build/reports/tests/iosSimulatorArm64Test/
shared/build/test-results/iosSimulatorArm64Test/
if-no-files-found: error
retention-days: 7
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.1 — SSH profily a iOS ve zdrojích (2026-11-01)

- Export SSH profilů v novém formátu v2 (typ ověření, startovací příkaz, keepalive, pořadí; bez hesel a klíčů) a import v1, v2 i starších exportů z telefonu.
- Pořadí SSH profilů šipkami, náhled změn před importem a varování u startovacího příkazu.
- Profil s ověřením klíčem bez přiřazeného klíče se nepřipojí a nabídne výběr nebo vytvoření klíče.
- Export funguje i po ukončení aplikace systémem během výběru souboru; varování lze zavřít.
- Zdrojový kód iOS verze (SwiftUI nad sdíleným jádrem) je součástí repozitáře; iOS se zatím nevydává.

## 1.0.0 — první veřejné vydání (2026-10-31)

- První veřejná verze: LAN skener, Wi-Fi analýza, SSH terminál, Wake-on-LAN, rychlostní testy a kontrola aktualizací.
Expand Down
2 changes: 1 addition & 1 deletion androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
alias(libs.plugins.kotlin.compose)
}
/** Release version; versionCode = major*10000 + minor*100 + patch (docs/distribuce.md §2). */
val netkitVersion = "1.0.0"
val netkitVersion = "1.0.1"
val netkitVersionCode = netkitVersion.split('.').map(String::toInt).let { (major, minor, patch) ->
require(minor in 0..99 && patch in 0..99) { "minor and patch must be 0..99" }
major * 10000 + minor * 100 + patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,26 @@ class M1Instrumentation : Instrumentation() {
phase=arguments.getString("phase").orEmpty()
try {
check(runId.matches(Regex("[a-f0-9]{32}"))) { "Invalid runId" }
check(phase in listOf("ui","lan","ssh","wifi","wifi-denied","ssh-ui","ssh-rotated","lan-confirm","ssh-lifecycle","ssh-legacy","lan-discovery","lan-icmp-rtt","wifi-freshness","ssh-reconnect","json-limits")) { "Invalid phase" }
check(phase in listOf("ui","lan","ssh","wifi","wifi-denied","ssh-ui","ssh-rotated","lan-confirm","ssh-lifecycle","ssh-legacy","lan-discovery","lan-icmp-rtt","wifi-freshness","ssh-reconnect","json-limits","ssh-key-editor","ssh-profiles-v2","ssh-profiles-r1","ssh-profiles-p3")) { "Invalid phase" }
app=targetContext.applicationContext as M1TestApplication
marker("PHASE:$phase:START")
runBlocking {
withTimeout(if (phase == "ssh-lifecycle") 380_000L else 115_000L) {
when(phase) { "json-limits" -> jsonLimitsPhase(); "ssh-reconnect" -> sshUiPhase(reconnect = true); "wifi-freshness" -> wifiFreshnessPhase(); "ui" -> uiPhase(); "lan" -> lanPhase(); "lan-icmp-rtt" -> lanIcmpRttPhase(); "lan-confirm" -> lanConfirmPhase(); "lan-discovery" -> lanDiscoveryPhase(); "ssh" -> sshPhase(); "ssh-ui" -> sshUiPhase(); "ssh-lifecycle" -> sshUiPhase(lifecycle = true); "ssh-rotated" -> sshRotatedPhase(); "ssh-legacy" -> sshLegacyPhase(); "wifi" -> wifiPhase(false); "wifi-denied" -> wifiPhase(true) }
when(phase) { "ssh-profiles-p3" -> sshProfilesP3Evidence(this@M1Instrumentation, app, ::screenshot, ::marker); "ssh-profiles-r1" -> sshProfilesR1Evidence(this@M1Instrumentation, app, ::screenshot, ::marker); "ssh-profiles-v2" -> sshProfilesV2Evidence(this@M1Instrumentation, app, ::screenshot, ::marker); "ssh-key-editor" -> sshKeyEditorEvidence(this@M1Instrumentation, app, arguments.getString("stage") ?: "2", arguments.getString("order") != "import-first", ::screenshot, ::marker); "json-limits" -> jsonLimitsPhase(); "ssh-reconnect" -> sshUiPhase(reconnect = true); "wifi-freshness" -> wifiFreshnessPhase(); "ui" -> uiPhase(); "lan" -> lanPhase(); "lan-icmp-rtt" -> lanIcmpRttPhase(); "lan-confirm" -> lanConfirmPhase(); "lan-discovery" -> lanDiscoveryPhase(); "ssh" -> sshPhase(); "ssh-ui" -> sshUiPhase(); "ssh-lifecycle" -> sshUiPhase(lifecycle = true); "ssh-rotated" -> sshRotatedPhase(); "ssh-legacy" -> sshLegacyPhase(); "wifi" -> wifiPhase(false); "wifi-denied" -> wifiPhase(true) }
}
}
} catch (failure: Throwable) {
// Exception class/step only: provider/library messages may include credentials or key data.
if (phase == "ssh-key-editor" || phase == "ssh-profiles-v2" || phase == "ssh-profiles-r1" || phase == "ssh-profiles-p3") {
marker("SSH_TEST_STACK:" + failure.stackTrace.take(12).joinToString(";"))
try { screenshot("ssh-test-failure.png") } catch (_: Exception) { }
}
failureType=failure.javaClass.simpleName
outcome="FAIL"
} finally {
if (::app.isInitialized) {
try { app.closeStore() } catch (_: Throwable) { outcome="FAIL" }
try { app.cleanupUiSecrets() } catch (_: Throwable) { outcome="FAIL" }
try { if (phase != "ssh-key-editor" || arguments.getString("stage") != "1" || outcome != "PASS") app.cleanupUiSecrets() } catch (_: Throwable) { outcome="FAIL" }
}
}
// Cleanup is part of the verdict and must finish before Instrumentation can stop the process.
Expand Down
Loading
Loading