mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 12:30:29 +00:00
Merge branch 'main' into THEMEING
This commit is contained in:
commit
f27955d882
5 changed files with 24 additions and 13 deletions
|
|
@ -5,4 +5,4 @@
|
|||
#include "idevice/JITEnableContext.h"
|
||||
#include "idevice/idevice.h"
|
||||
#include "idevice/em_proxy.h"
|
||||
|
||||
#include "idevice/heartbeat.h"
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func UpdateRetrieval() -> Bool{
|
|||
|
||||
@main
|
||||
struct HeartbeatApp: App {
|
||||
@State private var isLoading = true
|
||||
@State private var isLoading2 = true
|
||||
@State private var isPairing = false
|
||||
@State private var heartBeat = false
|
||||
@State private var error: Int32? = nil
|
||||
|
|
@ -92,6 +92,8 @@ struct HeartbeatApp: App {
|
|||
@State private var alert_title = ""
|
||||
@StateObject private var mount = MountingProgress.shared
|
||||
@AppStorage("appTheme") private var appTheme: String = "system"
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
|
||||
|
||||
let urls: [String] = [
|
||||
"https://github.com/doronz88/DeveloperDiskImage/raw/refs/heads/main/PersonalizedImages/Xcode_iOS_DDI_Personalized/BuildManifest.plist",
|
||||
|
|
@ -166,7 +168,7 @@ struct HeartbeatApp: App {
|
|||
}
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
if isLoading {
|
||||
if isLoading2 {
|
||||
LoadingView()
|
||||
.onAppear {
|
||||
startProxy() { result, error in
|
||||
|
|
@ -176,7 +178,7 @@ struct HeartbeatApp: App {
|
|||
if FileManager.default.fileExists(atPath: URL.documentsDirectory.appendingPathComponent("pairingFile.plist").path) {
|
||||
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in
|
||||
if pubHeartBeat {
|
||||
isLoading = false
|
||||
isLoading2 = false
|
||||
timer.invalidate()
|
||||
} else {
|
||||
if let error {
|
||||
|
|
@ -192,7 +194,7 @@ struct HeartbeatApp: App {
|
|||
|
||||
startHeartbeatInBackground()
|
||||
} else {
|
||||
isLoading = false
|
||||
isLoading2 = false
|
||||
}
|
||||
} else if let vpn_error {
|
||||
showAlert(title: "Error", message: "EM Proxy failed to connect: \(vpn_error)", showOk: true) { _ in
|
||||
|
|
@ -254,6 +256,12 @@ struct HeartbeatApp: App {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in
|
||||
if !isHeartbeat {
|
||||
startHeartbeatInBackground()
|
||||
}
|
||||
}
|
||||
}
|
||||
.overlay(
|
||||
ZStack {
|
||||
|
|
|
|||
|
|
@ -211,12 +211,5 @@ func mountPersonalDDI(deviceIP: String = "10.7.0.1", imagePath: String, trustcac
|
|||
}
|
||||
}
|
||||
|
||||
if result != IdeviceSuccess {
|
||||
print(result)
|
||||
print("Failed to mount personalized image")
|
||||
return 10 // EC: 10
|
||||
} else {
|
||||
print("Successfully mounted personalized image!")
|
||||
return 0 // no EC
|
||||
}
|
||||
return Int(result.rawValue)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
#include <limits.h>
|
||||
#include "heartbeat.h"
|
||||
|
||||
|
||||
bool isHeartbeat = false;
|
||||
|
||||
|
||||
void startHeartbeat(IdevicePairingFile* pairing_file, TcpProviderHandle** provider, int* heartbeatSessionId, HeartbeatCompletionHandlerC completion, LogFuncC logger) {
|
||||
int currentSessionId = *heartbeatSessionId;
|
||||
|
||||
|
|
@ -47,6 +51,7 @@ void startHeartbeat(IdevicePairingFile* pairing_file, TcpProviderHandle** provid
|
|||
|
||||
completion(0, "Heartbeat Completed");
|
||||
|
||||
isHeartbeat = true;
|
||||
u_int64_t current_interval = 15;
|
||||
while (1) {
|
||||
if(*heartbeatSessionId != currentSessionId) {
|
||||
|
|
@ -58,6 +63,7 @@ void startHeartbeat(IdevicePairingFile* pairing_file, TcpProviderHandle** provid
|
|||
err = heartbeat_get_marco(client, current_interval, &new_interval);
|
||||
if (err != IdeviceSuccess) {
|
||||
logger("DEBUG: Failed to get marco: %d", err);
|
||||
isHeartbeat = false;
|
||||
heartbeat_client_free(client);
|
||||
return;
|
||||
}
|
||||
|
|
@ -68,9 +74,11 @@ void startHeartbeat(IdevicePairingFile* pairing_file, TcpProviderHandle** provid
|
|||
err = heartbeat_send_polo(client);
|
||||
if (err != IdeviceSuccess) {
|
||||
logger("DEBUG: Failed to send polo: %d", err);
|
||||
isHeartbeat = false;
|
||||
heartbeat_client_free(client);
|
||||
return;
|
||||
}
|
||||
logger("DEBUG: Polo reply sent successfully.");
|
||||
isHeartbeat = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
typedef void (^HeartbeatCompletionHandlerC)(int result, const char *message);
|
||||
typedef void (^LogFuncC)(const char* message, ...);
|
||||
|
||||
extern bool isHeartbeat;
|
||||
|
||||
void startHeartbeat(IdevicePairingFile* pairintFile, TcpProviderHandle** provider, int* heartbeatSessionId, HeartbeatCompletionHandlerC completion, LogFuncC logger);
|
||||
|
||||
#endif /* HEARTBEAT_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue