Skip to content

Commit ffd9fdb

Browse files
committed
Remote and local trackers lists #345
1 parent 1ad5c18 commit ffd9fdb

File tree

19 files changed

+1207
-44
lines changed

19 files changed

+1207
-44
lines changed

.github/workflows/ios-debug.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: "Build iOS app"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build_with_signing:
11+
runs-on: macos-14
12+
steps:
13+
- uses: maxim-lobanov/setup-xcode@v1
14+
with:
15+
xcode-version: 16.0
16+
17+
- name: checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Prepare Brew
23+
run: brew install boost
24+
25+
- name: Prepare LibTorrent
26+
run: ./Submodules/LibTorrent-Swift/make.sh
27+
28+
- name: Install the Apple certificate and provisioning profile
29+
env:
30+
FIREBASE_INFO_PLIST_BASE64: ${{ secrets.FIREBASE_INFO_PLIST_BASE64 }}
31+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
32+
BUILD_CERTIFICATE_PASSWORD: ${{ secrets.BUILD_CERTIFICATE_PASSWORD }}
33+
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
34+
BUILD_PROVISION_PROFILE_PROD_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_PROD_BASE64 }}
35+
BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_BASE64 }}
36+
BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_PROD_BASE64: ${{ secrets.BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_PROD_BASE64 }}
37+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
38+
run: |
39+
# create variables
40+
FIREBASE_INFO_PLIST_PATH=iTorrent/Core/Assets/GoogleService-Info.plist
41+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
42+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
43+
PP_PROD_PATH=$RUNNER_TEMP/build_pp_prod.mobileprovision
44+
PW_PP_PATH=$RUNNER_TEMP/build_progresswidget_pp.mobileprovision
45+
PW_PP_PROD_PATH=$RUNNER_TEMP/build_progresswidget_pp_prod.mobileprovision
46+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
47+
48+
# import firebase plist to the project
49+
echo -n "$FIREBASE_INFO_PLIST_BASE64" | base64 --decode -o $FIREBASE_INFO_PLIST_PATH
50+
51+
# import certificate and provisioning profile from secrets
52+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
53+
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
54+
echo -n "$BUILD_PROVISION_PROFILE_PROD_BASE64" | base64 --decode -o $PP_PROD_PATH
55+
echo -n "$BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_BASE64" | base64 --decode -o $PW_PP_PATH
56+
echo -n "$BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_PROD_BASE64" | base64 --decode -o $PW_PP_PROD_PATH
57+
58+
# create temporary keychain
59+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
60+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
61+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
62+
63+
# import certificate to keychain
64+
security import $CERTIFICATE_PATH -P "$BUILD_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
65+
security list-keychain -d user -s $KEYCHAIN_PATH
66+
67+
# apply provisioning profile
68+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
69+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
70+
cp $PP_PROD_PATH ~/Library/MobileDevice/Provisioning\ Profiles
71+
cp $PW_PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
72+
cp $PW_PP_PROD_PATH ~/Library/MobileDevice/Provisioning\ Profiles
73+
74+
- name: build archive
75+
run: |
76+
xcodebuild \
77+
-workspace iTorrent.xcworkspace \
78+
-scheme "iTorrent" \
79+
-archivePath $RUNNER_TEMP/itorrent.xcarchive \
80+
-sdk iphoneos \
81+
-configuration Release \
82+
-destination generic/platform=iOS \
83+
clean archive
84+
85+
- name: Upload archive
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: itorrent.xcarchive
89+
path: |
90+
${{ runner.temp }}/itorrent.xcarchive
91+
92+
export_ipa:
93+
needs: [build_with_signing]
94+
runs-on: macos-14
95+
strategy:
96+
matrix:
97+
org: [adhoc, prod]
98+
include:
99+
- org: adhoc
100+
export_options_plist_secret: EXPORT_OPTIONS_PLIST
101+
- org: prod
102+
export_options_plist_secret: EXPORT_PROD_OPTIONS_PLIST
103+
steps:
104+
- uses: maxim-lobanov/setup-xcode@v1
105+
with:
106+
xcode-version: 16.0
107+
108+
- name: Download artifacts
109+
uses: actions/download-artifact@v4
110+
111+
- name: Install the Apple certificate and provisioning profile
112+
env:
113+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
114+
BUILD_CERTIFICATE_PASSWORD: ${{ secrets.BUILD_CERTIFICATE_PASSWORD }}
115+
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
116+
BUILD_PROVISION_PROFILE_PROD_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_PROD_BASE64 }}
117+
BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_BASE64 }}
118+
BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_PROD_BASE64: ${{ secrets.BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_PROD_BASE64 }}
119+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
120+
run: |
121+
# create variables
122+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
123+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
124+
PP_PROD_PATH=$RUNNER_TEMP/build_pp_prod.mobileprovision
125+
PW_PP_PATH=$RUNNER_TEMP/build_progresswidget_pp.mobileprovision
126+
PW_PP_PROD_PATH=$RUNNER_TEMP/build_progresswidget_pp_prod.mobileprovision
127+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
128+
129+
# import certificate and provisioning profile from secrets
130+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
131+
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
132+
echo -n "$BUILD_PROVISION_PROFILE_PROD_BASE64" | base64 --decode -o $PP_PROD_PATH
133+
echo -n "$BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_BASE64" | base64 --decode -o $PW_PP_PATH
134+
echo -n "$BUILD_PROGRESS_WIDGET_PROVISION_PROFILE_PROD_BASE64" | base64 --decode -o $PW_PP_PROD_PATH
135+
136+
# create temporary keychain
137+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
138+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
139+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
140+
141+
# import certificate to keychain
142+
security import $CERTIFICATE_PATH -P "$BUILD_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
143+
security list-keychain -d user -s $KEYCHAIN_PATH
144+
145+
# apply provisioning profile
146+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
147+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
148+
cp $PP_PROD_PATH ~/Library/MobileDevice/Provisioning\ Profiles
149+
cp $PW_PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
150+
cp $PW_PP_PROD_PATH ~/Library/MobileDevice/Provisioning\ Profiles
151+
152+
- name: Export ipa
153+
env:
154+
EXPORT_OPTIONS_PLIST: ${{ secrets[matrix.export_options_plist_secret] }}
155+
run: |
156+
EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
157+
echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH
158+
xcodebuild -exportArchive -archivePath itorrent.xcarchive -exportOptionsPlist $EXPORT_OPTS_PATH -exportPath $RUNNER_TEMP/build
159+
160+
- name: Move dSYMs
161+
run: mv itorrent.xcarchive/dSYMs $RUNNER_TEMP/dSYMs
162+
163+
- name: Upload application
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: app-Release-${{ matrix.org }}
167+
path: |
168+
${{ runner.temp }}/build/iTorrent.ipa
169+
${{ runner.temp }}/build/manifest.plist
170+
${{ runner.temp }}/dSYMs

