├── Applications
├── Extrac.app
└── Contents
│ ├── Frameworks
│ ├── libswiftAppKit.dylib
│ ├── libswiftCore.dylib
│ ├── libswiftCoreData.dylib
│ ├── libswiftCoreGraphics.dylib
│ ├── libswiftCoreImage.dylib
│ ├── libswiftDarwin.dylib
│ ├── libswiftDispatch.dylib
│ ├── libswiftFoundation.dylib
│ ├── libswiftIOKit.dylib
│ ├── libswiftObjectiveC.dylib
│ ├── libswiftXPC.dylib
│ └── libswiftos.dylib
│ ├── Info.plist
│ ├── MacOS
│ └── Extrac
│ ├── PkgInfo
│ ├── Resources
│ ├── AppIcon.icns
│ ├── Assets.car
│ ├── Base.lproj
│ │ └── Main.storyboardc
│ │ │ ├── Info.plist
│ │ │ ├── MainMenu.nib
│ │ │ ├── NSViewController-w2v-q9-FJE.nib
│ │ │ ├── NSViewController-ycJ-YI-Hkh.nib
│ │ │ ├── NSWindowController-B8D-0N-5wS.nib
│ │ │ ├── XfG-lQ-9wD-view-yaF-eR-hmK.nib
│ │ │ ├── w2v-q9-FJE-view-rnu-LK-BBq.nib
│ │ │ └── ycJ-YI-Hkh-view-V9H-BM-Jbj.nib
│ ├── CARExtractor
│ ├── Info.plist
│ └── itsnottoolate.gif
│ └── _CodeSignature
│ └── CodeResources
├── Readme.md
├── iPa图片提取
├── CARExtractor
├── File.swift
├── Header.h
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcuserdata
│ │ │ ├── .xcuserdatad
│ │ │ └── xcschemes
│ │ │ │ ├── Pods-iPa图片提取.xcscheme
│ │ │ │ ├── Pods-iPa图片提取Tests.xcscheme
│ │ │ │ ├── Pods-iPa图片提取UITests.xcscheme
│ │ │ │ └── xcschememanagement.plist
│ │ │ └── Tian.xcuserdatad
│ │ │ └── xcschemes
│ │ │ ├── Pods-iPa图片提取.xcscheme
│ │ │ ├── Pods-iPa图片提取Tests.xcscheme
│ │ │ ├── Pods-iPa图片提取UITests.xcscheme
│ │ │ ├── SSZipArchive.xcscheme
│ │ │ └── xcschememanagement.plist
│ └── Target Support Files
│ │ ├── Pods-iPa图片提取
│ │ ├── Info.plist
│ │ ├── Pods-iPa图片提取-acknowledgements.markdown
│ │ ├── Pods-iPa图片提取-acknowledgements.plist
│ │ ├── Pods-iPa图片提取-dummy.m
│ │ ├── Pods-iPa图片提取-frameworks.sh
│ │ ├── Pods-iPa图片提取-resources.sh
│ │ ├── Pods-iPa图片提取-umbrella.h
│ │ ├── Pods-iPa图片提取.debug.xcconfig
│ │ ├── Pods-iPa图片提取.modulemap
│ │ └── Pods-iPa图片提取.release.xcconfig
│ │ ├── Pods-iPa图片提取Tests
│ │ ├── Info.plist
│ │ ├── Pods-iPa图片提取Tests-acknowledgements.markdown
│ │ ├── Pods-iPa图片提取Tests-acknowledgements.plist
│ │ ├── Pods-iPa图片提取Tests-dummy.m
│ │ ├── Pods-iPa图片提取Tests-frameworks.sh
│ │ ├── Pods-iPa图片提取Tests-resources.sh
│ │ ├── Pods-iPa图片提取Tests-umbrella.h
│ │ ├── Pods-iPa图片提取Tests.debug.xcconfig
│ │ ├── Pods-iPa图片提取Tests.modulemap
│ │ └── Pods-iPa图片提取Tests.release.xcconfig
│ │ └── Pods-iPa图片提取UITests
│ │ ├── Info.plist
│ │ ├── Pods-iPa图片提取UITests-acknowledgements.markdown
│ │ ├── Pods-iPa图片提取UITests-acknowledgements.plist
│ │ ├── Pods-iPa图片提取UITests-dummy.m
│ │ ├── Pods-iPa图片提取UITests-frameworks.sh
│ │ ├── Pods-iPa图片提取UITests-resources.sh
│ │ ├── Pods-iPa图片提取UITests-umbrella.h
│ │ ├── Pods-iPa图片提取UITests.debug.xcconfig
│ │ ├── Pods-iPa图片提取UITests.modulemap
│ │ └── Pods-iPa图片提取UITests.release.xcconfig
├── SSZipArchive
│ ├── Info.plist
│ ├── SSZipArchive+Swift.swift
│ ├── SSZipArchive.h
│ ├── SSZipArchive.m
│ ├── SSZipCommon.h
│ ├── ZipArchive.h
│ ├── aes
│ │ ├── aes.h
│ │ ├── aes_via_ace.h
│ │ ├── aescrypt.c
│ │ ├── aeskey.c
│ │ ├── aesopt.h
│ │ ├── aestab.c
│ │ ├── aestab.h
│ │ ├── brg_endian.h
│ │ ├── brg_types.h
│ │ ├── entropy.c
│ │ ├── entropy.h
│ │ ├── fileenc.c
│ │ ├── fileenc.h
│ │ ├── hmac.c
│ │ ├── hmac.h
│ │ ├── prng.c
│ │ ├── prng.h
│ │ ├── pwd2key.c
│ │ ├── pwd2key.h
│ │ ├── sha1.c
│ │ └── sha1.h
│ └── minizip
│ │ ├── crypt.h
│ │ ├── ioapi.c
│ │ ├── ioapi.h
│ │ ├── mztools.c
│ │ ├── mztools.h
│ │ ├── unzip.c
│ │ ├── unzip.h
│ │ ├── zip.c
│ │ └── zip.h
├── iPa图片提取.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── Tian.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── Tian.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── Extrac.xcscheme
│ │ └── xcschememanagement.plist
├── iPa图片提取.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── Tian.xcuserdatad
│ │ ├── UserInterfaceState.xcuserstate
│ │ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
├── iPa图片提取
│ ├── AboutVC.swift
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── 256.imageset
│ │ │ ├── 256.png
│ │ │ └── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ ├── 1024.png
│ │ │ ├── 128.png
│ │ │ ├── 16.png
│ │ │ ├── 256-1.png
│ │ │ ├── 256.png
│ │ │ ├── 32-1.png
│ │ │ ├── 32.png
│ │ │ ├── 512-1.png
│ │ │ ├── 512.png
│ │ │ ├── 65.png
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── appPlaceholder.imageset
│ │ │ ├── Contents.json
│ │ │ ├── appPlaceholder_185x185_@1x.png
│ │ │ └── appPlaceholder_185x185_@2x.png
│ │ ├── green-hover.imageset
│ │ │ ├── Contents.json
│ │ │ ├── green-hover.png
│ │ │ └── green-hover@2x.png
│ │ ├── red-hover.imageset
│ │ │ ├── Contents.json
│ │ │ ├── red-hover.png
│ │ │ └── red-hover@2x.png
│ │ ├── winxinPay.imageset
│ │ │ ├── Contents.json
│ │ │ └── IMG_1981.png
│ │ └── yellow-hover.imageset
│ │ │ ├── Contents.json
│ │ │ ├── yellow-hover.png
│ │ │ └── yellow-hover@2x.png
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── DragView.swift
│ ├── FileItem.swift
│ ├── GifView.swift
│ ├── Info.plist
│ ├── MainVC.swift
│ └── MainWindow.swift
├── iPa图片提取Tests
│ ├── Info.plist
│ └── iPa____Tests.swift
├── iPa图片提取UITests
│ ├── Info.plist
│ └── iPa____UITests.swift
└── itsnottoolate.gif
└── images
├── 0.png
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
└── 6.png
/Applications:
--------------------------------------------------------------------------------
1 | /Applications
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftAppKit.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftAppKit.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftCore.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftCore.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftCoreData.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftCoreData.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftCoreGraphics.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftCoreGraphics.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftCoreImage.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftCoreImage.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftDarwin.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftDarwin.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftDispatch.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftDispatch.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftFoundation.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftFoundation.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftIOKit.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftIOKit.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftObjectiveC.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftObjectiveC.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftXPC.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftXPC.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Frameworks/libswiftos.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Frameworks/libswiftos.dylib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 15G1004
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | Extrac
11 | CFBundleIconFile
12 | AppIcon
13 | CFBundleIdentifier
14 | space.tianziyao.iPa----
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | Extrac
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | 1.0
23 | CFBundleSupportedPlatforms
24 |
25 | MacOSX
26 |
27 | DTCompiler
28 | com.apple.compilers.llvm.clang.1_0
29 | DTPlatformBuild
30 | 8A218a
31 | DTPlatformVersion
32 | GM
33 | DTSDKBuild
34 | 16A300
35 | DTSDKName
36 | macosx10.12
37 | DTXcode
38 | 0800
39 | DTXcodeBuild
40 | 8A218a
41 | LSApplicationCategoryType
42 | public.app-category.developer-tools
43 | LSMinimumSystemVersion
44 | 10.10
45 | NSHumanReadableCopyright
46 | Copyright © 2016年 田子瑶. All rights reserved.
47 | NSMainStoryboardFile
48 | Main
49 | NSPrincipalClass
50 | NSApplication
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Extrac.app/Contents/MacOS/Extrac:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/MacOS/Extrac
--------------------------------------------------------------------------------
/Extrac.app/Contents/PkgInfo:
--------------------------------------------------------------------------------
1 | APPL????
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/AppIcon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/AppIcon.icns
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Assets.car:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Assets.car
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/NSViewController-w2v-q9-FJE.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/NSViewController-w2v-q9-FJE.nib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/NSViewController-ycJ-YI-Hkh.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/NSViewController-ycJ-YI-Hkh.nib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-yaF-eR-hmK.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-yaF-eR-hmK.nib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/w2v-q9-FJE-view-rnu-LK-BBq.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/w2v-q9-FJE-view-rnu-LK-BBq.nib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/ycJ-YI-Hkh-view-V9H-BM-Jbj.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/Base.lproj/Main.storyboardc/ycJ-YI-Hkh-view-V9H-BM-Jbj.nib
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/CARExtractor:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/CARExtractor
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Extrac.app/Contents/Resources/itsnottoolate.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/Extrac.app/Contents/Resources/itsnottoolate.gif
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | 我的第一个开源项目,主要作用是提取 APP 中的 UI 素材和 Car 类型文件的图片提取。
2 | UI设计师、个人开发者和好奇心用户的福音,只需拖放 iPa 安装包即可获取此 APP 内的 UI 图片,如希望获取微信的 UI 素材,拖放『微信.iPa』 即可。同时支持文件夹拖放及批量处理。
3 | 运行环境:OS X 10.10 及以上版本。
4 | 如果对你有帮助请在下载链接中点一下 Star,如果感觉好用欢迎分享给你的朋友~
5 |
6 | ### 开发者:
7 |
8 | 编译环境:Swift 3.0,Xcode 8.1
9 |
10 | ### 普通用户:
11 |
12 | 将下载的 Extrac.app 拖放到 Application 目录即可使用。
13 |
14 | 1. 选中要处理的 iPa、Car、JPG、PNG文件,你可以使用多选,或者将它们放在一个文件夹中,将文件拖放到 Extrac.app 中间的深色图标;
15 | 2. 等待处理完成即可;
16 |
17 | |  |  |
18 | | ------------------ | ------------------ |
19 | |  |  |
20 |
21 | #### 注意:
22 |
23 | 你可能需要开启 `系统偏好设置 -> 安全性和隐私 -> 允许从以下位置下载的应用 ->被认可的开发者/任何来源 `。
24 |
25 |
26 |
27 | ---
28 |
29 | This is my first open source software, Its main effect is to extract the APP’s UI material.
30 |
31 | This is a gift for UI designers, developers and curious users, you just need to drag and drop of iPa installation package, and bang! you've got this APP UI images.
32 |
33 | Like Twitter, rag and drop the twitter.ipa, and you got Twitter's UI pictures.
34 |
35 | 
36 |
37 | Also, it supports folder drag and drop and batch processing.
38 |
39 | Operating environment: OS X 10.10 or above
40 |
41 | ### Developer:
42 |
43 | Development environment: Swift 3.0,Xcode 8.1
44 |
45 | ### User
46 |
47 | Drag and drop the downloaded Extrac.app into the Application directory, Done.
48 |
49 | #### Warning
50 |
51 | May be, you need to open`System Preferences -> Security & Privacy -> Mac App Store and identified developers or Anywhere`.
52 |
53 |
--------------------------------------------------------------------------------
/iPa图片提取/CARExtractor:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/CARExtractor
--------------------------------------------------------------------------------
/iPa图片提取/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // iPa图片提取
4 | //
5 | // Created by 田子瑶 on 16/11/5.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import AppKit
11 |
12 | extension NSAttributedString {
13 |
14 | class func hyperlinkFromString(inString: String, withURL url: URL) -> NSAttributedString {
15 | let attrString = NSMutableAttributedString(string: inString)
16 | let range = NSMakeRange(0, attrString.length)
17 | attrString.beginEditing()
18 | attrString.addAttribute(NSLinkAttributeName, value: url.absoluteString, range: range)
19 | attrString.addAttribute(NSForegroundColorAttributeName, value: NSColor.blue, range: range)
20 | let num = NSNumber.init(value: NSUnderlineStyle.styleSingle.rawValue)
21 | attrString.addAttribute(NSUnderlineStyleAttributeName, value: num, range: range)
22 | attrString.endEditing()
23 | return attrString
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/iPa图片提取/Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Header.h
3 | // iPa图片提取
4 | //
5 | // Created by 田子瑶 on 16/11/3.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | #ifndef Header_h
10 | #define Header_h
11 |
12 | #import "ZipArchive.h"
13 |
14 | #endif /* Header_h */
15 |
--------------------------------------------------------------------------------
/iPa图片提取/Podfile:
--------------------------------------------------------------------------------
1 | project 'iPa图片提取.xcodeproj'
2 |
3 | # Uncomment this line to define a global platform for your project
4 | # platform :ios, '9.0'
5 |
6 | target 'iPa图片提取' do
7 | # Comment this line if you're not using Swift and don't want to use dynamic frameworks
8 | use_frameworks!
9 |
10 |
11 | target 'iPa图片提取Tests' do
12 | inherit! :search_paths
13 | # Pods for testing
14 | end
15 |
16 | target 'iPa图片提取UITests' do
17 | inherit! :search_paths
18 | # Pods for testing
19 | end
20 |
21 | end
22 |
--------------------------------------------------------------------------------
/iPa图片提取/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODFILE CHECKSUM: bf38843eb0bf2b589e58e79f85c92f686c8eebf1
2 |
3 | COCOAPODS: 1.0.0
4 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODFILE CHECKSUM: bf38843eb0bf2b589e58e79f85c92f686c8eebf1
2 |
3 | COCOAPODS: 1.0.0
4 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/.xcuserdatad/xcschemes/Pods-iPa图片提取.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/.xcuserdatad/xcschemes/Pods-iPa图片提取Tests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/.xcuserdatad/xcschemes/Pods-iPa图片提取UITests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-iPa图片提取.xcscheme
8 |
9 | isShown
10 |
11 |
12 | Pods-iPa图片提取Tests.xcscheme
13 |
14 | isShown
15 |
16 |
17 | Pods-iPa图片提取UITests.xcscheme
18 |
19 | isShown
20 |
21 |
22 |
23 | SuppressBuildableAutocreation
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/Tian.xcuserdatad/xcschemes/Pods-iPa图片提取.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/Tian.xcuserdatad/xcschemes/Pods-iPa图片提取Tests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/Tian.xcuserdatad/xcschemes/Pods-iPa图片提取UITests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/Tian.xcuserdatad/xcschemes/SSZipArchive.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Pods.xcodeproj/xcuserdata/Tian.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-iPa图片提取.xcscheme
8 |
9 | orderHint
10 | 1
11 |
12 | Pods-iPa图片提取Tests.xcscheme
13 |
14 | orderHint
15 | 2
16 |
17 | Pods-iPa图片提取UITests.xcscheme
18 |
19 | orderHint
20 | 3
21 |
22 | SSZipArchive.xcscheme
23 |
24 | orderHint
25 | 4
26 |
27 |
28 | SuppressBuildableAutocreation
29 |
30 | 4A54C44E758E423CAD4DADA2EE0A96A2
31 |
32 | primary
33 |
34 |
35 | 57960FA52825B9162F3A0E56CE9AA1ED
36 |
37 | primary
38 |
39 |
40 | 57F2DE8F64E45D08CA303B71FB83BC6A
41 |
42 | primary
43 |
44 |
45 | 89C4CF05CC73B5FC5DB850232B28483B
46 |
47 | primary
48 |
49 |
50 | AE264F7D8B8C3EBB0DEE4589739F6FB8
51 |
52 | primary
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_iPa____ : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_iPa____
5 | @end
6 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | *)
22 | TARGET_DEVICE_ARGS="--target-device mac"
23 | ;;
24 | esac
25 |
26 | realpath() {
27 | DIRECTORY="$(cd "${1%/*}" && pwd)"
28 | FILENAME="${1##*/}"
29 | echo "$DIRECTORY/$FILENAME"
30 | }
31 |
32 | install_resource()
33 | {
34 | if [[ "$1" = /* ]] ; then
35 | RESOURCE_PATH="$1"
36 | else
37 | RESOURCE_PATH="${PODS_ROOT}/$1"
38 | fi
39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
40 | cat << EOM
41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
42 | EOM
43 | exit 1
44 | fi
45 | case $RESOURCE_PATH in
46 | *.storyboard)
47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
49 | ;;
50 | *.xib)
51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
53 | ;;
54 | *.framework)
55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
59 | ;;
60 | *.xcdatamodel)
61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
63 | ;;
64 | *.xcdatamodeld)
65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
67 | ;;
68 | *.xcmappingmodel)
69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
71 | ;;
72 | *.xcassets)
73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
75 | ;;
76 | *)
77 | echo "$RESOURCE_PATH"
78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
79 | ;;
80 | esac
81 | }
82 |
83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
88 | fi
89 | rm -f "$RESOURCES_TO_COPY"
90 |
91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
92 | then
93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
95 | while read line; do
96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
97 | XCASSET_FILES+=("$line")
98 | fi
99 | done <<<"$OTHER_XCASSETS"
100 |
101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
102 | fi
103 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double Pods_iPa____VersionNumber;
5 | FOUNDATION_EXPORT const unsigned char Pods_iPa____VersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CODE_SIGN_IDENTITY =
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}/Pods
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_iPa____ {
2 | umbrella header "Pods-iPa图片提取-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取/Pods-iPa图片提取.release.xcconfig:
--------------------------------------------------------------------------------
1 | CODE_SIGN_IDENTITY =
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}/Pods
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_iPa____Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_iPa____Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | *)
22 | TARGET_DEVICE_ARGS="--target-device mac"
23 | ;;
24 | esac
25 |
26 | realpath() {
27 | DIRECTORY="$(cd "${1%/*}" && pwd)"
28 | FILENAME="${1##*/}"
29 | echo "$DIRECTORY/$FILENAME"
30 | }
31 |
32 | install_resource()
33 | {
34 | if [[ "$1" = /* ]] ; then
35 | RESOURCE_PATH="$1"
36 | else
37 | RESOURCE_PATH="${PODS_ROOT}/$1"
38 | fi
39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
40 | cat << EOM
41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
42 | EOM
43 | exit 1
44 | fi
45 | case $RESOURCE_PATH in
46 | *.storyboard)
47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
49 | ;;
50 | *.xib)
51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
53 | ;;
54 | *.framework)
55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
59 | ;;
60 | *.xcdatamodel)
61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
63 | ;;
64 | *.xcdatamodeld)
65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
67 | ;;
68 | *.xcmappingmodel)
69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
71 | ;;
72 | *.xcassets)
73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
75 | ;;
76 | *)
77 | echo "$RESOURCE_PATH"
78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
79 | ;;
80 | esac
81 | }
82 |
83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
88 | fi
89 | rm -f "$RESOURCES_TO_COPY"
90 |
91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
92 | then
93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
95 | while read line; do
96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
97 | XCASSET_FILES+=("$line")
98 | fi
99 | done <<<"$OTHER_XCASSETS"
100 |
101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
102 | fi
103 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double Pods_iPa____TestsVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char Pods_iPa____TestsVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CODE_SIGN_IDENTITY =
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}/Pods
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_iPa____Tests {
2 | umbrella header "Pods-iPa图片提取Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取Tests/Pods-iPa图片提取Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | CODE_SIGN_IDENTITY =
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}/Pods
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_iPa____UITests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_iPa____UITests
5 | @end
6 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | *)
22 | TARGET_DEVICE_ARGS="--target-device mac"
23 | ;;
24 | esac
25 |
26 | realpath() {
27 | DIRECTORY="$(cd "${1%/*}" && pwd)"
28 | FILENAME="${1##*/}"
29 | echo "$DIRECTORY/$FILENAME"
30 | }
31 |
32 | install_resource()
33 | {
34 | if [[ "$1" = /* ]] ; then
35 | RESOURCE_PATH="$1"
36 | else
37 | RESOURCE_PATH="${PODS_ROOT}/$1"
38 | fi
39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
40 | cat << EOM
41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
42 | EOM
43 | exit 1
44 | fi
45 | case $RESOURCE_PATH in
46 | *.storyboard)
47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
49 | ;;
50 | *.xib)
51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
53 | ;;
54 | *.framework)
55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
59 | ;;
60 | *.xcdatamodel)
61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
63 | ;;
64 | *.xcdatamodeld)
65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
67 | ;;
68 | *.xcmappingmodel)
69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
71 | ;;
72 | *.xcassets)
73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
75 | ;;
76 | *)
77 | echo "$RESOURCE_PATH"
78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
79 | ;;
80 | esac
81 | }
82 |
83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
88 | fi
89 | rm -f "$RESOURCES_TO_COPY"
90 |
91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
92 | then
93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
95 | while read line; do
96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
97 | XCASSET_FILES+=("$line")
98 | fi
99 | done <<<"$OTHER_XCASSETS"
100 |
101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
102 | fi
103 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double Pods_iPa____UITestsVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char Pods_iPa____UITestsVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CODE_SIGN_IDENTITY =
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}/Pods
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_iPa____UITests {
2 | umbrella header "Pods-iPa图片提取UITests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/iPa图片提取/Pods/Target Support Files/Pods-iPa图片提取UITests/Pods-iPa图片提取UITests.release.xcconfig:
--------------------------------------------------------------------------------
1 | CODE_SIGN_IDENTITY =
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}/Pods
7 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/SSZipArchive+Swift.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSZipArchive+Swift.swift
3 | // ZipArchive
4 | //
5 | // Created by William Dunay on 7/6/16.
6 | // Copyright © 2016 smumryak. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension SSZipArchive {
12 |
13 | static func unzipFileAtPath(_ path: String, toDestination destination: String, overwrite: Bool, password: String?, delegate: SSZipArchiveDelegate?) throws -> Bool {
14 |
15 | var success = false
16 | var error: NSError?
17 |
18 | success = __unzipFile(atPath: path, toDestination: destination, overwrite: overwrite, password: password, error: &error, delegate: delegate)
19 | if let throwableError = error {
20 | throw throwableError
21 | }
22 |
23 | return success
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/SSZipArchive.h:
--------------------------------------------------------------------------------
1 | //
2 | // SSZipArchive.h
3 | // SSZipArchive
4 | //
5 | // Created by Sam Soffes on 7/21/10.
6 | // Copyright (c) Sam Soffes 2010-2015. All rights reserved.
7 | //
8 |
9 | #ifndef _SSZIPARCHIVE_H
10 | #define _SSZIPARCHIVE_H
11 |
12 | #import
13 | #include "SSZipCommon.h"
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | @protocol SSZipArchiveDelegate;
18 |
19 | @interface SSZipArchive : NSObject
20 |
21 | // Password check
22 | + (BOOL)isFilePasswordProtectedAtPath:(NSString *)path;
23 |
24 | // Unzip
25 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
26 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id)delegate;
27 |
28 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error;
29 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error delegate:(nullable id)delegate NS_REFINED_FOR_SWIFT;
30 |
31 | + (BOOL)unzipFileAtPath:(NSString *)path
32 | toDestination:(NSString *)destination
33 | preserveAttributes:(BOOL)preserveAttributes
34 | overwrite:(BOOL)overwrite
35 | password:(nullable NSString *)password
36 | error:(NSError * *)error
37 | delegate:(nullable id)delegate;
38 |
39 | + (BOOL)unzipFileAtPath:(NSString *)path
40 | toDestination:(NSString *)destination
41 | progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
42 | completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler;
43 |
44 | + (BOOL)unzipFileAtPath:(NSString *)path
45 | toDestination:(NSString *)destination
46 | overwrite:(BOOL)overwrite
47 | password:(nullable NSString *)password
48 | progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
49 | completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler;
50 |
51 | // Zip
52 |
53 | // without password
54 | + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths;
55 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath;
56 |
57 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory;
58 |
59 | // with password, password could be nil
60 | + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password;
61 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password;
62 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password;
63 |
64 | - (instancetype)initWithPath:(NSString *)path;
65 | @property (NS_NONATOMIC_IOSONLY, readonly) BOOL open;
66 | - (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
67 | - (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password;
68 | - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password;
69 | - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
70 | @property (NS_NONATOMIC_IOSONLY, readonly) BOOL close;
71 |
72 | @end
73 |
74 | @protocol SSZipArchiveDelegate
75 |
76 | @optional
77 |
78 | - (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo;
79 | - (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath;
80 |
81 | - (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
82 | - (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
83 | - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
84 | - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath;
85 |
86 | - (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total;
87 | - (void)zipArchiveDidUnzipArchiveFile:(NSString *)zipFile entryPath:(NSString *)entryPath destPath:(NSString *)destPath;
88 |
89 | @end
90 |
91 | NS_ASSUME_NONNULL_END
92 |
93 | #endif /* _SSZIPARCHIVE_H */
94 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/SSZipCommon.h:
--------------------------------------------------------------------------------
1 | #ifndef SSZipCommon
2 | #define SSZipCommon
3 |
4 | /* tm_unz contain date/time info */
5 | typedef struct tm_unz_s
6 | {
7 | unsigned int tm_sec; /* seconds after the minute - [0,59] */
8 | unsigned int tm_min; /* minutes after the hour - [0,59] */
9 | unsigned int tm_hour; /* hours since midnight - [0,23] */
10 | unsigned int tm_mday; /* day of the month - [1,31] */
11 | unsigned int tm_mon; /* months since January - [0,11] */
12 | unsigned int tm_year; /* years - [1980..2044] */
13 | } tm_unz;
14 |
15 | typedef struct unz_file_info_s
16 | {
17 | unsigned long version; /* version made by 2 bytes */
18 | unsigned long version_needed; /* version needed to extract 2 bytes */
19 | unsigned long flag; /* general purpose bit flag 2 bytes */
20 | unsigned long compression_method; /* compression method 2 bytes */
21 | unsigned long dosDate; /* last mod file date in Dos fmt 4 bytes */
22 | unsigned long crc; /* crc-32 4 bytes */
23 | unsigned long compressed_size; /* compressed size 4 bytes */
24 | unsigned long uncompressed_size; /* uncompressed size 4 bytes */
25 | unsigned long size_filename; /* filename length 2 bytes */
26 | unsigned long size_file_extra; /* extra field length 2 bytes */
27 | unsigned long size_file_comment; /* file comment length 2 bytes */
28 |
29 | unsigned long disk_num_start; /* disk number start 2 bytes */
30 | unsigned long internal_fa; /* internal file attributes 2 bytes */
31 | unsigned long external_fa; /* external file attributes 4 bytes */
32 |
33 | tm_unz tmu_date;
34 | } unz_file_info;
35 |
36 | /* unz_file_info contain information about a file in the zipfile */
37 | typedef struct unz_file_info64_s
38 | {
39 | unsigned long version; /* version made by 2 bytes */
40 | unsigned long version_needed; /* version needed to extract 2 bytes */
41 | unsigned long flag; /* general purpose bit flag 2 bytes */
42 | unsigned long compression_method; /* compression method 2 bytes */
43 | unsigned long dosDate; /* last mod file date in Dos fmt 4 bytes */
44 | unsigned long crc; /* crc-32 4 bytes */
45 | unsigned long long compressed_size; /* compressed size 8 bytes */
46 | unsigned long long uncompressed_size; /* uncompressed size 8 bytes */
47 | unsigned long size_filename; /* filename length 2 bytes */
48 | unsigned long size_file_extra; /* extra field length 2 bytes */
49 | unsigned long size_file_comment; /* file comment length 2 bytes */
50 |
51 | unsigned long disk_num_start; /* disk number start 2 bytes */
52 | unsigned long internal_fa; /* internal file attributes 2 bytes */
53 | unsigned long external_fa; /* external file attributes 4 bytes */
54 |
55 | tm_unz tmu_date;
56 | unsigned long long disk_offset;
57 | unsigned long size_file_extra_internal;
58 | } unz_file_info64;
59 |
60 | typedef struct unz_global_info_s
61 | {
62 | unsigned long number_entry; /* total number of entries in
63 | the central dir on this disk */
64 |
65 | unsigned long number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP*/
66 |
67 |
68 | unsigned long size_comment; /* size of the global comment of the zipfile */
69 | } unz_global_info;
70 |
71 | typedef struct unz_global_info64
72 | {
73 | unsigned long long number_entry; /* total number of entries in
74 | the central dir on this disk */
75 |
76 | unsigned long number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP*/
77 |
78 | unsigned long size_comment; /* size of the global comment of the zipfile */
79 | } unz_global_info64;
80 |
81 | #endif
82 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/ZipArchive.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZipArchive.h
3 | // ZipArchive
4 | //
5 | // Created by Serhii Mumriak on 12/1/15.
6 | // Copyright © 2015 smumryak. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for ZipArchive.
12 | FOUNDATION_EXPORT double ZipArchiveVersionNumber;
13 |
14 | //! Project version string for ZipArchive.
15 | FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 | #import "SSZipArchive.h"
20 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/aes.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | The redistribution and use of this software (with or without changes)
6 | is allowed without the payment of fees or royalties provided that:
7 |
8 | source code distributions include the above copyright notice, this
9 | list of conditions and the following disclaimer;
10 |
11 | binary distributions include the above copyright notice, this list
12 | of conditions and the following disclaimer in their documentation.
13 |
14 | This software is provided 'as is' with no explicit or implied warranties
15 | in respect of its operation, including, but not limited to, correctness
16 | and fitness for purpose.
17 | ---------------------------------------------------------------------------
18 | Issue Date: 20/12/2007
19 |
20 | This file contains the definitions required to use AES in C. See aesopt.h
21 | for optimisation details.
22 | */
23 |
24 | #ifndef _AES_H
25 | #define _AES_H
26 |
27 | #include
28 |
29 | /* This include is used to find 8 & 32 bit unsigned integer types */
30 | #include "brg_types.h"
31 |
32 | #if defined(__cplusplus)
33 | extern "C"
34 | {
35 | #endif
36 |
37 | #define AES_128 /* if a fast 128 bit key scheduler is needed */
38 | #define AES_192 /* if a fast 192 bit key scheduler is needed */
39 | #define AES_256 /* if a fast 256 bit key scheduler is needed */
40 | #define AES_VAR /* if variable key size scheduler is needed */
41 | #define AES_MODES /* if support is needed for modes */
42 |
43 | /* The following must also be set in assembler files if being used */
44 |
45 | #define AES_ENCRYPT /* if support for encryption is needed */
46 | #define AES_DECRYPT /* if support for decryption is needed */
47 | #define AES_REV_DKS /* define to reverse decryption key schedule */
48 |
49 | #define AES_BLOCK_SIZE 16 /* the AES block size in bytes */
50 | #define N_COLS 4 /* the number of columns in the state */
51 |
52 | /* The key schedule length is 11, 13 or 15 16-byte blocks for 128, */
53 | /* 192 or 256-bit keys respectively. That is 176, 208 or 240 bytes */
54 | /* or 44, 52 or 60 32-bit words. */
55 |
56 | #if defined( AES_VAR ) || defined( AES_256 )
57 | #define KS_LENGTH 60
58 | #elif defined( AES_192 )
59 | #define KS_LENGTH 52
60 | #else
61 | #define KS_LENGTH 44
62 | #endif
63 |
64 | #define AES_RETURN INT_RETURN
65 |
66 | /* the character array 'inf' in the following structures is used */
67 | /* to hold AES context information. This AES code uses cx->inf.b[0] */
68 | /* to hold the number of rounds multiplied by 16. The other three */
69 | /* elements can be used by code that implements additional modes */
70 |
71 | typedef union
72 | { uint_32t l;
73 | uint_8t b[4];
74 | } aes_inf;
75 |
76 | typedef struct
77 | { uint_32t ks[KS_LENGTH];
78 | aes_inf inf;
79 | } aes_encrypt_ctx;
80 |
81 | typedef struct
82 | { uint_32t ks[KS_LENGTH];
83 | aes_inf inf;
84 | } aes_decrypt_ctx;
85 |
86 | /* This routine must be called before first use if non-static */
87 | /* tables are being used */
88 |
89 | AES_RETURN aes_init(void);
90 |
91 | /* Key lengths in the range 16 <= key_len <= 32 are given in bytes, */
92 | /* those in the range 128 <= key_len <= 256 are given in bits */
93 |
94 | #if defined( AES_ENCRYPT )
95 |
96 | #if defined( AES_128 ) || defined( AES_VAR)
97 | AES_RETURN aes_encrypt_key128(const unsigned char *key, aes_encrypt_ctx cx[1]);
98 | #endif
99 |
100 | #if defined( AES_192 ) || defined( AES_VAR)
101 | AES_RETURN aes_encrypt_key192(const unsigned char *key, aes_encrypt_ctx cx[1]);
102 | #endif
103 |
104 | #if defined( AES_256 ) || defined( AES_VAR)
105 | AES_RETURN aes_encrypt_key256(const unsigned char *key, aes_encrypt_ctx cx[1]);
106 | #endif
107 |
108 | #if defined( AES_VAR )
109 | AES_RETURN aes_encrypt_key(const unsigned char *key, int key_len, aes_encrypt_ctx cx[1]);
110 | #endif
111 |
112 | AES_RETURN aes_encrypt(const unsigned char *in, unsigned char *out, const aes_encrypt_ctx cx[1]);
113 |
114 | #endif
115 |
116 | #if defined( AES_DECRYPT )
117 |
118 | #if defined( AES_128 ) || defined( AES_VAR)
119 | AES_RETURN aes_decrypt_key128(const unsigned char *key, aes_decrypt_ctx cx[1]);
120 | #endif
121 |
122 | #if defined( AES_192 ) || defined( AES_VAR)
123 | AES_RETURN aes_decrypt_key192(const unsigned char *key, aes_decrypt_ctx cx[1]);
124 | #endif
125 |
126 | #if defined( AES_256 ) || defined( AES_VAR)
127 | AES_RETURN aes_decrypt_key256(const unsigned char *key, aes_decrypt_ctx cx[1]);
128 | #endif
129 |
130 | #if defined( AES_VAR )
131 | AES_RETURN aes_decrypt_key(const unsigned char *key, int key_len, aes_decrypt_ctx cx[1]);
132 | #endif
133 |
134 | AES_RETURN aes_decrypt(const unsigned char *in, unsigned char *out, const aes_decrypt_ctx cx[1]);
135 |
136 | #endif
137 |
138 | #if defined( AES_MODES )
139 |
140 | /* Multiple calls to the following subroutines for multiple block */
141 | /* ECB, CBC, CFB, OFB and CTR mode encryption can be used to handle */
142 | /* long messages incremantally provided that the context AND the iv */
143 | /* are preserved between all such calls. For the ECB and CBC modes */
144 | /* each individual call within a series of incremental calls must */
145 | /* process only full blocks (i.e. len must be a multiple of 16) but */
146 | /* the CFB, OFB and CTR mode calls can handle multiple incremental */
147 | /* calls of any length. Each mode is reset when a new AES key is */
148 | /* set but ECB and CBC operations can be reset without setting a */
149 | /* new key by setting a new IV value. To reset CFB, OFB and CTR */
150 | /* without setting the key, aes_mode_reset() must be called and the */
151 | /* IV must be set. NOTE: All these calls update the IV on exit so */
152 | /* this has to be reset if a new operation with the same IV as the */
153 | /* previous one is required (or decryption follows encryption with */
154 | /* the same IV array). */
155 |
156 | AES_RETURN aes_test_alignment_detection(unsigned int n);
157 |
158 | AES_RETURN aes_ecb_encrypt(const unsigned char *ibuf, unsigned char *obuf,
159 | int len, const aes_encrypt_ctx cx[1]);
160 |
161 | AES_RETURN aes_ecb_decrypt(const unsigned char *ibuf, unsigned char *obuf,
162 | int len, const aes_decrypt_ctx cx[1]);
163 |
164 | AES_RETURN aes_cbc_encrypt(const unsigned char *ibuf, unsigned char *obuf,
165 | int len, unsigned char *iv, const aes_encrypt_ctx cx[1]);
166 |
167 | AES_RETURN aes_cbc_decrypt(const unsigned char *ibuf, unsigned char *obuf,
168 | int len, unsigned char *iv, const aes_decrypt_ctx cx[1]);
169 |
170 | AES_RETURN aes_mode_reset(aes_encrypt_ctx cx[1]);
171 |
172 | AES_RETURN aes_cfb_encrypt(const unsigned char *ibuf, unsigned char *obuf,
173 | int len, unsigned char *iv, aes_encrypt_ctx cx[1]);
174 |
175 | AES_RETURN aes_cfb_decrypt(const unsigned char *ibuf, unsigned char *obuf,
176 | int len, unsigned char *iv, aes_encrypt_ctx cx[1]);
177 |
178 | #define aes_ofb_encrypt aes_ofb_crypt
179 | #define aes_ofb_decrypt aes_ofb_crypt
180 |
181 | AES_RETURN aes_ofb_crypt(const unsigned char *ibuf, unsigned char *obuf,
182 | int len, unsigned char *iv, aes_encrypt_ctx cx[1]);
183 |
184 | typedef void cbuf_inc(unsigned char *cbuf);
185 |
186 | #define aes_ctr_encrypt aes_ctr_crypt
187 | #define aes_ctr_decrypt aes_ctr_crypt
188 |
189 | AES_RETURN aes_ctr_crypt(const unsigned char *ibuf, unsigned char *obuf,
190 | int len, unsigned char *cbuf, cbuf_inc ctr_inc, aes_encrypt_ctx cx[1]);
191 |
192 | #endif
193 |
194 | #if defined(__cplusplus)
195 | }
196 | #endif
197 |
198 | #endif
199 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/aestab.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | The redistribution and use of this software (with or without changes)
6 | is allowed without the payment of fees or royalties provided that:
7 |
8 | source code distributions include the above copyright notice, this
9 | list of conditions and the following disclaimer;
10 |
11 | binary distributions include the above copyright notice, this list
12 | of conditions and the following disclaimer in their documentation.
13 |
14 | This software is provided 'as is' with no explicit or implied warranties
15 | in respect of its operation, including, but not limited to, correctness
16 | and fitness for purpose.
17 | ---------------------------------------------------------------------------
18 | Issue Date: 20/12/2007
19 |
20 | This file contains the code for declaring the tables needed to implement
21 | AES. The file aesopt.h is assumed to be included before this header file.
22 | If there are no global variables, the definitions here can be used to put
23 | the AES tables in a structure so that a pointer can then be added to the
24 | AES context to pass them to the AES routines that need them. If this
25 | facility is used, the calling program has to ensure that this pointer is
26 | managed appropriately. In particular, the value of the t_dec(in,it) item
27 | in the table structure must be set to zero in order to ensure that the
28 | tables are initialised. In practice the three code sequences in aeskey.c
29 | that control the calls to aes_init() and the aes_init() routine itself will
30 | have to be changed for a specific implementation. If global variables are
31 | available it will generally be preferable to use them with the precomputed
32 | FIXED_TABLES option that uses static global tables.
33 |
34 | The following defines can be used to control the way the tables
35 | are defined, initialised and used in embedded environments that
36 | require special features for these purposes
37 |
38 | the 't_dec' construction is used to declare fixed table arrays
39 | the 't_set' construction is used to set fixed table values
40 | the 't_use' construction is used to access fixed table values
41 |
42 | 256 byte tables:
43 |
44 | t_xxx(s,box) => forward S box
45 | t_xxx(i,box) => inverse S box
46 |
47 | 256 32-bit word OR 4 x 256 32-bit word tables:
48 |
49 | t_xxx(f,n) => forward normal round
50 | t_xxx(f,l) => forward last round
51 | t_xxx(i,n) => inverse normal round
52 | t_xxx(i,l) => inverse last round
53 | t_xxx(l,s) => key schedule table
54 | t_xxx(i,m) => key schedule table
55 |
56 | Other variables and tables:
57 |
58 | t_xxx(r,c) => the rcon table
59 | */
60 |
61 | #if !defined( _AESTAB_H )
62 | #define _AESTAB_H
63 |
64 | #if defined(__cplusplus)
65 | extern "C" {
66 | #endif
67 |
68 | #define t_dec(m,n) t_##m##n
69 | #define t_set(m,n) t_##m##n
70 | #define t_use(m,n) t_##m##n
71 |
72 | #if defined(FIXED_TABLES)
73 | # if !defined( __GNUC__ ) && (defined( __MSDOS__ ) || defined( __WIN16__ ))
74 | /* make tables far data to avoid using too much DGROUP space (PG) */
75 | # define CONST const far
76 | # else
77 | # define CONST const
78 | # endif
79 | #else
80 | # define CONST
81 | #endif
82 |
83 | #if defined(DO_TABLES)
84 | # define EXTERN
85 | #else
86 | # define EXTERN extern
87 | #endif
88 |
89 | #if defined(_MSC_VER) && defined(TABLE_ALIGN)
90 | #define ALIGN __declspec(align(TABLE_ALIGN))
91 | #else
92 | #define ALIGN
93 | #endif
94 |
95 | #if defined( __WATCOMC__ ) && ( __WATCOMC__ >= 1100 )
96 | # define XP_DIR __cdecl
97 | #else
98 | # define XP_DIR
99 | #endif
100 |
101 | #if defined(DO_TABLES) && defined(FIXED_TABLES)
102 | #define d_1(t,n,b,e) EXTERN ALIGN CONST XP_DIR t n[256] = b(e)
103 | #define d_4(t,n,b,e,f,g,h) EXTERN ALIGN CONST XP_DIR t n[4][256] = { b(e), b(f), b(g), b(h) }
104 | EXTERN ALIGN CONST uint_32t t_dec(r,c)[RC_LENGTH] = rc_data(w0);
105 | #else
106 | #define d_1(t,n,b,e) EXTERN ALIGN CONST XP_DIR t n[256]
107 | #define d_4(t,n,b,e,f,g,h) EXTERN ALIGN CONST XP_DIR t n[4][256]
108 | EXTERN ALIGN CONST uint_32t t_dec(r,c)[RC_LENGTH];
109 | #endif
110 |
111 | #if defined( SBX_SET )
112 | d_1(uint_8t, t_dec(s,box), sb_data, h0);
113 | #endif
114 | #if defined( ISB_SET )
115 | d_1(uint_8t, t_dec(i,box), isb_data, h0);
116 | #endif
117 |
118 | #if defined( FT1_SET )
119 | d_1(uint_32t, t_dec(f,n), sb_data, u0);
120 | #endif
121 | #if defined( FT4_SET )
122 | d_4(uint_32t, t_dec(f,n), sb_data, u0, u1, u2, u3);
123 | #endif
124 |
125 | #if defined( FL1_SET )
126 | d_1(uint_32t, t_dec(f,l), sb_data, w0);
127 | #endif
128 | #if defined( FL4_SET )
129 | d_4(uint_32t, t_dec(f,l), sb_data, w0, w1, w2, w3);
130 | #endif
131 |
132 | #if defined( IT1_SET )
133 | d_1(uint_32t, t_dec(i,n), isb_data, v0);
134 | #endif
135 | #if defined( IT4_SET )
136 | d_4(uint_32t, t_dec(i,n), isb_data, v0, v1, v2, v3);
137 | #endif
138 |
139 | #if defined( IL1_SET )
140 | d_1(uint_32t, t_dec(i,l), isb_data, w0);
141 | #endif
142 | #if defined( IL4_SET )
143 | d_4(uint_32t, t_dec(i,l), isb_data, w0, w1, w2, w3);
144 | #endif
145 |
146 | #if defined( LS1_SET )
147 | #if defined( FL1_SET )
148 | #undef LS1_SET
149 | #else
150 | d_1(uint_32t, t_dec(l,s), sb_data, w0);
151 | #endif
152 | #endif
153 |
154 | #if defined( LS4_SET )
155 | #if defined( FL4_SET )
156 | #undef LS4_SET
157 | #else
158 | d_4(uint_32t, t_dec(l,s), sb_data, w0, w1, w2, w3);
159 | #endif
160 | #endif
161 |
162 | #if defined( IM1_SET )
163 | d_1(uint_32t, t_dec(i,m), mm_data, v0);
164 | #endif
165 | #if defined( IM4_SET )
166 | d_4(uint_32t, t_dec(i,m), mm_data, v0, v1, v2, v3);
167 | #endif
168 |
169 | #if defined(__cplusplus)
170 | }
171 | #endif
172 |
173 | #endif
174 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/brg_endian.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | The redistribution and use of this software (with or without changes)
6 | is allowed without the payment of fees or royalties provided that:
7 |
8 | source code distributions include the above copyright notice, this
9 | list of conditions and the following disclaimer;
10 |
11 | binary distributions include the above copyright notice, this list
12 | of conditions and the following disclaimer in their documentation.
13 |
14 | This software is provided 'as is' with no explicit or implied warranties
15 | in respect of its operation, including, but not limited to, correctness
16 | and fitness for purpose.
17 | ---------------------------------------------------------------------------
18 | Issue Date: 20/12/2007
19 | */
20 |
21 | #ifndef _BRG_ENDIAN_H
22 | #define _BRG_ENDIAN_H
23 |
24 | #define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */
25 | #define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */
26 |
27 | /* Include files where endian defines and byteswap functions may reside */
28 | #if defined( __sun )
29 | # include
30 | #elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ )
31 | # include
32 | #elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \
33 | defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ )
34 | # include
35 | #elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
36 | # if !defined( __MINGW32__ ) && !defined( _AIX )
37 | # include
38 | # if !defined( __BEOS__ )
39 | # include
40 | # endif
41 | # endif
42 | #endif
43 |
44 | /* Now attempt to set the define for platform byte order using any */
45 | /* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */
46 | /* seem to encompass most endian symbol definitions */
47 |
48 | #if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN )
49 | # if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN
50 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
51 | # elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN
52 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
53 | # endif
54 | #elif defined( BIG_ENDIAN )
55 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
56 | #elif defined( LITTLE_ENDIAN )
57 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
58 | #endif
59 |
60 | #if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN )
61 | # if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN
62 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
63 | # elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN
64 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
65 | # endif
66 | #elif defined( _BIG_ENDIAN )
67 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
68 | #elif defined( _LITTLE_ENDIAN )
69 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
70 | #endif
71 |
72 | #if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN )
73 | # if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN
74 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
75 | # elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN
76 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
77 | # endif
78 | #elif defined( __BIG_ENDIAN )
79 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
80 | #elif defined( __LITTLE_ENDIAN )
81 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
82 | #endif
83 |
84 | #if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ )
85 | # if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__
86 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
87 | # elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__
88 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
89 | # endif
90 | #elif defined( __BIG_ENDIAN__ )
91 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
92 | #elif defined( __LITTLE_ENDIAN__ )
93 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
94 | #endif
95 |
96 | /* if the platform byte order could not be determined, then try to */
97 | /* set this define using common machine defines */
98 | #if !defined(PLATFORM_BYTE_ORDER)
99 |
100 | #if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \
101 | defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \
102 | defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \
103 | defined( vax ) || defined( vms ) || defined( VMS ) || \
104 | defined( __VMS ) || defined( _M_X64 )
105 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
106 |
107 | #elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \
108 | defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \
109 | defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \
110 | defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \
111 | defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \
112 | defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \
113 | defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX )
114 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
115 |
116 | #elif 0 /* **** EDIT HERE IF NECESSARY **** */
117 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
118 | #elif 0 /* **** EDIT HERE IF NECESSARY **** */
119 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
120 | #else
121 | # error Please edit lines 126 or 128 in brg_endian.h to set the platform byte order
122 | #endif
123 |
124 | #endif
125 |
126 | #endif
127 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/brg_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | The redistribution and use of this software (with or without changes)
6 | is allowed without the payment of fees or royalties provided that:
7 |
8 | source code distributions include the above copyright notice, this
9 | list of conditions and the following disclaimer;
10 |
11 | binary distributions include the above copyright notice, this list
12 | of conditions and the following disclaimer in their documentation.
13 |
14 | This software is provided 'as is' with no explicit or implied warranties
15 | in respect of its operation, including, but not limited to, correctness
16 | and fitness for purpose.
17 | ---------------------------------------------------------------------------
18 | Issue Date: 20/12/2007
19 |
20 | The unsigned integer types defined here are of the form uint_t where
21 | is the length of the type; for example, the unsigned 32-bit type is
22 | 'uint_32t'. These are NOT the same as the 'C99 integer types' that are
23 | defined in the inttypes.h and stdint.h headers since attempts to use these
24 | types have shown that support for them is still highly variable. However,
25 | since the latter are of the form uint_t, a regular expression search
26 | and replace (in VC++ search on 'uint_{:z}t' and replace with 'uint\1_t')
27 | can be used to convert the types used here to the C99 standard types.
28 | */
29 |
30 | #ifndef _BRG_TYPES_H
31 | #define _BRG_TYPES_H
32 |
33 | #if defined(__cplusplus)
34 | extern "C" {
35 | #endif
36 |
37 | #include
38 |
39 | #if defined( _MSC_VER ) && ( _MSC_VER >= 1300 )
40 | # include
41 | # define ptrint_t intptr_t
42 | #elif defined( __ECOS__ )
43 | # define intptr_t unsigned int
44 | # define ptrint_t intptr_t
45 | #elif defined( __GNUC__ ) && ( __GNUC__ >= 3 )
46 | # include
47 | # define ptrint_t intptr_t
48 | #else
49 | # define ptrint_t int
50 | #endif
51 |
52 | #ifndef BRG_UI8
53 | # define BRG_UI8
54 | # if UCHAR_MAX == 255u
55 | typedef unsigned char uint_8t;
56 | # else
57 | # error Please define uint_8t as an 8-bit unsigned integer type in brg_types.h
58 | # endif
59 | #endif
60 |
61 | #ifndef BRG_UI16
62 | # define BRG_UI16
63 | # if USHRT_MAX == 65535u
64 | typedef unsigned short uint_16t;
65 | # else
66 | # error Please define uint_16t as a 16-bit unsigned short type in brg_types.h
67 | # endif
68 | #endif
69 |
70 | #ifndef BRG_UI32
71 | # define BRG_UI32
72 | # if UINT_MAX == 4294967295u
73 | # define li_32(h) 0x##h##u
74 | typedef unsigned int uint_32t;
75 | # elif ULONG_MAX == 4294967295u
76 | # define li_32(h) 0x##h##ul
77 | typedef unsigned long uint_32t;
78 | # elif defined( _CRAY )
79 | # error This code needs 32-bit data types, which Cray machines do not provide
80 | # else
81 | # error Please define uint_32t as a 32-bit unsigned integer type in brg_types.h
82 | # endif
83 | #endif
84 |
85 | #ifndef BRG_UI64
86 | # if defined( __BORLANDC__ ) && !defined( __MSDOS__ )
87 | # define BRG_UI64
88 | # define li_64(h) 0x##h##ui64
89 | typedef unsigned __int64 uint_64t;
90 | # elif defined( _MSC_VER ) && ( _MSC_VER < 1300 ) /* 1300 == VC++ 7.0 */
91 | # define BRG_UI64
92 | # define li_64(h) 0x##h##ui64
93 | typedef unsigned __int64 uint_64t;
94 | # elif defined( __sun ) && defined( ULONG_MAX ) && ULONG_MAX == 0xfffffffful
95 | # define BRG_UI64
96 | # define li_64(h) 0x##h##ull
97 | typedef unsigned long long uint_64t;
98 | # elif defined( __MVS__ )
99 | # define BRG_UI64
100 | # define li_64(h) 0x##h##ull
101 | typedef unsigned int long long uint_64t;
102 | # elif defined( UINT_MAX ) && UINT_MAX > 4294967295u
103 | # if UINT_MAX == 18446744073709551615u
104 | # define BRG_UI64
105 | # define li_64(h) 0x##h##u
106 | typedef unsigned int uint_64t;
107 | # endif
108 | # elif defined( ULONG_MAX ) && ULONG_MAX > 4294967295u
109 | # if ULONG_MAX == 18446744073709551615ul
110 | # define BRG_UI64
111 | # define li_64(h) 0x##h##ul
112 | typedef unsigned long uint_64t;
113 | # endif
114 | # elif defined( ULLONG_MAX ) && ULLONG_MAX > 4294967295u
115 | # if ULLONG_MAX == 18446744073709551615ull
116 | # define BRG_UI64
117 | # define li_64(h) 0x##h##ull
118 | typedef unsigned long long uint_64t;
119 | # endif
120 | # elif defined( ULONG_LONG_MAX ) && ULONG_LONG_MAX > 4294967295u
121 | # if ULONG_LONG_MAX == 18446744073709551615ull
122 | # define BRG_UI64
123 | # define li_64(h) 0x##h##ull
124 | typedef unsigned long long uint_64t;
125 | # endif
126 | # endif
127 | #endif
128 |
129 | #if !defined( BRG_UI64 )
130 | # if defined( NEED_UINT_64T )
131 | # error Please define uint_64t as an unsigned 64 bit type in brg_types.h
132 | # endif
133 | #endif
134 |
135 | #ifndef RETURN_VALUES
136 | # define RETURN_VALUES
137 | # if defined( DLL_EXPORT )
138 | # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
139 | # define VOID_RETURN __declspec( dllexport ) void __stdcall
140 | # define INT_RETURN __declspec( dllexport ) int __stdcall
141 | # elif defined( __GNUC__ )
142 | # define VOID_RETURN __declspec( __dllexport__ ) void
143 | # define INT_RETURN __declspec( __dllexport__ ) int
144 | # else
145 | # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
146 | # endif
147 | # elif defined( DLL_IMPORT )
148 | # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
149 | # define VOID_RETURN __declspec( dllimport ) void __stdcall
150 | # define INT_RETURN __declspec( dllimport ) int __stdcall
151 | # elif defined( __GNUC__ )
152 | # define VOID_RETURN __declspec( __dllimport__ ) void
153 | # define INT_RETURN __declspec( __dllimport__ ) int
154 | # else
155 | # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
156 | # endif
157 | # elif defined( __WATCOMC__ )
158 | # define VOID_RETURN void __cdecl
159 | # define INT_RETURN int __cdecl
160 | # else
161 | # define VOID_RETURN void
162 | # define INT_RETURN int
163 | # endif
164 | #endif
165 |
166 | /* These defines are used to detect and set the memory alignment of pointers.
167 | Note that offsets are in bytes.
168 |
169 | ALIGN_OFFSET(x,n) return the positive or zero offset of
170 | the memory addressed by the pointer 'x'
171 | from an address that is aligned on an
172 | 'n' byte boundary ('n' is a power of 2)
173 |
174 | ALIGN_FLOOR(x,n) return a pointer that points to memory
175 | that is aligned on an 'n' byte boundary
176 | and is not higher than the memory address
177 | pointed to by 'x' ('n' is a power of 2)
178 |
179 | ALIGN_CEIL(x,n) return a pointer that points to memory
180 | that is aligned on an 'n' byte boundary
181 | and is not lower than the memory address
182 | pointed to by 'x' ('n' is a power of 2)
183 | */
184 |
185 | #define ALIGN_OFFSET(x,n) (((ptrint_t)(x)) & ((n) - 1))
186 | #define ALIGN_FLOOR(x,n) ((uint_8t*)(x) - ( ((ptrint_t)(x)) & ((n) - 1)))
187 | #define ALIGN_CEIL(x,n) ((uint_8t*)(x) + (-((ptrint_t)(x)) & ((n) - 1)))
188 |
189 | /* These defines are used to declare buffers in a way that allows
190 | faster operations on longer variables to be used. In all these
191 | defines 'size' must be a power of 2 and >= 8. NOTE that the
192 | buffer size is in bytes but the type length is in bits
193 |
194 | UNIT_TYPEDEF(x,size) declares a variable 'x' of length
195 | 'size' bits
196 |
197 | BUFR_TYPEDEF(x,size,bsize) declares a buffer 'x' of length 'bsize'
198 | bytes defined as an array of variables
199 | each of 'size' bits (bsize must be a
200 | multiple of size / 8)
201 |
202 | UNIT_CAST(x,size) casts a variable to a type of
203 | length 'size' bits
204 |
205 | UPTR_CAST(x,size) casts a pointer to a pointer to a
206 | varaiable of length 'size' bits
207 | */
208 |
209 | #define UI_TYPE(size) uint_##size##t
210 | #define UNIT_TYPEDEF(x,size) typedef UI_TYPE(size) x
211 | #define BUFR_TYPEDEF(x,size,bsize) typedef UI_TYPE(size) x[bsize / (size >> 3)]
212 | #define UNIT_CAST(x,size) ((UI_TYPE(size) )(x))
213 | #define UPTR_CAST(x,size) ((UI_TYPE(size)*)(x))
214 |
215 | #if defined(__cplusplus)
216 | }
217 | #endif
218 |
219 | #endif
220 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/entropy.c:
--------------------------------------------------------------------------------
1 | #ifdef _WIN32
2 | #include
3 | #else
4 | #include
5 | #include
6 | #include
7 | #endif
8 |
9 | #if defined(__cplusplus)
10 | extern "C"
11 | {
12 | #endif
13 |
14 | #ifdef _WIN32
15 | int entropy_fun(unsigned char buf[], unsigned int len)
16 | {
17 | HCRYPTPROV provider;
18 | unsigned __int64 pentium_tsc[1];
19 | unsigned int i;
20 | int result = 0;
21 |
22 |
23 | if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
24 | {
25 | result = CryptGenRandom(provider, len, buf);
26 | CryptReleaseContext(provider, 0);
27 | if (result)
28 | return len;
29 | }
30 |
31 | QueryPerformanceCounter((LARGE_INTEGER *)pentium_tsc);
32 |
33 | for(i = 0; i < 8 && i < len; ++i)
34 | buf[i] = ((unsigned char*)pentium_tsc)[i];
35 |
36 | return i;
37 | }
38 | #else
39 | int entropy_fun(unsigned char buf[], unsigned int len)
40 | {
41 | int frand = open("/dev/random", O_RDONLY);
42 | int rlen = 0;
43 | if (frand != -1)
44 | {
45 | rlen = (int)read(frand, buf, len);
46 | close(frand);
47 | }
48 | return rlen;
49 | }
50 | #endif
51 |
52 | #if defined(__cplusplus)
53 | }
54 | #endif
55 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/entropy.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _ENTROPY_FUN_H
3 | #define _ENTROPY_FUN_H
4 |
5 | #if defined(__cplusplus)
6 | extern "C"
7 | {
8 | #endif
9 |
10 | int entropy_fun(unsigned char buf[], unsigned int len);
11 |
12 | #if defined(__cplusplus)
13 | }
14 | #endif
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/fileenc.c:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK.
4 | All rights reserved.
5 |
6 | LICENSE TERMS
7 |
8 | The free distribution and use of this software in both source and binary
9 | form is allowed (with or without changes) provided that:
10 |
11 | 1. distributions of this source code include the above copyright
12 | notice, this list of conditions and the following disclaimer;
13 |
14 | 2. distributions in binary form include the above copyright
15 | notice, this list of conditions and the following disclaimer
16 | in the documentation and/or other associated materials;
17 |
18 | 3. the copyright holder's name is not used to endorse products
19 | built using this software without specific written permission.
20 |
21 | ALTERNATIVELY, provided that this notice is retained in full, this product
22 | may be distributed under the terms of the GNU General Public License (GPL),
23 | in which case the provisions of the GPL apply INSTEAD OF those given above.
24 |
25 | DISCLAIMER
26 |
27 | This software is provided 'as is' with no explicit or implied warranties
28 | in respect of its properties, including, but not limited to, correctness
29 | and/or fitness for purpose.
30 | -------------------------------------------------------------------------
31 | Issue Date: 24/01/2003
32 |
33 | This file implements password based file encryption and authentication
34 | using AES in CTR mode, HMAC-SHA1 authentication and RFC2898 password
35 | based key derivation.
36 |
37 | */
38 |
39 | #include
40 |
41 | #include "fileenc.h"
42 |
43 | #if defined(__cplusplus)
44 | extern "C"
45 | {
46 | #endif
47 |
48 | /* subroutine for data encryption/decryption */
49 | /* this could be speeded up a lot by aligning */
50 | /* buffers and using 32 bit operations */
51 |
52 | static void encr_data(unsigned char data[], unsigned long d_len, fcrypt_ctx cx[1])
53 | {
54 | unsigned long i = 0, pos = cx->encr_pos;
55 |
56 | while (i < d_len) {
57 | if (pos == AES_BLOCK_SIZE) {
58 | unsigned int j = 0;
59 | /* increment encryption nonce */
60 | while (j < 8 && !++cx->nonce[j])
61 | ++j;
62 | /* encrypt the nonce to form next xor buffer */
63 | aes_encrypt(cx->nonce, cx->encr_bfr, cx->encr_ctx);
64 | pos = 0;
65 | }
66 |
67 | data[i++] ^= cx->encr_bfr[pos++];
68 | }
69 |
70 | cx->encr_pos = (unsigned int)pos;
71 | }
72 |
73 | int fcrypt_init(
74 | int mode, /* the mode to be used (input) */
75 | const unsigned char pwd[], /* the user specified password (input) */
76 | unsigned int pwd_len, /* the length of the password (input) */
77 | const unsigned char salt[], /* the salt (input) */
78 | #ifdef PASSWORD_VERIFIER
79 | unsigned char pwd_ver[PWD_VER_LENGTH], /* 2 byte password verifier (output) */
80 | #endif
81 | fcrypt_ctx cx[1]) /* the file encryption context (output) */
82 | {
83 | unsigned char kbuf[2 * MAX_KEY_LENGTH + PWD_VER_LENGTH];
84 |
85 | if (pwd_len > MAX_PWD_LENGTH)
86 | return PASSWORD_TOO_LONG;
87 |
88 | if (mode < 1 || mode > 3)
89 | return BAD_MODE;
90 |
91 | cx->mode = mode;
92 | cx->pwd_len = pwd_len;
93 |
94 | /* derive the encryption and authentication keys and the password verifier */
95 | derive_key(pwd, pwd_len, salt, SALT_LENGTH(mode), KEYING_ITERATIONS,
96 | kbuf, 2 * KEY_LENGTH(mode) + PWD_VER_LENGTH);
97 |
98 | /* initialise the encryption nonce and buffer pos */
99 | cx->encr_pos = AES_BLOCK_SIZE;
100 | /* if we need a random component in the encryption */
101 | /* nonce, this is where it would have to be set */
102 | memset(cx->nonce, 0, AES_BLOCK_SIZE * sizeof(unsigned char));
103 |
104 | /* initialise for encryption using key 1 */
105 | aes_encrypt_key(kbuf, KEY_LENGTH(mode), cx->encr_ctx);
106 |
107 | /* initialise for authentication using key 2 */
108 | hmac_sha_begin(cx->auth_ctx);
109 | hmac_sha_key(kbuf + KEY_LENGTH(mode), KEY_LENGTH(mode), cx->auth_ctx);
110 |
111 | #ifdef PASSWORD_VERIFIER
112 | memcpy(pwd_ver, kbuf + 2 * KEY_LENGTH(mode), PWD_VER_LENGTH);
113 | #endif
114 |
115 | return GOOD_RETURN;
116 | }
117 |
118 | /* perform 'in place' encryption and authentication */
119 |
120 | void fcrypt_encrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1])
121 | {
122 | encr_data(data, data_len, cx);
123 | hmac_sha_data(data, data_len, cx->auth_ctx);
124 | }
125 |
126 | /* perform 'in place' authentication and decryption */
127 |
128 | void fcrypt_decrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1])
129 | {
130 | hmac_sha_data(data, data_len, cx->auth_ctx);
131 | encr_data(data, data_len, cx);
132 | }
133 |
134 | /* close encryption/decryption and return the MAC value */
135 |
136 | int fcrypt_end(unsigned char mac[], fcrypt_ctx cx[1])
137 | {
138 | hmac_sha_end(mac, MAC_LENGTH(cx->mode), cx->auth_ctx);
139 | return MAC_LENGTH(cx->mode); /* return MAC length in bytes */
140 | }
141 |
142 | #if defined(__cplusplus)
143 | }
144 | #endif
145 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/fileenc.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK.
4 | All rights reserved.
5 |
6 | LICENSE TERMS
7 |
8 | The free distribution and use of this software in both source and binary
9 | form is allowed (with or without changes) provided that:
10 |
11 | 1. distributions of this source code include the above copyright
12 | notice, this list of conditions and the following disclaimer;
13 |
14 | 2. distributions in binary form include the above copyright
15 | notice, this list of conditions and the following disclaimer
16 | in the documentation and/or other associated materials;
17 |
18 | 3. the copyright holder's name is not used to endorse products
19 | built using this software without specific written permission.
20 |
21 | ALTERNATIVELY, provided that this notice is retained in full, this product
22 | may be distributed under the terms of the GNU General Public License (GPL),
23 | in which case the provisions of the GPL apply INSTEAD OF those given above.
24 |
25 | DISCLAIMER
26 |
27 | This software is provided 'as is' with no explicit or implied warranties
28 | in respect of its properties, including, but not limited to, correctness
29 | and/or fitness for purpose.
30 | ---------------------------------------------------------------------------
31 | Issue Date: 24/01/2003
32 |
33 | This file contains the header file for fileenc.c, which implements password
34 | based file encryption and authentication using AES in CTR mode, HMAC-SHA1
35 | authentication and RFC2898 password based key derivation.
36 | */
37 |
38 | #ifndef _FENC_H
39 | #define _FENC_H
40 |
41 | #include "aes.h"
42 | #include "hmac.h"
43 | #include "pwd2key.h"
44 |
45 | #define PASSWORD_VERIFIER
46 |
47 | #define MAX_KEY_LENGTH 32
48 | #define MAX_PWD_LENGTH 128
49 | #define MAX_SALT_LENGTH 16
50 | #define KEYING_ITERATIONS 1000
51 |
52 | #ifdef PASSWORD_VERIFIER
53 | #define PWD_VER_LENGTH 2
54 | #else
55 | #define PWD_VER_LENGTH 0
56 | #endif
57 |
58 | #define GOOD_RETURN 0
59 | #define PASSWORD_TOO_LONG -100
60 | #define BAD_MODE -101
61 |
62 | /*
63 | Field lengths (in bytes) versus File Encryption Mode (0 < mode < 4)
64 |
65 | Mode Key Salt MAC Overhead
66 | 1 16 8 10 18
67 | 2 24 12 10 22
68 | 3 32 16 10 26
69 |
70 | The following macros assume that the mode value is correct.
71 | */
72 |
73 | #define KEY_LENGTH(mode) (8 * (mode & 3) + 8)
74 | #define SALT_LENGTH(mode) (4 * (mode & 3) + 4)
75 | #define MAC_LENGTH(mode) (10)
76 |
77 | /* the context for file encryption */
78 |
79 | #if defined(__cplusplus)
80 | extern "C"
81 | {
82 | #endif
83 |
84 | typedef struct
85 | { unsigned char nonce[AES_BLOCK_SIZE]; /* the CTR nonce */
86 | unsigned char encr_bfr[AES_BLOCK_SIZE]; /* encrypt buffer */
87 | aes_encrypt_ctx encr_ctx[1]; /* encryption context */
88 | hmac_ctx auth_ctx[1]; /* authentication context */
89 | unsigned int encr_pos; /* block position (enc) */
90 | unsigned int pwd_len; /* password length */
91 | unsigned int mode; /* File encryption mode */
92 | } fcrypt_ctx;
93 |
94 | /* initialise file encryption or decryption */
95 |
96 | int fcrypt_init(
97 | int mode, /* the mode to be used (input) */
98 | const unsigned char pwd[], /* the user specified password (input) */
99 | unsigned int pwd_len, /* the length of the password (input) */
100 | const unsigned char salt[], /* the salt (input) */
101 | #ifdef PASSWORD_VERIFIER
102 | unsigned char pwd_ver[PWD_VER_LENGTH], /* 2 byte password verifier (output) */
103 | #endif
104 | fcrypt_ctx cx[1]); /* the file encryption context (output) */
105 |
106 | /* perform 'in place' encryption or decryption and authentication */
107 |
108 | void fcrypt_encrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1]);
109 | void fcrypt_decrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1]);
110 |
111 | /* close encryption/decryption and return the MAC value */
112 | /* the return value is the length of the MAC */
113 |
114 | int fcrypt_end(unsigned char mac[], /* the MAC value (output) */
115 | fcrypt_ctx cx[1]); /* the context (input) */
116 |
117 | #if defined(__cplusplus)
118 | }
119 | #endif
120 |
121 | #endif
122 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/hmac.c:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | LICENSE TERMS
6 |
7 | The free distribution and use of this software in both source and binary
8 | form is allowed (with or without changes) provided that:
9 |
10 | 1. distributions of this source code include the above copyright
11 | notice, this list of conditions and the following disclaimer;
12 |
13 | 2. distributions in binary form include the above copyright
14 | notice, this list of conditions and the following disclaimer
15 | in the documentation and/or other associated materials;
16 |
17 | 3. the copyright holder's name is not used to endorse products
18 | built using this software without specific written permission.
19 |
20 | ALTERNATIVELY, provided that this notice is retained in full, this product
21 | may be distributed under the terms of the GNU General Public License (GPL),
22 | in which case the provisions of the GPL apply INSTEAD OF those given above.
23 |
24 | DISCLAIMER
25 |
26 | This software is provided 'as is' with no explicit or implied warranties
27 | in respect of its properties, including, but not limited to, correctness
28 | and/or fitness for purpose.
29 | ---------------------------------------------------------------------------
30 | Issue Date: 26/08/2003
31 |
32 | This is an implementation of HMAC, the FIPS standard keyed hash function
33 | */
34 |
35 | #include "hmac.h"
36 | #include "brg_types.h"
37 |
38 | #if defined(__cplusplus)
39 | extern "C"
40 | {
41 | #endif
42 |
43 | /* initialise the HMAC context to zero */
44 | void hmac_sha_begin(hmac_ctx cx[1])
45 | {
46 | memset(cx, 0, sizeof(hmac_ctx));
47 | }
48 |
49 | /* input the HMAC key (can be called multiple times) */
50 | int hmac_sha_key(const unsigned char key[], unsigned long key_len, hmac_ctx cx[1])
51 | {
52 | if(cx->klen == HMAC_IN_DATA) /* error if further key input */
53 | return HMAC_BAD_MODE; /* is attempted in data mode */
54 |
55 | if(cx->klen + key_len > HASH_INPUT_SIZE) /* if the key has to be hashed */
56 | {
57 | if(cx->klen <= HASH_INPUT_SIZE) /* if the hash has not yet been */
58 | { /* started, initialise it and */
59 | sha_begin(cx->ctx); /* hash stored key characters */
60 | sha_hash(cx->key, cx->klen, cx->ctx);
61 | }
62 |
63 | sha_hash(key, key_len, cx->ctx); /* hash long key data into hash */
64 | }
65 | else /* otherwise store key data */
66 | memcpy(cx->key + cx->klen, key, key_len);
67 |
68 | cx->klen += key_len; /* update the key length count */
69 | return HMAC_OK;
70 | }
71 |
72 | /* input the HMAC data (can be called multiple times) - */
73 | /* note that this call terminates the key input phase */
74 | void hmac_sha_data(const unsigned char data[], unsigned long data_len, hmac_ctx cx[1])
75 | { unsigned int i;
76 |
77 | if(cx->klen != HMAC_IN_DATA) /* if not yet in data phase */
78 | {
79 | if(cx->klen > HASH_INPUT_SIZE) /* if key is being hashed */
80 | { /* complete the hash and */
81 | sha_end(cx->key, cx->ctx); /* store the result as the */
82 | cx->klen = HASH_OUTPUT_SIZE; /* key and set new length */
83 | }
84 |
85 | /* pad the key if necessary */
86 | memset(cx->key + cx->klen, 0, HASH_INPUT_SIZE - cx->klen);
87 |
88 | /* xor ipad into key value */
89 | for(i = 0; i < (HASH_INPUT_SIZE >> 2); ++i)
90 | ((uint_32t*)cx->key)[i] ^= 0x36363636;
91 |
92 | /* and start hash operation */
93 | sha_begin(cx->ctx);
94 | sha_hash(cx->key, HASH_INPUT_SIZE, cx->ctx);
95 |
96 | /* mark as now in data mode */
97 | cx->klen = HMAC_IN_DATA;
98 | }
99 |
100 | /* hash the data (if any) */
101 | if(data_len)
102 | sha_hash(data, data_len, cx->ctx);
103 | }
104 |
105 | /* compute and output the MAC value */
106 | void hmac_sha_end(unsigned char mac[], unsigned long mac_len, hmac_ctx cx[1])
107 | { unsigned char dig[HASH_OUTPUT_SIZE];
108 | unsigned int i;
109 |
110 | /* if no data has been entered perform a null data phase */
111 | if(cx->klen != HMAC_IN_DATA)
112 | hmac_sha_data((const unsigned char*)0, 0, cx);
113 |
114 | sha_end(dig, cx->ctx); /* complete the inner hash */
115 |
116 | /* set outer key value using opad and removing ipad */
117 | for(i = 0; i < (HASH_INPUT_SIZE >> 2); ++i)
118 | ((uint_32t*)cx->key)[i] ^= 0x36363636 ^ 0x5c5c5c5c;
119 |
120 | /* perform the outer hash operation */
121 | sha_begin(cx->ctx);
122 | sha_hash(cx->key, HASH_INPUT_SIZE, cx->ctx);
123 | sha_hash(dig, HASH_OUTPUT_SIZE, cx->ctx);
124 | sha_end(dig, cx->ctx);
125 |
126 | /* output the hash value */
127 | for(i = 0; i < mac_len; ++i)
128 | mac[i] = dig[i];
129 | }
130 |
131 | /* 'do it all in one go' subroutine */
132 | void hmac_sha(const unsigned char key[], unsigned long key_len,
133 | const unsigned char data[], unsigned long data_len,
134 | unsigned char mac[], unsigned long mac_len)
135 | { hmac_ctx cx[1];
136 |
137 | hmac_sha_begin(cx);
138 | hmac_sha_key(key, key_len, cx);
139 | hmac_sha_data(data, data_len, cx);
140 | hmac_sha_end(mac, mac_len, cx);
141 | }
142 |
143 | #if defined(__cplusplus)
144 | }
145 | #endif
146 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/hmac.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | LICENSE TERMS
6 |
7 | The free distribution and use of this software in both source and binary
8 | form is allowed (with or without changes) provided that:
9 |
10 | 1. distributions of this source code include the above copyright
11 | notice, this list of conditions and the following disclaimer;
12 |
13 | 2. distributions in binary form include the above copyright
14 | notice, this list of conditions and the following disclaimer
15 | in the documentation and/or other associated materials;
16 |
17 | 3. the copyright holder's name is not used to endorse products
18 | built using this software without specific written permission.
19 |
20 | ALTERNATIVELY, provided that this notice is retained in full, this product
21 | may be distributed under the terms of the GNU General Public License (GPL),
22 | in which case the provisions of the GPL apply INSTEAD OF those given above.
23 |
24 | DISCLAIMER
25 |
26 | This software is provided 'as is' with no explicit or implied warranties
27 | in respect of its properties, including, but not limited to, correctness
28 | and/or fitness for purpose.
29 | ---------------------------------------------------------------------------
30 | Issue Date: 26/08/2003
31 |
32 | This is an implementation of HMAC, the FIPS standard keyed hash function
33 | */
34 |
35 | #ifndef _HMAC_H
36 | #define _HMAC_H
37 |
38 | #include
39 |
40 | #if defined(__cplusplus)
41 | extern "C"
42 | {
43 | #endif
44 |
45 | #define USE_SHA1
46 |
47 | #if !defined(USE_SHA1) && !defined(USE_SHA256)
48 | #error define USE_SHA1 or USE_SHA256 to set the HMAC hash algorithm
49 | #endif
50 |
51 | #ifdef USE_SHA1
52 |
53 | #include "sha1.h"
54 |
55 | #define HASH_INPUT_SIZE SHA1_BLOCK_SIZE
56 | #define HASH_OUTPUT_SIZE SHA1_DIGEST_SIZE
57 | #define sha_ctx sha1_ctx
58 | #define sha_begin sha1_begin
59 | #define sha_hash sha1_hash
60 | #define sha_end sha1_end
61 |
62 | #endif
63 |
64 | #ifdef USE_SHA256
65 |
66 | #include "sha2.h"
67 |
68 | #define HASH_INPUT_SIZE SHA256_BLOCK_SIZE
69 | #define HASH_OUTPUT_SIZE SHA256_DIGEST_SIZE
70 | #define sha_ctx sha256_ctx
71 | #define sha_begin sha256_begin
72 | #define sha_hash sha256_hash
73 | #define sha_end sha256_end
74 |
75 | #endif
76 |
77 | #define HMAC_OK 0
78 | #define HMAC_BAD_MODE -1
79 | #define HMAC_IN_DATA 0xffffffff
80 |
81 | typedef struct
82 | { unsigned char key[HASH_INPUT_SIZE];
83 | sha_ctx ctx[1];
84 | unsigned long klen;
85 | } hmac_ctx;
86 |
87 | void hmac_sha_begin(hmac_ctx cx[1]);
88 |
89 | int hmac_sha_key(const unsigned char key[], unsigned long key_len, hmac_ctx cx[1]);
90 |
91 | void hmac_sha_data(const unsigned char data[], unsigned long data_len, hmac_ctx cx[1]);
92 |
93 | void hmac_sha_end(unsigned char mac[], unsigned long mac_len, hmac_ctx cx[1]);
94 |
95 | void hmac_sha(const unsigned char key[], unsigned long key_len,
96 | const unsigned char data[], unsigned long data_len,
97 | unsigned char mac[], unsigned long mac_len);
98 |
99 | #if defined(__cplusplus)
100 | }
101 | #endif
102 |
103 | #endif
104 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/prng.c:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK.
4 | All rights reserved.
5 |
6 | LICENSE TERMS
7 |
8 | The free distribution and use of this software in both source and binary
9 | form is allowed (with or without changes) provided that:
10 |
11 | 1. distributions of this source code include the above copyright
12 | notice, this list of conditions and the following disclaimer;
13 |
14 | 2. distributions in binary form include the above copyright
15 | notice, this list of conditions and the following disclaimer
16 | in the documentation and/or other associated materials;
17 |
18 | 3. the copyright holder's name is not used to endorse products
19 | built using this software without specific written permission.
20 |
21 | ALTERNATIVELY, provided that this notice is retained in full, this product
22 | may be distributed under the terms of the GNU General Public License (GPL),
23 | in which case the provisions of the GPL apply INSTEAD OF those given above.
24 |
25 | DISCLAIMER
26 |
27 | This software is provided 'as is' with no explicit or implied warranties
28 | in respect of its properties, including, but not limited to, correctness
29 | and/or fitness for purpose.
30 | ---------------------------------------------------------------------------
31 | Issue Date: 24/01/2003
32 |
33 | This file implements a random data pool based on the use of an external
34 | entropy function. It is based on the ideas advocated by Peter Gutmann in
35 | his work on pseudo random sequence generators. It is not a 'paranoid'
36 | random sequence generator and no attempt is made to protect the pool
37 | from prying eyes either by memory locking or by techniques to obscure
38 | its location in memory.
39 | */
40 |
41 | #include
42 | #include "prng.h"
43 |
44 | #if defined(__cplusplus)
45 | extern "C"
46 | {
47 | #endif
48 |
49 | /* mix a random data pool using the SHA1 compression function (as */
50 | /* suggested by Peter Gutmann in his paper on random pools) */
51 |
52 | static void prng_mix(unsigned char buf[])
53 | { unsigned int i, len;
54 | sha1_ctx ctx[1];
55 |
56 | /*lint -e{663} unusual array to pointer conversion */
57 | for(i = 0; i < PRNG_POOL_SIZE; i += SHA1_DIGEST_SIZE)
58 | {
59 | /* copy digest size pool block into SHA1 hash block */
60 | memcpy(ctx->hash, buf + (i ? i : PRNG_POOL_SIZE)
61 | - SHA1_DIGEST_SIZE, SHA1_DIGEST_SIZE);
62 |
63 | /* copy data from pool into the SHA1 data buffer */
64 | len = PRNG_POOL_SIZE - i;
65 | memcpy(ctx->wbuf, buf + i, (len > SHA1_BLOCK_SIZE ? SHA1_BLOCK_SIZE : len));
66 |
67 | if(len < SHA1_BLOCK_SIZE)
68 | memcpy(((char*)ctx->wbuf) + len, buf, SHA1_BLOCK_SIZE - len);
69 |
70 | /* compress using the SHA1 compression function */
71 | sha1_compile(ctx);
72 |
73 | /* put digest size block back into the random pool */
74 | memcpy(buf + i, ctx->hash, SHA1_DIGEST_SIZE);
75 | }
76 | }
77 |
78 | /* refresh the output buffer and update the random pool by adding */
79 | /* entropy and remixing */
80 |
81 | static void update_pool(prng_ctx ctx[1])
82 | { unsigned int i = 0;
83 |
84 | /* transfer random pool data to the output buffer */
85 | memcpy(ctx->obuf, ctx->rbuf, PRNG_POOL_SIZE);
86 |
87 | /* enter entropy data into the pool */
88 | while(i < PRNG_POOL_SIZE)
89 | i += ctx->entropy(ctx->rbuf + i, PRNG_POOL_SIZE - i);
90 |
91 | /* invert and xor the original pool data into the pool */
92 | for(i = 0; i < PRNG_POOL_SIZE; ++i)
93 | ctx->rbuf[i] ^= ~ctx->obuf[i];
94 |
95 | /* mix the pool and the output buffer */
96 | prng_mix(ctx->rbuf);
97 | prng_mix(ctx->obuf);
98 | }
99 |
100 | void prng_init(prng_entropy_fn fun, prng_ctx ctx[1])
101 | { int i;
102 |
103 | /* clear the buffers and the counter in the context */
104 | memset(ctx, 0, sizeof(prng_ctx));
105 |
106 | /* set the pointer to the entropy collection function */
107 | ctx->entropy = fun;
108 |
109 | /* initialise the random data pool */
110 | update_pool(ctx);
111 |
112 | /* mix the pool a minimum number of times */
113 | for(i = 0; i < PRNG_MIN_MIX; ++i)
114 | prng_mix(ctx->rbuf);
115 |
116 | /* update the pool to prime the pool output buffer */
117 | update_pool(ctx);
118 | }
119 |
120 | /* provide random bytes from the random data pool */
121 |
122 | void prng_rand(unsigned char data[], unsigned int data_len, prng_ctx ctx[1])
123 | { unsigned char *rp = data;
124 | unsigned int len, pos = ctx->pos;
125 |
126 | while(data_len)
127 | {
128 | /* transfer 'data_len' bytes (or the number of bytes remaining */
129 | /* the pool output buffer if less) into the output */
130 | len = (data_len < PRNG_POOL_SIZE - pos ? data_len : PRNG_POOL_SIZE - pos);
131 | memcpy(rp, ctx->obuf + pos, len);
132 | rp += len; /* update ouput buffer position pointer */
133 | pos += len; /* update pool output buffer pointer */
134 | data_len -= len; /* update the remaining data count */
135 |
136 | /* refresh the random pool if necessary */
137 | if(pos == PRNG_POOL_SIZE)
138 | {
139 | update_pool(ctx); pos = 0;
140 | }
141 | }
142 |
143 | ctx->pos = pos;
144 | }
145 |
146 | void prng_end(prng_ctx ctx[1])
147 | {
148 | /* ensure the data in the context is destroyed */
149 | memset(ctx, 0, sizeof(prng_ctx));
150 | }
151 |
152 | #if defined(__cplusplus)
153 | }
154 | #endif
155 |
156 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/prng.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK.
4 | All rights reserved.
5 |
6 | LICENSE TERMS
7 |
8 | The free distribution and use of this software in both source and binary
9 | form is allowed (with or without changes) provided that:
10 |
11 | 1. distributions of this source code include the above copyright
12 | notice, this list of conditions and the following disclaimer;
13 |
14 | 2. distributions in binary form include the above copyright
15 | notice, this list of conditions and the following disclaimer
16 | in the documentation and/or other associated materials;
17 |
18 | 3. the copyright holder's name is not used to endorse products
19 | built using this software without specific written permission.
20 |
21 | ALTERNATIVELY, provided that this notice is retained in full, this product
22 | may be distributed under the terms of the GNU General Public License (GPL),
23 | in which case the provisions of the GPL apply INSTEAD OF those given above.
24 |
25 | DISCLAIMER
26 |
27 | This software is provided 'as is' with no explicit or implied warranties
28 | in respect of its properties, including, but not limited to, correctness
29 | and/or fitness for purpose.
30 | ---------------------------------------------------------------------------
31 | Issue Date: 24/01/2003
32 |
33 | This is the header file for an implementation of a random data pool based on
34 | the use of an external entropy function (inspired by Peter Gutmann's work).
35 | */
36 |
37 | #ifndef _PRNG_H
38 | #define _PRNG_H
39 |
40 | #include "sha1.h"
41 |
42 | #define PRNG_POOL_LEN 256 /* minimum random pool size */
43 | #define PRNG_MIN_MIX 20 /* min initial pool mixing iterations */
44 |
45 | /* ensure that pool length is a multiple of the SHA1 digest size */
46 |
47 | #define PRNG_POOL_SIZE (SHA1_DIGEST_SIZE * (1 + (PRNG_POOL_LEN - 1) / SHA1_DIGEST_SIZE))
48 |
49 | #if defined(__cplusplus)
50 | extern "C"
51 | {
52 | #endif
53 |
54 | /* A function for providing entropy is a parameter in the prng_init() */
55 | /* call. This function has the following form and returns a maximum */
56 | /* of 'len' bytes of pseudo random data in the buffer 'buf'. It can */
57 | /* return less than 'len' bytes but will be repeatedly called for more */
58 | /* data in this case. */
59 |
60 | typedef int (*prng_entropy_fn)(unsigned char buf[], unsigned int len);
61 |
62 | typedef struct
63 | { unsigned char rbuf[PRNG_POOL_SIZE]; /* the random pool */
64 | unsigned char obuf[PRNG_POOL_SIZE]; /* pool output buffer */
65 | unsigned int pos; /* output buffer position */
66 | prng_entropy_fn entropy; /* entropy function pointer */
67 | } prng_ctx;
68 |
69 | /* initialise the random stream generator */
70 | void prng_init(prng_entropy_fn fun, prng_ctx ctx[1]);
71 |
72 | /* obtain random bytes from the generator */
73 | void prng_rand(unsigned char data[], unsigned int data_len, prng_ctx ctx[1]);
74 |
75 | /* close the random stream generator */
76 | void prng_end(prng_ctx ctx[1]);
77 |
78 | #if defined(__cplusplus)
79 | }
80 | #endif
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/pwd2key.c:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | LICENSE TERMS
6 |
7 | The free distribution and use of this software in both source and binary
8 | form is allowed (with or without changes) provided that:
9 |
10 | 1. distributions of this source code include the above copyright
11 | notice, this list of conditions and the following disclaimer;
12 |
13 | 2. distributions in binary form include the above copyright
14 | notice, this list of conditions and the following disclaimer
15 | in the documentation and/or other associated materials;
16 |
17 | 3. the copyright holder's name is not used to endorse products
18 | built using this software without specific written permission.
19 |
20 | ALTERNATIVELY, provided that this notice is retained in full, this product
21 | may be distributed under the terms of the GNU General Public License (GPL),
22 | in which case the provisions of the GPL apply INSTEAD OF those given above.
23 |
24 | DISCLAIMER
25 |
26 | This software is provided 'as is' with no explicit or implied warranties
27 | in respect of its properties, including, but not limited to, correctness
28 | and/or fitness for purpose.
29 | ---------------------------------------------------------------------------
30 | Issue Date: 26/08/2003
31 |
32 | This is an implementation of RFC2898, which specifies key derivation from
33 | a password and a salt value.
34 | */
35 |
36 | #include
37 | #include "hmac.h"
38 |
39 | #if defined(__cplusplus)
40 | extern "C"
41 | {
42 | #endif
43 |
44 | void derive_key(const unsigned char pwd[], /* the PASSWORD */
45 | unsigned int pwd_len, /* and its length */
46 | const unsigned char salt[], /* the SALT and its */
47 | unsigned int salt_len, /* length */
48 | unsigned int iter, /* the number of iterations */
49 | unsigned char key[], /* space for the output key */
50 | unsigned int key_len)/* and its required length */
51 | {
52 | unsigned int i, j, k, n_blk;
53 | unsigned char uu[HASH_OUTPUT_SIZE], ux[HASH_OUTPUT_SIZE];
54 | hmac_ctx c1[1], c2[1], c3[1];
55 |
56 | /* set HMAC context (c1) for password */
57 | hmac_sha_begin(c1);
58 | hmac_sha_key(pwd, pwd_len, c1);
59 |
60 | /* set HMAC context (c2) for password and salt */
61 | memcpy(c2, c1, sizeof(hmac_ctx));
62 | hmac_sha_data(salt, salt_len, c2);
63 |
64 | /* find the number of SHA blocks in the key */
65 | n_blk = 1 + (key_len - 1) / HASH_OUTPUT_SIZE;
66 |
67 | for(i = 0; i < n_blk; ++i) /* for each block in key */
68 | {
69 | /* ux[] holds the running xor value */
70 | memset(ux, 0, HASH_OUTPUT_SIZE);
71 |
72 | /* set HMAC context (c3) for password and salt */
73 | memcpy(c3, c2, sizeof(hmac_ctx));
74 |
75 | /* enter additional data for 1st block into uu */
76 | uu[0] = (unsigned char)((i + 1) >> 24);
77 | uu[1] = (unsigned char)((i + 1) >> 16);
78 | uu[2] = (unsigned char)((i + 1) >> 8);
79 | uu[3] = (unsigned char)(i + 1);
80 |
81 | /* this is the key mixing iteration */
82 | for(j = 0, k = 4; j < iter; ++j)
83 | {
84 | /* add previous round data to HMAC */
85 | hmac_sha_data(uu, k, c3);
86 |
87 | /* obtain HMAC for uu[] */
88 | hmac_sha_end(uu, HASH_OUTPUT_SIZE, c3);
89 |
90 | /* xor into the running xor block */
91 | for(k = 0; k < HASH_OUTPUT_SIZE; ++k)
92 | ux[k] ^= uu[k];
93 |
94 | /* set HMAC context (c3) for password */
95 | memcpy(c3, c1, sizeof(hmac_ctx));
96 | }
97 |
98 | /* compile key blocks into the key output */
99 | j = 0; k = i * HASH_OUTPUT_SIZE;
100 | while(j < HASH_OUTPUT_SIZE && k < key_len)
101 | key[k++] = ux[j++];
102 | }
103 | }
104 |
105 | #ifdef TEST
106 |
107 | #include
108 |
109 | struct
110 | { unsigned int pwd_len;
111 | unsigned int salt_len;
112 | unsigned int it_count;
113 | unsigned char *pwd;
114 | unsigned char salt[32];
115 | unsigned char key[32];
116 | } tests[] =
117 | {
118 | { 8, 4, 5, (unsigned char*)"password",
119 | {
120 | 0x12, 0x34, 0x56, 0x78
121 | },
122 | {
123 | 0x5c, 0x75, 0xce, 0xf0, 0x1a, 0x96, 0x0d, 0xf7,
124 | 0x4c, 0xb6, 0xb4, 0x9b, 0x9e, 0x38, 0xe6, 0xb5
125 | }
126 | },
127 | { 8, 8, 5, (unsigned char*)"password",
128 | {
129 | 0x12, 0x34, 0x56, 0x78, 0x78, 0x56, 0x34, 0x12
130 | },
131 | {
132 | 0xd1, 0xda, 0xa7, 0x86, 0x15, 0xf2, 0x87, 0xe6,
133 | 0xa1, 0xc8, 0xb1, 0x20, 0xd7, 0x06, 0x2a, 0x49
134 | }
135 | },
136 | { 8, 21, 1, (unsigned char*)"password",
137 | {
138 | "ATHENA.MIT.EDUraeburn"
139 | },
140 | {
141 | 0xcd, 0xed, 0xb5, 0x28, 0x1b, 0xb2, 0xf8, 0x01,
142 | 0x56, 0x5a, 0x11, 0x22, 0xb2, 0x56, 0x35, 0x15
143 | }
144 | },
145 | { 8, 21, 2, (unsigned char*)"password",
146 | {
147 | "ATHENA.MIT.EDUraeburn"
148 | },
149 | {
150 | 0x01, 0xdb, 0xee, 0x7f, 0x4a, 0x9e, 0x24, 0x3e,
151 | 0x98, 0x8b, 0x62, 0xc7, 0x3c, 0xda, 0x93, 0x5d
152 | }
153 | },
154 | { 8, 21, 1200, (unsigned char*)"password",
155 | {
156 | "ATHENA.MIT.EDUraeburn"
157 | },
158 | {
159 | 0x5c, 0x08, 0xeb, 0x61, 0xfd, 0xf7, 0x1e, 0x4e,
160 | 0x4e, 0xc3, 0xcf, 0x6b, 0xa1, 0xf5, 0x51, 0x2b
161 | }
162 | }
163 | };
164 |
165 | int main()
166 | { unsigned int i, j, key_len = 256;
167 | unsigned char key[256];
168 |
169 | printf("\nTest of RFC2898 Password Based Key Derivation");
170 | for(i = 0; i < 5; ++i)
171 | {
172 | derive_key(tests[i].pwd, tests[i].pwd_len, tests[i].salt,
173 | tests[i].salt_len, tests[i].it_count, key, key_len);
174 |
175 | printf("\ntest %i: ", i + 1);
176 | printf("key %s", memcmp(tests[i].key, key, 16) ? "is bad" : "is good");
177 | for(j = 0; j < key_len && j < 64; j += 4)
178 | {
179 | if(j % 16 == 0)
180 | printf("\n");
181 | printf("0x%02x%02x%02x%02x ", key[j], key[j + 1], key[j + 2], key[j + 3]);
182 | }
183 | printf(j < key_len ? " ... \n" : "\n");
184 | }
185 | printf("\n");
186 | return 0;
187 | }
188 |
189 | #if defined(__cplusplus)
190 | }
191 | #endif
192 |
193 | #endif
194 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/pwd2key.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | LICENSE TERMS
6 |
7 | The free distribution and use of this software in both source and binary
8 | form is allowed (with or without changes) provided that:
9 |
10 | 1. distributions of this source code include the above copyright
11 | notice, this list of conditions and the following disclaimer;
12 |
13 | 2. distributions in binary form include the above copyright
14 | notice, this list of conditions and the following disclaimer
15 | in the documentation and/or other associated materials;
16 |
17 | 3. the copyright holder's name is not used to endorse products
18 | built using this software without specific written permission.
19 |
20 | ALTERNATIVELY, provided that this notice is retained in full, this product
21 | may be distributed under the terms of the GNU General Public License (GPL),
22 | in which case the provisions of the GPL apply INSTEAD OF those given above.
23 |
24 | DISCLAIMER
25 |
26 | This software is provided 'as is' with no explicit or implied warranties
27 | in respect of its properties, including, but not limited to, correctness
28 | and/or fitness for purpose.
29 | ---------------------------------------------------------------------------
30 | Issue Date: 26/08/2003
31 |
32 | This is an implementation of RFC2898, which specifies key derivation from
33 | a password and a salt value.
34 | */
35 |
36 | #ifndef PWD2KEY_H
37 | #define PWD2KEY_H
38 |
39 | #if defined(__cplusplus)
40 | extern "C"
41 | {
42 | #endif
43 |
44 | void derive_key(
45 | const unsigned char pwd[], /* the PASSWORD, and */
46 | unsigned int pwd_len, /* its length */
47 | const unsigned char salt[], /* the SALT and its */
48 | unsigned int salt_len, /* length */
49 | unsigned int iter, /* the number of iterations */
50 | unsigned char key[], /* space for the output key */
51 | unsigned int key_len); /* and its required length */
52 |
53 | #if defined(__cplusplus)
54 | }
55 | #endif
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/aes/sha1.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved.
4 |
5 | LICENSE TERMS
6 |
7 | The free distribution and use of this software in both source and binary
8 | form is allowed (with or without changes) provided that:
9 |
10 | 1. distributions of this source code include the above copyright
11 | notice, this list of conditions and the following disclaimer;
12 |
13 | 2. distributions in binary form include the above copyright
14 | notice, this list of conditions and the following disclaimer
15 | in the documentation and/or other associated materials;
16 |
17 | 3. the copyright holder's name is not used to endorse products
18 | built using this software without specific written permission.
19 |
20 | ALTERNATIVELY, provided that this notice is retained in full, this product
21 | may be distributed under the terms of the GNU General Public License (GPL),
22 | in which case the provisions of the GPL apply INSTEAD OF those given above.
23 |
24 | DISCLAIMER
25 |
26 | This software is provided 'as is' with no explicit or implied warranties
27 | in respect of its properties, including, but not limited to, correctness
28 | and/or fitness for purpose.
29 | ---------------------------------------------------------------------------
30 | Issue Date: 01/08/2005
31 | */
32 |
33 | #ifndef _SHA1_H
34 | #define _SHA1_H
35 |
36 | #include
37 | #include "brg_types.h"
38 |
39 | #define SHA1_BLOCK_SIZE 64
40 | #define SHA1_DIGEST_SIZE 20
41 |
42 | #if defined(__cplusplus)
43 | extern "C"
44 | {
45 | #endif
46 |
47 | /* type to hold the SHA256 context */
48 |
49 | typedef struct
50 | { uint_32t count[2];
51 | uint_32t hash[5];
52 | uint_32t wbuf[16];
53 | } sha1_ctx;
54 |
55 | /* Note that these prototypes are the same for both bit and */
56 | /* byte oriented implementations. However the length fields */
57 | /* are in bytes or bits as appropriate for the version used */
58 | /* and bit sequences are input as arrays of bytes in which */
59 | /* bit sequences run from the most to the least significant */
60 | /* end of each byte */
61 |
62 | VOID_RETURN sha1_compile(sha1_ctx ctx[1]);
63 |
64 | VOID_RETURN sha1_begin(sha1_ctx ctx[1]);
65 | VOID_RETURN sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1]);
66 | VOID_RETURN sha1_end(unsigned char hval[], sha1_ctx ctx[1]);
67 | VOID_RETURN sha1(unsigned char hval[], const unsigned char data[], unsigned long len);
68 |
69 | #if defined(__cplusplus)
70 | }
71 | #endif
72 |
73 | #endif
74 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/minizip/crypt.h:
--------------------------------------------------------------------------------
1 | /* crypt.h -- base code for traditional PKWARE encryption
2 | Version 1.01e, February 12th, 2005
3 |
4 | Copyright (C) 1998-2005 Gilles Vollant
5 | Modifications for Info-ZIP crypting
6 | Copyright (C) 2003 Terry Thorsen
7 |
8 | This code is a modified version of crypting code in Info-ZIP distribution
9 |
10 | Copyright (C) 1990-2000 Info-ZIP. All rights reserved.
11 |
12 | See the Info-ZIP LICENSE file version 2000-Apr-09 or later for terms of use
13 | which also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
14 |
15 | The encryption/decryption parts of this source code (as opposed to the
16 | non-echoing password parts) were originally written in Europe. The
17 | whole source package can be freely distributed, including from the USA.
18 | (Prior to January 2000, re-export from the US was a violation of US law.)
19 |
20 | This encryption code is a direct transcription of the algorithm from
21 | Roger Schlafly, described by Phil Katz in the file appnote.txt. This
22 | file (appnote.txt) is distributed with the PKZIP program (even in the
23 | version without encryption capabilities).
24 |
25 | If you don't need crypting in your application, just define symbols
26 | NOCRYPT and NOUNCRYPT.
27 | */
28 |
29 | #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
30 |
31 | /***********************************************************************
32 | * Return the next byte in the pseudo-random sequence
33 | */
34 | static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
35 | {
36 | unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
37 | * unpredictable manner on 16-bit systems; not a problem
38 | * with any known compiler so far, though */
39 |
40 | temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
41 | return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
42 | }
43 |
44 | /***********************************************************************
45 | * Update the encryption keys with the next byte of plain text
46 | */
47 | static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
48 | {
49 | (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
50 | (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
51 | (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
52 | {
53 | register int keyshift = (int)((*(pkeys+1)) >> 24);
54 | (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
55 | }
56 | return c;
57 | }
58 |
59 |
60 | /***********************************************************************
61 | * Initialize the encryption keys and the random header according to
62 | * the given password.
63 | */
64 | static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
65 | {
66 | *(pkeys+0) = 305419896L;
67 | *(pkeys+1) = 591751049L;
68 | *(pkeys+2) = 878082192L;
69 | while (*passwd != 0) {
70 | update_keys(pkeys,pcrc_32_tab,(int)*passwd);
71 | passwd++;
72 | }
73 | }
74 |
75 | #define zdecode(pkeys,pcrc_32_tab,c) \
76 | (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
77 |
78 | #define zencode(pkeys,pcrc_32_tab,c,t) \
79 | (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
80 |
81 | #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
82 |
83 | #define RAND_HEAD_LEN 12
84 | /* "last resort" source for second part of crypt seed pattern */
85 | # ifndef ZCR_SEED2
86 | # define ZCR_SEED2 3141592654UL /* use PI as default pattern */
87 | # endif
88 |
89 | static int crypthead(const char* passwd, /* password string */
90 | unsigned char* buf, /* where to write header */
91 | int bufSize,
92 | unsigned long* pkeys,
93 | const unsigned long* pcrc_32_tab,
94 | unsigned long crcForCrypting)
95 | {
96 | int n; /* index in random header */
97 | int t; /* temporary */
98 | int c; /* random byte */
99 | unsigned char header[RAND_HEAD_LEN-2]; /* random header */
100 | static unsigned calls = 0; /* ensure different random header each time */
101 |
102 | if (bufSize> 7) & 0xff;
117 | header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
118 | }
119 | /* Encrypt random header (last two bytes is high word of crc) */
120 | init_keys(passwd, pkeys, pcrc_32_tab);
121 | for (n = 0; n < RAND_HEAD_LEN-2; n++)
122 | {
123 | buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
124 | }
125 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
126 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
127 | return n;
128 | }
129 |
130 | #endif
131 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/minizip/ioapi.h:
--------------------------------------------------------------------------------
1 | /* ioapi.h -- IO base function header for compress/uncompress .zip
2 | part of the MiniZip project
3 |
4 | Copyright (C) 1998-2010 Gilles Vollant
5 | http://www.winimage.com/zLibDll/minizip.html
6 | Modifications for Zip64 support
7 | Copyright (C) 2009-2010 Mathias Svensson
8 | http://result42.com
9 |
10 | This program is distributed under the terms of the same license as zlib.
11 | See the accompanying LICENSE file for the full text of the license.
12 | */
13 |
14 | #ifndef _ZLIBIOAPI64_H
15 | #define _ZLIBIOAPI64_H
16 |
17 | #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
18 | # ifndef __USE_FILE_OFFSET64
19 | # define __USE_FILE_OFFSET64
20 | # endif
21 | # ifndef __USE_LARGEFILE64
22 | # define __USE_LARGEFILE64
23 | # endif
24 | # ifndef _LARGEFILE64_SOURCE
25 | # define _LARGEFILE64_SOURCE
26 | # endif
27 | # ifndef _FILE_OFFSET_BIT
28 | # define _FILE_OFFSET_BIT 64
29 | # endif
30 | #endif
31 |
32 | #include
33 | #include
34 | #include "zlib.h"
35 |
36 | #if defined(USE_FILE32API)
37 | # define fopen64 fopen
38 | # define ftello64 ftell
39 | # define fseeko64 fseek
40 | #else
41 | # if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
42 | # define fopen64 fopen
43 | # define ftello64 ftello
44 | # define fseeko64 fseeko
45 | # endif
46 | # ifdef _MSC_VER
47 | # define fopen64 fopen
48 | # if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
49 | # define ftello64 _ftelli64
50 | # define fseeko64 _fseeki64
51 | # else /* old MSC */
52 | # define ftello64 ftell
53 | # define fseeko64 fseek
54 | # endif
55 | # endif
56 | #endif
57 |
58 | /* a type choosen by DEFINE */
59 | #ifdef HAVE_64BIT_INT_CUSTOM
60 | typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
61 | #else
62 | # ifdef HAS_STDINT_H
63 | # include "stdint.h"
64 | typedef uint64_t ZPOS64_T;
65 | # else
66 | # if defined(_MSC_VER) || defined(__BORLANDC__)
67 | typedef unsigned __int64 ZPOS64_T;
68 | # else
69 | typedef unsigned long long int ZPOS64_T;
70 | # endif
71 | # endif
72 | #endif
73 |
74 | #ifdef __cplusplus
75 | extern "C" {
76 | #endif
77 |
78 | #define ZLIB_FILEFUNC_SEEK_CUR (1)
79 | #define ZLIB_FILEFUNC_SEEK_END (2)
80 | #define ZLIB_FILEFUNC_SEEK_SET (0)
81 |
82 | #define ZLIB_FILEFUNC_MODE_READ (1)
83 | #define ZLIB_FILEFUNC_MODE_WRITE (2)
84 | #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
85 | #define ZLIB_FILEFUNC_MODE_EXISTING (4)
86 | #define ZLIB_FILEFUNC_MODE_CREATE (8)
87 |
88 | #ifndef ZCALLBACK
89 | # if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || \
90 | defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
91 | # define ZCALLBACK CALLBACK
92 | # else
93 | # define ZCALLBACK
94 | # endif
95 | #endif
96 |
97 | typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
98 | typedef voidpf (ZCALLBACK *opendisk_file_func) OF((voidpf opaque, voidpf stream, int number_disk, int mode));
99 | typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
100 | typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
101 | typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
102 | typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
103 |
104 | typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
105 | typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
106 |
107 | /* here is the "old" 32 bits structure structure */
108 | typedef struct zlib_filefunc_def_s
109 | {
110 | open_file_func zopen_file;
111 | opendisk_file_func zopendisk_file;
112 | read_file_func zread_file;
113 | write_file_func zwrite_file;
114 | tell_file_func ztell_file;
115 | seek_file_func zseek_file;
116 | close_file_func zclose_file;
117 | testerror_file_func zerror_file;
118 | voidpf opaque;
119 | } zlib_filefunc_def;
120 |
121 | typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
122 | typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
123 | typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
124 | typedef voidpf (ZCALLBACK *opendisk64_file_func)OF((voidpf opaque, voidpf stream, int number_disk, int mode));
125 |
126 | typedef struct zlib_filefunc64_def_s
127 | {
128 | open64_file_func zopen64_file;
129 | opendisk64_file_func zopendisk64_file;
130 | read_file_func zread_file;
131 | write_file_func zwrite_file;
132 | tell64_file_func ztell64_file;
133 | seek64_file_func zseek64_file;
134 | close_file_func zclose_file;
135 | testerror_file_func zerror_file;
136 | voidpf opaque;
137 | } zlib_filefunc64_def;
138 |
139 | void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
140 | void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
141 |
142 | /* now internal definition, only for zip.c and unzip.h */
143 | typedef struct zlib_filefunc64_32_def_s
144 | {
145 | zlib_filefunc64_def zfile_func64;
146 | open_file_func zopen32_file;
147 | opendisk_file_func zopendisk32_file;
148 | tell_file_func ztell32_file;
149 | seek_file_func zseek32_file;
150 | } zlib_filefunc64_32_def;
151 |
152 | #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
153 | #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
154 | /*#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))*/
155 | /*#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))*/
156 | #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
157 | #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
158 |
159 | voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
160 | voidpf call_zopendisk64 OF((const zlib_filefunc64_32_def* pfilefunc, voidpf filestream, int number_disk, int mode));
161 | long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
162 | ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
163 |
164 | void fill_zlib_filefunc64_32_def_from_filefunc32 OF((zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32));
165 |
166 | #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
167 | #define ZOPENDISK64(filefunc,filestream,diskn,mode) (call_zopendisk64((&(filefunc)),(filestream),(diskn),(mode)))
168 | #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
169 | #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
170 |
171 | #ifdef __cplusplus
172 | }
173 | #endif
174 |
175 | #endif
176 |
--------------------------------------------------------------------------------
/iPa图片提取/SSZipArchive/minizip/mztools.h:
--------------------------------------------------------------------------------
1 | /*
2 | Additional tools for Minizip
3 | Code: Xavier Roche '2004
4 | License: Same as ZLIB (www.gzip.org)
5 | */
6 |
7 | #ifndef _zip_tools_H
8 | #define _zip_tools_H
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | #ifndef _ZLIB_H
15 | #include "zlib.h"
16 | #endif
17 |
18 | #include "unzip.h"
19 |
20 | /* Repair a ZIP file (missing central directory)
21 | file: file to recover
22 | fileOut: output file after recovery
23 | fileOutTmp: temporary file name used for recovery
24 | */
25 | extern int ZEXPORT unzRepair(const char* file,
26 | const char* fileOut,
27 | const char* fileOutTmp,
28 | uLong* nRecovered,
29 | uLong* bytesRecovered);
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcodeproj/project.xcworkspace/xcuserdata/Tian.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取.xcodeproj/project.xcworkspace/xcuserdata/Tian.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcodeproj/xcuserdata/Tian.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
12 |
13 |
14 |
16 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcodeproj/xcuserdata/Tian.xcuserdatad/xcschemes/Extrac.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcodeproj/xcuserdata/Tian.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Extrac.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 949E78A01DC76278007E4107
16 |
17 | primary
18 |
19 |
20 | 949E78B11DC76278007E4107
21 |
22 | primary
23 |
24 |
25 | 949E78BC1DC76278007E4107
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcworkspace/xcuserdata/Tian.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取.xcworkspace/xcuserdata/Tian.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取.xcworkspace/xcuserdata/Tian.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/AboutVC.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AboutVC.swift
3 | // iPa图片提取
4 | //
5 | // Created by 田子瑶 on 16/11/5.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class AboutVC: NSViewController {
12 |
13 |
14 | @IBOutlet weak var archive: NSTextField!
15 | @IBOutlet weak var extractor: NSTextField!
16 | @IBOutlet weak var email: NSTextField!
17 | @IBOutlet weak var homePage: NSTextField!
18 |
19 | override func viewDidLoad() {
20 | super.viewDidLoad()
21 |
22 | setLabelTitle(label: extractor, title: "iOS-Asset-Extractor", url: "https://github.com/Marxon13/iOS-Asset-Extractor")
23 | setLabelTitle(label: archive, title: "ZipArchive ", url: "https://github.com/mattconnolly/ZipArchive")
24 | let emailUrl = "mailto:ziyao.tian@gmail.com?subject=About%20Extract.app&body=Hi"
25 | setLabelTitle(label: email, title: "ziyao.tian@gmail.com", url: emailUrl)
26 | setLabelTitle(label: homePage, title: "github.com/tianziyao", url: "https://github.com/tianziyao")
27 | }
28 |
29 | func setLabelTitle(label: NSTextField, title: String, url: String) {
30 |
31 | label.allowsEditingTextAttributes = true
32 | label.isSelectable = true
33 | let url = URL(string: url)
34 | let string = NSMutableAttributedString()
35 | string.append(NSAttributedString.hyperlinkFromString(inString: title, withURL: url!))
36 | label.attributedStringValue = string
37 | }
38 |
39 | @IBAction func backButtonClicked(_ sender: AnyObject) {
40 | self.dismiss(self)
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // iPa图片提取
4 | //
5 | // Created by 田子瑶 on 16/10/31.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 |
15 |
16 | func applicationDidFinishLaunching(_ aNotification: Notification) {
17 |
18 |
19 | }
20 |
21 | func applicationWillTerminate(_ aNotification: Notification) {
22 | // Insert code here to tear down your application
23 | }
24 |
25 |
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/256.imageset/256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/256.imageset/256.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/256.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "256.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/1024.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/128.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/16.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/256-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/256-1.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/256.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/32-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/32-1.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/32.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/512-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/512-1.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/512.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/65.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/65.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "32-1.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "65.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "256-1.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "512-1.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/appPlaceholder.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "appPlaceholder_185x185_@1x.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "appPlaceholder_185x185_@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/appPlaceholder.imageset/appPlaceholder_185x185_@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/appPlaceholder.imageset/appPlaceholder_185x185_@1x.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/appPlaceholder.imageset/appPlaceholder_185x185_@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/appPlaceholder.imageset/appPlaceholder_185x185_@2x.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/green-hover.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "green-hover.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "green-hover@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/green-hover.imageset/green-hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/green-hover.imageset/green-hover.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/green-hover.imageset/green-hover@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/green-hover.imageset/green-hover@2x.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/red-hover.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "red-hover.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "red-hover@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/red-hover.imageset/red-hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/red-hover.imageset/red-hover.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/red-hover.imageset/red-hover@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/red-hover.imageset/red-hover@2x.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/winxinPay.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "IMG_1981.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/winxinPay.imageset/IMG_1981.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/winxinPay.imageset/IMG_1981.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/yellow-hover.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "yellow-hover.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "yellow-hover@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/yellow-hover.imageset/yellow-hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/yellow-hover.imageset/yellow-hover.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Assets.xcassets/yellow-hover.imageset/yellow-hover@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/iPa图片提取/Assets.xcassets/yellow-hover.imageset/yellow-hover@2x.png
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/DragView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DragView.swift
3 | // iPa图片提取
4 | //
5 | // Created by 田子瑶 on 16/10/31.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 |
12 | protocol DragViewDelegate {
13 | func dragView(dragView: DragView, didDragItems items: [String])
14 | }
15 |
16 | class DragView: NSView {
17 |
18 | private var enable: Bool = false
19 |
20 | override init(frame frameRect: NSRect) {
21 | super.init(frame: frameRect)
22 |
23 | dragEnable = false
24 | self.dragEnable = true
25 |
26 | }
27 |
28 | required init?(coder: NSCoder) {
29 | super.init(coder: coder)
30 | //fatalError("init(coder:) has not been implemented")
31 | }
32 |
33 | /// 设置是否使用文件拖放
34 | var dragEnable: Bool {
35 |
36 | set {
37 | if !newValue {
38 | // 关闭文件拖放
39 | self.unregisterDraggedTypes()
40 | }
41 | else {
42 | // 开启文件拖放
43 | self.register(forDraggedTypes: [NSFilenamesPboardType])
44 | }
45 | self.enable = newValue
46 | }
47 |
48 | get {
49 | return self.enable
50 | }
51 | }
52 |
53 | /// 接收到拖拽文件后回调
54 | var delegate: DragViewDelegate!
55 |
56 | override func draw(_ dirtyRect: NSRect) {
57 | super.draw(dirtyRect)
58 |
59 | dragEnable = false
60 | self.dragEnable = true
61 |
62 | }
63 |
64 | func notificationPost(eventName: String, dict: [String : String]) {
65 | let notification = Notification(name: NSNotification.Name(rawValue: eventName),
66 | object: nil,
67 | userInfo: dict)
68 | NotificationCenter.default.post(notification)
69 | }
70 |
71 | override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
72 | notificationPost(eventName: "updataForStatusLabel", dict: ["title" : "停止拖放以继续"])
73 | dragEnable = true
74 | self.needsDisplay = true
75 | return NSDragOperation.copy
76 | }
77 |
78 | override func draggingExited(_ sender: NSDraggingInfo?) {
79 | notificationPost(eventName: "updataForStatusLabel", dict: ["title" : "拖拽文件到这里"])
80 | dragEnable = false
81 | self.needsDisplay = true
82 | }
83 |
84 | override func draggingEnded(_ sender: NSDraggingInfo?) {
85 | dragEnable = false
86 | self.needsDisplay = true
87 | }
88 |
89 | override func performDragOperation(_ sender: NSDraggingInfo) -> Bool {
90 |
91 | let pasteboard = sender.draggingPasteboard()
92 |
93 | if (pasteboard.types?.contains(NSFilenamesPboardType))! {
94 | let items = pasteboard.propertyList(forType: NSFilenamesPboardType)
95 | self.delegate.dragView(dragView: self, didDragItems: items as! [String])
96 | return true
97 | }
98 | return false
99 | }
100 |
101 |
102 |
103 | }
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/FileItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // FileItem.swift
3 | // iPa图片提取
4 | //
5 | // Created by 田子瑶 on 16/10/31.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class FileItem: NSObject {
12 |
13 | private var path: String!
14 |
15 | /// 文件路径
16 | var filePath: String {
17 | set {
18 | path = newValue
19 | isFileExists = FileManager.default.fileExists(atPath: newValue, isDirectory: &isDirectory)
20 | }
21 | get {
22 | return path
23 | }
24 | }
25 |
26 | /// 文件(夹)名称
27 | var fileName: String {
28 | return (filePath as NSString).lastPathComponent
29 | }
30 |
31 | /// 是否是文件夹
32 | var isDirectory: ObjCBool = false
33 |
34 | /// 是否存在
35 | var isFileExists: Bool!
36 |
37 | /// 工厂方法
38 | ///
39 | /// - parameter withPath: 文件路径
40 | ///
41 | /// - returns: 模型实例
42 | class func fileItem(withPath: String) -> FileItem {
43 | let fileItem = FileItem()
44 | fileItem.filePath = withPath
45 | return fileItem
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/GifView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GifView.swift
3 | // GifForMACDev
4 | //
5 | // Created by 田子瑶 on 16/11/4.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class GifView: NSView {
12 |
13 | var image: NSImage!
14 | var gifBitmapRep: NSBitmapImageRep!
15 | var currentFrameIdx: NSInteger!
16 | var timer: Timer!
17 |
18 | override func draw(_ dirtyRect: NSRect) {
19 | super.draw(dirtyRect)
20 |
21 | self.drawGif()
22 |
23 | }
24 |
25 | func setImage(withUrl url: String) {
26 |
27 | var request = URLRequest(url: URL.init(string: url)!)
28 | request.addValue("image/*", forHTTPHeaderField: "Accept")
29 |
30 | let task = URLSession.shared.dataTask(with: request) { (data, resp, error) in
31 |
32 | guard error == nil || data == nil else {
33 | Swift.print("请求错误或请求数据为空")
34 | return
35 | }
36 |
37 | let image = NSImage(data: data!)
38 | self.setImage(withImage: image!)
39 | }
40 |
41 | task.resume()
42 | }
43 |
44 | func setImage(withImage image: NSImage) {
45 |
46 | self.image = image
47 | self.gifBitmapRep = nil
48 |
49 | if self.timer != nil {
50 | self.timer.invalidate()
51 | self.timer = nil
52 | }
53 |
54 | let reps = self.image.representations
55 |
56 | for rep in reps {
57 | let rep = rep as! NSBitmapImageRep
58 | let numFrame = rep.value(forProperty: NSImageFrameCount) as! Int
59 | if numFrame == 0 {
60 | break
61 | }
62 | let delayTime = rep.value(forProperty: NSImageCurrentFrameDuration) as! TimeInterval
63 | self.currentFrameIdx = 0
64 | self.gifBitmapRep = rep
65 | self.timer = Timer(timeInterval: delayTime / 3,
66 | target: self,
67 | selector: #selector(GifView.animateGif),
68 | userInfo: nil,
69 | repeats: true)
70 | }
71 |
72 | RunLoop.main.add(self.timer, forMode: .commonModes)
73 | }
74 |
75 | func animateGif() {
76 | self.needsDisplay = true
77 | }
78 |
79 | func drawGif() {
80 |
81 | if self.gifBitmapRep != nil {
82 |
83 | let numFrame = gifBitmapRep.value(forProperty: NSImageFrameCount) as! NSInteger
84 |
85 | if self.currentFrameIdx >= numFrame {
86 | self.currentFrameIdx = 0
87 | }
88 |
89 | self.gifBitmapRep.setProperty(NSImageCurrentFrame, withValue: self.currentFrameIdx)
90 |
91 | let selfHeight = self.frame.size.height
92 | let selfWidth = self.frame.size.width
93 |
94 | let imageHeight = self.image.size.height
95 | let imageWidth = self.image.size.width
96 |
97 | var drawGifRect = NSRect()
98 |
99 | if self.image.size.width > self.frame.size.width || self.image.size.height > self.frame.size.height {
100 |
101 | let newWidth = imageWidth / 1.7
102 | let newHeight = imageHeight / 1.7
103 | drawGifRect = NSRect(x: (selfWidth - newWidth) / 2,
104 | y: (selfHeight - newHeight) / 2,
105 | width: newWidth,
106 | height: newHeight)
107 | }
108 | else {
109 | drawGifRect = NSRect(x: (selfWidth - imageWidth) / 2,
110 | y: (selfHeight - imageWidth) / 2,
111 | width: imageWidth,
112 | height: imageHeight)
113 | }
114 | self.gifBitmapRep.draw(in: drawGifRect,
115 | from: NSZeroRect,
116 | operation: .sourceOver,
117 | fraction: 1.0,
118 | respectFlipped: false,
119 | hints: nil)
120 |
121 | self.currentFrameIdx! += 1
122 |
123 | }
124 |
125 | }
126 |
127 | }
128 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | LSApplicationCategoryType
22 | public.app-category.developer-tools
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2016年 田子瑶. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取/MainWindow.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MainWindow.swift
3 | // iPa图片提取
4 | //
5 | // Created by 田子瑶 on 16/11/2.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class MainWindow: NSWindowController {
12 |
13 | override func windowDidLoad() {
14 | super.windowDidLoad()
15 | //通过窗口背景移动
16 | self.window?.isMovableByWindowBackground = true
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取Tests/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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取Tests/iPa____Tests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // iPa____Tests.swift
3 | // iPa图片提取Tests
4 | //
5 | // Created by 田子瑶 on 16/10/31.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import iPa____
11 |
12 | class iPa____Tests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measure {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取UITests/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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/iPa图片提取/iPa图片提取UITests/iPa____UITests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // iPa____UITests.swift
3 | // iPa图片提取UITests
4 | //
5 | // Created by 田子瑶 on 16/10/31.
6 | // Copyright © 2016年 田子瑶. All rights reserved.
7 | //
8 |
9 | import XCTest
10 |
11 | class iPa____UITests: XCTestCase {
12 |
13 | override func setUp() {
14 | super.setUp()
15 |
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 |
18 | // In UI tests it is usually best to stop immediately when a failure occurs.
19 | continueAfterFailure = false
20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
21 | XCUIApplication().launch()
22 |
23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
24 | }
25 |
26 | override func tearDown() {
27 | // Put teardown code here. This method is called after the invocation of each test method in the class.
28 | super.tearDown()
29 | }
30 |
31 | func testExample() {
32 | // Use recording to get started writing UI tests.
33 | // Use XCTAssert and related functions to verify your tests produce the correct results.
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/iPa图片提取/itsnottoolate.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/iPa图片提取/itsnottoolate.gif
--------------------------------------------------------------------------------
/images/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/images/0.png
--------------------------------------------------------------------------------
/images/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/images/1.png
--------------------------------------------------------------------------------
/images/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/images/2.png
--------------------------------------------------------------------------------
/images/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/images/3.png
--------------------------------------------------------------------------------
/images/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/images/4.png
--------------------------------------------------------------------------------
/images/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/images/5.png
--------------------------------------------------------------------------------
/images/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianziyao/Extract/ce1dd02d0fd3b15519a07b9857dbd5161f2e2402/images/6.png
--------------------------------------------------------------------------------