@@ -698,38 +698,7 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
698
698
setStatus ( " Error extracting ipa file " )
699
699
cleanup ( tempFolder) ; return
700
700
}
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
+
733
702
} catch {
734
703
setStatus ( " Error extracting ipa file " )
735
704
cleanup ( tempFolder) ; return
@@ -746,6 +715,7 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
746
715
try fileManager. createDirectory ( atPath: payloadDirectory, withIntermediateDirectories: true , attributes: nil )
747
716
setStatus ( " Copying app to payload directory " )
748
717
try fileManager. copyItem ( atPath: inputFile, toPath: payloadDirectory. stringByAppendingPathComponent ( inputFile. lastPathComponent) )
718
+
749
719
} catch {
750
720
setStatus ( " Error copying app to payload directory " )
751
721
cleanup ( tempFolder) ; return
@@ -778,6 +748,43 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
778
748
cleanup ( tempFolder) ; return
779
749
}
780
750
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
+
781
788
// Loop through app bundles in payload directory
782
789
do {
783
790
let files = try fileManager. contentsOfDirectory ( atPath: payloadDirectory)
@@ -1011,12 +1018,11 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
1011
1018
//MARK: Codesigning - App
1012
1019
let signingFunction = generateFileSignFunc ( payloadDirectory, entitlementsPath: entitlementsPlist, signingCertificate: signingCertificate!)
1013
1020
1014
-
1015
1021
recursiveDirectorySearch ( appBundlePath, extensions: signableExtensions, found: signingFunction)
1016
1022
signingFunction ( appBundlePath)
1017
1023
1018
-
1019
1024
let appPath = appBundlePath. lastPathComponent
1025
+
1020
1026
let appLast = appBundlePath. stringByDeletingLastPathComponent. lastPathComponent
1021
1027
1022
1028
let appLCP = String ( ) . appendingFormat ( " %@/%@ " , appLast, appPath)
0 commit comments