.github/workflows/ios.yml renamed to .github/workflows/ios-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: maxim-lobanov/setup-xcode@v1
1717
with:
18-
xcode-version: 15.4
18+
xcode-version: 16.0
1919

2020
- name: checkout repository
2121
uses: actions/checkout@v4
@@ -114,7 +114,7 @@ jobs:
114114
steps:
115115
- uses: maxim-lobanov/setup-xcode@v1
116116
with:
117-
xcode-version: 15.4
117+
xcode-version: 16.0
118118

119119
- name: Download artifacts
120120
uses: actions/download-artifact@v4
@@ -190,7 +190,7 @@ jobs:
190190

191191
- uses: maxim-lobanov/setup-xcode@v1
192192
with:
193-
xcode-version: 15.4
193+
xcode-version: 16.0
194194

195195
- name: Download artifacts
196196
uses: actions/download-artifact@v4
@@ -224,7 +224,7 @@ jobs:
224224
steps:
225225
- uses: maxim-lobanov/setup-xcode@v1
226226
with:
227-
xcode-version: 15.4
227+
xcode-version: 16.0
228228

229229
- name: Checkout repository
230230
uses: actions/checkout@v4
@@ -259,7 +259,7 @@ jobs:
259259
steps:
260260
- uses: maxim-lobanov/setup-xcode@v1
261261
with:
262-
xcode-version: 15.4
262+
xcode-version: 16.0
263263

264264
- name: Download artifacts
265265
uses: actions/download-artifact@v4

ProgressWidget/ProgressWidgetLiveActivity.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,9 @@ struct ProgressWidgetLiveActivity: Widget {
3838
// Lock screen/banner UI goes here
3939

4040
if #available(iOS 18, *) {
41-
#if XCODE16
4241
ProgressWidgetLiveActivityWatchSupportContent(context: context)
4342
.tint(Color(uiColor: context.tintColor))
4443
.padding()
45-
#else
46-
ProgressWidgetLiveActivityContent(context: context)
47-
.tint(Color(uiColor: context.tintColor))
48-
.padding()
49-
#endif
50-
5144
} else {
5245
ProgressWidgetLiveActivityContent(context: context)
5346
.tint(Color(uiColor: context.tintColor))
@@ -105,18 +98,13 @@ struct ProgressWidgetLiveActivity: Widget {
10598
}
10699

107100
if #available(iOS 18.0, *) {
108-
#if XCODE16
109101
return config.supplementalActivityFamilies([.small])
110-
#else
111-
return config
112-
#endif
113102
} else {
114103
return config
115104
}
116105
}
117106
}
118107

