Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit b7f7639

Browse files
authored
Update app to use ProSourceManager package, and test source loading
1 parent 482ed4a commit b7f7639

File tree

5 files changed

+90
-11
lines changed

5 files changed

+90
-11
lines changed

.github/workflows/build-unsigned-ipa.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ jobs:
9595
echo "project.pbxproj header (first 60 lines):"
9696
sed -n '1,60p' prostore.xcodeproj/project.pbxproj || true
9797
98+
- name: Resolve Swift Package dependencies
99+
run: |
100+
set -e
101+
echo "Resolving Swift package dependencies for prostore..."
102+
xcodebuild -resolvePackageDependencies -project prostore.xcodeproj -scheme prostore -configuration Release
103+
98104
- name: Try building archive, auto-fix objectVersion on future-format error
99105
run: |
100106
set -e

Sources/prostore/ContentView.swift

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import SwiftUI
2+
3+
struct ContentView: View {
4+
@StateObject private var vm = SourceViewModel()
5+
6+
// Replace these with your real source URLs
7+
private let urls: [URL] = [
8+
URL(string: "https://repository.apptesters.org")!,
9+
URL(string: "https://quarksources.github.io/altstore-complete.json")!
10+
]
11+
12+
var body: some View {
13+
NavigationView {
14+
Group {
15+
if vm.isLoading && vm.outputs.isEmpty {
16+
VStack {
17+
ProgressView()
18+
Text("Fetching sources...")
19+
.font(.caption)
20+
}
21+
} else {
22+
List {
23+
ForEach(vm.outputs, id: \.0) { item in
24+
Section(header: Text(item.0.absoluteString).font(.caption)) {
25+
switch item.1 {
26+
case .success(let prettyJSON):
27+
// Show JSON in a scrollable monospace block
28+
ScrollView(.horizontal) {
29+
Text(prettyJSON)
30+
.font(.system(.body, design: .monospaced))
31+
.textSelection(.enabled)
32+
.padding(.vertical, 6)
33+
}
34+
.frame(maxHeight: 300)
35+
case .failure(let err):
36+
Text("Error: \(err.localizedDescription)")
37+
.foregroundColor(.red)
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}
44+
.navigationTitle("Sources")
45+
.toolbar {
46+
Button("Reload") {
47+
Task {
48+
await vm.load(urls: urls)
49+
}
50+
}
51+
}
52+
.task {
53+
// Load automatically when view appears
54+
await vm.load(urls: urls)
55+
}
56+
}
57+
}
58+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Foundation
2+
import Combine
3+
import ProSourceManager
4+
5+
@MainActor
6+
final class SourceViewModel: ObservableObject {
7+
@Published var outputs: [(URL, Result<String, Error>)] = []
8+
@Published var isLoading: Bool = false
9+
10+
func load(urls: [URL]) async {
11+
isLoading = true
12+
let results = await ProSourceManager.fetchJSONStrings(from: urls)
13+
self.outputs = results
14+
isLoading = false
15+
}
16+
}

Sources/prostore/prostore.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import SwiftUI
22

33
@main
4-
struct ProStoreApp: App {
4+
struct ProStore: App {
55
var body: some Scene {
66
WindowGroup {
7-
EmptyView()
7+
ContentView()
88
}
99
}
1010
}

project.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
name: prostore
2-
3-
options:
4-
bundleIdPrefix: com.prostoreios
5-
6-
configs:
7-
Debug: debug
8-
Release: release
1+
packages:
2+
ProSourceManager:
3+
url: https://github.com/ProStore-iOS/ProSourceManager.git
4+
branch: main
95

106
targets:
117
prostore:
@@ -27,4 +23,7 @@ targets:
2723
UILaunchStoryboardName: "LaunchScreen"
2824
NSPrincipalClass: "UIApplication"
2925
NSAppTransportSecurity:
30-
NSAllowsArbitraryLoads: true
26+
NSAllowsArbitraryLoads: true
27+
dependencies:
28+
- package: ProSourceManager
29+
product: ProSourceManager

0 commit comments

Comments
 (0)