Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ fastlane/README.md
fastlane/report.xml
Configs/LocalOverrides.xcconfig
.asc/
Rust/**/target/
.codex/
Inspect.xcodeproj/
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"images" : [
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"filename" : "launch_background_light@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"filename" : "launch_background_light@3x.png",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "launch_background_dark@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "launch_background_dark@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions App/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>InspectAppGroupIdentifier</key>
<string>$(INSPECT_APP_GROUP_IDENTIFIER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
14 changes: 14 additions & 0 deletions App/Resources/Inspect.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>$(INSPECT_APP_GROUP_IDENTIFIER)</string>
</array>
</dict>
</plist>
36 changes: 9 additions & 27 deletions App/Resources/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -17,29 +16,17 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="LwW-1u-JmV">
<rect key="frame" x="110.33333333333331" y="384" width="172.33333333333337" height="70"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Inspect" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R2J-rf-R6p">
<rect key="frame" x="0.0" y="0.0" width="172.33333333333334" height="38.333333333333336"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="32"/>
<color key="textColor" systemColor="systemBlueColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Certificate Inspector" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AQd-Og-kMt">
<rect key="frame" x="0.0" y="46.333333333333336" width="172.33333333333334" height="23.666666666666664"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
<color key="textColor" white="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="T0P-9M-v9u">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<color key="backgroundColor" red="0.81999999999999995" green="0.90000000000000002" blue="0.95999999999999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="LwW-1u-JmV" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="7fA-lZ-fYj"/>
<constraint firstItem="LwW-1u-JmV" firstAttribute="centerY" secondItem="Bcu-3y-fUS" secondAttribute="centerY" id="i7d-Qb-W6V"/>
<constraint firstItem="T0P-9M-v9u" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="09l-U9-I1A"/>
<constraint firstAttribute="trailing" secondItem="T0P-9M-v9u" secondAttribute="trailing" id="OB4-EZ-q7Q"/>
<constraint firstItem="T0P-9M-v9u" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="UbV-5C-uh4"/>
<constraint firstAttribute="bottom" secondItem="T0P-9M-v9u" secondAttribute="bottom" id="nrD-gc-GOd"/>
</constraints>
</view>
</viewController>
Expand All @@ -48,11 +35,6 @@
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBlueColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<image name="LaunchBackground" width="390" height="844"/>
</resources>
</document>
3 changes: 1 addition & 2 deletions App/Sources/InspectApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import SwiftUI
struct InspectApp: App {
var body: some Scene {
WindowGroup {
InspectionRootView(screenshotScenario: .current)
.tint(.inspectAccent)
InspectAppRootView()
}
}
}
69 changes: 69 additions & 0 deletions App/Sources/InspectAppRootView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import InspectFeature
import SwiftUI

private enum InspectTab: Hashable {
case inspect
case monitor
case settings
}

struct InspectAppRootView: View {
@Environment(\.scenePhase) private var scenePhase
@State private var selectedTab: InspectTab = .inspect
@State private var liveMonitorManager = LiveMonitorManager()

var body: some View {
if InspectionScreenshotScenario.current != nil {
InspectionRootView(screenshotScenario: .current)
.tint(.inspectAccent)
} else {
TabView(selection: $selectedTab) {
InspectionRootView(
showsMonitorCard: false,
showsAboutCard: false
)
.tabItem {
Label("Inspect", systemImage: "magnifyingglass.circle")
}
.tag(InspectTab.inspect)
.accessibilityIdentifier("tab.inspect")

InspectionMonitorView {
await liveMonitorManager.refresh()
}
.tabItem {
Label("Monitor", systemImage: "wave.3.right.circle")
}
.tag(InspectTab.monitor)
.accessibilityIdentifier("tab.monitor")

InspectSettingsView(manager: liveMonitorManager)
.tabItem {
Label("Settings", systemImage: "gearshape")
}
.tag(InspectTab.settings)
.accessibilityIdentifier("tab.settings")
}
.tint(.inspectAccent)
.task {
let manager = liveMonitorManager
InspectionLiveMonitorCoordinator.configure { isEnabled in
try await manager.setLiveMonitorEnabled(isEnabled)
}
await manager.refresh()
}
.onChange(of: scenePhase) { _, newPhase in
guard newPhase == .active else {
return
}

Task {
await liveMonitorManager.refresh()
}
}
.onDisappear {
InspectionLiveMonitorCoordinator.configure(toggleHandler: nil)
}
}
}
}
Loading
Loading