119-
#if XCODE16
120108
@available(iOS 18.0, *)
121109
struct ProgressWidgetLiveActivityWatchSupportContent: View {
122110
@Environment(\.activityFamily) var activityFamily
@@ -180,7 +168,6 @@ struct ProgressWidgetLiveActivityWatchSupportContent: View {
180168
}
181169
}
182170
}
183-
#endif
184171

185172
struct ProgressWidgetLiveActivityContent: View {
186173
@State var context: ActivityViewContext<ProgressWidgetAttributes>

iTorrent.xcodeproj/project.pbxproj

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
D1B99D932BEE631B00F51514 /* Benefit.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B99D8F2BEE631B00F51514 /* Benefit.swift */; };
187187
D1B99D942BEE631B00F51514 /* Tier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B99D902BEE631B00F51514 /* Tier.swift */; };
188188
D1B99D962BEE657F00F51514 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B99D952BEE657F00F51514 /* API.swift */; };
189+
D1BB073B2C98524B00981D5F /* TrackersListService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BB073A2C98524A00981D5F /* TrackersListService.swift */; };
190+
D1BB07432C985EB800981D5F /* TrackersListPreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BB07422C985EAE00981D5F /* TrackersListPreferencesView.swift */; };
191+
D1BB07452C9869C300981D5F /* TrackersListDetailsPreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BB07442C9869B900981D5F /* TrackersListDetailsPreferencesView.swift */; };
189192
D1CAB8852AF3B51E00EB6AFF /* ToggleCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1CAB8842AF3B51E00EB6AFF /* ToggleCellView.swift */; };
190193
D1CAB8872AF3B52E00EB6AFF /* ToggleCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1CAB8862AF3B52E00EB6AFF /* ToggleCellViewModel.swift */; };
191194
D1D1279B2BC7CA7600C04533 /* SwiftUILayoutGuides.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D1279A2BC7CA7600C04533 /* SwiftUILayoutGuides.swift */; };
@@ -418,6 +421,9 @@
418421
D1B99D8F2BEE631B00F51514 /* Benefit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Benefit.swift; sourceTree = "<group>"; };
419422
D1B99D902BEE631B00F51514 /* Tier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tier.swift; sourceTree = "<group>"; };
420423
D1B99D952BEE657F00F51514 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = "<group>"; };
424+
D1BB073A2C98524A00981D5F /* TrackersListService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackersListService.swift; sourceTree = "<group>"; };
425+
D1BB07422C985EAE00981D5F /* TrackersListPreferencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackersListPreferencesView.swift; sourceTree = "<group>"; };
426+
D1BB07442C9869B900981D5F /* TrackersListDetailsPreferencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackersListDetailsPreferencesView.swift; sourceTree = "<group>"; };
421427
D1CAB8842AF3B51E00EB6AFF /* ToggleCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleCellView.swift; sourceTree = "<group>"; };
422428
D1CAB8862AF3B52E00EB6AFF /* ToggleCellViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleCellViewModel.swift; sourceTree = "<group>"; };
423429
D1D1279A2BC7CA7600C04533 /* SwiftUILayoutGuides.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUILayoutGuides.swift; sourceTree = "<group>"; };
@@ -793,6 +799,7 @@
793799
D111384C2AF9663F008907F7 /* Preferences */ = {
794800
isa = PBXGroup;
795801
children = (
802+
D1BB07412C985E9700981D5F /* TrackersList */,
796803
7C95B7A32C34B554000EC50F /* Storage */,
797804
D1DB718E2BD92206007F9267 /* Patreon */,
798805
7CB6F6CC2BD82B8A00D0813B /* FileSharing */,
@@ -1118,6 +1125,7 @@
11181125
D1A226F02AEF018500669D6D /* Services */ = {
11191126
isa = PBXGroup;
11201127
children = (
1128+
D1BB07392C98522D00981D5F /* TrackersListService */,
11211129
7C1C08AE2C31FEF700569B45 /* IntentsService */,
11221130
7C3142D42C31ED4600397E82 /* LiveActivityService */,
11231131
D1B99D842BEE5E4100F51514 /* Patreon */,
@@ -1256,6 +1264,23 @@
12561264
path = Models;
12571265
sourceTree = "<group>";
12581266
};
1267+
D1BB07392C98522D00981D5F /* TrackersListService */ = {
1268+
isa = PBXGroup;
1269+
children = (
1270+
D1BB073A2C98524A00981D5F /* TrackersListService.swift */,
1271+
);
1272+
path = TrackersListService;
1273+
sourceTree = "<group>";
1274+
};
1275+
D1BB07412C985E9700981D5F /* TrackersList */ = {
1276+
isa = PBXGroup;
1277+
children = (
1278+
D1BB07442C9869B900981D5F /* TrackersListDetailsPreferencesView.swift */,
1279+
D1BB07422C985EAE00981D5F /* TrackersListPreferencesView.swift */,
1280+
);
1281+
path = TrackersList;
1282+
sourceTree = "<group>";
1283+
};
12591284
D1CAB8832AF3B50C00EB6AFF /* ToggleCell */ = {
12601285
isa = PBXGroup;
12611286
children = (
@@ -1539,6 +1564,7 @@
15391564
D11138552AF97511008907F7 /* TorrentAddFileItemViewModel.swift in Sources */,
15401565
D11333B52AF19C4900FA017E /* TorrentHandle+Extension.swift in Sources */,
15411566
D19E00202AEFFA1B000A17A2 /* DetailCellView.swift in Sources */,
1567+
D1BB07452C9869C300981D5F /* TrackersListDetailsPreferencesView.swift in Sources */,
15421568
D1ACFDC62AF6DB9F0098FF56 /* TorrentFilesFileListCell.swift in Sources */,
15431569
D1A227072AEF0B2C00669D6D /* TorrentListItem.swift in Sources */,
15441570
D111384B2AF965F1008907F7 /* TorrentAddViewModel.swift in Sources */,
@@ -1602,6 +1628,7 @@
16021628
7CFEBE7C2BC4318E0013233F /* RssChannelViewController.swift in Sources */,
16031629
7C5FBE2C2BBDD6B40069E5A0 /* UIView+LayerColors.swift in Sources */,
16041630
7C4ED08D2BE646E40034B62C /* AdView+Meta.swift in Sources */,
1631+
D1BB07432C985EB800981D5F /* TrackersListPreferencesView.swift in Sources */,
16051632
D1B538572AF1171900694AFD /* TorrentDetailProgressCellView.swift in Sources */,
16061633
7C5FBE742BC2F0A30069E5A0 /* MvvmViewModelProtocol+Alert.swift in Sources */,
16071634
D1EFCD122AF572E400D33A7A /* TorrentFilesFileItemViewModel.swift in Sources */,
@@ -1672,6 +1699,7 @@
16721699
D1DB71802BD6773E007F9267 /* RssSearchViewModel.swift in Sources */,
16731700
D17733EE2BBC2C5F006FC81A /* ProxyPreferencesViewModel.swift in Sources */,
16741701
7CF6DA3E2C0F9DC40033D03F /* LiveActivityService.swift in Sources */,
1702+
D1BB073B2C98524B00981D5F /* TrackersListService.swift in Sources */,
16751703
7C4ED0982BEF8B8E0034B62C /* PatreonCredentials.swift in Sources */,
16761704
D173D9E12BC0286800E4F9EB /* UIMenu+Priority.swift in Sources */,
16771705
D1AA00CE2AFA8B1000B74629 /* PreferencesStorage.swift in Sources */,
@@ -1744,6 +1772,7 @@
17441772
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "iTorrent2 ProgressWidget Dev";
17451773
SKIP_INSTALL = YES;
17461774
SUPPORTS_MACCATALYST = YES;
1775+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$inherited XCODE16";
17471776
SWIFT_EMIT_LOC_STRINGS = YES;
17481777
TARGETED_DEVICE_FAMILY = "1,2";
17491778
};
@@ -1891,6 +1920,7 @@
18911920
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "iTorrent2 ProgressWidget Dev";
18921921
SKIP_INSTALL = YES;
18931922
SUPPORTS_MACCATALYST = YES;
1923+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$inherited XCODE16";
18941924
SWIFT_EMIT_LOC_STRINGS = YES;
18951925
TARGETED_DEVICE_FAMILY = "1,2";
18961926
};
@@ -2033,6 +2063,7 @@
20332063
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "iTorrent2 ProgressWidget Distrib";
20342064
SKIP_INSTALL = YES;
20352065
SUPPORTS_MACCATALYST = YES;
2066+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$inherited XCODE16";
20362067
SWIFT_EMIT_LOC_STRINGS = YES;
20372068
TARGETED_DEVICE_FAMILY = "1,2";
20382069
};

0 commit comments

Comments
 (0)