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
125 changes: 125 additions & 0 deletions apps/IPA-Control/IPAControl.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {};
objectVersion = 56;
objects = {

/* Begin PBXBuildFile section */
A00000000000000000000021 /* IPAControlApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A00000000000000000000011 /* IPAControlApp.swift */; };
A00000000000000000000022 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A00000000000000000000012 /* ContentView.swift */; };
A00000000000000000000023 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = A00000000000000000000013 /* Models.swift */; };
A00000000000000000000024 /* IPAControlModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A00000000000000000000014 /* IPAControlModel.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
A00000000000000000000010 /* IPAControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IPAControl.app; sourceTree = BUILT_PRODUCTS_DIR; };
A00000000000000000000011 /* IPAControlApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPAControlApp.swift; sourceTree = "<group>"; };
A00000000000000000000012 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
A00000000000000000000013 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; };
A00000000000000000000014 /* IPAControlModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPAControlModel.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
A00000000000000000000031 /* Frameworks */ = {isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = (); runOnlyForDeploymentPostprocessing = 0; };
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
A00000000000000000000001 = {
isa = PBXGroup;
children = (
A00000000000000000000002 /* IPAControl */,
A00000000000000000000003 /* Products */,
);
sourceTree = "<group>";
};
A00000000000000000000002 /* IPAControl */ = {
isa = PBXGroup;
children = (
A00000000000000000000011 /* IPAControlApp.swift */,
A00000000000000000000012 /* ContentView.swift */,
A00000000000000000000013 /* Models.swift */,
A00000000000000000000014 /* IPAControlModel.swift */,
);
path = IPAControl;
sourceTree = "<group>";
};
A00000000000000000000003 /* Products */ = {
isa = PBXGroup;
children = (A00000000000000000000010 /* IPAControl.app */,);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
A00000000000000000000040 /* IPAControl */ = {
isa = PBXNativeTarget;
buildConfigurationList = A00000000000000000000051 /* Build configuration list for PBXNativeTarget "IPAControl" */;
buildPhases = (
A00000000000000000000032 /* Sources */,
A00000000000000000000031 /* Frameworks */,
A00000000000000000000033 /* Resources */,
);
buildRules = ();
dependencies = ();
name = IPAControl;
productName = IPAControl;
productReference = A00000000000000000000010 /* IPAControl.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
A00000000000000000000041 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastUpgradeCheck = 1600;
TargetAttributes = {A00000000000000000000040 = {CreatedOnToolsVersion = 16.0; }; };
};
buildConfigurationList = A00000000000000000000050 /* Build configuration list for PBXProject */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (en, Base,);
mainGroup = A00000000000000000000001;
productRefGroup = A00000000000000000000003 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (A00000000000000000000040 /* IPAControl */,);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
A00000000000000000000033 /* Resources */ = {isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = (); runOnlyForDeploymentPostprocessing = 0; };
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
A00000000000000000000032 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A00000000000000000000021 /* IPAControlApp.swift in Sources */,
A00000000000000000000022 /* ContentView.swift in Sources */,
A00000000000000000000023 /* Models.swift in Sources */,
A00000000000000000000024 /* IPAControlModel.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
A00000000000000000000061 /* Debug */ = {isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu17; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ("DEBUG=1", "$(inherited)",); IPHONEOS_DEPLOYMENT_TARGET = 17.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; };
A00000000000000000000062 /* Release */ = {isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu17; IPHONEOS_DEPLOYMENT_TARGET = 17.0; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; }; name = Release; };
A00000000000000000000063 /* Debug */ = {isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = "IPA Control"; INFOPLIST_KEY_UILaunchScreen_Generation = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ("$(inherited)", "@executable_path/Frameworks",); MARKETING_VERSION = 0.1.0; PRODUCT_BUNDLE_IDENTIFIER = cz.caseycz.ipacontrol; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Debug; };
A00000000000000000000064 /* Release */ = {isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = "IPA Control"; INFOPLIST_KEY_UILaunchScreen_Generation = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ("$(inherited)", "@executable_path/Frameworks",); MARKETING_VERSION = 0.1.0; PRODUCT_BUNDLE_IDENTIFIER = cz.caseycz.ipacontrol; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Release; };
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
A00000000000000000000050 /* Build configuration list for PBXProject */ = {isa = XCConfigurationList; buildConfigurations = (A00000000000000000000061 /* Debug */, A00000000000000000000062 /* Release */,); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; };
A00000000000000000000051 /* Build configuration list for PBXNativeTarget "IPAControl" */ = {isa = XCConfigurationList; buildConfigurations = (A00000000000000000000063 /* Debug */, A00000000000000000000064 /* Release */,); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; };
/* End XCConfigurationList section */
};
rootObject = A00000000000000000000041 /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme LastUpgradeVersion="1600" version="1.3">
<BuildAction parallelizeBuildables="YES" buildImplicitDependencies="YES">
<BuildActionEntries>
<BuildActionEntry buildForTesting="YES" buildForRunning="YES" buildForProfiling="YES" buildForArchiving="YES" buildForAnalyzing="YES">
<BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="A00000000000000000000040" BuildableName="IPAControl.app" BlueprintName="IPAControl" ReferencedContainer="container:IPAControl.xcodeproj" />
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv="YES">
<Testables />
</TestAction>
<LaunchAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" launchStyle="0" useCustomWorkingDirectory="NO" ignoresPersistentStateOnLaunch="NO" debugDocumentVersioning="YES" debugServiceExtension="internal" allowLocationSimulation="YES">
<BuildableProductRunnable runnableDebuggingMode="0">
<BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="A00000000000000000000040" BuildableName="IPAControl.app" BlueprintName="IPAControl" ReferencedContainer="container:IPAControl.xcodeproj" />
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction buildConfiguration="Release" shouldUseLaunchSchemeArgsEnv="YES" savedToolIdentifier="" useCustomWorkingDirectory="NO" debugDocumentVersioning="YES">
<BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="A00000000000000000000040" BuildableName="IPAControl.app" BlueprintName="IPAControl" ReferencedContainer="container:IPAControl.xcodeproj" /></BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction buildConfiguration="Debug" />
<ArchiveAction buildConfiguration="Release" revealArchiveInOrganizer="YES" />
</Scheme>
209 changes: 209 additions & 0 deletions apps/IPA-Control/IPAControl/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
import SwiftUI

