Skip to content

Commit 83a3c1d

Browse files
committed
changed version number to 0.9.2.
Hopefully fixed the DFU completion -> crash bug that's affected a few users. It comes at the cost of reconnecting automatically to the PT (unless the autoconnect setting is enabled and that device has been selected), but I think that's a worthwhile trade
1 parent 8f3c96c commit 83a3c1d

10 files changed

Lines changed: 27 additions & 37 deletions

File tree

Infini-iOS.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@
796796
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
797797
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
798798
CODE_SIGN_STYLE = Automatic;
799-
CURRENT_PROJECT_VERSION = 5;
799+
CURRENT_PROJECT_VERSION = 1;
800800
DEVELOPMENT_ASSET_PATHS = "\"Infini-iOS/Preview Content\"";
801801
DEVELOPMENT_TEAM = 99BHY6DC82;
802802
ENABLE_PREVIEWS = YES;
@@ -806,7 +806,7 @@
806806
"$(inherited)",
807807
"@executable_path/Frameworks",
808808
);
809-
MARKETING_VERSION = 0.9.1;
809+
MARKETING_VERSION = 0.9.2;
810810
PRODUCT_BUNDLE_IDENTIFIER = "com.alexemry.Infini-iOS";
811811
PRODUCT_NAME = "$(TARGET_NAME)";
812812
SWIFT_VERSION = 5.0;
@@ -820,7 +820,7 @@
820820
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
821821
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
822822
CODE_SIGN_STYLE = Automatic;
823-
CURRENT_PROJECT_VERSION = 5;
823+
CURRENT_PROJECT_VERSION = 1;
824824
DEVELOPMENT_ASSET_PATHS = "\"Infini-iOS/Preview Content\"";
825825
DEVELOPMENT_TEAM = 99BHY6DC82;
826826
ENABLE_PREVIEWS = YES;
@@ -830,7 +830,7 @@
830830
"$(inherited)",
831831
"@executable_path/Frameworks",
832832
);
833-
MARKETING_VERSION = 0.9.1;
833+
MARKETING_VERSION = 0.9.2;
834834
PRODUCT_BUNDLE_IDENTIFIER = "com.alexemry.Infini-iOS";
835835
PRODUCT_NAME = "$(TARGET_NAME)";
836836
SWIFT_VERSION = 5.0;

Infini-iOS/BLE/BLEAutoconnectManager.swift

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import CoreBluetooth
1212

