Merge remote-tracking branch 'refs/remotes/upstream/develop'

Conflicts:
	AltStore.xcodeproj/project.pbxproj
	AltStore/AppDelegate.swift
This commit is contained in:
Nythepegasus
2022-08-19 01:14:16 -04:00
8 changed files with 312 additions and 98 deletions

View File

@@ -21,7 +21,7 @@
@interface AKDevice
+ (AKDevice *)currentDevice;
- (NSString *)uniqueDeviceIdentifier;
- (NSString *)serialNumber;
- (nullable NSString *)serialNumber;
- (NSString *)serverFriendlyDescription;
@end
@@ -83,7 +83,7 @@
localUserID:headers[@"X-Apple-I-MD-LU"]
routingInfo:[headers[@"X-Apple-I-MD-RINFO"] longLongValue]
deviceUniqueIdentifier:device.uniqueDeviceIdentifier
deviceSerialNumber:device.serialNumber
deviceSerialNumber:device.serialNumber ?: @"C02LKHBBFD57" // serialNumber can be nil, so provide valid fallback serial number.
deviceDescription:device.serverFriendlyDescription
date:date
locale:[NSLocale currentLocale]

View File

@@ -348,9 +348,11 @@
BFF7C90F257844C900E55F36 /* AltXPC.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = BFF7C904257844C900E55F36 /* AltXPC.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
BFF7C920257844FA00E55F36 /* ALTPluginService.m in Sources */ = {isa = PBXBuildFile; fileRef = BF5C5FCE237DF69100EDD0C6 /* ALTPluginService.m */; };
BFF7C9342578492100E55F36 /* ALTAnisetteData.m in Sources */ = {isa = PBXBuildFile; fileRef = BFB49AA823834CF900D542D9 /* ALTAnisetteData.m */; };
D504F42628AD72C50014BB5D /* ProgressRing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D504F42528AD72C50014BB5D /* ProgressRing.swift */; };
D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8B62727841800A9B5DD /* libAppleArchive.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
D533E8BC2727BBEE00A9B5DD /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8BB2727BBEE00A9B5DD /* libfragmentzip.a */; };
D533E8BE2727BBF800A9B5DD /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8BD2727BBF800A9B5DD /* libcurl.a */; };
D55E163728776CB700A627A1 /* ComplicationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55E163528776CB000A627A1 /* ComplicationView.swift */; };
D57DF638271E32F000677701 /* PatchApp.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D57DF637271E32F000677701 /* PatchApp.storyboard */; };
D57DF63F271E51E400677701 /* ALTAppPatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = D57DF63E271E51E400677701 /* ALTAppPatcher.m */; };
D57F2C9126E0070200B9FA39 /* EnableJITOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57F2C9026E0070200B9FA39 /* EnableJITOperation.swift */; };
@@ -834,10 +836,12 @@
BFF7C93B257849C600E55F36 /* AltXPC.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AltXPC.entitlements; sourceTree = "<group>"; };
BFF7EC4C25081E9300BDE521 /* AltStore 8.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "AltStore 8.xcdatamodel"; sourceTree = "<group>"; };
BFFCFA45248835530077BFCE /* AltDaemon.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AltDaemon.entitlements; sourceTree = "<group>"; };
D504F42528AD72C50014BB5D /* ProgressRing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressRing.swift; sourceTree = "<group>"; };
D533E8B62727841800A9B5DD /* libAppleArchive.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libAppleArchive.tbd; path = usr/lib/libAppleArchive.tbd; sourceTree = SDKROOT; };
D533E8B82727B61400A9B5DD /* fragmentzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fragmentzip.h; sourceTree = "<group>"; };
D533E8BB2727BBEE00A9B5DD /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = Dependencies/fragmentzip/libfragmentzip.a; sourceTree = SOURCE_ROOT; };
D533E8BD2727BBF800A9B5DD /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = Dependencies/libcurl/libcurl.a; sourceTree = SOURCE_ROOT; };
D55E163528776CB000A627A1 /* ComplicationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComplicationView.swift; sourceTree = "<group>"; };
D57DF637271E32F000677701 /* PatchApp.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = PatchApp.storyboard; sourceTree = "<group>"; };
D57DF63D271E51E400677701 /* ALTAppPatcher.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALTAppPatcher.h; sourceTree = "<group>"; };
D57DF63E271E51E400677701 /* ALTAppPatcher.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALTAppPatcher.m; sourceTree = "<group>"; };
@@ -1417,6 +1421,8 @@
BF98917D250AAC4F002ACF50 /* AltWidget.swift */,
BF42345825101C1D006D1EB2 /* WidgetView.swift */,
BF98917C250AAC4F002ACF50 /* Countdown.swift */,
D55E163528776CB000A627A1 /* ComplicationView.swift */,
D504F42528AD72C50014BB5D /* ProgressRing.swift */,
BF989170250AABF4002ACF50 /* Assets.xcassets */,
BF989172250AABF4002ACF50 /* Info.plist */,
);
@@ -2467,7 +2473,9 @@
files = (
BF98917E250AAC4F002ACF50 /* Countdown.swift in Sources */,
BF42345A25101C35006D1EB2 /* WidgetView.swift in Sources */,
D55E163728776CB700A627A1 /* ComplicationView.swift in Sources */,
BF98917F250AAC4F002ACF50 /* AltWidget.swift in Sources */,
D504F42628AD72C50014BB5D /* ProgressRing.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -33,8 +33,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
private lazy var intentHandler = IntentHandler()
private lazy var viewAppIntentHandler = ViewAppIntentHandler()
@available(iOS 14, *)
private var intentHandler: IntentHandler {
get { _intentHandler as! IntentHandler }
set { _intentHandler = newValue }
}
@available(iOS 14, *)
private var viewAppIntentHandler: ViewAppIntentHandler {
get { _viewAppIntentHandler as! ViewAppIntentHandler }
set { _viewAppIntentHandler = newValue }
}
private lazy var _intentHandler: Any = {
guard #available(iOS 14, *) else { fatalError() }
return IntentHandler()
}()
private lazy var _viewAppIntentHandler: Any = {
guard #available(iOS 14, *) else { fatalError() }
return ViewAppIntentHandler()
}()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
{

View File

@@ -46,9 +46,6 @@ class AppManager
{
static let shared = AppManager()
@available(iOS 13, *)
private(set) lazy var publisher: AppManagerPublisher = AppManagerPublisher()
private(set) var updatePatronsResult: Result<Void, Error>?
private let operationQueue = OperationQueue()
@@ -67,8 +64,27 @@ class AppManager
}
}
@available(iOS 13.0, *)
private lazy var cancellables = Set<AnyCancellable>()
@available(iOS 13, *)
private(set) var publisher: AppManagerPublisher {
get { _publisher as! AppManagerPublisher }
set { _publisher = newValue }
}
@available(iOS 13, *)
private(set) var cancellables: Set<AnyCancellable> {
get { _cancellables as! Set<AnyCancellable> }
set { _cancellables = newValue }
}
private lazy var _publisher: Any = {
guard #available(iOS 13, *) else { fatalError() }
return AppManagerPublisher()
}()
private lazy var _cancellables: Any = {
guard #available(iOS 13, *) else { fatalError() }
return Set<AnyCancellable>()
}()
private init()
{

View File

@@ -7,14 +7,14 @@
"name": "AltStore",
"bundleIdentifier": "com.rileytestut.AltStore",
"developerName": "Riley Testut",
"version": "1.5",
"versionDate": "2022-05-06T08:00:00-07:00",
"versionDescription": "TRUSTED SOURCES\n• Download and update certain third party apps entirely through AltStore\n• Add Trusted Sources directly from the new Sources page\n• Trusted Sources are sources weve explicitly approved that meet our safety standards\n• You can still sideload any .ipa you want via the \"+\" button in My Apps \n• Support for adding any source by URL will be coming later\n\nALTJIT\n• Allows sideloaded apps to use Just-in-Time (JIT) compilation\n• Long-press an app in My Apps, then choose “Enable JIT”\n• JIT will remain enabled until the app is quit\n• Requires iOS 14 or later\n• Requires AltServer 1.5 or later\n\nIMPROVED\n• Adds Shane to credits and Patreon screen\n• Loads “Friend Tier” Patrons much faster on Patreon screen\n\nFIXED\n• Fixed a potential crash when sideloading certain apps\n• Fixed some apps having access to AltStores app group after being (de-)activated\n• Fixed Core Data error when not connected to internet",
"downloadURL": "https://cdn.altstore.io/file/altstore/apps/altstore/1_5.ipa",
"version": "1.5.1",
"versionDate": "2022-07-14T12:00:00-05:00",
"versionDescription": "This update fixes the following issues:\n\n• Using Apple IDs that contain capital letters\n• Using Apple IDs with 2FA enabled without any trusted devices\n• Repeatedly asking some users to sign in every refresh\n• \"Incorrect Apple ID or password\" error after changing Apple ID email address\n• “Application is missing application-identifier” error when sideloading or (de-)activating certain apps\n• Potential crash when receiving unknown error codes from AltServer",
"downloadURL": "https://cdn.altstore.io/file/altstore/apps/altstore/1_5_1.ipa",
"localizedDescription": "AltStore is an alternative app store for non-jailbroken devices. \n\nThis version of AltStore allows you to install Delta, an all-in-one emulator for iOS, as well as sideload other .ipa files from the Files app.",
"iconURL": "https://user-images.githubusercontent.com/705880/65270980-1eb96f80-dad1-11e9-9367-78ccd25ceb02.png",
"tintColor": "018084",
"size": 5459395,
"size": 5465976,
"screenshotURLs": [
"https://user-images.githubusercontent.com/705880/78942028-acf54300-7a6d-11ea-821c-5bb7a9b3e73a.PNG",
"https://user-images.githubusercontent.com/705880/78942222-0fe6da00-7a6e-11ea-9f2a-dda16157583c.PNG",
@@ -92,14 +92,14 @@
"bundleIdentifier": "com.rileytestut.Delta.Beta",
"developerName": "Riley Testut",
"subtitle": "Classic games in your pocket.",
"version": "1.4b1",
"versionDate": "2022-06-02T09:00:00-07:00",
"versionDescription": "NEW\n• iPad-optimized UI\n• Redesigned iPad controller skins for NES, SNES, and DS games\n• Temporary iPad controller skins for GBC, GBA, Genesis, and N64 games\n\nIMPROVED\n• Modern menu UI when importing games\n• Updated \"Copy Deep Link\" icon when sharing a game\n\nFIXED\n• Fixed keyboard support on iOS 15+\n• Fixed invisible \"Games\" navigation bar and toolbar on iOS 15+\n• Fixed error sharing games via certain share methods\n• Fixed exporting save files for games with names containing special characters\n• Fixed UI bug where previous game controller would remaining selected after switching\n• Fixed game controller input mapping UI on iPad\n• Fixed crash importing games on iPad\n• Fixed crash sharing games on iPad",
"downloadURL": "https://cdn.altstore.io/file/altstore/apps/delta/1_4_b1.ipa",
"version": "1.4b2",
"versionDate": "2022-08-16T08:00:00-05:00",
"versionDescription": "NEW\n• Supports Split View and Stage Manager multitasking on iPad\n• Automatically pauses + resumes emulation when switching between foreground apps with Stage Manager\n• Optimized full screen-width controller skins when using Split View, Slide Over, or Stage Manager\n• Supports controller skins with new `placement` parameter\n• Supports controller skins with custom screens that dont have explicit `outputFrame`\n\nFIXED\n• Fixed not detecting keyboard presses when remapping inputs\n• Fixed potential crash rendering game screen after changing EAGLContext\n• Fixed incorrect game screen frame when software keyboard appears on iOS 16\n• Fixed software keyboard sometimes appearing when not emulating anything",
"downloadURL": "https://cdn.altstore.io/file/altstore/apps/delta/1_4_b2.ipa",
"localizedDescription": "The next consoles for Delta are coming: this beta version of Delta brings support for playing Nintendo DS and Sega Genesis games!\n\nPlease report any issues you find to support@altstore.io. Thanks!",
"iconURL": "https://user-images.githubusercontent.com/705880/63391976-4d311700-c37a-11e9-91a8-4fb0c454413d.png",
"tintColor": "8A28F7",
"size": 38346715,
"size": 42968657,
"beta": true,
"permissions": [
{
@@ -186,15 +186,6 @@
"date": "2019-09-28",
"notify": true
},
{
"title": "Welcome to AltStore",
"identifier": "welcome-to-altstore",
"caption": "Please read the FAQ for help with installing apps.",
"tintColor": "018084",
"url": "https://altstore.io/faq/",
"date": "2019-09-28",
"notify": false
},
{
"title": "Sideloading is Here!",
"identifier": "sideloading-is-here",
@@ -261,6 +252,15 @@
"url": "https://faq.altstore.io/release-notes/altstore",
"date": "2022-05-05",
"notify": true
},
{
"title": "New to AltStore?",
"identifier": "updated-faq",
"caption": "Check out our updated guide to learn how to sideload apps!",
"tintColor": "018084",
"url": "https://faq.altstore.io",
"date": "2022-07-28",
"notify": false
}
],
"userInfo": {

View File

@@ -173,8 +173,7 @@ struct Provider: IntentTimelineProvider
}
}
@main
struct AltWidget: Widget
struct HomeScreenWidget: Widget
{
private let kind: String = "AppDetail"
@@ -189,3 +188,35 @@ struct AltWidget: Widget
.description("View remaining days until your sideloaded apps expire.")
}
}
struct LockScreenWidget: Widget
{
private let kind: String = "LockAppDetail"
public var body: some WidgetConfiguration {
if #available(iOSApplicationExtension 16, *)
{
return IntentConfiguration(kind: kind,
intent: ViewAppIntent.self,
provider: Provider()) { (entry) in
ComplicationView(entry: entry)
}
.supportedFamilies([.accessoryCircular])
.configurationDisplayName("AltWidget")
.description("View remaining days until AltStore expires.")
}
else
{
return EmptyWidgetConfiguration()
}
}
}
@main
struct AltWidgets: WidgetBundle
{
var body: some Widget {
HomeScreenWidget()
LockScreenWidget()
}
}

View File

@@ -0,0 +1,86 @@
//
// ComplicationView.swift
// AltStore
//
// Created by Riley Testut on 7/7/22.
// Copyright © 2022 Riley Testut. All rights reserved.
//
import SwiftUI
import WidgetKit
@available(iOS 16, *)
struct ComplicationView: View
{
let entry: AppEntry
var body: some View {
let refreshedDate = self.entry.app?.refreshedDate ?? .now
let expirationDate = self.entry.app?.expirationDate ?? .now
let totalDays = expirationDate.numberOfCalendarDays(since: refreshedDate)
let daysRemaining = expirationDate.numberOfCalendarDays(since: self.entry.date)
let progress = Double(daysRemaining) / Double(totalDays)
ZStack(alignment: .center) {
ProgressRing(progress: progress) {
if daysRemaining < 0
{
Text("Expired")
.font(.system(size: 10, weight: .bold))
}
else
{
VStack(spacing: -1) {
Text("\(daysRemaining)")
.font(.system(size: 20, weight: .bold, design: .rounded))
Text(daysRemaining == 1 ? "DAY" : "DAYS")
.font(.caption)
}
.offset(y: -1)
}
}
}
.unredacted()
}
}
@available(iOS 16, *)
struct ComplicationView_Previews: PreviewProvider {
static var previews: some View {
let shortRefreshedDate = Calendar.current.date(byAdding: .day, value: -2, to: Date()) ?? Date()
let shortExpirationDate = Calendar.current.date(byAdding: .day, value: 7, to: shortRefreshedDate) ?? Date()
let longRefreshedDate = Calendar.current.date(byAdding: .day, value: -100, to: Date()) ?? Date()
let longExpirationDate = Calendar.current.date(byAdding: .day, value: 365, to: longRefreshedDate) ?? Date()
let expiredDate = shortExpirationDate.addingTimeInterval(1 * 60 * 60 * 24)
let weekAltstore = AppSnapshot(name: "AltStore",
bundleIdentifier: "com.rileytestut.AltStore",
expirationDate: shortExpirationDate,
refreshedDate: shortRefreshedDate,
tintColor: .altPrimary,
icon: UIImage(named: "AltStore"))
let yearAltstore = AppSnapshot(name: "AltStore",
bundleIdentifier: "com.rileytestut.AltStore",
expirationDate: longExpirationDate,
refreshedDate: longRefreshedDate,
tintColor: .altPrimary,
icon: UIImage(named: "AltStore"))
return Group {
ComplicationView(entry: AppEntry(date: Date(), app: weekAltstore))
.previewContext(WidgetPreviewContext(family: .accessoryCircular))
ComplicationView(entry: AppEntry(date: expiredDate, app: weekAltstore))
.previewContext(WidgetPreviewContext(family: .accessoryCircular))
ComplicationView(entry: AppEntry(date: longRefreshedDate, app: yearAltstore))
.previewContext(WidgetPreviewContext(family: .accessoryCircular))
}
}
}

View File

@@ -0,0 +1,54 @@
//
// ProgressRing.swift
// AltWidgetExtension
//
// Created by Riley Testut on 8/17/22.
// Copyright © 2022 Riley Testut. All rights reserved.
//
import SwiftUI
import WidgetKit
struct ProgressRing<Content: View>: View
{
let progress: Double
private let content: Content
init(progress: Double, @ViewBuilder content: () -> Content)
{
self.progress = progress
self.content = content()
}
var body: some View {
ZStack(alignment: .center) {
ring(progress: 1.0)
.opacity(0.3)
ring(progress: self.progress)
content
}
}
@ViewBuilder
private func ring(progress: Double) -> some View {
let strokeStyle = StrokeStyle(lineWidth: 4.0, lineCap: .round, lineJoin: .round)
Circle()
.inset(by: 2.0)
.trim(from: 0.0, to: progress)
.rotation(Angle(degrees: -90), anchor: .center)
.stroke(style: strokeStyle)
}
}
struct ProgressRing_Previews: PreviewProvider {
static var previews: some View {
ProgressRing(progress: 0.5) {
EmptyView()
}
.previewContext(WidgetPreviewContext(family: .systemSmall))
}
}