├── .gitignore
├── .DS_Store
├── unzip
├── .DS_Store
├── unzip
│ ├── .DS_Store
│ ├── ViewController.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ ├── AppDelegate.m
│ └── ViewController.m
├── unzipTests
│ ├── .DS_Store
│ ├── Info.plist
│ └── unzipTests.m
├── podfile
├── unzip.xcworkspace
│ ├── xcuserdata
│ │ └── xiangwenwen.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── contents.xcworkspacedata
├── unzip.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── xiangwenwen.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ ├── xcuserdata
│ │ └── xiangwenwen.xcuserdatad
│ │ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── unzip.xcscheme
│ └── project.pbxproj
├── Podfile.lock
└── unzipUITests
│ ├── Info.plist
│ └── unzipUITests.m
├── package.json
├── README.md
├── bridge.js
└── iOS.JavaScriptBridge.js
/.gitignore:
--------------------------------------------------------------------------------
1 | Pods/
2 | *.zip
3 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningminers/cheerful/HEAD/.DS_Store
--------------------------------------------------------------------------------
/unzip/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningminers/cheerful/HEAD/unzip/.DS_Store
--------------------------------------------------------------------------------
/unzip/unzip/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningminers/cheerful/HEAD/unzip/unzip/.DS_Store
--------------------------------------------------------------------------------
/unzip/unzipTests/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningminers/cheerful/HEAD/unzip/unzipTests/.DS_Store
--------------------------------------------------------------------------------
/unzip/podfile:
--------------------------------------------------------------------------------
1 | pod 'WebViewJavascriptBridge', '~> 4.1.4'
2 | pod 'ZipArchive', '~> 1.4.0'
3 | pod 'Masonry', '~> 0.6.3'
4 |
--------------------------------------------------------------------------------
/unzip/unzip.xcworkspace/xcuserdata/xiangwenwen.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningminers/cheerful/HEAD/unzip/unzip.xcworkspace/xcuserdata/xiangwenwen.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/unzip/unzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/unzip/unzip.xcodeproj/project.xcworkspace/xcuserdata/xiangwenwen.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningminers/cheerful/HEAD/unzip/unzip.xcodeproj/project.xcworkspace/xcuserdata/xiangwenwen.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/unzip/unzip/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // unzip
4 | //
5 | // Created by xiangwenwen on 15/10/9.
6 | // Copyright © 2015年 xiangwenwen. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/unzip/unzip.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/unzip/unzip/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // unzip
4 | //
5 | // Created by xiangwenwen on 15/10/9.
6 | // Copyright © 2015年 xiangwenwen. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/unzip/unzip/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // unzip
4 | //
5 | // Created by xiangwenwen on 15/10/9.
6 | // Copyright © 2015年 xiangwenwen. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/unzip/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Masonry (0.6.3)
3 | - WebViewJavascriptBridge (4.1.4)
4 | - ZipArchive (1.4.0)
5 |
6 | DEPENDENCIES:
7 | - Masonry (~> 0.6.3)
8 | - WebViewJavascriptBridge (~> 4.1.4)
9 | - ZipArchive (~> 1.4.0)
10 |
11 | SPEC CHECKSUMS:
12 | Masonry: ff105a956abcd19a618b2028b121cb638d7a8e2f
13 | WebViewJavascriptBridge: f10ac16f2cd3adf2b941bd79477c55a8f6e01044
14 | ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966
15 |
16 | COCOAPODS: 0.38.2
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cheerful",
3 | "version": "1.0.0",
4 | "description": "bridge iOSBridge AndroidBridge",
5 | "main": "bridge.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/icepy/cheerful.git"
12 | },
13 | "keywords": [
14 | "bridge",
15 | "iOSBridge",
16 | "AndroidBridge"
17 | ],
18 | "author": "icepy",
19 | "license": "MIT",
20 | "bugs": {
21 | "url": "https://github.com/icepy/cheerful/issues"
22 | },
23 | "homepage": "https://github.com/icepy/cheerful#readme"
24 | }
25 |
--------------------------------------------------------------------------------
/unzip/unzip/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/unzip/unzipTests/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 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/unzip/unzipUITests/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 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/unzip/unzip.xcodeproj/xcuserdata/xiangwenwen.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | unzip.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 17C814BF1BC757D10097AF47
16 |
17 | primary
18 |
19 |
20 | 17C814D81BC757D10097AF47
21 |
22 | primary
23 |
24 |
25 | 17C814E31BC757D10097AF47
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/unzip/unzipTests/unzipTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // unzipTests.m
3 | // unzipTests
4 | //
5 | // Created by xiangwenwen on 15/10/9.
6 | // Copyright © 2015年 xiangwenwen. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface unzipTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation unzipTests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | // This is an example of a functional test case.
29 | // Use XCTAssert and related functions to verify your tests produce the correct results.
30 | }
31 |
32 | - (void)testPerformanceExample {
33 | // This is an example of a performance test case.
34 | [self measureBlock:^{
35 | // Put the code you want to measure the time of here.
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/unzip/unzipUITests/unzipUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // unzipUITests.m
3 | // unzipUITests
4 | //
5 | // Created by xiangwenwen on 15/10/9.
6 | // Copyright © 2015年 xiangwenwen. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface unzipUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation unzipUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // 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.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/unzip/unzip/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSAllowsArbitraryLoads
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 |
32 | UILaunchStoryboardName
33 | LaunchScreen
34 | UIMainStoryboardFile
35 | Main
36 | UIRequiredDeviceCapabilities
37 |
38 | armv7
39 |
40 | UISupportedInterfaceOrientations
41 |
42 | UIInterfaceOrientationPortrait
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/unzip/unzip/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/unzip/unzip/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Cheerful
2 |
3 | 小巧的JavaScript与Native通信库(JavaScript端实现),拿去即可使用,已经过项目的实际检测。
4 |
5 | ### iOS实现
6 |
7 | 如果你的iOS项目使用了[WebViewJavascriptBridge](https://github.com/marcuswestin/WebViewJavascriptBridge),那么你可不必引入iOS-JavaScriptBridge.js文件,直接引入bridge.js文件即可。
8 |
9 | 如果你的iOS项目未使用[WebViewJavascriptBridge](https://github.com/marcuswestin/WebViewJavascriptBridge),那么你需要先引入iOS-JavaScriptBridge.js文件,并且需要在iOS端实现对 CUSTOM_PROTOCOL_SCHEME = 'wvjbscheme'的截取,并且使用stringByEvaluatingJavaScriptFromString去执行截取的参数QUEUE_HAS_MESSAGE。
10 |
11 | ### Android 实现
12 |
13 | Android不会存在这个问题,因为它们使用的是对象映射来实现。
14 |
15 | public final String API_KEY = "jsApi";
16 | openWebView.addJavascriptInterface(baseJsApi, API_KEY);
17 |
18 | 不过如果在JS端获取响应,你依然必须在Android实现对JS端的执行:
19 |
20 | JSONObject object = new JSONObject(jsonParam);
21 | androidResponseFunSigning = "androidResponseFunSigning." + object.getString("funcKey");
22 | openWebView.loadUrl("javascript:window.NativeEvaluatingJavaScript." + androidResponseFunSigning + "('" + json + "')");
23 |
24 | ### How Use it ?
25 |
26 | 在页面中引入:
27 |
28 |
29 |
30 | 使用AMD引入:
31 |
32 | define(['bridge'],function(bridge){
33 |
34 | });
35 |
36 | 使用CommonJS
37 |
38 | var bridge = require('bridge');
39 |
40 |
41 | ### API
42 |
43 | /**
44 | * [register 向Native调起Api]
45 | * @param {[JSON]} opt [funSigning(函数签名)arg(传递的参数)callback(方法回调)]
46 | * @return {[undefined]} [undefined]
47 | */
48 | register:function(opt) {
49 | if(!opt || !opt.funcSigning) { throw new Error("Method missed."); }
50 | registerFunSigningForNativeHandler(opt);
51 | },
52 | /*
53 | 是否为iOS客户端
54 | */
55 | isIOS: isIOS,
56 | /*
57 | 是否为Android客户端
58 | */
59 | isAndroid: isAndroid,
60 | /**
61 | * [registerNativeEvaluatingJavaScript 注册Native可以执行的JavaScript函数]
62 | * @param {[type]} name [description]
63 | * @param {[type]} func [description]
64 | * @return {[type]} [description]
65 | */
66 | registerNativeEvaluatingJavaScript:function(name,des){
67 | window.NativeEvaluatingJavaScript[name] = des;
68 | },
69 | version:'1.0.0'
70 |
--------------------------------------------------------------------------------
/unzip/unzip/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // unzip
4 | //
5 | // Created by xiangwenwen on 15/10/9.
6 | // Copyright © 2015年 xiangwenwen. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/unzip/unzip/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // unzip
4 | //
5 | // Created by xiangwenwen on 15/10/9.
6 | // Copyright © 2015年 xiangwenwen. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 | #import "ViewController.h"
13 |
14 | @interface ViewController ()
15 |
16 | @property(nonatomic, strong) WebViewJavascriptBridge *bridge;
17 | @property(nonatomic, strong) UIWebView *webview;
18 | @property(nonatomic, copy) NSString *doc;
19 |
20 | @end
21 |
22 | @implementation ViewController
23 |
24 | -(UIWebView *)webview
25 | {
26 | if (!_webview) {
27 | _webview = [[UIWebView alloc] initWithFrame:self.view.frame];
28 | }
29 | return _webview;
30 | }
31 |
32 | -(WebViewJavascriptBridge *)bridge
33 | {
34 | if (!_bridge) {
35 | _bridge = [WebViewJavascriptBridge bridgeForWebView:self.webview webViewDelegate:self handler:^(id data, WVJBResponseCallback responseCallback) {
36 | responseCallback(@"启动 webview bridge");
37 | }];
38 | }
39 | return _bridge;
40 | }
41 |
42 | - (void)viewDidLoad {
43 | [super viewDidLoad];
44 | [self.view addSubview:self.webview];
45 | self.doc = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
46 | [self readHTMLString];
47 | // Do any additional setup after loading the view, typically from a nib.
48 | [self.bridge registerHandler:@"authR...." handler:^(id data, WVJBResponseCallback responseCallback) {
49 | responseCallback(@"hello");
50 | }];
51 | }
52 |
53 | - (void)readHTMLString
54 | {
55 | NSString *zipResource = [[NSBundle mainBundle] pathForResource:@"app-d10bd73eb129cfff6b2b13822296a9b4" ofType:@"zip"];
56 | ZipArchive *ze = [[ZipArchive alloc] init];
57 | if ([ze UnzipOpenFile:zipResource]) {
58 | BOOL success = [ze UnzipFileTo:self.doc overWrite:YES];
59 | if (success) {
60 | NSLog(@"解压成功 --- >");
61 | [ze UnzipCloseFile];
62 | NSString *htmlPath = [self.doc stringByAppendingPathComponent:@"index.html"];
63 | NSString *htmlString = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
64 | NSURL *baseUrl = [NSURL URLWithString:[self.doc stringByAppendingPathComponent:@"index.html?communityId=1&discovery"]];
65 | [self.webview loadHTMLString:htmlString baseURL:baseUrl];
66 | }
67 | }
68 | }
69 |
70 | - (void)didReceiveMemoryWarning {
71 | [super didReceiveMemoryWarning];
72 | // Dispose of any resources that can be recreated.
73 | }
74 |
75 | @end
76 |
--------------------------------------------------------------------------------
/bridge.js:
--------------------------------------------------------------------------------
1 |
2 | 'use strict';
3 |
4 | (function(factory){
5 | var root = (typeof self == 'object' && self.self == self && self) ||
6 | (typeof global == 'object' && global.global == global && global);
7 | if (typeof define === 'function' && define.amd) {
8 | define(factory);
9 | }else if(typeof exports === 'object' && typeof module === 'object'){
10 | module.exports = factory();
11 | }else if(typeof exports === 'object'){
12 | exports['bridge'] = factory()
13 | }else{
14 | root.bridge = factory();
15 | }
16 | })(function(){
17 | var registerFunSigningForNativeHandler,
18 | ua = navigator.userAgent,
19 | // 'jsApi' definition of Android Webview
20 | androidApi = window.jsApi,
21 | isIOS = /iphone|ipad|ipod/i.test(ua),
22 | isAndroid = /android/i.test(ua),
23 | uid = 0;
24 | /**
25 | * [NativeEvaluatingJavaScript 用于Native调用JS的注册函数]
26 | * @type {[JSON]}
27 | */
28 | window.NativeEvaluatingJavaScript = {
29 | androidResponseFunSigning:{}
30 | };
31 | var androidResponseFunSigning = window.NativeEvaluatingJavaScript.androidResponseFunSigning;
32 | /**
33 | * [androidBridge 安卓交互处理]
34 | * @type {Object}
35 | */
36 | var androidBridge = {
37 | callNative:function(option){
38 | var funcSigning = option.funcSigning;
39 | delete option.funcSigning;
40 | if(option && typeof option.callback === 'function'){
41 | var funcKey = 'icepy_'+(uid++)+'_'+(new Date().getTime())+Math.floor(Math.random(100)*100);
42 | androidResponseFunSigning[funcKey] = option.callback;
43 | option.arg.funcKey = funcKey;
44 | }
45 | if (androidApi) {
46 | androidApi[funcSigning](JSON.stringify(option.arg || {}));
47 | };
48 | }
49 | };
50 |
51 | var init = true;
52 | var bridge = null;
53 | /**
54 | * [iOSBridge iOS交互处理]
55 | * @type {Object}
56 | */
57 | var iOSBridge = {
58 | connectWebViewJavascriptBridge:function(callback){
59 | if(window.WebViewJavascriptBridge){
60 | callback(WebViewJavascriptBridge);
61 | }else{
62 | document.addEventListener('WebViewJavascriptBridgeReady',function() {
63 | callback(WebViewJavascriptBridge);
64 | },false);
65 | }
66 | },
67 | callNative:function(option){
68 | if(!bridge){
69 | iOSBridge.connectWebViewJavascriptBridge(function(_bridge){
70 | bridge = _bridge;
71 | bridge.init();
72 | iOSBridge.handler(bridge,option);
73 | });
74 | }else{
75 | iOSBridge.handler(bridge,option);
76 | }
77 | },
78 | handler:function(bridge,option){
79 | bridge.callHandler(option.funcSigning,option.arg || {},function(response) {
80 | if(typeof option.callback === 'function'){
81 | option.callback(response);
82 | }
83 | });
84 | }
85 | };
86 |
87 | if(isIOS){
88 | registerFunSigningForNativeHandler = iOSBridge.callNative;
89 | }else if(isAndroid) {
90 | registerFunSigningForNativeHandler = androidBridge.callNative;
91 | }else{
92 | //throw new Error("Unkown UA.");
93 | };
94 |
95 | return {
96 | /**
97 | * [register 向Native调起Api]
98 | * @param {[JSON]} opt [funSigning(函数签名)arg(传递的参数)callback(方法回调)]
99 | * @return {[undefined]} [undefined]
100 | */
101 | register:function(opt) {
102 | if(!opt || !opt.funcSigning) { throw new Error("Method missed."); }
103 | registerFunSigningForNativeHandler(opt);
104 | },
105 | /*
106 | 是否为iOS客户端
107 | */
108 | isIOS: isIOS,
109 | /*
110 | 是否为Android客户端
111 | */
112 | isAndroid: isAndroid,
113 | /**
114 | * [registerNativeEvaluatingJavaScript 注册Native可以执行的JavaScript函数]
115 | * @param {[type]} name [description]
116 | * @param {[type]} func [description]
117 | * @return {[type]} [description]
118 | */
119 | registerNativeEvaluatingJavaScript:function(name,des){
120 | window.NativeEvaluatingJavaScript[name] = des;
121 | },
122 | version:'1.0.0'
123 | };
124 | });
--------------------------------------------------------------------------------
/unzip/unzip.xcodeproj/xcuserdata/xiangwenwen.xcuserdatad/xcschemes/unzip.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 |
--------------------------------------------------------------------------------
/iOS.JavaScriptBridge.js:
--------------------------------------------------------------------------------
1 | ;(function() {
2 | if (window.WebViewJavascriptBridge) {
3 | return
4 | }
5 | var messagingIframe
6 | var sendMessageQueue = []
7 | var receiveMessageQueue = []
8 | var messageHandlers = {}
9 |
10 | var CUSTOM_PROTOCOL_SCHEME = 'wvjbscheme'
11 | var QUEUE_HAS_MESSAGE = '__WVJB_QUEUE_MESSAGE__'
12 |
13 | var responseCallbacks = {}
14 | var uniqueId = 1
15 |
16 | function _createQueueReadyIframe(doc) {
17 | messagingIframe = doc.createElement('iframe')
18 | messagingIframe.style.display = 'none'
19 | messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE
20 | doc.documentElement.appendChild(messagingIframe)
21 | }
22 |
23 | function init(messageHandler) {
24 | if (WebViewJavascriptBridge._messageHandler) {
25 | throw new Error('WebViewJavascriptBridge.init called twice')
26 | }
27 | WebViewJavascriptBridge._messageHandler = messageHandler
28 | var receivedMessages = receiveMessageQueue
29 | receiveMessageQueue = null
30 | for (var i = 0; i < receivedMessages.length; i++) {
31 | _dispatchMessageFromObjC(receivedMessages[i])
32 | }
33 | }
34 |
35 | function send(data, responseCallback) {
36 | _doSend({
37 | data: data
38 | }, responseCallback)
39 | }
40 |
41 | function registerHandler(handlerName, handler) {
42 | messageHandlers[handlerName] = handler
43 | }
44 |
45 | function callHandler(handlerName, data, responseCallback) {
46 | _doSend({
47 | handlerName: handlerName,
48 | data: data
49 | }, responseCallback)
50 | }
51 |
52 | function _doSend(message, responseCallback) {
53 | if (responseCallback) {
54 | var callbackId = 'cb_' + (uniqueId++) + '_' + new Date().getTime()
55 | responseCallbacks[callbackId] = responseCallback
56 | message['callbackId'] = callbackId
57 | }
58 | sendMessageQueue.push(message)
59 | messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE
60 | }
61 |
62 | function _fetchQueue() {
63 | var messageQueueString = JSON.stringify(sendMessageQueue)
64 | sendMessageQueue = []
65 | return messageQueueString
66 | }
67 |
68 | function _dispatchMessageFromObjC(messageJSON) {
69 | setTimeout(function _timeoutDispatchMessageFromObjC() {
70 | var message = JSON.parse(messageJSON)
71 | var messageHandler
72 | var responseCallback
73 |
74 | if (message.responseId) {
75 | responseCallback = responseCallbacks[message.responseId]
76 | if (!responseCallback) {
77 | return;
78 | }
79 | responseCallback(message.responseData)
80 | delete responseCallbacks[message.responseId]
81 | } else {
82 | if (message.callbackId) {
83 | var callbackResponseId = message.callbackId
84 | responseCallback = function(responseData) {
85 | _doSend({
86 | responseId: callbackResponseId,
87 | responseData: responseData
88 | })
89 | }
90 | }
91 |
92 | var handler = WebViewJavascriptBridge._messageHandler
93 | if (message.handlerName) {
94 | handler = messageHandlers[message.handlerName]
95 | }
96 |
97 | try {
98 | handler(message.data, responseCallback)
99 | } catch (exception) {
100 | if (typeof console != 'undefined') {
101 | console.log("WebViewJavascriptBridge: WARNING: javascript handler threw.", message, exception)
102 | }
103 | }
104 | }
105 | })
106 | }
107 |
108 | function _handleMessageFromObjC(messageJSON) {
109 | if (receiveMessageQueue) {
110 | receiveMessageQueue.push(messageJSON)
111 | } else {
112 | _dispatchMessageFromObjC(messageJSON)
113 | }
114 | }
115 |
116 | window.WebViewJavascriptBridge = {
117 | init: init,
118 | send: send,
119 | registerHandler: registerHandler,
120 | callHandler: callHandler,
121 | _fetchQueue: _fetchQueue,
122 | _handleMessageFromObjC: _handleMessageFromObjC
123 | }
124 |
125 | var doc = document
126 | _createQueueReadyIframe(doc)
127 | var readyEvent = doc.createEvent('Events')
128 | readyEvent.initEvent('WebViewJavascriptBridgeReady')
129 | readyEvent.bridge = WebViewJavascriptBridge
130 | doc.dispatchEvent(readyEvent)
131 | })();
132 |
--------------------------------------------------------------------------------
/unzip/unzip.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 06009230CF29D2E7685C259F /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E2F1C59BC503BA0DEAD47CE0 /* libPods.a */; };
11 | 173070011BC764A500BDBC9B /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 173070001BC764A500BDBC9B /* WebKit.framework */; };
12 | 17C814C51BC757D10097AF47 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C814C41BC757D10097AF47 /* main.m */; };
13 | 17C814C81BC757D10097AF47 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C814C71BC757D10097AF47 /* AppDelegate.m */; };
14 | 17C814CB1BC757D10097AF47 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C814CA1BC757D10097AF47 /* ViewController.m */; };
15 | 17C814CE1BC757D10097AF47 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17C814CC1BC757D10097AF47 /* Main.storyboard */; };
16 | 17C814D01BC757D10097AF47 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17C814CF1BC757D10097AF47 /* Assets.xcassets */; };
17 | 17C814D31BC757D10097AF47 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17C814D11BC757D10097AF47 /* LaunchScreen.storyboard */; };
18 | 17C814DE1BC757D10097AF47 /* unzipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C814DD1BC757D10097AF47 /* unzipTests.m */; };
19 | 17C814E91BC757D10097AF47 /* unzipUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C814E81BC757D10097AF47 /* unzipUITests.m */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 17C814DA1BC757D10097AF47 /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 17C814B81BC757D10097AF47 /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 17C814BF1BC757D10097AF47;
28 | remoteInfo = unzip;
29 | };
30 | 17C814E51BC757D10097AF47 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 17C814B81BC757D10097AF47 /* Project object */;
33 | proxyType = 1;
34 | remoteGlobalIDString = 17C814BF1BC757D10097AF47;
35 | remoteInfo = unzip;
36 | };
37 | /* End PBXContainerItemProxy section */
38 |
39 | /* Begin PBXFileReference section */
40 | 169481C9F96767158762C229 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; };
41 | 173070001BC764A500BDBC9B /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
42 | 17C814C01BC757D10097AF47 /* unzip.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = unzip.app; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 17C814C41BC757D10097AF47 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
44 | 17C814C61BC757D10097AF47 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
45 | 17C814C71BC757D10097AF47 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
46 | 17C814C91BC757D10097AF47 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
47 | 17C814CA1BC757D10097AF47 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
48 | 17C814CD1BC757D10097AF47 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
49 | 17C814CF1BC757D10097AF47 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
50 | 17C814D21BC757D10097AF47 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
51 | 17C814D41BC757D10097AF47 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | 17C814D91BC757D10097AF47 /* unzipTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = unzipTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 17C814DD1BC757D10097AF47 /* unzipTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = unzipTests.m; sourceTree = ""; };
54 | 17C814DF1BC757D10097AF47 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | 17C814E41BC757D10097AF47 /* unzipUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = unzipUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
56 | 17C814E81BC757D10097AF47 /* unzipUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = unzipUITests.m; sourceTree = ""; };
57 | 17C814EA1BC757D10097AF47 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | BBA4957232E743F8AA42F1A6 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; };
59 | E2F1C59BC503BA0DEAD47CE0 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
60 | /* End PBXFileReference section */
61 |
62 | /* Begin PBXFrameworksBuildPhase section */
63 | 17C814BD1BC757D10097AF47 /* Frameworks */ = {
64 | isa = PBXFrameworksBuildPhase;
65 | buildActionMask = 2147483647;
66 | files = (
67 | 173070011BC764A500BDBC9B /* WebKit.framework in Frameworks */,
68 | 06009230CF29D2E7685C259F /* libPods.a in Frameworks */,
69 | );
70 | runOnlyForDeploymentPostprocessing = 0;
71 | };
72 | 17C814D61BC757D10097AF47 /* Frameworks */ = {
73 | isa = PBXFrameworksBuildPhase;
74 | buildActionMask = 2147483647;
75 | files = (
76 | );
77 | runOnlyForDeploymentPostprocessing = 0;
78 | };
79 | 17C814E11BC757D10097AF47 /* Frameworks */ = {
80 | isa = PBXFrameworksBuildPhase;
81 | buildActionMask = 2147483647;
82 | files = (
83 | );
84 | runOnlyForDeploymentPostprocessing = 0;
85 | };
86 | /* End PBXFrameworksBuildPhase section */
87 |
88 | /* Begin PBXGroup section */
89 | 091E57629AF4180BF94CB314 /* Frameworks */ = {
90 | isa = PBXGroup;
91 | children = (
92 | 173070001BC764A500BDBC9B /* WebKit.framework */,
93 | E2F1C59BC503BA0DEAD47CE0 /* libPods.a */,
94 | );
95 | name = Frameworks;
96 | sourceTree = "";
97 | };
98 | 17C814B71BC757D10097AF47 = {
99 | isa = PBXGroup;
100 | children = (
101 | 17C814C21BC757D10097AF47 /* unzip */,
102 | 17C814DC1BC757D10097AF47 /* unzipTests */,
103 | 17C814E71BC757D10097AF47 /* unzipUITests */,
104 | 17C814C11BC757D10097AF47 /* Products */,
105 | 79F230FEE2423937611B985F /* Pods */,
106 | 091E57629AF4180BF94CB314 /* Frameworks */,
107 | );
108 | sourceTree = "";
109 | };
110 | 17C814C11BC757D10097AF47 /* Products */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 17C814C01BC757D10097AF47 /* unzip.app */,
114 | 17C814D91BC757D10097AF47 /* unzipTests.xctest */,
115 | 17C814E41BC757D10097AF47 /* unzipUITests.xctest */,
116 | );
117 | name = Products;
118 | sourceTree = "";
119 | };
120 | 17C814C21BC757D10097AF47 /* unzip */ = {
121 | isa = PBXGroup;
122 | children = (
123 | 17C814C61BC757D10097AF47 /* AppDelegate.h */,
124 | 17C814C71BC757D10097AF47 /* AppDelegate.m */,
125 | 17C814C91BC757D10097AF47 /* ViewController.h */,
126 | 17C814CA1BC757D10097AF47 /* ViewController.m */,
127 | 17C814CC1BC757D10097AF47 /* Main.storyboard */,
128 | 17C814CF1BC757D10097AF47 /* Assets.xcassets */,
129 | 17C814D11BC757D10097AF47 /* LaunchScreen.storyboard */,
130 | 17C814D41BC757D10097AF47 /* Info.plist */,
131 | 17C814C31BC757D10097AF47 /* Supporting Files */,
132 | );
133 | path = unzip;
134 | sourceTree = "";
135 | };
136 | 17C814C31BC757D10097AF47 /* Supporting Files */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 17C814C41BC757D10097AF47 /* main.m */,
140 | );
141 | name = "Supporting Files";
142 | sourceTree = "";
143 | };
144 | 17C814DC1BC757D10097AF47 /* unzipTests */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 17C814DD1BC757D10097AF47 /* unzipTests.m */,
148 | 17C814DF1BC757D10097AF47 /* Info.plist */,
149 | );
150 | path = unzipTests;
151 | sourceTree = "";
152 | };
153 | 17C814E71BC757D10097AF47 /* unzipUITests */ = {
154 | isa = PBXGroup;
155 | children = (
156 | 17C814E81BC757D10097AF47 /* unzipUITests.m */,
157 | 17C814EA1BC757D10097AF47 /* Info.plist */,
158 | );
159 | path = unzipUITests;
160 | sourceTree = "";
161 | };
162 | 79F230FEE2423937611B985F /* Pods */ = {
163 | isa = PBXGroup;
164 | children = (
165 | 169481C9F96767158762C229 /* Pods.debug.xcconfig */,
166 | BBA4957232E743F8AA42F1A6 /* Pods.release.xcconfig */,
167 | );
168 | name = Pods;
169 | sourceTree = "";
170 | };
171 | /* End PBXGroup section */
172 |
173 | /* Begin PBXNativeTarget section */
174 | 17C814BF1BC757D10097AF47 /* unzip */ = {
175 | isa = PBXNativeTarget;
176 | buildConfigurationList = 17C814ED1BC757D10097AF47 /* Build configuration list for PBXNativeTarget "unzip" */;
177 | buildPhases = (
178 | A6B696B6C2BB922C31433473 /* Check Pods Manifest.lock */,
179 | 17C814BC1BC757D10097AF47 /* Sources */,
180 | 17C814BD1BC757D10097AF47 /* Frameworks */,
181 | 17C814BE1BC757D10097AF47 /* Resources */,
182 | B1EBE2E5F2D46FF13998E428 /* Copy Pods Resources */,
183 | );
184 | buildRules = (
185 | );
186 | dependencies = (
187 | );
188 | name = unzip;
189 | productName = unzip;
190 | productReference = 17C814C01BC757D10097AF47 /* unzip.app */;
191 | productType = "com.apple.product-type.application";
192 | };
193 | 17C814D81BC757D10097AF47 /* unzipTests */ = {
194 | isa = PBXNativeTarget;
195 | buildConfigurationList = 17C814F01BC757D10097AF47 /* Build configuration list for PBXNativeTarget "unzipTests" */;
196 | buildPhases = (
197 | 17C814D51BC757D10097AF47 /* Sources */,
198 | 17C814D61BC757D10097AF47 /* Frameworks */,
199 | 17C814D71BC757D10097AF47 /* Resources */,
200 | );
201 | buildRules = (
202 | );
203 | dependencies = (
204 | 17C814DB1BC757D10097AF47 /* PBXTargetDependency */,
205 | );
206 | name = unzipTests;
207 | productName = unzipTests;
208 | productReference = 17C814D91BC757D10097AF47 /* unzipTests.xctest */;
209 | productType = "com.apple.product-type.bundle.unit-test";
210 | };
211 | 17C814E31BC757D10097AF47 /* unzipUITests */ = {
212 | isa = PBXNativeTarget;
213 | buildConfigurationList = 17C814F31BC757D10097AF47 /* Build configuration list for PBXNativeTarget "unzipUITests" */;
214 | buildPhases = (
215 | 17C814E01BC757D10097AF47 /* Sources */,
216 | 17C814E11BC757D10097AF47 /* Frameworks */,
217 | 17C814E21BC757D10097AF47 /* Resources */,
218 | );
219 | buildRules = (
220 | );
221 | dependencies = (
222 | 17C814E61BC757D10097AF47 /* PBXTargetDependency */,
223 | );
224 | name = unzipUITests;
225 | productName = unzipUITests;
226 | productReference = 17C814E41BC757D10097AF47 /* unzipUITests.xctest */;
227 | productType = "com.apple.product-type.bundle.ui-testing";
228 | };
229 | /* End PBXNativeTarget section */
230 |
231 | /* Begin PBXProject section */
232 | 17C814B81BC757D10097AF47 /* Project object */ = {
233 | isa = PBXProject;
234 | attributes = {
235 | LastUpgradeCheck = 0700;
236 | ORGANIZATIONNAME = xiangwenwen;
237 | TargetAttributes = {
238 | 17C814BF1BC757D10097AF47 = {
239 | CreatedOnToolsVersion = 7.0.1;
240 | DevelopmentTeam = V94YS5RCTX;
241 | };
242 | 17C814D81BC757D10097AF47 = {
243 | CreatedOnToolsVersion = 7.0.1;
244 | TestTargetID = 17C814BF1BC757D10097AF47;
245 | };
246 | 17C814E31BC757D10097AF47 = {
247 | CreatedOnToolsVersion = 7.0.1;
248 | TestTargetID = 17C814BF1BC757D10097AF47;
249 | };
250 | };
251 | };
252 | buildConfigurationList = 17C814BB1BC757D10097AF47 /* Build configuration list for PBXProject "unzip" */;
253 | compatibilityVersion = "Xcode 3.2";
254 | developmentRegion = English;
255 | hasScannedForEncodings = 0;
256 | knownRegions = (
257 | en,
258 | Base,
259 | );
260 | mainGroup = 17C814B71BC757D10097AF47;
261 | productRefGroup = 17C814C11BC757D10097AF47 /* Products */;
262 | projectDirPath = "";
263 | projectRoot = "";
264 | targets = (
265 | 17C814BF1BC757D10097AF47 /* unzip */,
266 | 17C814D81BC757D10097AF47 /* unzipTests */,
267 | 17C814E31BC757D10097AF47 /* unzipUITests */,
268 | );
269 | };
270 | /* End PBXProject section */
271 |
272 | /* Begin PBXResourcesBuildPhase section */
273 | 17C814BE1BC757D10097AF47 /* Resources */ = {
274 | isa = PBXResourcesBuildPhase;
275 | buildActionMask = 2147483647;
276 | files = (
277 | 17C814D31BC757D10097AF47 /* LaunchScreen.storyboard in Resources */,
278 | 17C814D01BC757D10097AF47 /* Assets.xcassets in Resources */,
279 | 17C814CE1BC757D10097AF47 /* Main.storyboard in Resources */,
280 | );
281 | runOnlyForDeploymentPostprocessing = 0;
282 | };
283 | 17C814D71BC757D10097AF47 /* Resources */ = {
284 | isa = PBXResourcesBuildPhase;
285 | buildActionMask = 2147483647;
286 | files = (
287 | );
288 | runOnlyForDeploymentPostprocessing = 0;
289 | };
290 | 17C814E21BC757D10097AF47 /* Resources */ = {
291 | isa = PBXResourcesBuildPhase;
292 | buildActionMask = 2147483647;
293 | files = (
294 | );
295 | runOnlyForDeploymentPostprocessing = 0;
296 | };
297 | /* End PBXResourcesBuildPhase section */
298 |
299 | /* Begin PBXShellScriptBuildPhase section */
300 | A6B696B6C2BB922C31433473 /* Check Pods Manifest.lock */ = {
301 | isa = PBXShellScriptBuildPhase;
302 | buildActionMask = 2147483647;
303 | files = (
304 | );
305 | inputPaths = (
306 | );
307 | name = "Check Pods Manifest.lock";
308 | outputPaths = (
309 | );
310 | runOnlyForDeploymentPostprocessing = 0;
311 | shellPath = /bin/sh;
312 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
313 | showEnvVarsInLog = 0;
314 | };
315 | B1EBE2E5F2D46FF13998E428 /* Copy Pods Resources */ = {
316 | isa = PBXShellScriptBuildPhase;
317 | buildActionMask = 2147483647;
318 | files = (
319 | );
320 | inputPaths = (
321 | );
322 | name = "Copy Pods Resources";
323 | outputPaths = (
324 | );
325 | runOnlyForDeploymentPostprocessing = 0;
326 | shellPath = /bin/sh;
327 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
328 | showEnvVarsInLog = 0;
329 | };
330 | /* End PBXShellScriptBuildPhase section */
331 |
332 | /* Begin PBXSourcesBuildPhase section */
333 | 17C814BC1BC757D10097AF47 /* Sources */ = {
334 | isa = PBXSourcesBuildPhase;
335 | buildActionMask = 2147483647;
336 | files = (
337 | 17C814CB1BC757D10097AF47 /* ViewController.m in Sources */,
338 | 17C814C81BC757D10097AF47 /* AppDelegate.m in Sources */,
339 | 17C814C51BC757D10097AF47 /* main.m in Sources */,
340 | );
341 | runOnlyForDeploymentPostprocessing = 0;
342 | };
343 | 17C814D51BC757D10097AF47 /* Sources */ = {
344 | isa = PBXSourcesBuildPhase;
345 | buildActionMask = 2147483647;
346 | files = (
347 | 17C814DE1BC757D10097AF47 /* unzipTests.m in Sources */,
348 | );
349 | runOnlyForDeploymentPostprocessing = 0;
350 | };
351 | 17C814E01BC757D10097AF47 /* Sources */ = {
352 | isa = PBXSourcesBuildPhase;
353 | buildActionMask = 2147483647;
354 | files = (
355 | 17C814E91BC757D10097AF47 /* unzipUITests.m in Sources */,
356 | );
357 | runOnlyForDeploymentPostprocessing = 0;
358 | };
359 | /* End PBXSourcesBuildPhase section */
360 |
361 | /* Begin PBXTargetDependency section */
362 | 17C814DB1BC757D10097AF47 /* PBXTargetDependency */ = {
363 | isa = PBXTargetDependency;
364 | target = 17C814BF1BC757D10097AF47 /* unzip */;
365 | targetProxy = 17C814DA1BC757D10097AF47 /* PBXContainerItemProxy */;
366 | };
367 | 17C814E61BC757D10097AF47 /* PBXTargetDependency */ = {
368 | isa = PBXTargetDependency;
369 | target = 17C814BF1BC757D10097AF47 /* unzip */;
370 | targetProxy = 17C814E51BC757D10097AF47 /* PBXContainerItemProxy */;
371 | };
372 | /* End PBXTargetDependency section */
373 |
374 | /* Begin PBXVariantGroup section */
375 | 17C814CC1BC757D10097AF47 /* Main.storyboard */ = {
376 | isa = PBXVariantGroup;
377 | children = (
378 | 17C814CD1BC757D10097AF47 /* Base */,
379 | );
380 | name = Main.storyboard;
381 | sourceTree = "";
382 | };
383 | 17C814D11BC757D10097AF47 /* LaunchScreen.storyboard */ = {
384 | isa = PBXVariantGroup;
385 | children = (
386 | 17C814D21BC757D10097AF47 /* Base */,
387 | );
388 | name = LaunchScreen.storyboard;
389 | sourceTree = "";
390 | };
391 | /* End PBXVariantGroup section */
392 |
393 | /* Begin XCBuildConfiguration section */
394 | 17C814EB1BC757D10097AF47 /* Debug */ = {
395 | isa = XCBuildConfiguration;
396 | buildSettings = {
397 | ALWAYS_SEARCH_USER_PATHS = NO;
398 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
399 | CLANG_CXX_LIBRARY = "libc++";
400 | CLANG_ENABLE_MODULES = YES;
401 | CLANG_ENABLE_OBJC_ARC = YES;
402 | CLANG_WARN_BOOL_CONVERSION = YES;
403 | CLANG_WARN_CONSTANT_CONVERSION = YES;
404 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
405 | CLANG_WARN_EMPTY_BODY = YES;
406 | CLANG_WARN_ENUM_CONVERSION = YES;
407 | CLANG_WARN_INT_CONVERSION = YES;
408 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
409 | CLANG_WARN_UNREACHABLE_CODE = YES;
410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
411 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
412 | COPY_PHASE_STRIP = NO;
413 | DEBUG_INFORMATION_FORMAT = dwarf;
414 | ENABLE_STRICT_OBJC_MSGSEND = YES;
415 | ENABLE_TESTABILITY = YES;
416 | GCC_C_LANGUAGE_STANDARD = gnu99;
417 | GCC_DYNAMIC_NO_PIC = NO;
418 | GCC_NO_COMMON_BLOCKS = YES;
419 | GCC_OPTIMIZATION_LEVEL = 0;
420 | GCC_PREPROCESSOR_DEFINITIONS = (
421 | "DEBUG=1",
422 | "$(inherited)",
423 | );
424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
426 | GCC_WARN_UNDECLARED_SELECTOR = YES;
427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
428 | GCC_WARN_UNUSED_FUNCTION = YES;
429 | GCC_WARN_UNUSED_VARIABLE = YES;
430 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
431 | MTL_ENABLE_DEBUG_INFO = YES;
432 | ONLY_ACTIVE_ARCH = YES;
433 | SDKROOT = iphoneos;
434 | };
435 | name = Debug;
436 | };
437 | 17C814EC1BC757D10097AF47 /* Release */ = {
438 | isa = XCBuildConfiguration;
439 | buildSettings = {
440 | ALWAYS_SEARCH_USER_PATHS = NO;
441 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
442 | CLANG_CXX_LIBRARY = "libc++";
443 | CLANG_ENABLE_MODULES = YES;
444 | CLANG_ENABLE_OBJC_ARC = YES;
445 | CLANG_WARN_BOOL_CONVERSION = YES;
446 | CLANG_WARN_CONSTANT_CONVERSION = YES;
447 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
448 | CLANG_WARN_EMPTY_BODY = YES;
449 | CLANG_WARN_ENUM_CONVERSION = YES;
450 | CLANG_WARN_INT_CONVERSION = YES;
451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
452 | CLANG_WARN_UNREACHABLE_CODE = YES;
453 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
454 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
455 | COPY_PHASE_STRIP = NO;
456 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
457 | ENABLE_NS_ASSERTIONS = NO;
458 | ENABLE_STRICT_OBJC_MSGSEND = YES;
459 | GCC_C_LANGUAGE_STANDARD = gnu99;
460 | GCC_NO_COMMON_BLOCKS = YES;
461 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
462 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
463 | GCC_WARN_UNDECLARED_SELECTOR = YES;
464 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
465 | GCC_WARN_UNUSED_FUNCTION = YES;
466 | GCC_WARN_UNUSED_VARIABLE = YES;
467 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
468 | MTL_ENABLE_DEBUG_INFO = NO;
469 | SDKROOT = iphoneos;
470 | VALIDATE_PRODUCT = YES;
471 | };
472 | name = Release;
473 | };
474 | 17C814EE1BC757D10097AF47 /* Debug */ = {
475 | isa = XCBuildConfiguration;
476 | baseConfigurationReference = 169481C9F96767158762C229 /* Pods.debug.xcconfig */;
477 | buildSettings = {
478 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
479 | CODE_SIGN_IDENTITY = "iPhone Developer";
480 | INFOPLIST_FILE = unzip/Info.plist;
481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
482 | PRODUCT_BUNDLE_IDENTIFIER = wen.unzip;
483 | PRODUCT_NAME = "$(TARGET_NAME)";
484 | };
485 | name = Debug;
486 | };
487 | 17C814EF1BC757D10097AF47 /* Release */ = {
488 | isa = XCBuildConfiguration;
489 | baseConfigurationReference = BBA4957232E743F8AA42F1A6 /* Pods.release.xcconfig */;
490 | buildSettings = {
491 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
492 | CODE_SIGN_IDENTITY = "iPhone Developer";
493 | INFOPLIST_FILE = unzip/Info.plist;
494 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
495 | PRODUCT_BUNDLE_IDENTIFIER = wen.unzip;
496 | PRODUCT_NAME = "$(TARGET_NAME)";
497 | };
498 | name = Release;
499 | };
500 | 17C814F11BC757D10097AF47 /* Debug */ = {
501 | isa = XCBuildConfiguration;
502 | buildSettings = {
503 | BUNDLE_LOADER = "$(TEST_HOST)";
504 | INFOPLIST_FILE = unzipTests/Info.plist;
505 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
506 | PRODUCT_BUNDLE_IDENTIFIER = wen.unzipTests;
507 | PRODUCT_NAME = "$(TARGET_NAME)";
508 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unzip.app/unzip";
509 | };
510 | name = Debug;
511 | };
512 | 17C814F21BC757D10097AF47 /* Release */ = {
513 | isa = XCBuildConfiguration;
514 | buildSettings = {
515 | BUNDLE_LOADER = "$(TEST_HOST)";
516 | INFOPLIST_FILE = unzipTests/Info.plist;
517 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
518 | PRODUCT_BUNDLE_IDENTIFIER = wen.unzipTests;
519 | PRODUCT_NAME = "$(TARGET_NAME)";
520 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unzip.app/unzip";
521 | };
522 | name = Release;
523 | };
524 | 17C814F41BC757D10097AF47 /* Debug */ = {
525 | isa = XCBuildConfiguration;
526 | buildSettings = {
527 | INFOPLIST_FILE = unzipUITests/Info.plist;
528 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
529 | PRODUCT_BUNDLE_IDENTIFIER = wen.unzipUITests;
530 | PRODUCT_NAME = "$(TARGET_NAME)";
531 | TEST_TARGET_NAME = unzip;
532 | USES_XCTRUNNER = YES;
533 | };
534 | name = Debug;
535 | };
536 | 17C814F51BC757D10097AF47 /* Release */ = {
537 | isa = XCBuildConfiguration;
538 | buildSettings = {
539 | INFOPLIST_FILE = unzipUITests/Info.plist;
540 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
541 | PRODUCT_BUNDLE_IDENTIFIER = wen.unzipUITests;
542 | PRODUCT_NAME = "$(TARGET_NAME)";
543 | TEST_TARGET_NAME = unzip;
544 | USES_XCTRUNNER = YES;
545 | };
546 | name = Release;
547 | };
548 | /* End XCBuildConfiguration section */
549 |
550 | /* Begin XCConfigurationList section */
551 | 17C814BB1BC757D10097AF47 /* Build configuration list for PBXProject "unzip" */ = {
552 | isa = XCConfigurationList;
553 | buildConfigurations = (
554 | 17C814EB1BC757D10097AF47 /* Debug */,
555 | 17C814EC1BC757D10097AF47 /* Release */,
556 | );
557 | defaultConfigurationIsVisible = 0;
558 | defaultConfigurationName = Release;
559 | };
560 | 17C814ED1BC757D10097AF47 /* Build configuration list for PBXNativeTarget "unzip" */ = {
561 | isa = XCConfigurationList;
562 | buildConfigurations = (
563 | 17C814EE1BC757D10097AF47 /* Debug */,
564 | 17C814EF1BC757D10097AF47 /* Release */,
565 | );
566 | defaultConfigurationIsVisible = 0;
567 | defaultConfigurationName = Release;
568 | };
569 | 17C814F01BC757D10097AF47 /* Build configuration list for PBXNativeTarget "unzipTests" */ = {
570 | isa = XCConfigurationList;
571 | buildConfigurations = (
572 | 17C814F11BC757D10097AF47 /* Debug */,
573 | 17C814F21BC757D10097AF47 /* Release */,
574 | );
575 | defaultConfigurationIsVisible = 0;
576 | defaultConfigurationName = Release;
577 | };
578 | 17C814F31BC757D10097AF47 /* Build configuration list for PBXNativeTarget "unzipUITests" */ = {
579 | isa = XCConfigurationList;
580 | buildConfigurations = (
581 | 17C814F41BC757D10097AF47 /* Debug */,
582 | 17C814F51BC757D10097AF47 /* Release */,
583 | );
584 | defaultConfigurationIsVisible = 0;
585 | defaultConfigurationName = Release;
586 | };
587 | /* End XCConfigurationList section */
588 | };
589 | rootObject = 17C814B81BC757D10097AF47 /* Project object */;
590 | }
591 |
--------------------------------------------------------------------------------