Skip to content

Commit

Permalink
2.14.74
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakr233 committed Aug 13, 2024
1 parent 0ea51f1 commit f9b4162
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 49 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,11 @@ cython_debug/

.DS_Store

.//BBackupp/Resources/AuxiliaryBinary/*
BBackupp/Resources/AuxiliaryBinary/*

*.xcarchive
.cache/
Package.resolved

MobileBackup/libimobiledevice
19 changes: 19 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
image: ghcr.io/cirruslabs/macos-sonoma-xcode:15.3

variables:
HOMEBREW_NO_AUTO_UPDATE: 1
CI_SKIP_BUMP_VERSION: 1

stages:
- CompileRelease

CompileRelease:
tags:
- xcode
stage: CompileRelease
script:
- brew install xcbeautify swiftformat
- ./Resource/Script/build.release.sh $(pwd)/BBackupp.xcarchive
artifacts:
paths:
- BBackupp.xcarchive
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "Foundation/AppleMobileDevice"]
path = Foundation/AppleMobileDevice
url = https://github.com/Lakr233/AppleMobileDevice
[submodule "MobileBackup/libimobiledevice"]
path = MobileBackup/libimobiledevice
url = https://github.com/libimobiledevice/libimobiledevice
Empty file added .root
Empty file.
2 changes: 1 addition & 1 deletion BBackupp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@
repositoryURL = "https://github.com/Lakr233/ColorfulX";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.2.15;
minimumVersion = 5.1.1;
};
};
50C60CB12BA536E000DA4B3D /* XCRemoteSwiftPackageReference "BetterCodable" */ = {
Expand Down
4 changes: 0 additions & 4 deletions BBackupp/Backend/Backup/BackupPlan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,13 @@ extension BackupPlan.Automation.BackupKeepOption {
var interfaceText: String {
switch self {
case .unlimited: "Keep Unlimited Backups"

case .n1: "Keep 1 Backups"
case .n2: "Keep 2 Backups"
case .n3: "Keep 3 Backups"
case .n4: "Keep 4 Backups"
case .n5: "Keep 5 Backups"
case .n6: "Keep 6 Backups"
case .n7: "Keep 7 Backups"

case .d3: "Keep All within 3 Days"
case .d7: "Keep All within 7 Days"
case .d30: "Keep All within 30 Days"
Expand All @@ -186,15 +184,13 @@ extension BackupPlan.Automation.BackupKeepOption {

switch self {
case .unlimited: break

case .n1: saveFirst(1)
case .n2: saveFirst(2)
case .n3: saveFirst(3)
case .n4: saveFirst(4)
case .n5: saveFirst(5)
case .n6: saveFirst(6)
case .n7: saveFirst(7)

case .d3: saveList = saveList.filter { abs($0.date.timeIntervalSinceNow) < 3 * 24 * 3600 }
case .d7: saveList = saveList.filter { abs($0.date.timeIntervalSinceNow) < 7 * 24 * 3600 }
case .d30: saveList = saveList.filter { abs($0.date.timeIntervalSinceNow) < 30 * 24 * 3600 }
Expand Down
40 changes: 0 additions & 40 deletions BBackupp/Backend/Backup/BackupTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,6 @@ class BackupTask: ObservableObject, Identifiable {
try? logFile?.close()
}

if config.useNetwork {
decodeOutput("waking up device...\n")
let retryCount = 20
for i in 1 ... retryCount {
if error != nil { return }
if wakeupDevice() {
decodeOutput("device is ready.\n")
break
}
if i >= retryCount {
decodeOutput("warning: service may not available.\n")
} else {
decodeOutput("warning: service not available, retry in 3s. (\(i)/\(retryCount))\n")
sleep(3)
}
}
}

decodeOutput("starting command...\n")
let recp = AuxiliaryExecute.spawn(
command: Self.mobileBackupExecutable,
Expand All @@ -192,28 +174,6 @@ class BackupTask: ObservableObject, Identifiable {
}
}

// MARK: HELPER

private func wakeupDevice() -> Bool {
var success = false
amdManager.sendPairRequest(udid: config.device.udid)
amdManager.requireDevice(udid: config.device.udid, connection: config.useNetwork ? .net : .usb) { device in
guard let device else { return }
amdManager.requireLockdownClient(device: device, handshake: true) { client in
guard let client else { return }
amdManager.requireLockdownService(client: client, serviceName: MOBILEBACKUP2_SERVICE_NAME) { mb2_service in
guard let mb2_service else { return }
amdManager.requireMobileBackup2Service(device: device, mobileBackup2Service: mb2_service) { mb2_client in
guard let mb2_client else { return }
_ = mb2_client
success = true
}
}
}
}
return success
}

// MARK: OUTPUT HANDLER

private func decodeReceipt(_ recp: AuxiliaryExecute.ExecuteReceipt) {
Expand Down
26 changes: 26 additions & 0 deletions BBackupp/License.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


## ColorVector


MIT License

Copyright (c) 2024 Lakr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


## ColorfulX


Expand Down
2 changes: 1 addition & 1 deletion BBackupp/Version.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.12.66
2.14.74

0 comments on commit f9b4162

Please sign in to comment.