[debug]: enabled back appropriate preprocessor debug blocks as before wherever applicable

This commit is contained in:
Magesh K
2025-01-12 18:01:11 +05:30
parent 61989e7d40
commit 55f4aa7deb
10 changed files with 72 additions and 63 deletions

View File

@@ -715,9 +715,10 @@ private extension AuthenticationOperation
// If we're not using the same certificate used to install AltStore, warn user that they need to refresh.
guard !provisioningProfile.certificates.contains(signer.certificate) else { return completionHandler(false) }
//#if DEBUG
// #if DEBUG && targetEnvironment(simulator)
// completionHandler(false)
//#else
// #else
DispatchQueue.main.async {
let context = AuthenticatedOperationContext(context: self.context)
context.operations.removeAllObjects() // Prevent deadlock due to endless waiting on previous operations to finish.
@@ -733,7 +734,7 @@ private extension AuthenticationOperation
completionHandler(false)
}
}
//#endif
// #endif
}
}

View File

@@ -134,19 +134,21 @@ extension FetchProvisioningProfilesOperation
// or if installedApp.team is nil but resignedBundleIdentifier contains the team's identifier.
let teamsMatch = installedApp.team?.identifier == team.identifier || (installedApp.team == nil && installedApp.resignedBundleIdentifier.contains(team.identifier))
// #if DEBUG
//
// if app.isAltStoreApp
// {
// // Use legacy bundle ID format for AltStore.
// preferredBundleID = teamsMatch ? installedApp.resignedBundleIdentifier : nil
// }
// else
// {
// preferredBundleID = teamsMatch ? installedApp.resignedBundleIdentifier : nil
// }
//
// #else
// TODO: @mahee96: Try to keep the debug build and release build operations similar, refactor later with proper reasoning
// for now, restricted it to debug on simulator only
#if DEBUG && targetEnvironment(simulator)
if app.isAltStoreApp
{
// Use legacy bundle ID format for AltStore.
preferredBundleID = teamsMatch ? installedApp.resignedBundleIdentifier : nil
}
else
{
preferredBundleID = teamsMatch ? installedApp.resignedBundleIdentifier : nil
}
#else
if teamsMatch
{
@@ -160,7 +162,7 @@ extension FetchProvisioningProfilesOperation
preferredBundleID = nil
}
// #endif
#endif
}
else
{

View File

@@ -58,6 +58,7 @@ final class RemoveAppBackupOperation: ResultOperation<Void>
}
catch let error as CocoaError where error.code == CocoaError.Code.fileNoSuchFile
{
// TODO: @mahee96: Find out why should in debug builds the app-groups is not expected to match
// #if DEBUG
//
// // When debugging, it's expected that app groups don't match, so ignore.

View File

@@ -244,13 +244,14 @@ private extension ResignAppOperation
{
for case let fileURL as URL in enumerator
{
// #if DEBUG
// guard !fileURL.lastPathComponent.lowercased().contains(".xctest") else {
// // Remove embedded XCTest (+ dSYM) bundle from copied app bundle.
// try FileManager.default.removeItem(at: fileURL)
// continue
// }
// #endif
// for both sim and device, in debug mode builds, remove the tests bundles (if any)
#if DEBUG
guard !fileURL.lastPathComponent.lowercased().contains(".xctest") else {
// Remove embedded XCTest (+ dSYM) bundle from copied app bundle.
try FileManager.default.removeItem(at: fileURL)
continue
}
#endif
guard let appExtension = Bundle(url: fileURL) else { throw ALTError(.missingAppBundle) }
try prepare(appExtension)