struct ContentView: View {
var body: some View {
TabView {
MyAppsView()
.tabItem { Label("Moje aplikace", systemImage: "square.stack.3d.up") }
SourcesView()
.tabItem { Label("Zdroje", systemImage: "square.grid.2x2") }
SettingsView()
.tabItem { Label("Nastavení", systemImage: "gearshape") }
}
.tint(.indigo)
}
}

private struct MyAppsView: View {
var body: some View {
NavigationStack {
List {
Section {
ContentUnavailableView(
"Zatím žádné spravované aplikace",
systemImage: "app.badge.checkmark",
description: Text("Seznam bude dostupný po propojení podpisové a instalační služby. iOS běžným aplikacím nedovoluje zjistit úplný seznam nainstalovaných aplikací.")
)
}
Section("Bezplatný Apple účet") {
LabeledContent("Současně aktivní aplikace", value: "max. 3")
LabeledContent("Registrovaná App ID", value: "max. 10 / 7 dní")
LabeledContent("Platnost profilu", value: "7 dní")
}
Section {
Label("Obnovení podpisu bude dostupné po připojení serveru a ověření párování iPhonu.", systemImage: "info.circle")
.font(.footnote)
.foregroundStyle(.secondary)
}
}
.navigationTitle("IPA Control")
}
}
}

