Skip to content

Commit 0f3ef00

Browse files
committed
feat: added ondevice anisette data generation
1 parent 63228a5 commit 0f3ef00

7 files changed

Lines changed: 757 additions & 2 deletions

File tree

AltStore.xcodeproj/project.pbxproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
A809CCB53033E85E005DF922 /* AnisetteKit in Frameworks */ = {isa = PBXBuildFile; productRef = A809CCB43033E85E005DF922 /* AnisetteKit */; };
1011
A84596F62F7DC4C90000B8CD /* SideStore.conf in Resources */ = {isa = PBXBuildFile; fileRef = A84596F52F7DC4C90000B8CD /* SideStore.conf */; };
1112
A8C37026302DA7BA0010213A /* Minimuxer in Frameworks */ = {isa = PBXBuildFile; productRef = A8C37025302DA7BA0010213A /* Minimuxer */; };
1213
A8C37029302DA7F30010213A /* MarkdownKit in Frameworks */ = {isa = PBXBuildFile; productRef = A8C37028302DA7F30010213A /* MarkdownKit */; };
@@ -165,6 +166,7 @@
165166
isa = PBXFrameworksBuildPhase;
166167
buildActionMask = 2147483647;
167168
files = (
169+
A809CCB53033E85E005DF922 /* AnisetteKit in Frameworks */,
168170
A8C37026302DA7BA0010213A /* Minimuxer in Frameworks */,
169171
A8C37029302DA7F30010213A /* MarkdownKit in Frameworks */,
170172
A8C3702C302DA80D0010213A /* KeychainAccess in Frameworks */,
@@ -284,6 +286,7 @@
284286
A8C37034302DA84D0010213A /* Starscream */,
285287
A8C37038302DA8D90010213A /* SemanticVersion */,
286288
A8C38DEB302DB4E40010213A /* AltSign-Dynamic */,
289+
A809CCB43033E85E005DF922 /* AnisetteKit */,
287290
);
288291
productName = AltStore;
289292
productReference = BFD2476A2284B9A500981D42 /* SideStore.app */;
@@ -338,6 +341,7 @@
338341
A8C3702D302DA82A0010213A /* XCRemoteSwiftPackageReference "Nuke" */,
339342
A8C37033302DA84D0010213A /* XCRemoteSwiftPackageReference "Starscream" */,
340343
A8C37037302DA8D90010213A /* XCRemoteSwiftPackageReference "SemanticVersion" */,
344+
A809CCB33033E85E005DF922 /* XCRemoteSwiftPackageReference "AnisetteKit" */,
341345
);
342346
productRefGroup = BFD2476B2284B9A500981D42 /* Products */;
343347
projectDirPath = "";
@@ -857,6 +861,14 @@
857861
/* End XCLocalSwiftPackageReference section */
858862

859863
/* Begin XCRemoteSwiftPackageReference section */
864+
A809CCB33033E85E005DF922 /* XCRemoteSwiftPackageReference "AnisetteKit" */ = {
865+
isa = XCRemoteSwiftPackageReference;
866+
repositoryURL = "https://github.com/mahee96/AnisetteKit";
867+
requirement = {
868+
branch = main;
869+
kind = branch;
870+
};
871+
};
860872
A8C37027302DA7F30010213A /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {
861873
isa = XCRemoteSwiftPackageReference;
862874
repositoryURL = "https://github.com/bmoliveira/MarkdownKit.git";
@@ -900,6 +912,11 @@
900912
/* End XCRemoteSwiftPackageReference section */
901913

902914
/* Begin XCSwiftPackageProductDependency section */
915+
A809CCB43033E85E005DF922 /* AnisetteKit */ = {
916+
isa = XCSwiftPackageProductDependency;
917+
package = A809CCB33033E85E005DF922 /* XCRemoteSwiftPackageReference "AnisetteKit" */;
918+
productName = AnisetteKit;
919+
};
903920
A8C37025302DA7BA0010213A /* Minimuxer */ = {
904921
isa = XCSwiftPackageProductDependency;
905922
productName = Minimuxer;

AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AltStore/Core/Extensions/UserDefaults+AltStore.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ public extension UserDefaults
173173
get { self.bool(forKey: #function) }
174174
set { self.set(newValue, forKey: #function) }
175175
}
176+
@objc var useOnDeviceAnisette: Bool {
177+
get { self.bool(forKey: #function) }
178+
set { self.set(newValue, forKey: #function) }
179+
}
176180

177181
@objc var recreateDatabaseOnNextStart: Bool {
178182
get { self.bool(forKey: #function) }
@@ -363,6 +367,7 @@ public extension UserDefaults
363367
#keyPath(UserDefaults.menuAnisetteURL): "https://ani.sidestore.io",
364368
#keyPath(UserDefaults.isAnisetteOfflineMode): false,
365369
#keyPath(UserDefaults.disableAnisetteRotation): false,
370+
#keyPath(UserDefaults.useOnDeviceAnisette): true,
366371
#keyPath(UserDefaults.useLocalVPN): true,
367372
#keyPath(UserDefaults.enableEMPforWireguard): false,
368373
#keyPath(UserDefaults.skipNonCopyableBackupFiles): true,

AltStore/Settings/AnisetteServerList.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ typealias SUIButton = SwiftUI.Button
1414
// MARK: - AnisetteServerData
1515
struct AnisetteServerData: Codable {
1616
let servers: [Server]
17+
let oda: ODAValue?
18+
19+
enum CodingKeys: String, CodingKey {
20+
case servers
21+
case oda
22+
}
23+
24+
init(servers: [Server], oda: ODAValue? = nil) {
25+
self.servers = servers
26+
self.oda = oda
27+
}
28+
29+
init(from decoder: Decoder) throws {
30+
let container = try decoder.container(keyedBy: CodingKeys.self)
31+
self.servers = (try? container.decode([Server].self, forKey: .servers)) ?? []
32+
self.oda = try? container.decodeIfPresent(ODAValue.self, forKey: .oda)
33+
}
1734
}
1835

1936
// MARK: - Server

0 commit comments

Comments
 (0)