Skip to content

Commit d66cd8e

Browse files
committed
add: delete url schemes
1 parent 1811f2c commit d66cd8e

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
-127 Bytes
Binary file not shown.

AppResign/AppResign/AppResign.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class AppResign {
2424
var newDisplayName: String = ""
2525
var startSize: CGFloat?
2626
var NibLoaded = false
27+
var deleteURLSchemes = false
2728

2829
//MARK: Constants
2930
let defaults = UserDefaults()
@@ -359,6 +360,10 @@ class AppResign {
359360
}
360361
}
361362

363+
// MARK: Delete URL Schemes
364+
if deleteURLSchemes {
365+
let _ = self.plistBuddy(appBundleInfoPlist, command: "delete :CFBundleURLTypes")
366+
}
362367

363368
func generateFileSignFunc(_ payloadDirectory: String, entitlementsPath: String, signingCertificate: String) -> ( (file: String) -> Void ) {
364369

@@ -506,6 +511,10 @@ class AppResign {
506511
return Task().execute(plistBuddyPath, workingDirectory: nil, arguments: ["-c", "set :\(keyName) \(value)", plist])
507512
}
508513

514+
func plistBuddy(_ plist: String, command: String) -> AppSignerTaskOutput {
515+
return Task().execute(plistBuddyPath, workingDirectory: nil, arguments: ["-c", command, plist])
516+
}
517+
509518
func recursiveDirectorySearch(_ path: String, extensions: [String], found: ((file: String) -> Void)){
510519

511520
if let files = try? fileManager.contentsOfDirectory(atPath: path) {

AppResign/AppResign/main.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ func mainRoutine(_ input: String, output: String, certificate: String, provProfi
160160
appResign.newDisplayName = r
161161
}
162162
}
163+
164+
// If delete url schemes
165+
let deleteQuery = raw_input("Delete url schemes (y/n): ")
166+
if !deleteQuery.isEmpty && deleteQuery == "y" {
167+
appResign.deleteURLSchemes = true
168+
}
169+
163170
print("=============================")
164171

165172
// Start signing

0 commit comments

Comments
 (0)