private struct SourcesView: View {
@EnvironmentObject private var model: IPAControlModel
@State private var showingAddSource = false
@State private var sourceURL = ""
@State private var errorMessage: String?
@State private var adding = false

var body: some View {
NavigationStack {
List {
Section("Moje zdroje") {
if model.sources.isEmpty {
Text("Zatím nemáš žádný zdroj. Přidej adresu JSON ve formátu AltStore Classic.")
.foregroundStyle(.secondary)
}
ForEach(model.sources) { source in
VStack(alignment: .leading, spacing: 4) {
Text(source.name).font(.headline)
Text(source.url.absoluteString)
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(2)
}
}
.onDelete { offsets in
let removed = offsets.map { model.sources[$0] }
for source in removed { model.removeSource(source) }
}
}
Section("Katalog") {
if model.catalog.isEmpty {
Text("Přidané aplikace se zobrazí po načtení JSON zdrojů.")
.foregroundStyle(.secondary)
}
ForEach(model.catalog) { item in
VStack(alignment: .leading, spacing: 4) {
Text(item.app.name).font(.headline)
HStack {
Text(item.sourceName)
if let version = item.app.latestVersion {
Text("· v\(version.version)")
}
}
.font(.caption)
.foregroundStyle(.secondary)
Text(item.app.bundleIdentifier)
.font(.caption2)
.foregroundStyle(.tertiary)
.textSelection(.enabled)
}
.padding(.vertical, 3)
}
}
}
.navigationTitle("Zdroje")
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button { showingAddSource = true } label: { Image(systemName: "plus") }
}
ToolbarItem(placement: .topBarLeading) {
Button {
Task { await refresh() }
} label: {
if model.isLoading { ProgressView() }
else { Image(systemName: "arrow.clockwise") }
}
.disabled(model.isLoading)
}
}
.task { await refresh() }
.alert("Chyba", isPresented: Binding(
get: { errorMessage != nil },
set: { if !$0 { errorMessage = nil } }
)) { Button("OK", role: .cancel) {} } message: { Text(errorMessage ?? "") }
.sheet(isPresented: $showingAddSource) {
NavigationStack {
Form {
Section("Adresa JSON") {
TextField("https://example.com/source.json", text: $sourceURL)
.textInputAutocapitalization(.never)
.keyboardType(.URL)
.autocorrectionDisabled()
}
Section {
Text("Podporujeme HTTPS zdroje kompatibilní s AltStore Classic.")
.font(.footnote)
.foregroundStyle(.secondary)
}
}
.navigationTitle("Přidat zdroj")
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Zrušit") { showingAddSource = false }
}
ToolbarItem(placement: .confirmationAction) {
Button(adding ? "Načítám…" : "Přidat") {
adding = true
Task {
do {
try await model.addSource(sourceURL)
sourceURL = ""
showingAddSource = false
} catch {
errorMessage = error.localizedDescription
}
adding = false
}
}
.disabled(adding || sourceURL.isEmpty)
}
}
}
}
}
}

private func refresh() async {
do { try await model.refreshSources() }
catch { errorMessage = error.localizedDescription }
}
}

private struct SettingsView: View {
@EnvironmentObject private var model: IPAControlModel
@State private var errorMessage: String?
@State private var testing = false

var body: some View {
NavigationStack {
Form {
Section("Náš server") {
TextField("https://server.example.com", text: $model.serverURLString)
.textInputAutocapitalization(.never)
.keyboardType(.URL)
.autocorrectionDisabled()
LabeledContent("Stav", value: model.serverStatus)
Button(testing ? "Ověřuji…" : "Ověřit připojení") {
testing = true
Task {
do { try await model.checkServer() }
catch { errorMessage = error.localizedDescription }
testing = false
}
}
.disabled(testing)
}
Section("Budoucí funkce") {
Label("Podepisování IPA", systemImage: "signature")
Label("Obnovení profilů", systemImage: "arrow.clockwise.circle")
Label("Párování iPhonu", systemImage: "iphone.gen3")
}
Section("O aplikaci") {
LabeledContent("Verze", value: "0.1.0")
Text("První testovací klient. V této verzi neprobíhá instalace ani podepisování aplikací.")
.font(.footnote)
.foregroundStyle(.secondary)
}
}
.navigationTitle("Nastavení")
.alert("Chyba", isPresented: Binding(
get: { errorMessage != nil },
set: { if !$0 { errorMessage = nil } }
)) { Button("OK", role: .cancel) {} } message: { Text(errorMessage ?? "") }
}
}
}
13 changes: 13 additions & 0 deletions apps/IPA-Control/IPAControl/IPAControlApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import SwiftUI

@main
struct IPAControlApp: App {
@StateObject private var model = IPAControlModel()

var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(model)
}
}
}
Loading