├── .github
└── workflows
│ └── xcodebuild.yml
├── .gitignore
├── AppSigner
├── AppDelegate.swift
├── AppSigner.entitlements
├── Application.xib
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── 128x128.png
│ │ ├── 16x16.png
│ │ ├── 256x256-1.png
│ │ ├── 256x256.png
│ │ ├── 32x32-1.png
│ │ ├── 32x32.png
│ │ ├── 512x512.png
│ │ ├── 64x64.png
│ │ ├── Contents.json
│ │ ├── document-sign-2.png
│ │ └── document-sign.png
│ └── Contents.json
├── Classes
│ └── iASShared.swift
├── Info.plist
├── MainView.swift
├── Resources
│ └── fix-wwdr.sh
├── Updates.xib
└── UpdatesController.swift
├── LICENSE.txt
├── Log.swift
├── NSMenuLink.swift
├── NSTask-execute.swift
├── NimbusKit
├── markdown
│ ├── MarkdownTokenizer.m
│ ├── MarkdownTokens.h
│ ├── MarkdownTokens.m
│ ├── NSAttributedStringMarkdownParser.h
│ ├── NSAttributedStringMarkdownParser.m
│ └── NimbusMarkdown.h
└── memorymapping
│ ├── NimbusMemoryMapping.h
│ ├── fmemopen.c
│ └── fmemopen.h
├── ProvisioningProfile.swift
├── README.md
├── StringByAppendingPathComponent.swift
├── document-sign.svg
├── iOS App Signer-Bridging-Header.h
└── iOS App Signer.xcodeproj
├── project.pbxproj
└── project.xcworkspace
├── contents.xcworkspacedata
└── xcshareddata
└── IDEWorkspaceChecks.plist
/.github/workflows/xcodebuild.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: CI
4 |
5 | # Controls when the action will run.
6 | on:
7 | # Triggers the workflow on push or pull request events but only for the master branch
8 | push:
9 | branches: '*'
10 | pull_request:
11 | branches: '*'
12 |
13 | # Allows you to run this workflow manually from the Actions tab
14 | workflow_dispatch:
15 |
16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
17 | jobs:
18 | # This workflow contains a single job called "build"
19 | build:
20 | # The type of runner that the job will run on
21 | runs-on: macos-latest
22 |
23 | # Steps represent a sequence of tasks that will be executed as part of the job
24 | steps:
25 | - name: Checkout
26 | uses: actions/checkout@v2
27 |
28 | - name: Build
29 | run: xcodebuild build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
30 |
31 | - name: Upload Artifact
32 | uses: actions/upload-artifact@v4
33 | with:
34 | name: release
35 | path: build/Release
36 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #########################
2 | # .gitignore file for Xcode4 and Xcode5 Source projects
3 | #
4 | # Apple bugs, waiting for Apple to fix/respond:
5 | #
6 | # 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
7 | #
8 | # Version 2.6
9 | # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
10 | #
11 | # 2015 updates:
12 | # - Fixed typo in "xccheckout" line - thanks to @lyck for pointing it out!
13 | # - Fixed the .idea optional ignore. Thanks to @hashier for pointing this out
14 | # - Finally added "xccheckout" to the ignore. Apple still refuses to answer support requests about this, but in practice it seems you should ignore it.
15 | # - minor tweaks from Jona and Coeur (slightly more precise xc* filtering/names)
16 | # 2014 updates:
17 | # - appended non-standard items DISABLED by default (uncomment if you use those tools)
18 | # - removed the edit that an SO.com moderator made without bothering to ask me
19 | # - researched CocoaPods .lock more carefully, thanks to Gokhan Celiker
20 | # 2013 updates:
21 | # - fixed the broken "save personal Schemes"
22 | # - added line-by-line explanations for EVERYTHING (some were missing)
23 | #
24 | # NB: if you are storing "built" products, this WILL NOT WORK,
25 | # and you should use a different .gitignore (or none at all)
26 | # This file is for SOURCE projects, where there are many extra
27 | # files that we want to exclude
28 | #
29 | #########################
30 |
31 | #####
32 | # OS X temporary files that should never be committed
33 | #
34 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html
35 |
36 | .DS_Store
37 |
38 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html
39 |
40 | .Trashes
41 |
42 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html
43 |
44 | *.swp
45 |
46 | #
47 | # *.lock - this is used and abused by many editors for many different things.
48 | # For the main ones I use (e.g. Eclipse), it should be excluded
49 | # from source-control, but YMMV.
50 | # (lock files are usually local-only file-synchronization on the local FS that should NOT go in git)
51 | # c.f. the "OPTIONAL" section at bottom though, for tool-specific variations!
52 | #
53 | # In particular, if you're using CocoaPods, you'll want to comment-out this line:
54 | *.lock
55 |
56 |
57 | #
58 | # profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?)
59 | #profile
60 |
61 |
62 | ####
63 | # Xcode temporary files that should never be committed
64 | #
65 | # NB: NIB/XIB files still exist even on Storyboard projects, so we want this...
66 |
67 | *~.nib
68 |
69 |
70 | ####
71 | # Xcode build files -
72 | #
73 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"
74 |
75 | DerivedData/
76 |
77 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"
78 |
79 | build/
80 |
81 |
82 | #####
83 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
84 | #
85 | # This is complicated:
86 | #
87 | # SOMETIMES you need to put this file in version control.
88 | # Apple designed it poorly - if you use "custom executables", they are
89 | # saved in this file.
90 | # 99% of projects do NOT use those, so they do NOT want to version control this file.
91 | # ..but if you're in the 1%, comment out the line "*.pbxuser"
92 |
93 | # .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html
94 |
95 | *.pbxuser
96 |
97 | # .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
98 |
99 | *.mode1v3
100 |
101 | # .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
102 |
103 | *.mode2v3
104 |
105 | # .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file
106 |
107 | *.perspectivev3
108 |
109 | # NB: also, whitelist the default ones, some projects need to use these
110 | !default.pbxuser
111 | !default.mode1v3
112 | !default.mode2v3
113 | !default.perspectivev3
114 |
115 |
116 | ####
117 | # Xcode 4 - semi-personal settings
118 | #
119 | # Apple Shared data that Apple put in the wrong folder
120 | # c.f. http://stackoverflow.com/a/19260712/153422
121 | # FROM ANSWER: Apple says "don't ignore it"
122 | # FROM COMMENTS: Apple is wrong; Apple code is too buggy to trust; there are no known negative side-effects to ignoring Apple's unofficial advice and instead doing the thing that actively fixes bugs in Xcode
123 | # Up to you, but ... current advice: ignore it.
124 | *.xccheckout
125 |
126 | #
127 | #
128 | # OPTION 1: ---------------------------------
129 | # throw away ALL personal settings (including custom schemes!
130 | # - unless they are "shared")
131 | # As per build/ and DerivedData/, this ought to have a trailing slash
132 | #
133 | # NB: this is exclusive with OPTION 2 below
134 | xcuserdata/
135 |
136 | # OPTION 2: ---------------------------------
137 | # get rid of ALL personal settings, but KEEP SOME OF THEM
138 | # - NB: you must manually uncomment the bits you want to keep
139 | #
140 | # NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
141 | # or manually install git over the top of the OS X version
142 | # NB: this is exclusive with OPTION 1 above
143 | #
144 | #xcuserdata/**/*
145 |
146 | # (requires option 2 above): Personal Schemes
147 | #
148 | #!xcuserdata/**/xcschemes/*
149 |
150 | ####
151 | # XCode 4 workspaces - more detailed
152 | #
153 | # Workspaces are important! They are a core feature of Xcode - don't exclude them :)
154 | #
155 | # Workspace layout is quite spammy. For reference:
156 | #
157 | # /(root)/
158 | # /(project-name).xcodeproj/
159 | # project.pbxproj
160 | # /project.xcworkspace/
161 | # contents.xcworkspacedata
162 | # /xcuserdata/
163 | # /(your name)/xcuserdatad/
164 | # UserInterfaceState.xcuserstate
165 | # /xcshareddata/
166 | # /xcschemes/
167 | # (shared scheme name).xcscheme
168 | # /xcuserdata/
169 | # /(your name)/xcuserdatad/
170 | # (private scheme).xcscheme
171 | # xcschememanagement.plist
172 | #
173 | #
174 |
175 | ####
176 | # Xcode 4 - Deprecated classes
177 | #
178 | # Allegedly, if you manually "deprecate" your classes, they get moved here.
179 | #
180 | # We're using source-control, so this is a "feature" that we do not want!
181 |
182 | *.moved-aside
183 |
184 | ####
185 | # OPTIONAL: Some well-known tools that people use side-by-side with Xcode / iOS development
186 | #
187 | # NB: I'd rather not include these here, but gitignore's design is weak and doesn't allow
188 | # modular gitignore: you have to put EVERYTHING in one file.
189 | #
190 | # COCOAPODS:
191 | #
192 | # c.f. http://guides.cocoapods.org/using/using-cocoapods.html#what-is-a-podfilelock
193 | # c.f. http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
194 | #
195 | #!Podfile.lock
196 | #
197 | # RUBY:
198 | #
199 | # c.f. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
200 | #
201 | #!Gemfile.lock
202 | #
203 | # IDEA:
204 | #
205 | # c.f. https://www.jetbrains.com/objc/help/managing-projects-under-version-control.html?search=workspace.xml
206 | #
207 | #.idea/workspace.xml
208 | #
209 | # TEXTMATE:
210 | #
211 | # -- UNVERIFIED: c.f. http://stackoverflow.com/a/50283/153422
212 | #
213 | #tm_build_errors
214 |
215 | ####
216 | # UNKNOWN: recommended by others, but I can't discover what these files are
217 | #
218 |
--------------------------------------------------------------------------------
/AppSigner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // AppSigner
4 | //
5 | // Created by Daniel Radtke on 11/2/15.
6 | // Copyright © 2015 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 | @IBOutlet weak var mainView: MainView!
15 | @objc let fileManager = FileManager.default
16 |
17 |
18 | func applicationDidFinishLaunching(_ aNotification: Notification) {
19 | // Insert code here to initialize your application
20 | }
21 |
22 | func applicationWillTerminate(_ aNotification: Notification) {
23 | // Insert code here to tear down your application
24 | try? fileManager.removeItem(atPath: Log.logName)
25 | }
26 |
27 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
28 | return true
29 | }
30 | @IBAction func fixSigning(_ sender: NSMenuItem) {
31 | if let tempFolder = mainView.makeTempFolder() {
32 | iASShared.fixSigning(tempFolder)
33 | try? fileManager.removeItem(atPath: tempFolder)
34 | mainView.populateCodesigningCerts()
35 | }
36 | }
37 |
38 | @IBAction func nsMenuLinkClick(_ sender: NSMenuLink) {
39 | NSWorkspace.shared.open(URL(string: sender.url!)!)
40 | }
41 | @IBAction func viewLog(_ sender: AnyObject) {
42 | NSWorkspace.shared.openFile(Log.logName)
43 | }
44 | @IBAction func checkForUpdates(_ sender: NSMenuItem) {
45 | UpdatesController.checkForUpdate(forceShow: true)
46 | func updateCheckStatus(_ status: Bool, data: Data?, response: URLResponse?, error: Error?){
47 | if status == false {
48 | DispatchQueue.main.async {
49 | let alert = NSAlert()
50 |
51 |
52 | if error != nil {
53 | alert.messageText = "There was a problem checking for a new version."
54 | alert.informativeText = "More information is available in the application log."
55 | Log.write(error!.localizedDescription)
56 | } else {
57 | alert.messageText = "You are currently running the latest version."
58 | }
59 | alert.runModal()
60 | }
61 | }
62 | }
63 | UpdatesController.checkForUpdate(forceShow: true, callbackFunc: updateCheckStatus)
64 | }
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/AppSigner/AppSigner.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AppSigner/Application.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
213 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/128x128.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/16x16.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/256x256-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/256x256-1.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/256x256.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/32x32-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/32x32-1.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/32x32.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/512x512.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/64x64.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "16x16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "32x32-1.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "32x32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "64x64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "128x128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "256x256-1.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "256x256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "512x512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "document-sign-2.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "document-sign.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/document-sign-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/document-sign-2.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/AppIcon.appiconset/document-sign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanTheMan827/ios-app-signer/7c0daee1e1a49c8bd1d8a93f632e0b860b10d56a/AppSigner/Assets.xcassets/AppIcon.appiconset/document-sign.png
--------------------------------------------------------------------------------
/AppSigner/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AppSigner/Classes/iASShared.swift:
--------------------------------------------------------------------------------
1 | //
2 | // iASShared.swift
3 | // iOS App Signer
4 | //
5 | // Created by Daniel Radtke on 5/7/16.
6 | // Copyright © 2016 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | class iASShared {
11 | static func fixSigning(_ tempFolder: String){
12 | let script = "do shell script \"/bin/bash \\\"\(Bundle.main.path(forResource: "fix-wwdr", ofType: "sh")!)\\\"\" with administrator privileges"
13 | NSAppleScript(source: script)?.executeAndReturnError(nil)
14 | //https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
15 | return
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/AppSigner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.14.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.14.0
23 | LSApplicationCategoryType
24 | public.app-category.utilities
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 |
32 | NSHumanReadableCopyright
33 | Copyright © 2015 Daniel Radtke. All rights reserved.
34 | NSMainNibFile
35 | Application
36 | NSPrincipalClass
37 | NSApplication
38 |
39 |
40 |
--------------------------------------------------------------------------------
/AppSigner/Resources/fix-wwdr.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | security find-certificate -c "Apple Worldwide Developer Relations Certification Authority" -a -Z | awk '/SHA-1/{system("security delete-certificate -Z "$NF)}'
3 | TEMP="$(mktemp -d -t com.DanTheMan827.WWDR-Fix)"
4 | curl "https://developer.apple.com/certificationauthority/AppleWWDRCA.cer" > "$TEMP/AppleWWDRCA.cer"
5 | security add-certificates "$TEMP/AppleWWDRCA.cer"
6 | rm "$TEMP/AppleWWDRCA.cer"
--------------------------------------------------------------------------------
/AppSigner/Updates.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
99 |
109 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/AppSigner/UpdatesController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UpdatesController.swift
3 | // iOS App Signer
4 | //
5 | // Created by Daniel Radtke on 2/5/16.
6 | // Copyright © 2016 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import AppKit
11 | class UpdatesController: NSWindowController {
12 | //MARK: Variables
13 | @objc let markdownParser = NSAttributedStringMarkdownParser()
14 | @objc var latestVersion: String?
15 | @objc let prefs = UserDefaults.standard
16 | @objc static var updatesWindow: UpdatesController?
17 |
18 | //MARK: IBOutlets
19 | @IBOutlet weak var appIcon: NSImageView!
20 | @IBOutlet var updateWindow: NSWindow!
21 | @IBOutlet var changelogText: NSTextView!
22 | @IBOutlet weak var versionLabel: NSTextField!
23 |
24 | //MARK: Functions
25 | @objc static func checkForUpdate(
26 | _ currentVersion: String = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String,
27 | forceShow: Bool = false,
28 | callbackFunc: ((_ status: Bool, _ data: Data?, _ response: URLResponse?, _ error: Error?)->Void)? = nil
29 | ) {
30 | let requestURL: URL = URL(string: "https://api.github.com/repos/DanTheMan827/ios-app-signer/releases")!
31 | let urlRequest = URLRequest(url: requestURL)
32 |
33 | let configuration = URLSessionConfiguration.default
34 | configuration.requestCachePolicy = .reloadIgnoringLocalAndRemoteCacheData
35 | let session = URLSession(configuration: configuration)
36 |
37 | let task = session.dataTask(with: urlRequest, completionHandler: {
38 | (data, response, error) -> Void in
39 |
40 | if error == nil {
41 | let httpResponse = response as! HTTPURLResponse
42 | let statusCode = httpResponse.statusCode
43 |
44 | if (statusCode == 200) {
45 | do{
46 |
47 | let json = try JSONSerialization.jsonObject(with: data!, options:.allowFragments)
48 | if let releases = json as? [[String: AnyObject]],
49 | let release = releases[0] as? [String: AnyObject],
50 | let name = release["name"] as? String {
51 | let prefs = UserDefaults.standard
52 | if let skipVersion = prefs.string(forKey: "skipVersion"){
53 | if skipVersion == name && forceShow == false {
54 | return
55 | }
56 | }
57 | if name != currentVersion {
58 | DispatchQueue.main.async {
59 | // update some UI
60 | if updatesWindow == nil {
61 | updatesWindow = UpdatesController(windowNibName: "Updates")
62 | }
63 | updatesWindow!.showWindow([currentVersion,releases])
64 | }
65 | if let statusFunc = callbackFunc {
66 | statusFunc(true, data, response, error)
67 | }
68 | } else {
69 | if let statusFunc = callbackFunc {
70 | statusFunc(false, data, response, error)
71 | }
72 | }
73 | }
74 | }catch {
75 | Log.write("Error with Json: \(error)")
76 | }
77 | } else {
78 | if let statusFunc = callbackFunc {
79 | statusFunc(false, data, response, error)
80 | }
81 | }
82 | } else {
83 | if let statusFunc = callbackFunc {
84 | statusFunc(false, data, response, error)
85 | }
86 | }
87 | })
88 |
89 |
90 | task.resume()
91 |
92 | }
93 |
94 | override init(window: NSWindow?) {
95 | super.init(window: window)
96 |
97 | }
98 | required init?(coder: NSCoder) {
99 | super.init(coder: coder)
100 | }
101 | override func showWindow(_ sender: Any?) {
102 | super.showWindow(sender)
103 | appIcon.image = NSWorkspace.shared.icon(forFile: Bundle.main.bundlePath)
104 | var releaseOutput: [String] = []
105 | if let senderArray = sender as? [AnyObject] {
106 | if let releases = senderArray[1] as? [[String: AnyObject]],
107 | let currentVersion = senderArray[0] as? String {
108 | for release in releases {
109 | if let name = release["name"] as? String,
110 | let body = release["body"] as? String {
111 | if latestVersion == nil {
112 | latestVersion = name
113 | }
114 | if currentVersion == name {
115 | break
116 | }
117 | releaseOutput.append("**Version \(name)**\n\(body)")
118 | }
119 | }
120 | versionLabel.stringValue = "Version \(latestVersion!) is now available, you have \(currentVersion)."
121 | }
122 | setChangelog(releaseOutput.joined(separator: "\n\n"))
123 | }
124 |
125 | }
126 | @objc func setChangelog(_ text: String){
127 | changelogText.isEditable = true
128 | changelogText.string = ""
129 | changelogText.insertText(markdownParser.attributedString(fromMarkdownString: text))
130 | changelogText.isEditable = false
131 | }
132 |
133 | //MARK: IBActions
134 | @IBAction func skipVersion(_ sender: NSButton) {
135 | prefs.setValue(latestVersion, forKey: "skipVersion")
136 | updateWindow.close()
137 | }
138 | @IBAction func remindMeLater(_ sender: NSButton) {
139 | prefs.setValue(nil, forKey: "skipVersion")
140 | updateWindow.close()
141 | }
142 | @IBAction func visitProjectPage(_ sender: NSButton) {
143 | NSWorkspace.shared.open(URL(string: "http://dantheman827.github.io/ios-app-signer/")!)
144 | updateWindow.close()
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Log.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Log.swift
3 | // iOS App Signer
4 | //
5 | // Created by Daniel Radtke on 11/14/15.
6 | // Copyright © 2015 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | class Log {
11 | static let mainBundle = Bundle.main
12 | static let bundleID = mainBundle.bundleIdentifier
13 | static let bundleName = mainBundle.infoDictionary!["CFBundleName"]
14 | static let bundleVersion = mainBundle.infoDictionary!["CFBundleShortVersionString"]
15 | static let tempDirectory = NSTemporaryDirectory()
16 | static var logName = Log.tempDirectory.stringByAppendingPathComponent("\(Log.bundleID!)-\(Date().timeIntervalSince1970).log")
17 |
18 | static func write(_ value:String) {
19 | let formatter = DateFormatter()
20 | formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
21 |
22 |
23 | if let outputStream = OutputStream(toFileAtPath: logName, append: true) {
24 | outputStream.open()
25 | let text = "\(formatter.string(from: Date())) \(value)\n"
26 | let data = text.data(using: String.Encoding.utf8, allowLossyConversion: false)!
27 | outputStream.write((data as NSData).bytes.bindMemory(to: UInt8.self, capacity: data.count), maxLength: data.count)
28 | outputStream.close()
29 | }
30 | NSLog(value)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/NSMenuLink.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSMenuLink.swift
3 | // iOS App Signer
4 | //
5 | // Created by Daniel Radtke on 11/14/15.
6 | // Copyright © 2015 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import AppKit
11 |
12 | class NSMenuLink: NSMenuItem {
13 | @IBInspectable var url: String?
14 | }
--------------------------------------------------------------------------------
/NSTask-execute.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSTask-execute.swift
3 | // AppSigner
4 | //
5 | // Created by Daniel Radtke on 11/3/15.
6 | // Copyright © 2015 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | struct AppSignerTaskOutput {
11 | var output: String
12 | var status: Int32
13 | init(status: Int32, output: String){
14 | self.status = status
15 | self.output = output
16 | }
17 | }
18 | extension Process {
19 | func launchSynchronous() -> AppSignerTaskOutput {
20 | self.standardInput = FileHandle.nullDevice
21 | let pipe = Pipe()
22 | self.standardOutput = pipe
23 | self.standardError = pipe
24 | let pipeFile = pipe.fileHandleForReading
25 | self.launch()
26 |
27 | let data = NSMutableData()
28 | while self.isRunning {
29 | data.append(pipeFile.availableData)
30 | }
31 |
32 | pipeFile.closeFile();
33 | self.terminate();
34 |
35 | if let output = String.init(data: data as Data, encoding: String.Encoding.utf8) {
36 | return AppSignerTaskOutput(status: self.terminationStatus, output: output)
37 | } else {
38 | return AppSignerTaskOutput(status: self.terminationStatus, output: "")
39 | }
40 |
41 | }
42 |
43 | func execute(_ launchPath: String, workingDirectory: String?, arguments: [String]?)->AppSignerTaskOutput{
44 | self.launchPath = launchPath
45 | if arguments != nil {
46 | self.arguments = arguments
47 | }
48 | if workingDirectory != nil {
49 | self.currentDirectoryPath = workingDirectory!
50 | }
51 | return self.launchSynchronous()
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/NimbusKit/markdown/MarkdownTokens.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2012 Jeff Verkoeyen
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #include
18 |
19 | typedef enum {
20 | MARKDOWNFIRST_TOKEN = 0x100,
21 | MARKDOWNEM = MARKDOWNFIRST_TOKEN,
22 | MARKDOWNSTRONG,
23 | MARKDOWNSTRONGEM,
24 | MARKDOWNSTRIKETHROUGH,
25 | MARKDOWNHEADER,
26 | MARKDOWNMULTILINEHEADER,
27 | MARKDOWNURL,
28 | MARKDOWNHREF,
29 | MARKDOWNPARAGRAPH,
30 | MARKDOWNNEWLINE,
31 | MARKDOWNBULLETSTART,
32 | MARKDOWNCODESPAN,
33 | MARKDOWNUNKNOWN,
34 |
35 | } MarkdownParserCodes;
36 |
37 | extern const char* markdownnames[];
38 |
39 | #ifndef YY_TYPEDEF_YY_SCANNER_T
40 | #define YY_TYPEDEF_YY_SCANNER_T
41 | typedef void* yyscan_t;
42 | #endif
43 |
44 | extern FILE *markdownin;
45 |
46 | int markdownlex_init(yyscan_t* yyscanner);
47 | int markdownlex_destroy(yyscan_t yyscanner);
48 | void markdownset_in (FILE * in_str , yyscan_t yyscanner);
49 |
50 | int markdownlex(yyscan_t yyscanner);
51 | int markdownConsume(char* text, int token, yyscan_t yyscanner);
52 | int markdownget_lineno(yyscan_t scanner);
53 |
54 | #define MARKDOWN_EXTRA_TYPE void*
55 | MARKDOWN_EXTRA_TYPE markdownget_extra(yyscan_t scanner);
56 | void markdownset_extra(MARKDOWN_EXTRA_TYPE arbitrary_data , yyscan_t scanner);
57 |
--------------------------------------------------------------------------------
/NimbusKit/markdown/MarkdownTokens.m:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2011-2014 NimbusKit
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | const char* markdownnames[] = {
18 | "EM",
19 | "STRONG",
20 | "STRONGEM",
21 | "STRIKETHROUGH",
22 | "HEADER",
23 | "MULTILINEHEADER",
24 | "URL",
25 | "HREF",
26 | "PARAGRAPH",
27 | "NEWLINE",
28 | "BULLETSTART",
29 | "MARKDOWNCODESPAN",
30 | "UNKNOWN"
31 | };
32 |
--------------------------------------------------------------------------------
/NimbusKit/markdown/NSAttributedStringMarkdownParser.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2011-2014 NimbusKit
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #import
18 |
19 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
20 | #import
21 | #define UINSFont UIFont
22 | #else
23 | #import
24 | #define UINSFont NSFont
25 | #endif
26 |
27 | typedef enum {
28 | NSAttributedStringMarkdownParserHeader1,
29 | NSAttributedStringMarkdownParserHeader2,
30 | NSAttributedStringMarkdownParserHeader3,
31 | NSAttributedStringMarkdownParserHeader4,
32 | NSAttributedStringMarkdownParserHeader5,
33 | NSAttributedStringMarkdownParserHeader6,
34 |
35 | } NSAttributedStringMarkdownParserHeader;
36 |
37 | @protocol NSAttributedStringMarkdownStylesheet;
38 |
39 | @interface NSAttributedStringMarkdownLink : NSObject
40 | @property (nonatomic, readonly, strong) NSURL* url;
41 | @property (nonatomic, readonly, assign) NSRange range;
42 | @property (nonatomic, readonly, copy) NSString *tooltip;
43 | @end
44 |
45 | /**
46 | * The NSAttributedStringMarkdownParser class parses a given markdown string into an
47 | * NSAttributedString.
48 | *
49 | * @ingroup NimbusMarkdown
50 | */
51 | @interface NSAttributedStringMarkdownParser : NSObject
52 |
53 | - (NSAttributedString *)attributedStringFromMarkdownString:(NSString *)string;
54 | - (NSArray *)links; // Array of NSAttributedStringMarkdownLink
55 |
56 | @property (nonatomic, strong) UINSFont* paragraphFont; // Default: systemFontOfSize:12
57 | @property (nonatomic, copy) NSString* boldFontName; // Default: boldSystemFont
58 | @property (nonatomic, copy) NSString* italicFontName; // Default: Helvetica-Oblique
59 | @property (nonatomic, copy) NSString* boldItalicFontName; // Default: Helvetica-BoldOblique
60 | @property (nonatomic, copy) NSString* codeFontName; // Default: Courier
61 |
62 | - (void)setFont:(UINSFont *)font forHeader:(NSAttributedStringMarkdownParserHeader)header;
63 | - (UINSFont *)fontForHeader:(NSAttributedStringMarkdownParserHeader)header;
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/NimbusKit/markdown/NSAttributedStringMarkdownParser.m:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2011-2014 NimbusKit
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #import "NSAttributedStringMarkdownParser.h"
18 |
19 | #import "MarkdownTokens.h"
20 | #import "fmemopen.h"
21 |
22 | #import
23 | #import
24 |
25 | static NSRegularExpression *_hrefRegex = nil;
26 | static inline NSRegularExpression* hrefRegex(void) {
27 | static dispatch_once_t onceToken;
28 | dispatch_once(&onceToken, ^{
29 | _hrefRegex = [NSRegularExpression regularExpressionWithPattern:@"\\[(.*?)\\]\\((\\S+)(\\s+(\"|\')(.*?)(\"|\'))?\\)"
30 | options:NSRegularExpressionCaseInsensitive
31 | error:nil];
32 | });
33 |
34 | return _hrefRegex;
35 | }
36 |
37 | int markdownConsume(char* text, int token, yyscan_t scanner);
38 |
39 | @interface NSAttributedStringMarkdownLink()
40 | @property (nonatomic, strong) NSURL* url;
41 | @property (nonatomic, assign) NSRange range;
42 | @property (nonatomic, copy) NSString *tooltip;
43 | @end
44 |
45 | @implementation NSAttributedStringMarkdownLink
46 | @end
47 |
48 | @implementation NSAttributedStringMarkdownParser {
49 | NSMutableDictionary* _headerFonts;
50 |
51 | NSMutableArray* _bulletStarts;
52 |
53 | NSMutableAttributedString* _accum;
54 | NSMutableArray* _links;
55 |
56 | UINSFont* _topFont;
57 | NSMutableDictionary* _fontCache;
58 | }
59 |
60 | - (id)init {
61 | if ((self = [super init])) {
62 | _headerFonts = [NSMutableDictionary dictionary];
63 |
64 | self.paragraphFont = [UINSFont systemFontOfSize:12];
65 | self.boldFontName = [UINSFont boldSystemFontOfSize:12].fontName;
66 | self.italicFontName = @"Helvetica-Oblique";
67 | self.boldItalicFontName = @"Helvetica-BoldOblique";
68 | self.codeFontName = @"Courier";
69 |
70 | NSAttributedStringMarkdownParserHeader header = NSAttributedStringMarkdownParserHeader1;
71 | for (CGFloat headerFontSize = 24; headerFontSize >= 14; headerFontSize -= 2, header++) {
72 | [self setFont:[UINSFont systemFontOfSize:headerFontSize] forHeader:header];
73 | }
74 | }
75 | return self;
76 | }
77 |
78 | - (id)copyWithZone:(NSZone *)zone {
79 | NSAttributedStringMarkdownParser* parser = [[self.class allocWithZone:zone] init];
80 | parser.paragraphFont = self.paragraphFont;
81 | parser.boldFontName = self.boldFontName;
82 | parser.italicFontName = self.italicFontName;
83 | parser.boldItalicFontName = self.boldItalicFontName;
84 | parser.codeFontName = self.codeFontName;
85 | for (NSAttributedStringMarkdownParserHeader header = NSAttributedStringMarkdownParserHeader1; header <= NSAttributedStringMarkdownParserHeader6; ++header) {
86 | [parser setFont:[self fontForHeader:header] forHeader:header];
87 | }
88 | return parser;
89 | }
90 |
91 | - (id)keyForHeader:(NSAttributedStringMarkdownParserHeader)header {
92 | return @(header);
93 | }
94 |
95 | - (void)setFont:(UINSFont *)font forHeader:(NSAttributedStringMarkdownParserHeader)header {
96 | _headerFonts[[self keyForHeader:header]] = font;
97 | }
98 |
99 | - (UINSFont *)fontForHeader:(NSAttributedStringMarkdownParserHeader)header {
100 | return _headerFonts[[self keyForHeader:header]];
101 | }
102 |
103 | - (NSAttributedString *)attributedStringFromMarkdownString:(NSString *)string {
104 | _links = [NSMutableArray array];
105 | _bulletStarts = [NSMutableArray array];
106 | _accum = [[NSMutableAttributedString alloc] init];
107 |
108 | const char* cstr = [string UTF8String];
109 | FILE* markdownin = fmemopen((void *)cstr, [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding], "r");
110 |
111 | yyscan_t scanner;
112 |
113 | markdownlex_init(&scanner);
114 | markdownset_extra((__bridge void *)(self), scanner);
115 | markdownset_in(markdownin, scanner);
116 | markdownlex(scanner);
117 | markdownlex_destroy(scanner);
118 |
119 | fclose(markdownin);
120 |
121 | if (_bulletStarts.count > 0) {
122 | // Treat nested bullet points as flat ones...
123 |
124 | // Finish off the previous dash and start a new one.
125 | NSInteger lastBulletStart = [[_bulletStarts lastObject] intValue];
126 | [_bulletStarts removeLastObject];
127 |
128 | [_accum addAttributes:[self paragraphStyle]
129 | range:NSMakeRange(lastBulletStart, _accum.length - lastBulletStart)];
130 | }
131 |
132 | #if TARGET_OS_MAC
133 | const BOOL shouldAddLinks = YES;
134 | #elif __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
135 | const BOOL shouldAddLinks = (NSLinkAttributeName != nil);
136 | #endif
137 |
138 | if (shouldAddLinks) {
139 | [self addLinksToAttributedString];
140 | }
141 |
142 | return [_accum copy];
143 | }
144 |
145 | - (void)addLinksToAttributedString {
146 | #if TARGET_OS_MAC || __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
147 | for (NSAttributedStringMarkdownLink *link in _links) {
148 | if (link.url) {
149 | [_accum addAttribute:NSLinkAttributeName value:link.url range:link.range];
150 | }
151 | }
152 | #endif
153 | }
154 |
155 | - (NSArray *)links {
156 | return [_links copy];
157 | }
158 |
159 | - (NSDictionary *)paragraphStyle {
160 | CGFloat paragraphSpacing = 0.0;
161 | CGFloat paragraphSpacingBefore = 0.0;
162 | CGFloat firstLineHeadIndent = 15.0;
163 | CGFloat headIndent = 30.0;
164 |
165 | CGFloat firstTabStop = 35.0; // width of your indent
166 | CGFloat lineSpacing = 0.45;
167 |
168 | #ifdef TARGET_OS_IPHONE
169 | NSTextAlignment alignment = NSTextAlignmentLeft;
170 |
171 | NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
172 | style.paragraphSpacing = paragraphSpacing;
173 | style.paragraphSpacingBefore = paragraphSpacingBefore;
174 | style.firstLineHeadIndent = firstLineHeadIndent;
175 | style.headIndent = headIndent;
176 | style.lineSpacing = lineSpacing;
177 | style.alignment = alignment;
178 | style.tabStops = @[[[NSTextTab alloc] initWithTextAlignment:alignment location:firstTabStop options:nil]];
179 |
180 | return @{ NSParagraphStyleAttributeName: style };
181 | #else
182 | CTTextAlignment alignment = kCTLeftTextAlignment;
183 |
184 | CTTextTabRef tabArray[] = { CTTextTabCreate(0, firstTabStop, NULL) };
185 |
186 | CFArrayRef tabStops = CFArrayCreate( kCFAllocatorDefault, (const void**) tabArray, 1, &kCFTypeArrayCallBacks );
187 | CFRelease(tabArray[0]);
188 |
189 | CTParagraphStyleSetting altSettings[] =
190 | {
191 | { kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing},
192 | { kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &alignment},
193 | { kCTParagraphStyleSpecifierFirstLineHeadIndent, sizeof(CGFloat), &firstLineHeadIndent},
194 | { kCTParagraphStyleSpecifierHeadIndent, sizeof(CGFloat), &headIndent},
195 | { kCTParagraphStyleSpecifierTabStops, sizeof(CFArrayRef), &tabStops},
196 | { kCTParagraphStyleSpecifierParagraphSpacing, sizeof(CGFloat), ¶graphSpacing},
197 | { kCTParagraphStyleSpecifierParagraphSpacingBefore, sizeof(CGFloat), ¶graphSpacingBefore}
198 | };
199 |
200 | CTParagraphStyleRef style;
201 | style = CTParagraphStyleCreate( altSettings, sizeof(altSettings) / sizeof(CTParagraphStyleSetting) );
202 |
203 | if ( style == NULL )
204 | {
205 | NSLog(@"*** Unable To Create CTParagraphStyle in apply paragraph formatting" );
206 | return nil;
207 | }
208 |
209 | return [NSDictionary dictionaryWithObjectsAndKeys:(__bridge id)style,(NSString*) kCTParagraphStyleAttributeName, nil];
210 | #endif
211 | }
212 |
213 | - (UINSFont *)topFont {
214 | if (nil == _topFont) {
215 | return self.paragraphFont;
216 | } else {
217 | return _topFont;
218 | }
219 | }
220 |
221 | - (id)keyForFontWithName:(NSString *)fontName pointSize:(CGFloat)pointSize {
222 | return [fontName stringByAppendingFormat:@"%f", pointSize];
223 | }
224 |
225 | - (CTFontRef)fontRefForFontWithName:(NSString *)fontName pointSize:(CGFloat)pointSize {
226 | id key = [self keyForFontWithName:fontName pointSize:pointSize];
227 | NSValue* value = _fontCache[key];
228 | if (nil == value) {
229 | CTFontRef fontRef = CTFontCreateWithName((__bridge CFStringRef)fontName, pointSize, nil);
230 | value = [NSValue valueWithPointer:fontRef];
231 | _fontCache[key] = value;
232 | }
233 | return [value pointerValue];
234 | }
235 |
236 | - (NSDictionary *)attributesForFontWithName:(NSString *)fontName {
237 | return @{NSFontAttributeName: [UINSFont fontWithName:fontName size:self.topFont.pointSize]};
238 | }
239 |
240 | - (NSDictionary *)attributesForFont:(UINSFont *)font {
241 | return @{NSFontAttributeName: font};
242 | }
243 |
244 | - (void)recurseOnString:(NSString *)string withFont:(UINSFont *)font {
245 | NSAttributedStringMarkdownParser* recursiveParser = [self copy];
246 | recursiveParser->_topFont = font;
247 | [_accum appendAttributedString:[recursiveParser attributedStringFromMarkdownString:string]];
248 |
249 | // Adjust the recursive parser's links so that they are offset correctly.
250 | for (NSAttributedStringMarkdownLink *currentLink in recursiveParser.links) {
251 | NSRange range = [currentLink range];
252 | range.location += _accum.length;
253 | currentLink.range = range;
254 | [_links addObject:currentLink];
255 | }
256 | }
257 |
258 | - (void)consumeToken:(int)token text:(char*)text {
259 | NSString* textAsString = [[NSString alloc] initWithCString:text encoding:NSUTF8StringEncoding];
260 |
261 | NSMutableDictionary* attributes = [NSMutableDictionary dictionary];
262 | [attributes addEntriesFromDictionary:[self attributesForFont:self.topFont]];
263 |
264 | switch (token) {
265 | case MARKDOWNEM: { // * *
266 | textAsString = [textAsString substringWithRange:NSMakeRange(1, textAsString.length - 2)];
267 | [attributes addEntriesFromDictionary:[self attributesForFontWithName:self.italicFontName]];
268 | break;
269 | }
270 | case MARKDOWNSTRONG: { // ** **
271 | textAsString = [textAsString substringWithRange:NSMakeRange(2, textAsString.length - 4)];
272 | [attributes addEntriesFromDictionary:[self attributesForFontWithName:self.boldFontName]];
273 | break;
274 | }
275 | case MARKDOWNSTRONGEM: { // *** ***
276 | textAsString = [textAsString substringWithRange:NSMakeRange(3, textAsString.length - 6)];
277 | [attributes addEntriesFromDictionary:[self attributesForFontWithName:self.boldItalicFontName]];
278 | break;
279 | }
280 | case MARKDOWNSTRIKETHROUGH: { // ~~ ~~
281 | textAsString = [textAsString substringWithRange:NSMakeRange(2, textAsString.length - 4)];
282 | [attributes addEntriesFromDictionary:@{NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle)}];
283 | break;
284 | }
285 | case MARKDOWNCODESPAN: { // ` `
286 | textAsString = [textAsString substringWithRange:NSMakeRange(1, textAsString.length - 2)];
287 | [attributes addEntriesFromDictionary:[self attributesForFontWithName:self.italicFontName]];
288 | break;
289 | }
290 | case MARKDOWNHEADER: { // ####
291 | NSRange rangeOfNonHash = [textAsString rangeOfCharacterFromSet:[[NSCharacterSet characterSetWithCharactersInString:@"#"] invertedSet]];
292 | if (rangeOfNonHash.length > 0) {
293 | textAsString = [[textAsString substringFromIndex:rangeOfNonHash.location] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
294 |
295 | NSAttributedStringMarkdownParserHeader header = (NSAttributedStringMarkdownParserHeader)(rangeOfNonHash.location - 1);
296 | [self recurseOnString:textAsString withFont:[self fontForHeader:header]];
297 |
298 | // We already appended the recursive parser's results in recurseOnString.
299 | textAsString = nil;
300 | }
301 | break;
302 | }
303 | case MARKDOWNMULTILINEHEADER: {
304 | NSArray* components = [textAsString componentsSeparatedByString:@"\n"];
305 | textAsString = [components objectAtIndex:0];
306 | UINSFont* font = nil;
307 | if ([[components objectAtIndex:1] rangeOfString:@"="].length > 0) {
308 | font = [self fontForHeader:NSAttributedStringMarkdownParserHeader1];
309 | } else if ([[components objectAtIndex:1] rangeOfString:@"-"].length > 0) {
310 | font = [self fontForHeader:NSAttributedStringMarkdownParserHeader2];
311 | }
312 |
313 | [self recurseOnString:textAsString withFont:font];
314 |
315 | // We already appended the recursive parser's results in recurseOnString.
316 | textAsString = nil;
317 | break;
318 | }
319 | case MARKDOWNPARAGRAPH: {
320 | textAsString = @"\n\n";
321 |
322 | if (_bulletStarts.count > 0) {
323 | // Treat nested bullet points as flat ones...
324 |
325 | // Finish off the previous dash and start a new one.
326 | NSInteger lastBulletStart = [[_bulletStarts lastObject] intValue];
327 | [_bulletStarts removeLastObject];
328 |
329 | [_accum addAttributes:[self paragraphStyle]
330 | range:NSMakeRange(lastBulletStart, _accum.length - lastBulletStart)];
331 | }
332 | break;
333 | }
334 | case MARKDOWNBULLETSTART: {
335 | NSInteger numberOfDashes = [textAsString rangeOfString:@" "].location;
336 | if (_bulletStarts.count > 0 && _bulletStarts.count <= numberOfDashes) {
337 | // Treat nested bullet points as flat ones...
338 |
339 | // Finish off the previous dash and start a new one.
340 | NSInteger lastBulletStart = [[_bulletStarts lastObject] intValue];
341 | [_bulletStarts removeLastObject];
342 |
343 | [_accum addAttributes:[self paragraphStyle]
344 | range:NSMakeRange(lastBulletStart, _accum.length - lastBulletStart)];
345 | }
346 |
347 | [_bulletStarts addObject:@(_accum.length)];
348 | textAsString = @"•\t";
349 | break;
350 | }
351 | case MARKDOWNNEWLINE: {
352 | textAsString = @"";
353 | break;
354 | }
355 | case MARKDOWNURL: {
356 | NSAttributedStringMarkdownLink* link = [[NSAttributedStringMarkdownLink alloc] init];
357 | link.url = [NSURL URLWithString:textAsString];
358 | link.range = NSMakeRange(_accum.length, textAsString.length);
359 | [_links addObject:link];
360 | break;
361 | }
362 | case MARKDOWNHREF: { // [Title] (url "tooltip")
363 | NSTextCheckingResult *result = [hrefRegex() firstMatchInString:textAsString options:0 range:NSMakeRange(0, textAsString.length)];
364 |
365 | NSRange linkTitleRange = [result rangeAtIndex:1];
366 | NSRange linkURLRange = [result rangeAtIndex:2];
367 | NSRange tooltipRange = [result rangeAtIndex:5];
368 |
369 | if (linkTitleRange.location != NSNotFound && linkURLRange.location != NSNotFound) {
370 | NSAttributedStringMarkdownLink *link = [[NSAttributedStringMarkdownLink alloc] init];
371 |
372 | link.url = [NSURL URLWithString:[textAsString substringWithRange:linkURLRange]];
373 | link.range = NSMakeRange(_accum.length, linkTitleRange.length);
374 |
375 | if (tooltipRange.location != NSNotFound) {
376 | link.tooltip = [textAsString substringWithRange:tooltipRange];
377 | }
378 |
379 | [_links addObject:link];
380 | textAsString = [textAsString substringWithRange:linkTitleRange];
381 | }
382 | break;
383 | }
384 | default: {
385 | break;
386 | }
387 | }
388 |
389 | if (textAsString.length > 0) {
390 | NSAttributedString* attributedString = [[NSAttributedString alloc] initWithString:textAsString attributes:attributes];
391 | [_accum appendAttributedString:attributedString];
392 | }
393 | }
394 |
395 | @end
396 |
397 | int markdownConsume(char* text, int token, yyscan_t scanner) {
398 | NSAttributedStringMarkdownParser* string = (__bridge NSAttributedStringMarkdownParser *)(markdownget_extra(scanner));
399 | [string consumeToken:token text:text];
400 | return 0;
401 | }
402 |
--------------------------------------------------------------------------------
/NimbusKit/markdown/NimbusMarkdown.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2011-2014 NimbusKit
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #ifdef NIMBUSKIT_FRAMEWORK
18 | #import
19 | #else
20 | #import "NSAttributedStringMarkdownParser.h"
21 | #endif
22 |
23 | /**
24 | * @defgroup NimbusMarkdown Nimbus Markdown
25 | *
26 | *
27 | *
28 | */
29 |
--------------------------------------------------------------------------------
/NimbusKit/memorymapping/NimbusMemoryMapping.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2011-2014 NimbusKit
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | #ifdef NIMBUSKIT_FRAMEWORK
18 | #import
19 | #else
20 | #import "fmemopen.h"
21 | #endif
22 |
23 | /**
24 | * @defgroup NimbusMemoryMappping Nimbus Memory Mapping
25 | *
26 | *
27 | *
28 | */
29 |
--------------------------------------------------------------------------------
/NimbusKit/memorymapping/fmemopen.c:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2011-2014 NimbusKit
3 | // Originally ported from https://github.com/ingenuitas/python-tesseract/blob/master/fmemopen.c
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | struct fmem {
24 | size_t pos;
25 | size_t size;
26 | char *buffer;
27 | };
28 | typedef struct fmem fmem_t;
29 |
30 | static int readfn(void *handler, char *buf, int size) {
31 | fmem_t *mem = handler;
32 | size_t available = mem->size - mem->pos;
33 |
34 | if (size > available) {
35 | size = available;
36 | }
37 | memcpy(buf, mem->buffer + mem->pos, sizeof(char) * size);
38 | mem->pos += size;
39 |
40 | return size;
41 | }
42 |
43 | static int writefn(void *handler, const char *buf, int size) {
44 | fmem_t *mem = handler;
45 | size_t available = mem->size - mem->pos;
46 |
47 | if (size > available) {
48 | size = available;
49 | }
50 | memcpy(mem->buffer + mem->pos, buf, sizeof(char) * size);
51 | mem->pos += size;
52 |
53 | return size;
54 | }
55 |
56 | static fpos_t seekfn(void *handler, fpos_t offset, int whence) {
57 | size_t pos;
58 | fmem_t *mem = handler;
59 |
60 | switch (whence) {
61 | case SEEK_SET: {
62 | if (offset >= 0) {
63 | pos = (size_t)offset;
64 | } else {
65 | pos = 0;
66 | }
67 | break;
68 | }
69 | case SEEK_CUR: {
70 | if (offset >= 0 || (size_t)(-offset) <= mem->pos) {
71 | pos = mem->pos + (size_t)offset;
72 | } else {
73 | pos = 0;
74 | }
75 | break;
76 | }
77 | case SEEK_END: pos = mem->size + (size_t)offset; break;
78 | default: return -1;
79 | }
80 |
81 | if (pos > mem->size) {
82 | return -1;
83 | }
84 |
85 | mem->pos = pos;
86 | return (fpos_t)pos;
87 | }
88 |
89 | static int closefn(void *handler) {
90 | free(handler);
91 | return 0;
92 | }
93 |
94 | FILE *fmemopen(void *buf, size_t size, const char *mode) {
95 | // This data is released on fclose.
96 | fmem_t* mem = (fmem_t *) malloc(sizeof(fmem_t));
97 |
98 | // Zero-out the structure.
99 | memset(mem, 0, sizeof(fmem_t));
100 |
101 | mem->size = size;
102 | mem->buffer = buf;
103 |
104 | // funopen's man page: https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/funopen.3.html
105 | return funopen(mem, readfn, writefn, seekfn, closefn);
106 | }
107 |
--------------------------------------------------------------------------------
/NimbusKit/memorymapping/fmemopen.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2011-2014 NimbusKit
3 | // Originally ported from https://github.com/ingenuitas/python-tesseract/blob/master/fmemopen.c
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 |
18 | #ifndef FMEMOPEN_H_
19 | #define FMEMOPEN_H_
20 |
21 | #if defined __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | /**
26 | * A BSD port of the fmemopen Linux method using funopen.
27 | *
28 | * man docs for fmemopen:
29 | * http://linux.die.net/man/3/fmemopen
30 | *
31 | * man docs for funopen:
32 | * https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/funopen.3.html
33 | *
34 | * This method is ported from ingenuitas' python-tesseract project.
35 | *
36 | * You must call fclose on the returned file pointer or memory will be leaked.
37 | *
38 | * @param buf The data that will be used to back the FILE* methods. Must be at least
39 | * @c size bytes.
40 | * @param size The size of the @c buf data.
41 | * @param mode The permitted stream operation modes.
42 | * @return A pointer that can be used in the fread/fwrite/fseek/fclose family of methods.
43 | * If a failure occurred NULL will be returned.
44 | * @ingroup NimbusMemoryMappping
45 | */
46 | FILE *fmemopen(void *buf, size_t size, const char *mode);
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 |
52 | #endif // #ifndef FMEMOPEN_H_
53 |
--------------------------------------------------------------------------------
/ProvisioningProfile.swift:
--------------------------------------------------------------------------------
1 | //
2 | // provisioningProfile.swift
3 | // AppSigner
4 | //
5 | // Created by Daniel Radtke on 11/4/15.
6 | // Copyright © 2015 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import AppKit
11 | struct ProvisioningProfile {
12 | var filename: String,
13 | name: String,
14 | created:Date,
15 | expires: Date,
16 | appID: String,
17 | teamID: String,
18 | entitlements: [String : AnyObject]
19 | fileprivate let delegate = NSApplication.shared.delegate as! AppDelegate
20 |
21 | static func getProfiles() -> [ProvisioningProfile] {
22 | let fileManager = FileManager()
23 |
24 | guard let libraryDirectory = fileManager.urls(for: .libraryDirectory, in: .userDomainMask).first else { return [] }
25 |
26 | let preMacOSSequouiaPath = libraryDirectory
27 | .path
28 | .stringByAppendingPathComponent("MobileDevice/Provisioning Profiles")
29 |
30 | let macOSSequoiaPath = libraryDirectory
31 | .path
32 | .stringByAppendingPathComponent("Developer/Xcode/UserData/Provisioning Profiles")
33 |
34 | let profiles = [preMacOSSequouiaPath, macOSSequoiaPath]
35 | .flatMap { (profilesPath: String) -> [String] in
36 | let contents = (try? fileManager.contentsOfDirectory(atPath: profilesPath)) ?? []
37 | return contents.map { (profile: String) -> String in
38 | profilesPath.stringByAppendingPathComponent(profile)
39 | }
40 | }
41 | .filter { path in
42 | path.pathExtension == "mobileprovision"
43 | }
44 | .compactMap { path in
45 | ProvisioningProfile(filename: path)
46 | }
47 | .sorted { lhs, rhs in
48 | lhs.created.timeIntervalSince1970 > rhs.created.timeIntervalSince1970
49 | }
50 |
51 | var names = Set()
52 | return profiles.filter { profile in
53 | let inserted = names.insert("\(profile.name)\(profile.appID)").inserted
54 | if inserted {
55 | NSLog("\(profile.name), \(profile.created)")
56 | }
57 | return inserted
58 | }
59 | }
60 |
61 | init?(filename: String){
62 | let securityArgs = ["cms","-D","-i", filename]
63 |
64 | let taskOutput = Process().execute("/usr/bin/security", workingDirectory: nil, arguments: securityArgs)
65 | let rawXML: String
66 | if taskOutput.status == 0 {
67 | if let xmlIndex = taskOutput.output.range(of: " String? {
124 | let data = PropertyListSerialization.dataFromPropertyList(entitlements, format: PropertyListSerialization.PropertyListFormat.xml, errorDescription: nil)!
125 | return String(data: data, encoding: .utf8)
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # iOS App Signer
2 | This is an app for OS X that can (re)sign apps and bundle them into ipa files that are ready to be installed on an iOS device.
3 |
4 | Supported input types are: ipa, deb, app, xcarchive
5 |
6 | Usage
7 | ------
8 | This app requires Xcode to be installed, it has run successfully on the new macOS 12 Monterey.
9 |
10 | You need a provisioning profile and signing certificate, you can get these from Xcode by creating a new project.
11 |
12 | You can then open up iOS App Signer and select your input file, signing certificate, provisioning file, and optionally specify a new application ID and/or application display name.
13 |
14 |
15 |
16 | Thanks To
17 | ------
18 | [maciekish / iReSign](https://github.com/maciekish/iReSign): The basic process was gleaned from the source code of this project.
19 |
--------------------------------------------------------------------------------
/StringByAppendingPathComponent.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StringByAppendingPathComponent.swift
3 | // AppSigner
4 | //
5 | // Created by Daniel Radtke on 11/3/15.
6 | // Copyright © 2015 Daniel Radtke. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | extension String {
11 |
12 | var lastPathComponent: String {
13 |
14 | get {
15 | return (self as NSString).lastPathComponent
16 | }
17 | }
18 | var pathExtension: String {
19 |
20 | get {
21 |
22 | return (self as NSString).pathExtension
23 | }
24 | }
25 | var stringByDeletingLastPathComponent: String {
26 |
27 | get {
28 |
29 | return (self as NSString).deletingLastPathComponent
30 | }
31 | }
32 | var stringByDeletingPathExtension: String {
33 |
34 | get {
35 |
36 | return (self as NSString).deletingPathExtension
37 | }
38 | }
39 | var pathComponents: [String] {
40 |
41 | get {
42 |
43 | return (self as NSString).pathComponents
44 | }
45 | }
46 |
47 | func stringByAppendingPathComponent(_ path: String) -> String {
48 |
49 | let nsSt = self as NSString
50 |
51 | return nsSt.appendingPathComponent(path)
52 | }
53 |
54 | func stringByAppendingPathExtension(_ ext: String) -> String? {
55 |
56 | let nsSt = self as NSString
57 |
58 | return nsSt.appendingPathExtension(ext)
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/iOS App Signer-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 | #import "NSAttributedStringMarkdownParser.h"
--------------------------------------------------------------------------------
/iOS App Signer.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 652408CC1BE743D4006FA4C6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652408CB1BE743D4006FA4C6 /* AppDelegate.swift */; };
11 | 652408CE1BE743D4006FA4C6 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652408CD1BE743D4006FA4C6 /* MainView.swift */; };
12 | 652408D01BE743D4006FA4C6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 652408CF1BE743D4006FA4C6 /* Assets.xcassets */; };
13 | 65311EAE1BF8259000516EFD /* NSMenuLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65311EAD1BF8259000516EFD /* NSMenuLink.swift */; };
14 | 65311EB01BF835F100516EFD /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65311EAF1BF835F100516EFD /* Log.swift */; };
15 | 65311EB61BF88EB800516EFD /* Application.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65311EB51BF88EB800516EFD /* Application.xib */; };
16 | 655FFF9D1BE9B3E300D43AD8 /* NSTask-execute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655FFF9C1BE9B3E300D43AD8 /* NSTask-execute.swift */; };
17 | 655FFF9F1BE9BA9D00D43AD8 /* StringByAppendingPathComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655FFF9E1BE9BA9D00D43AD8 /* StringByAppendingPathComponent.swift */; };
18 | 655FFFA21BEAD93600D43AD8 /* ProvisioningProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655FFFA11BEAD93600D43AD8 /* ProvisioningProfile.swift */; };
19 | 659734941C65A14300383D2D /* Updates.xib in Resources */ = {isa = PBXBuildFile; fileRef = 659734931C65A14300383D2D /* Updates.xib */; };
20 | 659734961C65A1E800383D2D /* UpdatesController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 659734951C65A1E800383D2D /* UpdatesController.swift */; };
21 | 659734A01C65B5F600383D2D /* MarkdownTokenizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6597349A1C65B5F600383D2D /* MarkdownTokenizer.m */; };
22 | 659734A11C65B5F600383D2D /* MarkdownTokens.m in Sources */ = {isa = PBXBuildFile; fileRef = 6597349C1C65B5F600383D2D /* MarkdownTokens.m */; };
23 | 659734A21C65B5F600383D2D /* NSAttributedStringMarkdownParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 6597349F1C65B5F600383D2D /* NSAttributedStringMarkdownParser.m */; };
24 | 659734A71C65B94F00383D2D /* fmemopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 659734A41C65B94F00383D2D /* fmemopen.c */; };
25 | 65B2EAA21CDE981500D02053 /* iASShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B2EAA11CDE981500D02053 /* iASShared.swift */; };
26 | 65CED3A32D8B6F3E00E9185B /* fix-wwdr.sh in Resources */ = {isa = PBXBuildFile; fileRef = 65CED3A22D8B6F3E00E9185B /* fix-wwdr.sh */; };
27 | /* End PBXBuildFile section */
28 |
29 | /* Begin PBXFileReference section */
30 | 652408C81BE743D4006FA4C6 /* iOS App Signer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS App Signer.app"; sourceTree = BUILT_PRODUCTS_DIR; };
31 | 652408CB1BE743D4006FA4C6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
32 | 652408CD1BE743D4006FA4C6 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; };
33 | 652408CF1BE743D4006FA4C6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
34 | 652408D41BE743D4006FA4C6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
35 | 65311EAD1BF8259000516EFD /* NSMenuLink.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSMenuLink.swift; sourceTree = ""; };
36 | 65311EAF1BF835F100516EFD /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; };
37 | 65311EB51BF88EB800516EFD /* Application.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Application.xib; sourceTree = ""; };
38 | 655FFF9C1BE9B3E300D43AD8 /* NSTask-execute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSTask-execute.swift"; sourceTree = ""; };
39 | 655FFF9E1BE9BA9D00D43AD8 /* StringByAppendingPathComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringByAppendingPathComponent.swift; sourceTree = ""; };
40 | 655FFFA11BEAD93600D43AD8 /* ProvisioningProfile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProvisioningProfile.swift; sourceTree = ""; };
41 | 659734931C65A14300383D2D /* Updates.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Updates.xib; sourceTree = ""; };
42 | 659734951C65A1E800383D2D /* UpdatesController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpdatesController.swift; sourceTree = ""; };
43 | 659734991C65B5F500383D2D /* iOS App Signer-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iOS App Signer-Bridging-Header.h"; sourceTree = ""; };
44 | 6597349A1C65B5F600383D2D /* MarkdownTokenizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MarkdownTokenizer.m; path = NimbusKit/markdown/MarkdownTokenizer.m; sourceTree = ""; };
45 | 6597349B1C65B5F600383D2D /* MarkdownTokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MarkdownTokens.h; path = NimbusKit/markdown/MarkdownTokens.h; sourceTree = ""; };
46 | 6597349C1C65B5F600383D2D /* MarkdownTokens.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MarkdownTokens.m; path = NimbusKit/markdown/MarkdownTokens.m; sourceTree = ""; };
47 | 6597349D1C65B5F600383D2D /* NimbusMarkdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NimbusMarkdown.h; path = NimbusKit/markdown/NimbusMarkdown.h; sourceTree = ""; };
48 | 6597349E1C65B5F600383D2D /* NSAttributedStringMarkdownParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSAttributedStringMarkdownParser.h; path = NimbusKit/markdown/NSAttributedStringMarkdownParser.h; sourceTree = ""; };
49 | 6597349F1C65B5F600383D2D /* NSAttributedStringMarkdownParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSAttributedStringMarkdownParser.m; path = NimbusKit/markdown/NSAttributedStringMarkdownParser.m; sourceTree = ""; };
50 | 659734A41C65B94F00383D2D /* fmemopen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fmemopen.c; path = NimbusKit/memorymapping/fmemopen.c; sourceTree = ""; };
51 | 659734A51C65B94F00383D2D /* fmemopen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmemopen.h; path = NimbusKit/memorymapping/fmemopen.h; sourceTree = ""; };
52 | 659734A61C65B94F00383D2D /* NimbusMemoryMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NimbusMemoryMapping.h; path = NimbusKit/memorymapping/NimbusMemoryMapping.h; sourceTree = ""; };
53 | 65B24E0D1BECB30D005D2068 /* AppSigner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = AppSigner.entitlements; sourceTree = ""; };
54 | 65B2EAA11CDE981500D02053 /* iASShared.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = iASShared.swift; path = AppSigner/Classes/iASShared.swift; sourceTree = ""; };
55 | 65CED3A22D8B6F3E00E9185B /* fix-wwdr.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fix-wwdr.sh"; path = "Resources/fix-wwdr.sh"; sourceTree = ""; };
56 | /* End PBXFileReference section */
57 |
58 | /* Begin PBXFrameworksBuildPhase section */
59 | 652408C51BE743D4006FA4C6 /* Frameworks */ = {
60 | isa = PBXFrameworksBuildPhase;
61 | buildActionMask = 2147483647;
62 | files = (
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | /* End PBXFrameworksBuildPhase section */
67 |
68 | /* Begin PBXGroup section */
69 | 652408BF1BE743D4006FA4C6 = {
70 | isa = PBXGroup;
71 | children = (
72 | 659734971C65B5B900383D2D /* NimbusKit */,
73 | 652408CA1BE743D4006FA4C6 /* AppSigner */,
74 | 652408C91BE743D4006FA4C6 /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 652408C91BE743D4006FA4C6 /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 652408C81BE743D4006FA4C6 /* iOS App Signer.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 652408CA1BE743D4006FA4C6 /* AppSigner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 65CED3A12D8B6F1B00E9185B /* Resources */,
90 | 655FFFDF1BEB270200D43AD8 /* Extensions */,
91 | 655FFFA01BEAD90800D43AD8 /* Classes */,
92 | 65311EB51BF88EB800516EFD /* Application.xib */,
93 | 659734931C65A14300383D2D /* Updates.xib */,
94 | 659734951C65A1E800383D2D /* UpdatesController.swift */,
95 | 65B24E0D1BECB30D005D2068 /* AppSigner.entitlements */,
96 | 652408CB1BE743D4006FA4C6 /* AppDelegate.swift */,
97 | 652408CD1BE743D4006FA4C6 /* MainView.swift */,
98 | 652408CF1BE743D4006FA4C6 /* Assets.xcassets */,
99 | 652408D41BE743D4006FA4C6 /* Info.plist */,
100 | );
101 | path = AppSigner;
102 | sourceTree = "";
103 | };
104 | 655FFFA01BEAD90800D43AD8 /* Classes */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 655FFFA11BEAD93600D43AD8 /* ProvisioningProfile.swift */,
108 | 65311EAF1BF835F100516EFD /* Log.swift */,
109 | 65311EAD1BF8259000516EFD /* NSMenuLink.swift */,
110 | 65B2EAA11CDE981500D02053 /* iASShared.swift */,
111 | );
112 | name = Classes;
113 | path = ..;
114 | sourceTree = "";
115 | };
116 | 655FFFDF1BEB270200D43AD8 /* Extensions */ = {
117 | isa = PBXGroup;
118 | children = (
119 | 655FFF9C1BE9B3E300D43AD8 /* NSTask-execute.swift */,
120 | 655FFF9E1BE9BA9D00D43AD8 /* StringByAppendingPathComponent.swift */,
121 | );
122 | name = Extensions;
123 | path = ..;
124 | sourceTree = "";
125 | };
126 | 659734971C65B5B900383D2D /* NimbusKit */ = {
127 | isa = PBXGroup;
128 | children = (
129 | 659734A31C65B93E00383D2D /* memorymapping */,
130 | 659734981C65B5C200383D2D /* markdown */,
131 | );
132 | name = NimbusKit;
133 | sourceTree = "";
134 | };
135 | 659734981C65B5C200383D2D /* markdown */ = {
136 | isa = PBXGroup;
137 | children = (
138 | 6597349A1C65B5F600383D2D /* MarkdownTokenizer.m */,
139 | 6597349B1C65B5F600383D2D /* MarkdownTokens.h */,
140 | 6597349C1C65B5F600383D2D /* MarkdownTokens.m */,
141 | 6597349D1C65B5F600383D2D /* NimbusMarkdown.h */,
142 | 6597349E1C65B5F600383D2D /* NSAttributedStringMarkdownParser.h */,
143 | 6597349F1C65B5F600383D2D /* NSAttributedStringMarkdownParser.m */,
144 | 659734991C65B5F500383D2D /* iOS App Signer-Bridging-Header.h */,
145 | );
146 | name = markdown;
147 | sourceTree = "";
148 | };
149 | 659734A31C65B93E00383D2D /* memorymapping */ = {
150 | isa = PBXGroup;
151 | children = (
152 | 659734A41C65B94F00383D2D /* fmemopen.c */,
153 | 659734A51C65B94F00383D2D /* fmemopen.h */,
154 | 659734A61C65B94F00383D2D /* NimbusMemoryMapping.h */,
155 | );
156 | name = memorymapping;
157 | sourceTree = "";
158 | };
159 | 65CED3A12D8B6F1B00E9185B /* Resources */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 65CED3A22D8B6F3E00E9185B /* fix-wwdr.sh */,
163 | );
164 | name = Resources;
165 | sourceTree = "";
166 | };
167 | /* End PBXGroup section */
168 |
169 | /* Begin PBXNativeTarget section */
170 | 652408C71BE743D4006FA4C6 /* iOS App Signer */ = {
171 | isa = PBXNativeTarget;
172 | buildConfigurationList = 652408ED1BE743D4006FA4C6 /* Build configuration list for PBXNativeTarget "iOS App Signer" */;
173 | buildPhases = (
174 | 652408C41BE743D4006FA4C6 /* Sources */,
175 | 652408C51BE743D4006FA4C6 /* Frameworks */,
176 | 652408C61BE743D4006FA4C6 /* Resources */,
177 | );
178 | buildRules = (
179 | );
180 | dependencies = (
181 | );
182 | name = "iOS App Signer";
183 | productName = AppSigner;
184 | productReference = 652408C81BE743D4006FA4C6 /* iOS App Signer.app */;
185 | productType = "com.apple.product-type.application";
186 | };
187 | /* End PBXNativeTarget section */
188 |
189 | /* Begin PBXProject section */
190 | 652408C01BE743D4006FA4C6 /* Project object */ = {
191 | isa = PBXProject;
192 | attributes = {
193 | LastSwiftUpdateCheck = 0720;
194 | LastUpgradeCheck = 0810;
195 | ORGANIZATIONNAME = "Daniel Radtke";
196 | TargetAttributes = {
197 | 652408C71BE743D4006FA4C6 = {
198 | CreatedOnToolsVersion = 7.1;
199 | DevelopmentTeam = 7PM929Z8M2;
200 | LastSwiftMigration = 1020;
201 | ProvisioningStyle = Automatic;
202 | SystemCapabilities = {
203 | com.apple.Sandbox = {
204 | enabled = 0;
205 | };
206 | };
207 | };
208 | };
209 | };
210 | buildConfigurationList = 652408C31BE743D4006FA4C6 /* Build configuration list for PBXProject "iOS App Signer" */;
211 | compatibilityVersion = "Xcode 3.2";
212 | developmentRegion = English;
213 | hasScannedForEncodings = 0;
214 | knownRegions = (
215 | English,
216 | en,
217 | Base,
218 | );
219 | mainGroup = 652408BF1BE743D4006FA4C6;
220 | productRefGroup = 652408C91BE743D4006FA4C6 /* Products */;
221 | projectDirPath = "";
222 | projectRoot = "";
223 | targets = (
224 | 652408C71BE743D4006FA4C6 /* iOS App Signer */,
225 | );
226 | };
227 | /* End PBXProject section */
228 |
229 | /* Begin PBXResourcesBuildPhase section */
230 | 652408C61BE743D4006FA4C6 /* Resources */ = {
231 | isa = PBXResourcesBuildPhase;
232 | buildActionMask = 2147483647;
233 | files = (
234 | 65CED3A32D8B6F3E00E9185B /* fix-wwdr.sh in Resources */,
235 | 65311EB61BF88EB800516EFD /* Application.xib in Resources */,
236 | 652408D01BE743D4006FA4C6 /* Assets.xcassets in Resources */,
237 | 659734941C65A14300383D2D /* Updates.xib in Resources */,
238 | );
239 | runOnlyForDeploymentPostprocessing = 0;
240 | };
241 | /* End PBXResourcesBuildPhase section */
242 |
243 | /* Begin PBXSourcesBuildPhase section */
244 | 652408C41BE743D4006FA4C6 /* Sources */ = {
245 | isa = PBXSourcesBuildPhase;
246 | buildActionMask = 2147483647;
247 | files = (
248 | 659734A01C65B5F600383D2D /* MarkdownTokenizer.m in Sources */,
249 | 652408CE1BE743D4006FA4C6 /* MainView.swift in Sources */,
250 | 659734A71C65B94F00383D2D /* fmemopen.c in Sources */,
251 | 65311EB01BF835F100516EFD /* Log.swift in Sources */,
252 | 655FFF9F1BE9BA9D00D43AD8 /* StringByAppendingPathComponent.swift in Sources */,
253 | 659734A11C65B5F600383D2D /* MarkdownTokens.m in Sources */,
254 | 652408CC1BE743D4006FA4C6 /* AppDelegate.swift in Sources */,
255 | 659734961C65A1E800383D2D /* UpdatesController.swift in Sources */,
256 | 65311EAE1BF8259000516EFD /* NSMenuLink.swift in Sources */,
257 | 655FFF9D1BE9B3E300D43AD8 /* NSTask-execute.swift in Sources */,
258 | 659734A21C65B5F600383D2D /* NSAttributedStringMarkdownParser.m in Sources */,
259 | 655FFFA21BEAD93600D43AD8 /* ProvisioningProfile.swift in Sources */,
260 | 65B2EAA21CDE981500D02053 /* iASShared.swift in Sources */,
261 | );
262 | runOnlyForDeploymentPostprocessing = 0;
263 | };
264 | /* End PBXSourcesBuildPhase section */
265 |
266 | /* Begin XCBuildConfiguration section */
267 | 652408EB1BE743D4006FA4C6 /* Debug */ = {
268 | isa = XCBuildConfiguration;
269 | buildSettings = {
270 | ALWAYS_SEARCH_USER_PATHS = NO;
271 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
272 | CLANG_CXX_LIBRARY = "libc++";
273 | CLANG_ENABLE_MODULES = YES;
274 | CLANG_ENABLE_OBJC_ARC = YES;
275 | CLANG_WARN_BOOL_CONVERSION = YES;
276 | CLANG_WARN_CONSTANT_CONVERSION = YES;
277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
278 | CLANG_WARN_EMPTY_BODY = YES;
279 | CLANG_WARN_ENUM_CONVERSION = YES;
280 | CLANG_WARN_INFINITE_RECURSION = YES;
281 | CLANG_WARN_INT_CONVERSION = YES;
282 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
283 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
284 | CLANG_WARN_UNREACHABLE_CODE = YES;
285 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
286 | CODE_SIGN_IDENTITY = "-";
287 | COPY_PHASE_STRIP = NO;
288 | DEBUG_INFORMATION_FORMAT = dwarf;
289 | ENABLE_STRICT_OBJC_MSGSEND = YES;
290 | ENABLE_TESTABILITY = YES;
291 | GCC_C_LANGUAGE_STANDARD = gnu99;
292 | GCC_DYNAMIC_NO_PIC = NO;
293 | GCC_NO_COMMON_BLOCKS = YES;
294 | GCC_OPTIMIZATION_LEVEL = 0;
295 | GCC_PREPROCESSOR_DEFINITIONS = (
296 | "DEBUG=1",
297 | "$(inherited)",
298 | );
299 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
300 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
301 | GCC_WARN_UNDECLARED_SELECTOR = YES;
302 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
303 | GCC_WARN_UNUSED_FUNCTION = YES;
304 | GCC_WARN_UNUSED_VARIABLE = YES;
305 | MACOSX_DEPLOYMENT_TARGET = 10.13;
306 | MTL_ENABLE_DEBUG_INFO = YES;
307 | ONLY_ACTIVE_ARCH = YES;
308 | SDKROOT = macosx;
309 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
310 | };
311 | name = Debug;
312 | };
313 | 652408EC1BE743D4006FA4C6 /* Release */ = {
314 | isa = XCBuildConfiguration;
315 | buildSettings = {
316 | ALWAYS_SEARCH_USER_PATHS = NO;
317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
318 | CLANG_CXX_LIBRARY = "libc++";
319 | CLANG_ENABLE_MODULES = YES;
320 | CLANG_ENABLE_OBJC_ARC = YES;
321 | CLANG_WARN_BOOL_CONVERSION = YES;
322 | CLANG_WARN_CONSTANT_CONVERSION = YES;
323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
324 | CLANG_WARN_EMPTY_BODY = YES;
325 | CLANG_WARN_ENUM_CONVERSION = YES;
326 | CLANG_WARN_INFINITE_RECURSION = YES;
327 | CLANG_WARN_INT_CONVERSION = YES;
328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
330 | CLANG_WARN_UNREACHABLE_CODE = YES;
331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
332 | CODE_SIGN_IDENTITY = "-";
333 | COPY_PHASE_STRIP = NO;
334 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
335 | ENABLE_NS_ASSERTIONS = NO;
336 | ENABLE_STRICT_OBJC_MSGSEND = YES;
337 | GCC_C_LANGUAGE_STANDARD = gnu99;
338 | GCC_NO_COMMON_BLOCKS = YES;
339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
341 | GCC_WARN_UNDECLARED_SELECTOR = YES;
342 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343 | GCC_WARN_UNUSED_FUNCTION = YES;
344 | GCC_WARN_UNUSED_VARIABLE = YES;
345 | MACOSX_DEPLOYMENT_TARGET = 10.13;
346 | MTL_ENABLE_DEBUG_INFO = NO;
347 | SDKROOT = macosx;
348 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
349 | };
350 | name = Release;
351 | };
352 | 652408EE1BE743D4006FA4C6 /* Debug */ = {
353 | isa = XCBuildConfiguration;
354 | buildSettings = {
355 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356 | CLANG_ENABLE_MODULES = YES;
357 | CODE_SIGN_IDENTITY = "Mac Developer";
358 | CODE_SIGN_STYLE = Automatic;
359 | COMBINE_HIDPI_IMAGES = YES;
360 | DEVELOPMENT_TEAM = "";
361 | ENABLE_HARDENED_RUNTIME = YES;
362 | INFOPLIST_FILE = AppSigner/Info.plist;
363 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
364 | MACOSX_DEPLOYMENT_TARGET = 10.13;
365 | PRODUCT_BUNDLE_IDENTIFIER = com.DanTheMan827.AppSigner;
366 | PRODUCT_NAME = "iOS App Signer";
367 | PROVISIONING_PROFILE_SPECIFIER = "";
368 | SWIFT_OBJC_BRIDGING_HEADER = "iOS App Signer-Bridging-Header.h";
369 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
370 | SWIFT_VERSION = 5.0;
371 | };
372 | name = Debug;
373 | };
374 | 652408EF1BE743D4006FA4C6 /* Release */ = {
375 | isa = XCBuildConfiguration;
376 | buildSettings = {
377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
378 | CLANG_ENABLE_MODULES = YES;
379 | CODE_SIGN_IDENTITY = "Mac Developer";
380 | CODE_SIGN_STYLE = Automatic;
381 | COMBINE_HIDPI_IMAGES = YES;
382 | DEVELOPMENT_TEAM = "";
383 | ENABLE_HARDENED_RUNTIME = YES;
384 | INFOPLIST_FILE = AppSigner/Info.plist;
385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
386 | MACOSX_DEPLOYMENT_TARGET = 10.13;
387 | PRODUCT_BUNDLE_IDENTIFIER = com.DanTheMan827.AppSigner;
388 | PRODUCT_NAME = "iOS App Signer";
389 | PROVISIONING_PROFILE_SPECIFIER = "";
390 | SWIFT_OBJC_BRIDGING_HEADER = "iOS App Signer-Bridging-Header.h";
391 | SWIFT_VERSION = 5.0;
392 | };
393 | name = Release;
394 | };
395 | /* End XCBuildConfiguration section */
396 |
397 | /* Begin XCConfigurationList section */
398 | 652408C31BE743D4006FA4C6 /* Build configuration list for PBXProject "iOS App Signer" */ = {
399 | isa = XCConfigurationList;
400 | buildConfigurations = (
401 | 652408EB1BE743D4006FA4C6 /* Debug */,
402 | 652408EC1BE743D4006FA4C6 /* Release */,
403 | );
404 | defaultConfigurationIsVisible = 0;
405 | defaultConfigurationName = Release;
406 | };
407 | 652408ED1BE743D4006FA4C6 /* Build configuration list for PBXNativeTarget "iOS App Signer" */ = {
408 | isa = XCConfigurationList;
409 | buildConfigurations = (
410 | 652408EE1BE743D4006FA4C6 /* Debug */,
411 | 652408EF1BE743D4006FA4C6 /* Release */,
412 | );
413 | defaultConfigurationIsVisible = 0;
414 | defaultConfigurationName = Release;
415 | };
416 | /* End XCConfigurationList section */
417 | };
418 | rootObject = 652408C01BE743D4006FA4C6 /* Project object */;
419 | }
420 |
--------------------------------------------------------------------------------
/iOS App Signer.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/iOS App Signer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------