1313
struct BLEAutoconnectManager {
1414
static var shared = BLEAutoconnectManager()
15-
16-
var dfu: Bool = false
17-
var uuid: String = String()
18-
15+
1916
func shouldDisplayConnectSheet() -> Bool {
2017
let bleManager = BLEManager.shared
2118
let autoconnect = UserDefaults.standard.object(forKey: "autoconnect") as? Bool ?? true
@@ -33,18 +30,9 @@ struct BLEAutoconnectManager {
3330
let autoconnect = UserDefaults.standard.object(forKey: "autoconnect") as? Bool ?? true
3431
let autoconnectUUID = UserDefaults.standard.object(forKey: "autoconnectUUID") as? String ?? ""
3532

36-
if dfu {
37-
if uuid == peripheral.identifier.uuidString {
38-
BLEManager.shared.connect(peripheral: peripheral)
39-
BLEAutoconnectManager.shared.dfu = false
40-
BLEAutoconnectManager.shared.uuid = String()
41-
return true
42-
}
43-
} else {
44-
if autoconnect && peripheral.identifier.uuidString == autoconnectUUID {
45-
BLEManager.shared.connect(peripheral: peripheral)
46-
return true
47-
}
33+
if autoconnect && peripheral.identifier.uuidString == autoconnectUUID {
34+
BLEManager.shared.connect(peripheral: peripheral)
35+
return true
4836
}
4937
return false
5038
}

Infini-iOS/DFU/DFU.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ class DFU_Updater: ObservableObject, DFUServiceDelegate, DFUProgressDelegate, Lo
106106
}
107107

108108
func logWith(_ level: LogLevel, message: String) {
109-
let logManager = DebugLogManager.shared
110-
logManager.debug(error: "DFU \(level.name()): \(message)", log: .dfu, date: nil)
109+
print("DFU \(level.name()): \(message)")
110+
let level = level.name()
111+
DebugLogManager.shared.debug(error: "DFU \(level): \(message)", log: .dfu, date: nil)
111112
}
112-
113-
114113
}

Infini-iOS/View Components/DFU View/DFUStartButtonColorSelector.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ extension DFUStartTransferButton {
4141
func colorChooser() -> Color {
4242
if colorScheme == .dark {
4343
if firmwareSelected {
44-
return Color.darkGray
44+
if downloadManager.downloading {
45+
return Color.darkestGray
46+
} else {
47+
return Color.darkGray
48+
}
4549
} else {
4650
if updateStarted {
4751
return Color.darkGray
@@ -52,15 +56,15 @@ extension DFUStartTransferButton {
5256
} else {
5357
if firmwareSelected {
5458
if downloadManager.downloading {
55-
return Color.darkestGray
59+
return Color.lightGray
5660
} else {
57-
return Color.darkGray
61+
return Color.blue
5862
}
5963
} else {
6064
if updateStarted {
61-
return Color.darkGray
65+
return Color.blue
6266
} else {
63-
return Color.darkestGray
67+
return Color.lightGray
6468
}
6569
}
6670
}

Infini-iOS/View Components/DFU View/DFUWithBLE.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ struct DFUWithBLE: View {
7979
dfuUpdater.firmwareURL = URL(fileURLWithPath: "")
8080
dfuUpdater.firmwareSelected = false
8181
dfuUpdater.firmwareFilename = ""
82-
BLEAutoconnectManager.shared.uuid = bleManager.infiniTime.identifier.uuidString
83-
BLEAutoconnectManager.shared.dfu = true
84-
bleManager.disconnect()
85-
bleManager.startScanning()
8682
}
8783
}
8884
}.transition(.opacity).animation(.easeInOut(duration: 1.0))

Infini-iOS/View Components/Debug View/DebugView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,21 @@ struct DebugView: View {
7171
Image(systemName: "radiowaves.right")
7272
Text("BLE")
7373
}
74+
.padding(.top)
7475
.tag(1)
7576
DebugViewDFU()
7677
.tabItem {
7778
Image(systemName: "arrow.up.doc")
7879
Text("DFU")
7980
}
81+
.padding(.top)
8082
.tag(2)
8183
DebugViewApp()
8284
.tabItem {
8385
Image(systemName: "ant")
8486
Text("App")
8587
}
88+
.padding(.top)
8689
.tag(3)
8790
}
8891
}

Infini-iOS/View Components/Debug View/DebugViewApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct DebugViewApp: View {
1919
ForEach(0..<logManager.logFiles.appLogEntries.count, id: \.self) { entry in
2020
Text(
2121
// if a date is included, prepend '[date] -', otherwise start with empty string
22-
logManager.logFiles.appLogEntries[entry].date.isEmpty ? "" : logManager.logFiles.appLogEntries[entry].date + " - " + logManager.logFiles.appLogEntries[entry].message
22+
(logManager.logFiles.appLogEntries[entry].date.isEmpty ? "" : logManager.logFiles.appLogEntries[entry].date + " - ") + logManager.logFiles.appLogEntries[entry].message
2323
)
2424
}
2525
}

Infini-iOS/View Components/Debug View/DebugViewBLE.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct DebugViewBLE: View {
2020
ForEach(0..<logManager.logFiles.bleLogEntries.count, id: \.self) { entry in
2121
Text(
2222
// if a date is included, prepend '[date] -', otherwise start with empty string
23-
logManager.logFiles.bleLogEntries[entry].date.isEmpty ? "" : logManager.logFiles.bleLogEntries[entry].date + " - " + logManager.logFiles.bleLogEntries[entry].message
23+
(logManager.logFiles.bleLogEntries[entry].date.isEmpty ? "" : logManager.logFiles.bleLogEntries[entry].date + " - ") + logManager.logFiles.bleLogEntries[entry].message
2424
)
2525
}
2626
}

Infini-iOS/View Components/Debug View/DebugViewDFU.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct DebugViewDFU: View {
1919
ForEach(0..<logManager.logFiles.dfuLogEntries.count, id: \.self) { entry in
2020
Text(
2121
// if a date is included, prepend '[date] -', otherwise start with empty string
22-
logManager.logFiles.dfuLogEntries[entry].date.isEmpty ? "" : logManager.logFiles.dfuLogEntries[entry].date + " - " + logManager.logFiles.dfuLogEntries[entry].message
22+
(logManager.logFiles.dfuLogEntries[entry].date.isEmpty ? "" : logManager.logFiles.dfuLogEntries[entry].date + " - ") + logManager.logFiles.dfuLogEntries[entry].message
2323
)
2424
}
2525
}

Infini-iOS/View Components/SideMenu.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ struct SideMenu: View {
106106
}
107107
.padding(20)
108108
.frame(maxWidth: .infinity, alignment: .leading)
109-
.background(colorScheme == .dark ? Color.darkGray : Color.lightGray)
109+
.background(colorScheme == .dark ? Color.darkGray : Color.white)
110110
}
111111
}

0 commit comments

Comments
 (0)