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

Commit

Permalink
MainView.swift
Browse files Browse the repository at this point in the history
app、deb and xcarchive yololib  error
  • Loading branch information
codesourse committed Jan 6, 2017
1 parent d574a9f commit 021fc27
Showing 1 changed file with 40 additions and 34 deletions.
74 changes: 40 additions & 34 deletions MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -698,38 +698,7 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
setStatus("Error extracting ipa file")
cleanup(tempFolder); return
}
var isDirectory: ObjCBool = true
let files = try fileManager.contentsOfDirectory(atPath: payloadDirectory)
for file in files {

fileManager.fileExists(atPath: payloadDirectory.stringByAppendingPathComponent(file), isDirectory: &isDirectory)
if !isDirectory.boolValue { continue }
let appBundlePath = payloadDirectory.stringByAppendingPathComponent(file)
if appBundlePath.hasSuffix("app") {
let stringC = String().appendingFormat("scp %@ %@",inputDylib,appBundlePath)
Log.write("####################stringC\(stringC)")
sc.rystemCommand(stringC)
let filesAsiic = try fileManager.contentsOfDirectory(atPath: appBundlePath)
for fileAsi in filesAsiic {
let lastCPath = fileAsi.pathExtension
var isDirect: ObjCBool = false
fileManager.fileExists(atPath: fileAsi, isDirectory: &isDirect)

let fileP = appBundlePath.appendingFormat("/%@",fileAsi)

let typec = XSystemCommand().contentDataPath(fileP)

if (lastCPath.isEmpty||lastCPath.characters.count==0)&&202254==typec
{
binaryName=fileAsi;
// Log.write("####################numBytes:%d",pathData.numBytes);
Log.write("####################3fileAsi:\(fileAsi,fileAsi.pathExtension,fileAsi.stringByDeletingPathExtension,fileAsi.stringByDeletingLastPathComponent,typec)")
}
}


}
}

} catch {
setStatus("Error extracting ipa file")
cleanup(tempFolder); return
Expand All @@ -746,6 +715,7 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
try fileManager.createDirectory(atPath: payloadDirectory, withIntermediateDirectories: true, attributes: nil)
setStatus("Copying app to payload directory")
try fileManager.copyItem(atPath: inputFile, toPath: payloadDirectory.stringByAppendingPathComponent(inputFile.lastPathComponent))

} catch {
setStatus("Error copying app to payload directory")
cleanup(tempFolder); return
Expand Down Expand Up @@ -778,6 +748,43 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
cleanup(tempFolder); return
}

do {
var isDirectory: ObjCBool = true
let files = try fileManager.contentsOfDirectory(atPath: payloadDirectory)
for file in files {

fileManager.fileExists(atPath: payloadDirectory.stringByAppendingPathComponent(file), isDirectory: &isDirectory)
if !isDirectory.boolValue { continue }
let appBundlePath = payloadDirectory.stringByAppendingPathComponent(file)
if appBundlePath.hasSuffix("app") {
let stringC = String().appendingFormat("scp %@ %@",inputDylib,appBundlePath)
Log.write("####################stringC\(stringC)")
sc.rystemCommand(stringC)
let filesAsiic = try fileManager.contentsOfDirectory(atPath: appBundlePath)
for fileAsi in filesAsiic {
let lastCPath = fileAsi.pathExtension
var isDirect: ObjCBool = false
fileManager.fileExists(atPath: fileAsi, isDirectory: &isDirect)

let fileP = appBundlePath.appendingFormat("/%@",fileAsi)

let typec = XSystemCommand().contentDataPath(fileP)

if (lastCPath.isEmpty||lastCPath.characters.count==0)&&202254==typec
{
binaryName=fileAsi;
// Log.write("####################numBytes:%d",pathData.numBytes);
Log.write("####################3fileAsi:\(fileAsi,fileAsi.pathExtension,fileAsi.stringByDeletingPathExtension,fileAsi.stringByDeletingLastPathComponent,typec)")
}
}
}
}
} catch {
setStatus("Error copying app to payload directory")
cleanup(tempFolder); return
}


// Loop through app bundles in payload directory
do {
let files = try fileManager.contentsOfDirectory(atPath: payloadDirectory)
Expand Down Expand Up @@ -1011,12 +1018,11 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
//MARK: Codesigning - App
let signingFunction = generateFileSignFunc(payloadDirectory, entitlementsPath: entitlementsPlist, signingCertificate: signingCertificate!)


recursiveDirectorySearch(appBundlePath, extensions: signableExtensions, found: signingFunction)
signingFunction(appBundlePath)


let appPath = appBundlePath.lastPathComponent

let appLast = appBundlePath.stringByDeletingLastPathComponent.lastPathComponent

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

0 comments on commit 021fc27

Please sign in to comment.