mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 04:20:30 +00:00
Fix not mounted error
This commit is contained in:
parent
ddee1d73f9
commit
3154290946
4 changed files with 22 additions and 5 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
|
||||
|
|
@ -91,6 +91,7 @@ struct HeartbeatApp: App {
|
|||
@State private var alert_string = ""
|
||||
@State private var alert_title = ""
|
||||
@StateObject private var mount = MountingProgress.shared
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
|
||||
let urls: [String] = [
|
||||
"https://github.com/doronz88/DeveloperDiskImage/raw/refs/heads/main/PersonalizedImages/Xcode_iOS_DDI_Personalized/BuildManifest.plist",
|
||||
|
|
@ -139,7 +140,7 @@ struct HeartbeatApp: App {
|
|||
}
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
if isLoading {
|
||||
if isLoading2 {
|
||||
LoadingView()
|
||||
.onAppear {
|
||||
startProxy() { result, error in
|
||||
|
|
@ -149,7 +150,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 {
|
||||
|
|
@ -165,7 +166,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
|
||||
|
|
@ -226,6 +227,12 @@ struct HeartbeatApp: App {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in
|
||||
if !isHeartbeat {
|
||||
startHeartbeatInBackground()
|
||||
}
|
||||
}
|
||||
}
|
||||
.overlay(
|
||||
ZStack {
|
||||
|
|
|
|||
|
|
@ -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