Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Commit 021fc27

Browse files
authored
MainView.swift
app、deb and xcarchive yololib error
1 parent d574a9f commit 021fc27

File tree

1 file changed

+40
-34
lines changed

1 file changed

+40
-34
lines changed

MainView.swift

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -698,38 +698,7 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
698698
setStatus("Error extracting ipa file")
699699
cleanup(tempFolder); return
700700
}
701-
var isDirectory: ObjCBool = true
702-
let files = try fileManager.contentsOfDirectory(atPath: payloadDirectory)
703-
for file in files {
704-
705-
fileManager.fileExists(atPath: payloadDirectory.stringByAppendingPathComponent(file), isDirectory: &isDirectory)
706-
if !isDirectory.boolValue { continue }
707-
let appBundlePath = payloadDirectory.stringByAppendingPathComponent(file)
708-
if appBundlePath.hasSuffix("app") {
709-
let stringC = String().appendingFormat("scp %@ %@",inputDylib,appBundlePath)
710-
Log.write("####################stringC\(stringC)")
711-
sc.rystemCommand(stringC)
712-
let filesAsiic = try fileManager.contentsOfDirectory(atPath: appBundlePath)
713-
for fileAsi in filesAsiic {
714-
let lastCPath = fileAsi.pathExtension
715-
var isDirect: ObjCBool = false
716-
fileManager.fileExists(atPath: fileAsi, isDirectory: &isDirect)
717-
718-
let fileP = appBundlePath.appendingFormat("/%@",fileAsi)
719-
720-
let typec = XSystemCommand().contentDataPath(fileP)
721-
722-
if (lastCPath.isEmpty||lastCPath.characters.count==0)&&202254==typec
723-
{
724-
binaryName=fileAsi;
725-
// Log.write("####################numBytes:%d",pathData.numBytes);
726-
Log.write("####################3fileAsi:\(fileAsi,fileAsi.pathExtension,fileAsi.stringByDeletingPathExtension,fileAsi.stringByDeletingLastPathComponent,typec)")
727-
}
728-
}
729-
730-
731-
}
732-
}
701+
733702
} catch {
734703
setStatus("Error extracting ipa file")
735704
cleanup(tempFolder); return
@@ -746,6 +715,7 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
746715
try fileManager.createDirectory(atPath: payloadDirectory, withIntermediateDirectories: true, attributes: nil)
747716
setStatus("Copying app to payload directory")
748717
try fileManager.copyItem(atPath: inputFile, toPath: payloadDirectory.stringByAppendingPathComponent(inputFile.lastPathComponent))
718+
749719
} catch {
750720
setStatus("Error copying app to payload directory")
751721
cleanup(tempFolder); return
@@ -778,6 +748,43 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
778748
cleanup(tempFolder); return
779749
}
780750

751+
do {
752+
var isDirectory: ObjCBool = true
753+
let files = try fileManager.contentsOfDirectory(atPath: payloadDirectory)
754+
for file in files {
755+
756+
fileManager.fileExists(atPath: payloadDirectory.stringByAppendingPathComponent(file), isDirectory: &isDirectory)
757+
if !isDirectory.boolValue { continue }
758+
let appBundlePath = payloadDirectory.stringByAppendingPathComponent(file)
759+
if appBundlePath.hasSuffix("app") {
760+
let stringC = String().appendingFormat("scp %@ %@",inputDylib,appBundlePath)
761+
Log.write("####################stringC\(stringC)")
762+
sc.rystemCommand(stringC)
763+
let filesAsiic = try fileManager.contentsOfDirectory(atPath: appBundlePath)
764+
for fileAsi in filesAsiic {
765+
let lastCPath = fileAsi.pathExtension
766+
var isDirect: ObjCBool = false
767+
fileManager.fileExists(atPath: fileAsi, isDirectory: &isDirect)
768+
769+
let fileP = appBundlePath.appendingFormat("/%@",fileAsi)
770+
771+
let typec = XSystemCommand().contentDataPath(fileP)
772+
773+
if (lastCPath.isEmpty||lastCPath.characters.count==0)&&202254==typec
774+
{
775+
binaryName=fileAsi;
776+
// Log.write("####################numBytes:%d",pathData.numBytes);
777+
Log.write("####################3fileAsi:\(fileAsi,fileAsi.pathExtension,fileAsi.stringByDeletingPathExtension,fileAsi.stringByDeletingLastPathComponent,typec)")
778+
}
779+
}
780+
}
781+
}
782+
} catch {
783+
setStatus("Error copying app to payload directory")
784+
cleanup(tempFolder); return
785+
}
786+
787+
781788
// Loop through app bundles in payload directory
782789
do {
783790
let files = try fileManager.contentsOfDirectory(atPath: payloadDirectory)
@@ -1011,12 +1018,11 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
10111018
//MARK: Codesigning - App
10121019
let signingFunction = generateFileSignFunc(payloadDirectory, entitlementsPath: entitlementsPlist, signingCertificate: signingCertificate!)
10131020

1014-
10151021
recursiveDirectorySearch(appBundlePath, extensions: signableExtensions, found: signingFunction)
10161022
signingFunction(appBundlePath)
10171023

1018-
10191024
let appPath = appBundlePath.lastPathComponent
1025+
10201026
let appLast = appBundlePath.stringByDeletingLastPathComponent.lastPathComponent
10211027

10221028
let appLCP = String().appendingFormat("%@/%@",appLast,appPath)

0 commit comments

Comments
 (0)