├── halfDemoWithoutH5
├── README.md
├── VKSafariDomainBridge.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── Awhisper.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ ├── xcuserdata
│ │ └── Awhisper.xcuserdatad
│ │ │ ├── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── VKSafariDomainBridge.xcscheme
│ │ │ └── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ └── project.pbxproj
└── VKSafariDomainBridge
│ ├── ViewController.h
│ ├── AppDelegate+VKSafariDomainBridge.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── VKSafariDomainBridge.h
│ ├── ViewController.m
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Base.lproj
│ ├── Main.storyboard
│ └── LaunchScreen.storyboard
│ ├── Info.plist
│ ├── AppDelegate+VKSafariDomainBridge.m
│ ├── AppDelegate.m
│ └── VKSafariDomainBridge.m
├── AppDelegate+VKSafariDomainBridge.h
├── VKSafariDomainBridge.h
├── AppDelegate+VKSafariDomainBridge.m
├── README.md
└── VKSafariDomainBridge.m
/halfDemoWithoutH5/README.md:
--------------------------------------------------------------------------------
1 | # 这个demo并不包含H5部分,我不懂H5,只是把项目里和H5伙伴联调好了的功能,把其中iOS部分,扒出来了,基本上就是repo的readme说的那种使用方法
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge.xcodeproj/project.xcworkspace/xcuserdata/Awhisper.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Awhisper/VKSafariDomainBridge/HEAD/halfDemoWithoutH5/VKSafariDomainBridge.xcodeproj/project.xcworkspace/xcuserdata/Awhisper.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/AppDelegate+VKSafariDomainBridge.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate+VKSafariDomainBridge.h
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate (VKSafariDomainBridge)
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/AppDelegate+VKSafariDomainBridge.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate+VKSafariDomainBridge.h
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate (VKSafariDomainBridge)
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. 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 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. 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 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge.xcodeproj/xcuserdata/Awhisper.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | VKSafariDomainBridge.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 6C181A9C1CE2DFF3003852A1
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/VKSafariDomainBridge.h:
--------------------------------------------------------------------------------
1 | //
2 | // VKSafariDomainBridge.h
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void(^VKSafariReturn)(BOOL success,NSString *info);
12 | static NSString * VKSafariInfoReceivedNotification = @"VKSafariInfoReceivedNotification";
13 |
14 | @interface VKSafariDomainBridge : NSObject
15 |
16 | @property (nonatomic,readonly) NSURL *safariUrl;
17 |
18 | @property (nonatomic,strong) NSString *safariKey;
19 |
20 | @property (nonatomic,assign) float timeOut;
21 |
22 | + (void)VKSetupSafariBridgeUrl:(NSURL *)url AndKey:(NSString *)key;
23 |
24 | + (instancetype)VKSingleton;
25 |
26 | -(void)VKGetSafariInfo:(VKSafariReturn)rtBlock;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/VKSafariDomainBridge.h:
--------------------------------------------------------------------------------
1 | //
2 | // VKSafariDomainBridge.h
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void(^VKSafariReturn)(BOOL success,NSString *info);
12 | static NSString * VKSafariInfoReceivedNotification = @"VKSafariInfoReceivedNotification";
13 |
14 | @interface VKSafariDomainBridge : NSObject
15 |
16 | @property (nonatomic,readonly) NSURL *safariUrl;
17 |
18 | @property (nonatomic,strong) NSString *safariKey;
19 |
20 | @property (nonatomic,assign) float timeOut;
21 |
22 | + (void)VKSetupSafariBridgeUrl:(NSURL *)url AndKey:(NSString *)key;
23 |
24 | + (instancetype)VKSingleton;
25 |
26 | -(void)VKGetSafariInfo:(VKSafariReturn)rtBlock;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "VKSafariDomainBridge.h"
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | NSURL *url = [NSURL URLWithString:@"xxx://xxx.xxx.xxx/xxx.xxx"];
20 | [VKSafariDomainBridge VKSetupSafariBridgeUrl:url AndKey:@"safari"];
21 | self.view.backgroundColor = [UIColor greenColor];
22 | // Do any additional setup after loading the view, typically from a nib.
23 | }
24 |
25 | -(void)viewDidAppear:(BOOL)animated
26 | {
27 | [[VKSafariDomainBridge VKSingleton]VKGetSafariInfo:^(BOOL success, NSString *info) {
28 | NSLog(@"%@ status = %@",info,@(success));
29 | }];
30 | }
31 |
32 | - (void)didReceiveMemoryWarning {
33 | [super didReceiveMemoryWarning];
34 | // Dispose of any resources that can be recreated.
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/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 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "83.5x83.5",
66 | "scale" : "2x"
67 | }
68 | ],
69 | "info" : {
70 | "version" : 1,
71 | "author" : "xcode"
72 | }
73 | }
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/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 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/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 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/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 | CFBundleURLTypes
22 |
23 |
24 | CFBundleTypeRole
25 | Editor
26 | CFBundleURLName
27 | yuedu
28 | CFBundleURLSchemes
29 |
30 | bdbook
31 |
32 |
33 |
34 | CFBundleVersion
35 | 1
36 | LSRequiresIPhoneOS
37 |
38 | UILaunchStoryboardName
39 | LaunchScreen
40 | UIMainStoryboardFile
41 | Main
42 | UIRequiredDeviceCapabilities
43 |
44 | armv7
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | UISupportedInterfaceOrientations~ipad
53 |
54 | UIInterfaceOrientationPortrait
55 | UIInterfaceOrientationPortraitUpsideDown
56 | UIInterfaceOrientationLandscapeLeft
57 | UIInterfaceOrientationLandscapeRight
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/AppDelegate+VKSafariDomainBridge.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate+VKSafariDomainBridge.m
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate+VKSafariDomainBridge.h"
10 | #import
11 | #import "VKSafariDomainBridge.h"
12 |
13 | @implementation AppDelegate (VKSafariDomainBridge)
14 |
15 | +(void)load
16 | {
17 |
18 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) {
19 | Class class = [self class];
20 |
21 | SEL origSelector = @selector(application:openURL:options:);
22 | SEL newSelector = @selector(vkApplication:openURL:options:);
23 |
24 | Method origMethod = class_getInstanceMethod(class,origSelector);
25 |
26 | if (!origMethod) {
27 | SEL emptySelector = @selector(vkEmptyApplication:openURL:options:);
28 | Method emptyMethod = class_getInstanceMethod(class,emptySelector);
29 | IMP emptyImp = method_getImplementation(emptyMethod);
30 | class_addMethod(self, origSelector, emptyImp,
31 | method_getTypeEncoding(emptyMethod));
32 | }
33 |
34 | origMethod = class_getInstanceMethod(class,origSelector);
35 | Method newMethod = class_getInstanceMethod(class,newSelector);
36 | if (origMethod && newMethod) {
37 | method_exchangeImplementations(origMethod, newMethod);
38 | }
39 | }
40 | }
41 |
42 | -(BOOL)vkEmptyApplication:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options
43 | {
44 | return NO;
45 | }
46 |
47 | -(BOOL)vkApplication:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary *)options
48 | {
49 | NSString *safariInfoKey = [VKSafariDomainBridge VKSingleton].safariKey;
50 | if ([[url absoluteString]containsString:safariInfoKey]) {
51 | if (url) {
52 | NSDictionary *userInfoDic = @{@"schemeUrl":url};
53 | [[NSNotificationCenter defaultCenter]postNotificationName:VKSafariInfoReceivedNotification object:self userInfo:userInfoDic];
54 | }
55 | return YES;
56 | }else
57 | {
58 | return [self vkApplication:application openURL:url options:options];
59 | }
60 | }
61 | @end
62 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/AppDelegate+VKSafariDomainBridge.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate+VKSafariDomainBridge.m
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate+VKSafariDomainBridge.h"
10 | #import
11 | #import "VKSafariDomainBridge.h"
12 |
13 | @implementation AppDelegate (VKSafariDomainBridge)
14 |
15 | +(void)load
16 | {
17 |
18 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) {
19 | Class class = [self class];
20 |
21 | SEL origSelector = @selector(application:openURL:options:);
22 | SEL newSelector = @selector(vkApplication:openURL:options:);
23 |
24 | Method origMethod = class_getInstanceMethod(class,origSelector);
25 |
26 | if (!origMethod) {
27 | SEL emptySelector = @selector(vkEmptyApplication:openURL:options:);
28 | Method emptyMethod = class_getInstanceMethod(class,emptySelector);
29 | IMP emptyImp = method_getImplementation(emptyMethod);
30 | class_addMethod(self, origSelector, emptyImp,
31 | method_getTypeEncoding(emptyMethod));
32 | }
33 |
34 | origMethod = class_getInstanceMethod(class,origSelector);
35 | Method newMethod = class_getInstanceMethod(class,newSelector);
36 | if (origMethod && newMethod) {
37 | method_exchangeImplementations(origMethod, newMethod);
38 | }
39 | }
40 | }
41 |
42 | -(BOOL)vkEmptyApplication:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options
43 | {
44 | return NO;
45 | }
46 |
47 | -(BOOL)vkApplication:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary *)options
48 | {
49 | NSString *safariInfoKey = [VKSafariDomainBridge VKSingleton].safariKey;
50 | if ([[url absoluteString]containsString:safariInfoKey]) {
51 | if (url) {
52 | NSDictionary *userInfoDic = @{@"schemeUrl":url};
53 | [[NSNotificationCenter defaultCenter]postNotificationName:VKSafariInfoReceivedNotification object:self userInfo:userInfoDic];
54 | }
55 | return YES;
56 | }else
57 | {
58 | return [self vkApplication:application openURL:url options:options];
59 | }
60 | }
61 | @end
62 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. 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 | -(BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary *)options
24 | {
25 | return NO;
26 | }
27 |
28 | - (void)applicationWillResignActive:(UIApplication *)application {
29 | // 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.
30 | // 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.
31 | }
32 |
33 | - (void)applicationDidEnterBackground:(UIApplication *)application {
34 | // 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.
35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
36 | }
37 |
38 | - (void)applicationWillEnterForeground:(UIApplication *)application {
39 | // 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.
40 | }
41 |
42 | - (void)applicationDidBecomeActive:(UIApplication *)application {
43 | // 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.
44 | }
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 这个工具已经不推荐使用了!!
2 |
3 | 原因是,SFViewController的方案在iOS10以后,Openurl事件会以各种方式被系统吞吃掉事件,duplicate事件,等等,因为有了更好的替换方案
4 |
5 | __所以非常非常不推荐继续使用这个SafariAutoLogin方案了__
6 |
7 |
8 | 新的方案请使用剪切板方案,详情看说明
9 |
10 | [iOS app与浏览器深度链接 DeeperLink](http://awhisper.github.io/2016/05/11/iOSBrowserDomainBridge/)
11 |
12 | ># Update 2016.11.23
13 |
14 | >更新一个最新的方案,老文章里面介绍的2个方案都不如这个易操作,唯一的问题是就看iOS10的覆盖率了,覆盖率不够之前下文的`设备指纹方案`可以与这个方案互补
15 |
16 | >- 只支持iOS10以上
17 | >- 通过剪切板
18 | >- 跨越浏览器app与宿主app,传递数据
19 |
20 | >[clipboard.js](https://github.com/zenorocha/clipboard.js)
21 |
22 | >一个1w Star的js库
23 |
24 | >因为iOS10系统给js开放了API可以操作剪切板,因此直接使用这个库,可以很方便的在任何App的webview(包含safari,微信,qq,百度框等)将数据存入剪切板
25 |
26 | >然后很方便的在其他任何app中,读取出剪贴板的数据用于互通
27 |
28 | >这个方案在准确度上,成功率上,适用范围上全面优于下文讨论的`设备指纹`和`SafariViewController方案`
29 |
30 | >忘掉`SafariViewController方案`吧,这个方案现在非常的坑
31 |
32 | >原因是,SFViewController的方案,Openurl事件会以各种方式被系统吞吃掉事件,duplicate等等,都会导致失败率非常的高
33 |
34 | # 以下为原说明文档,不推荐使用,不推荐使用,不推荐使用
35 |
36 |
37 |
38 | 感谢SafariAutoLoginTest这个demo项目提供的思路
39 |
40 | 我把它从demo展示,封装成了易用的工具
41 |
42 | [SafariAutoLoginTest Github地址](https://github.com/mackuba/SafariAutoLoginTest)
43 |
44 | # VKSafariDomainBridge
45 |
46 | 按理说整个流程应该分为2部分
47 |
48 | - wap页面功能:
49 | - 用户浏览wap页的存cookie (wap地址1,用户访问用的)
50 | - 隐藏safari浏览的读cookie页面(wap地址2,静默代码访问用的)
51 | - 隐藏safari跳转openurl功能
52 | - app内功能:
53 | - 打开隐藏safari
54 | - 收听openurl的回调,处理数据
55 | - 关闭隐藏safari
56 |
57 | 鉴于实在是不会h5相关的开发,所以我封装的工具就只包含app内的功能,H5部分已经与朋友联调通过,确认可行
58 |
59 | ```objectivec
60 | //初始化 VKSafariDomainBridge
61 | NSURL *url = [NSURL URLWithString:@"wap地址2,静默代码访问用的url"];
62 | NSString *key = @"xxkey"
63 | [VKSafariDomainBridge VKSetupSafariBridgeUrl:url AndKey:key];
64 | ```
65 | url的地址就是`wap地址2,静默代码访问用的`
66 | key作为协议识别关键字,隐藏safari发起的跳转,通过这个key识别,才会走入VKSafariDomainBridge的处理逻辑,如果是其他正规渠道的openurl跳转,key不匹配,便直接走正常逻辑,不会进行VKSafariDomainBridge处理
67 |
68 | 想要获取wap用户数据的时候
69 |
70 | ```objectivec
71 | [[VKSafariDomainBridge VKSingleton]VKGetSafariInfo:^(BOOL success, NSString *info) {
72 | NSLog(@"%@ status = %@",info,@(success));
73 | }];
74 | ```
75 | 通过回调,如果成功success会返回YES,并且整个跳转含有数据的url会被转成string,通过block返回,如果失败,则会返回NO
76 |
77 | # application:openURL:options:处理
78 |
79 | 整个工具需要通过appdelegate的openurl回调来实现,因此写成category形式,只要导入工程,便可以一行代码不需要写,自动生效。
80 |
81 | `application:openURL:options:`这个方法,如果没有在工程中用到,会自动添加,保证了openurl回调可以正常工作。
82 |
83 | 如果已经在工程中使用,已经有很多openurl协议要处理了,那么我的category会生成一个新方法,交换掉老的系统函数(MethodSwizzling),先判断url协议里是否含有上面提到的专属`Key`,含有则走我的处理逻辑,如果不含有,调用老函数,保证原项目功能无异常。
84 |
--------------------------------------------------------------------------------
/VKSafariDomainBridge.m:
--------------------------------------------------------------------------------
1 | //
2 | // VKSafariDomainBridge.m
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import "VKSafariDomainBridge.h"
10 | #import
11 | #import
12 | @interface VKSafariDomainBridge ()
13 |
14 | @property (nonatomic,copy) VKSafariReturn rtblock;
15 | @property (nonatomic,strong) SFSafariViewController *safari;
16 | @property (nonatomic,strong) NSURL *safariUrl;
17 |
18 | @end
19 |
20 | @implementation VKSafariDomainBridge
21 |
22 | static VKSafariDomainBridge *__vksingleton__;
23 |
24 |
25 | +(void)VKSetupSafariBridgeUrl:(NSURL *)url AndKey:(NSString *)key
26 | {
27 | if (url && key) {
28 | [self VKSingleton];
29 | [[self VKSingleton]setSafariUrl:url];
30 | [[self VKSingleton]setSafariKey:key];
31 | }
32 | }
33 |
34 | + (instancetype)VKSingleton
35 | {
36 | static dispatch_once_t once;
37 | dispatch_once(&once, ^{
38 | __vksingleton__ = [[self alloc] init];
39 | });
40 | return __vksingleton__;
41 | }
42 |
43 | -(instancetype)init
44 | {
45 | self = [super init];
46 | if (self) {
47 | self.timeOut = 30.0f;
48 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) {
49 | [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(VKSafariInfoRecieved:) name:VKSafariInfoReceivedNotification object:nil];
50 | }
51 |
52 | }
53 | return self;
54 | }
55 |
56 |
57 | -(void)VKGetSafariInfo:(VKSafariReturn)rtBlock
58 | {
59 | if (__vksingleton__.safariUrl && __vksingleton__.safariKey) {
60 |
61 | }else
62 | {
63 | rtBlock(NO,nil);
64 | }
65 |
66 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) {
67 | if (rtBlock) {
68 | self.rtblock = rtBlock;
69 |
70 | SFSafariViewController *safari = [[SFSafariViewController alloc]initWithURL:self.safariUrl];
71 | safari.delegate = self;
72 | safari.modalPresentationStyle = UIModalPresentationOverCurrentContext;
73 | safari.view.alpha = 0.0f;
74 | safari.view.userInteractionEnabled = NO;
75 | self.safari = safari;
76 |
77 | [[[UIApplication sharedApplication] keyWindow] addSubview:safari.view];
78 |
79 | }
80 | }else
81 | {
82 | if (rtBlock) {
83 | rtBlock(NO,nil);
84 | }
85 | }
86 |
87 | }
88 |
89 | -(void)safariViewController:(SFSafariViewController *)controller didCompleteInitialLoad:(BOOL)didLoadSuccessfully{
90 | __weak typeof(self) weakself = self;
91 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.timeOut * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
92 | [weakself VKTimeOut];
93 | [weakself.safari.view removeFromSuperview];
94 | weakself.safari = nil;
95 | });
96 |
97 | }
98 |
99 |
100 | -(void)VKSafariInfoRecieved:(NSNotification *)noti
101 | {
102 | NSDictionary *userInfo = noti.userInfo;
103 | NSURL *schemeurl = [userInfo objectForKey:@"schemeUrl"];
104 | NSString *encodeUrl = schemeurl.absoluteString;
105 | NSString *decodeUrl = [encodeUrl stringByRemovingPercentEncoding];
106 | if (self.rtblock) {
107 | self.rtblock(YES,decodeUrl);
108 | self.rtblock = nil;
109 | }
110 | }
111 |
112 | -(void)VKTimeOut
113 | {
114 | if (self.rtblock) {
115 | self.rtblock(NO,nil);
116 | self.rtblock = nil;
117 | }
118 | }
119 |
120 | @end
121 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge/VKSafariDomainBridge.m:
--------------------------------------------------------------------------------
1 | //
2 | // VKSafariDomainBridge.m
3 | // VKSafariDomainBridge
4 | //
5 | // Created by Awhisper on 16/5/11.
6 | // Copyright © 2016年 baidu. All rights reserved.
7 | //
8 |
9 | #import "VKSafariDomainBridge.h"
10 | #import
11 | #import
12 | @interface VKSafariDomainBridge ()
13 |
14 | @property (nonatomic,copy) VKSafariReturn rtblock;
15 | @property (nonatomic,strong) SFSafariViewController *safari;
16 | @property (nonatomic,strong) NSURL *safariUrl;
17 |
18 | @end
19 |
20 | @implementation VKSafariDomainBridge
21 |
22 | static VKSafariDomainBridge *__vksingleton__;
23 |
24 |
25 | +(void)VKSetupSafariBridgeUrl:(NSURL *)url AndKey:(NSString *)key
26 | {
27 | if (url && key) {
28 | [self VKSingleton];
29 | [[self VKSingleton]setSafariUrl:url];
30 | [[self VKSingleton]setSafariKey:key];
31 | }
32 | }
33 |
34 | + (instancetype)VKSingleton
35 | {
36 | static dispatch_once_t once;
37 | dispatch_once(&once, ^{
38 | __vksingleton__ = [[self alloc] init];
39 | });
40 | return __vksingleton__;
41 | }
42 |
43 | -(instancetype)init
44 | {
45 | self = [super init];
46 | if (self) {
47 | self.timeOut = 30.0f;
48 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) {
49 | [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(VKSafariInfoRecieved:) name:VKSafariInfoReceivedNotification object:nil];
50 | }
51 |
52 | }
53 | return self;
54 | }
55 |
56 |
57 | -(void)VKGetSafariInfo:(VKSafariReturn)rtBlock
58 | {
59 | if (__vksingleton__.safariUrl && __vksingleton__.safariKey) {
60 |
61 | }else
62 | {
63 | rtBlock(NO,nil);
64 | }
65 |
66 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) {
67 | if (rtBlock) {
68 | self.rtblock = rtBlock;
69 |
70 | SFSafariViewController *safari = [[SFSafariViewController alloc]initWithURL:self.safariUrl];
71 | safari.delegate = self;
72 | safari.modalPresentationStyle = UIModalPresentationOverCurrentContext;
73 | safari.view.alpha = 0.0f;
74 | safari.view.userInteractionEnabled = NO;
75 | self.safari = safari;
76 |
77 | [[[UIApplication sharedApplication] keyWindow] addSubview:safari.view];
78 |
79 | }
80 | }else
81 | {
82 | if (rtBlock) {
83 | rtBlock(NO,nil);
84 | }
85 | }
86 |
87 | }
88 |
89 | -(void)safariViewController:(SFSafariViewController *)controller didCompleteInitialLoad:(BOOL)didLoadSuccessfully{
90 | __weak typeof(self) weakself = self;
91 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.timeOut * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
92 | [weakself VKTimeOut];
93 | [weakself.safari.view removeFromSuperview];
94 | weakself.safari = nil;
95 | });
96 |
97 | }
98 |
99 |
100 | -(void)VKSafariInfoRecieved:(NSNotification *)noti
101 | {
102 | NSDictionary *userInfo = noti.userInfo;
103 | NSURL *schemeurl = [userInfo objectForKey:@"schemeUrl"];
104 | NSString *encodeUrl = schemeurl.absoluteString;
105 | NSString *decodeUrl = [encodeUrl stringByRemovingPercentEncoding];
106 | if (self.rtblock) {
107 | self.rtblock(YES,decodeUrl);
108 | self.rtblock = nil;
109 | }
110 | }
111 |
112 | -(void)VKTimeOut
113 | {
114 | if (self.rtblock) {
115 | self.rtblock(NO,nil);
116 | self.rtblock = nil;
117 | }
118 | }
119 |
120 | @end
121 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge.xcodeproj/xcuserdata/Awhisper.xcuserdatad/xcschemes/VKSafariDomainBridge.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 6C181AA21CE2DFF3003852A1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C181AA11CE2DFF3003852A1 /* main.m */; };
11 | 6C181AA51CE2DFF3003852A1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C181AA41CE2DFF3003852A1 /* AppDelegate.m */; };
12 | 6C181AA81CE2DFF3003852A1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C181AA71CE2DFF3003852A1 /* ViewController.m */; };
13 | 6C181AAB1CE2DFF3003852A1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6C181AA91CE2DFF3003852A1 /* Main.storyboard */; };
14 | 6C181AAD1CE2DFF3003852A1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6C181AAC1CE2DFF3003852A1 /* Assets.xcassets */; };
15 | 6C181AB01CE2DFF3003852A1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6C181AAE1CE2DFF3003852A1 /* LaunchScreen.storyboard */; };
16 | 6C181ABA1CE2E214003852A1 /* VKSafariDomainBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C181AB91CE2E213003852A1 /* VKSafariDomainBridge.m */; };
17 | 6C181ABD1CE2E2BE003852A1 /* AppDelegate+VKSafariDomainBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C181ABC1CE2E2BE003852A1 /* AppDelegate+VKSafariDomainBridge.m */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXFileReference section */
21 | 6C181A9D1CE2DFF3003852A1 /* VKSafariDomainBridge.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VKSafariDomainBridge.app; sourceTree = BUILT_PRODUCTS_DIR; };
22 | 6C181AA11CE2DFF3003852A1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
23 | 6C181AA31CE2DFF3003852A1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
24 | 6C181AA41CE2DFF3003852A1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
25 | 6C181AA61CE2DFF3003852A1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
26 | 6C181AA71CE2DFF3003852A1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
27 | 6C181AAA1CE2DFF3003852A1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
28 | 6C181AAC1CE2DFF3003852A1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
29 | 6C181AAF1CE2DFF3003852A1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
30 | 6C181AB11CE2DFF3003852A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | 6C181AB81CE2E213003852A1 /* VKSafariDomainBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VKSafariDomainBridge.h; sourceTree = ""; };
32 | 6C181AB91CE2E213003852A1 /* VKSafariDomainBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VKSafariDomainBridge.m; sourceTree = ""; };
33 | 6C181ABB1CE2E2BE003852A1 /* AppDelegate+VKSafariDomainBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+VKSafariDomainBridge.h"; sourceTree = ""; };
34 | 6C181ABC1CE2E2BE003852A1 /* AppDelegate+VKSafariDomainBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+VKSafariDomainBridge.m"; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | 6C181A9A1CE2DFF3003852A1 /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | );
43 | runOnlyForDeploymentPostprocessing = 0;
44 | };
45 | /* End PBXFrameworksBuildPhase section */
46 |
47 | /* Begin PBXGroup section */
48 | 6C181A941CE2DFF3003852A1 = {
49 | isa = PBXGroup;
50 | children = (
51 | 6C181A9F1CE2DFF3003852A1 /* VKSafariDomainBridge */,
52 | 6C181A9E1CE2DFF3003852A1 /* Products */,
53 | );
54 | sourceTree = "";
55 | };
56 | 6C181A9E1CE2DFF3003852A1 /* Products */ = {
57 | isa = PBXGroup;
58 | children = (
59 | 6C181A9D1CE2DFF3003852A1 /* VKSafariDomainBridge.app */,
60 | );
61 | name = Products;
62 | sourceTree = "";
63 | };
64 | 6C181A9F1CE2DFF3003852A1 /* VKSafariDomainBridge */ = {
65 | isa = PBXGroup;
66 | children = (
67 | 6C181AA31CE2DFF3003852A1 /* AppDelegate.h */,
68 | 6C181AA41CE2DFF3003852A1 /* AppDelegate.m */,
69 | 6C181AA61CE2DFF3003852A1 /* ViewController.h */,
70 | 6C181AA71CE2DFF3003852A1 /* ViewController.m */,
71 | 6C181AB81CE2E213003852A1 /* VKSafariDomainBridge.h */,
72 | 6C181AB91CE2E213003852A1 /* VKSafariDomainBridge.m */,
73 | 6C181ABB1CE2E2BE003852A1 /* AppDelegate+VKSafariDomainBridge.h */,
74 | 6C181ABC1CE2E2BE003852A1 /* AppDelegate+VKSafariDomainBridge.m */,
75 | 6C181AA91CE2DFF3003852A1 /* Main.storyboard */,
76 | 6C181AAC1CE2DFF3003852A1 /* Assets.xcassets */,
77 | 6C181AAE1CE2DFF3003852A1 /* LaunchScreen.storyboard */,
78 | 6C181AB11CE2DFF3003852A1 /* Info.plist */,
79 | 6C181AA01CE2DFF3003852A1 /* Supporting Files */,
80 | );
81 | path = VKSafariDomainBridge;
82 | sourceTree = "";
83 | };
84 | 6C181AA01CE2DFF3003852A1 /* Supporting Files */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 6C181AA11CE2DFF3003852A1 /* main.m */,
88 | );
89 | name = "Supporting Files";
90 | sourceTree = "";
91 | };
92 | /* End PBXGroup section */
93 |
94 | /* Begin PBXNativeTarget section */
95 | 6C181A9C1CE2DFF3003852A1 /* VKSafariDomainBridge */ = {
96 | isa = PBXNativeTarget;
97 | buildConfigurationList = 6C181AB41CE2DFF3003852A1 /* Build configuration list for PBXNativeTarget "VKSafariDomainBridge" */;
98 | buildPhases = (
99 | 6C181A991CE2DFF3003852A1 /* Sources */,
100 | 6C181A9A1CE2DFF3003852A1 /* Frameworks */,
101 | 6C181A9B1CE2DFF3003852A1 /* Resources */,
102 | );
103 | buildRules = (
104 | );
105 | dependencies = (
106 | );
107 | name = VKSafariDomainBridge;
108 | productName = VKSafariDomainBridge;
109 | productReference = 6C181A9D1CE2DFF3003852A1 /* VKSafariDomainBridge.app */;
110 | productType = "com.apple.product-type.application";
111 | };
112 | /* End PBXNativeTarget section */
113 |
114 | /* Begin PBXProject section */
115 | 6C181A951CE2DFF3003852A1 /* Project object */ = {
116 | isa = PBXProject;
117 | attributes = {
118 | LastUpgradeCheck = 0720;
119 | ORGANIZATIONNAME = baidu;
120 | TargetAttributes = {
121 | 6C181A9C1CE2DFF3003852A1 = {
122 | CreatedOnToolsVersion = 7.2.1;
123 | };
124 | };
125 | };
126 | buildConfigurationList = 6C181A981CE2DFF3003852A1 /* Build configuration list for PBXProject "VKSafariDomainBridge" */;
127 | compatibilityVersion = "Xcode 3.2";
128 | developmentRegion = English;
129 | hasScannedForEncodings = 0;
130 | knownRegions = (
131 | en,
132 | Base,
133 | );
134 | mainGroup = 6C181A941CE2DFF3003852A1;
135 | productRefGroup = 6C181A9E1CE2DFF3003852A1 /* Products */;
136 | projectDirPath = "";
137 | projectRoot = "";
138 | targets = (
139 | 6C181A9C1CE2DFF3003852A1 /* VKSafariDomainBridge */,
140 | );
141 | };
142 | /* End PBXProject section */
143 |
144 | /* Begin PBXResourcesBuildPhase section */
145 | 6C181A9B1CE2DFF3003852A1 /* Resources */ = {
146 | isa = PBXResourcesBuildPhase;
147 | buildActionMask = 2147483647;
148 | files = (
149 | 6C181AB01CE2DFF3003852A1 /* LaunchScreen.storyboard in Resources */,
150 | 6C181AAD1CE2DFF3003852A1 /* Assets.xcassets in Resources */,
151 | 6C181AAB1CE2DFF3003852A1 /* Main.storyboard in Resources */,
152 | );
153 | runOnlyForDeploymentPostprocessing = 0;
154 | };
155 | /* End PBXResourcesBuildPhase section */
156 |
157 | /* Begin PBXSourcesBuildPhase section */
158 | 6C181A991CE2DFF3003852A1 /* Sources */ = {
159 | isa = PBXSourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | 6C181ABD1CE2E2BE003852A1 /* AppDelegate+VKSafariDomainBridge.m in Sources */,
163 | 6C181AA81CE2DFF3003852A1 /* ViewController.m in Sources */,
164 | 6C181ABA1CE2E214003852A1 /* VKSafariDomainBridge.m in Sources */,
165 | 6C181AA51CE2DFF3003852A1 /* AppDelegate.m in Sources */,
166 | 6C181AA21CE2DFF3003852A1 /* main.m in Sources */,
167 | );
168 | runOnlyForDeploymentPostprocessing = 0;
169 | };
170 | /* End PBXSourcesBuildPhase section */
171 |
172 | /* Begin PBXVariantGroup section */
173 | 6C181AA91CE2DFF3003852A1 /* Main.storyboard */ = {
174 | isa = PBXVariantGroup;
175 | children = (
176 | 6C181AAA1CE2DFF3003852A1 /* Base */,
177 | );
178 | name = Main.storyboard;
179 | sourceTree = "";
180 | };
181 | 6C181AAE1CE2DFF3003852A1 /* LaunchScreen.storyboard */ = {
182 | isa = PBXVariantGroup;
183 | children = (
184 | 6C181AAF1CE2DFF3003852A1 /* Base */,
185 | );
186 | name = LaunchScreen.storyboard;
187 | sourceTree = "";
188 | };
189 | /* End PBXVariantGroup section */
190 |
191 | /* Begin XCBuildConfiguration section */
192 | 6C181AB21CE2DFF3003852A1 /* Debug */ = {
193 | isa = XCBuildConfiguration;
194 | buildSettings = {
195 | ALWAYS_SEARCH_USER_PATHS = NO;
196 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
197 | CLANG_CXX_LIBRARY = "libc++";
198 | CLANG_ENABLE_MODULES = YES;
199 | CLANG_ENABLE_OBJC_ARC = YES;
200 | CLANG_WARN_BOOL_CONVERSION = YES;
201 | CLANG_WARN_CONSTANT_CONVERSION = YES;
202 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
203 | CLANG_WARN_EMPTY_BODY = YES;
204 | CLANG_WARN_ENUM_CONVERSION = YES;
205 | CLANG_WARN_INT_CONVERSION = YES;
206 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
207 | CLANG_WARN_UNREACHABLE_CODE = YES;
208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
209 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
210 | COPY_PHASE_STRIP = NO;
211 | DEBUG_INFORMATION_FORMAT = dwarf;
212 | ENABLE_STRICT_OBJC_MSGSEND = YES;
213 | ENABLE_TESTABILITY = YES;
214 | GCC_C_LANGUAGE_STANDARD = gnu99;
215 | GCC_DYNAMIC_NO_PIC = NO;
216 | GCC_NO_COMMON_BLOCKS = YES;
217 | GCC_OPTIMIZATION_LEVEL = 0;
218 | GCC_PREPROCESSOR_DEFINITIONS = (
219 | "DEBUG=1",
220 | "$(inherited)",
221 | );
222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
224 | GCC_WARN_UNDECLARED_SELECTOR = YES;
225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
226 | GCC_WARN_UNUSED_FUNCTION = YES;
227 | GCC_WARN_UNUSED_VARIABLE = YES;
228 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
229 | MTL_ENABLE_DEBUG_INFO = YES;
230 | ONLY_ACTIVE_ARCH = YES;
231 | SDKROOT = iphoneos;
232 | TARGETED_DEVICE_FAMILY = "1,2";
233 | };
234 | name = Debug;
235 | };
236 | 6C181AB31CE2DFF3003852A1 /* Release */ = {
237 | isa = XCBuildConfiguration;
238 | buildSettings = {
239 | ALWAYS_SEARCH_USER_PATHS = NO;
240 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
241 | CLANG_CXX_LIBRARY = "libc++";
242 | CLANG_ENABLE_MODULES = YES;
243 | CLANG_ENABLE_OBJC_ARC = YES;
244 | CLANG_WARN_BOOL_CONVERSION = YES;
245 | CLANG_WARN_CONSTANT_CONVERSION = YES;
246 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
247 | CLANG_WARN_EMPTY_BODY = YES;
248 | CLANG_WARN_ENUM_CONVERSION = YES;
249 | CLANG_WARN_INT_CONVERSION = YES;
250 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
251 | CLANG_WARN_UNREACHABLE_CODE = YES;
252 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
253 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
254 | COPY_PHASE_STRIP = NO;
255 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
256 | ENABLE_NS_ASSERTIONS = NO;
257 | ENABLE_STRICT_OBJC_MSGSEND = YES;
258 | GCC_C_LANGUAGE_STANDARD = gnu99;
259 | GCC_NO_COMMON_BLOCKS = YES;
260 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
261 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
262 | GCC_WARN_UNDECLARED_SELECTOR = YES;
263 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
264 | GCC_WARN_UNUSED_FUNCTION = YES;
265 | GCC_WARN_UNUSED_VARIABLE = YES;
266 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
267 | MTL_ENABLE_DEBUG_INFO = NO;
268 | SDKROOT = iphoneos;
269 | TARGETED_DEVICE_FAMILY = "1,2";
270 | VALIDATE_PRODUCT = YES;
271 | };
272 | name = Release;
273 | };
274 | 6C181AB51CE2DFF3003852A1 /* Debug */ = {
275 | isa = XCBuildConfiguration;
276 | buildSettings = {
277 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
278 | INFOPLIST_FILE = VKSafariDomainBridge/Info.plist;
279 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
280 | PRODUCT_BUNDLE_IDENTIFIER = com.baidu.VKSafariDomainBridge;
281 | PRODUCT_NAME = "$(TARGET_NAME)";
282 | };
283 | name = Debug;
284 | };
285 | 6C181AB61CE2DFF3003852A1 /* Release */ = {
286 | isa = XCBuildConfiguration;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | INFOPLIST_FILE = VKSafariDomainBridge/Info.plist;
290 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
291 | PRODUCT_BUNDLE_IDENTIFIER = com.baidu.VKSafariDomainBridge;
292 | PRODUCT_NAME = "$(TARGET_NAME)";
293 | };
294 | name = Release;
295 | };
296 | /* End XCBuildConfiguration section */
297 |
298 | /* Begin XCConfigurationList section */
299 | 6C181A981CE2DFF3003852A1 /* Build configuration list for PBXProject "VKSafariDomainBridge" */ = {
300 | isa = XCConfigurationList;
301 | buildConfigurations = (
302 | 6C181AB21CE2DFF3003852A1 /* Debug */,
303 | 6C181AB31CE2DFF3003852A1 /* Release */,
304 | );
305 | defaultConfigurationIsVisible = 0;
306 | defaultConfigurationName = Release;
307 | };
308 | 6C181AB41CE2DFF3003852A1 /* Build configuration list for PBXNativeTarget "VKSafariDomainBridge" */ = {
309 | isa = XCConfigurationList;
310 | buildConfigurations = (
311 | 6C181AB51CE2DFF3003852A1 /* Debug */,
312 | 6C181AB61CE2DFF3003852A1 /* Release */,
313 | );
314 | defaultConfigurationIsVisible = 0;
315 | defaultConfigurationName = Release;
316 | };
317 | /* End XCConfigurationList section */
318 | };
319 | rootObject = 6C181A951CE2DFF3003852A1 /* Project object */;
320 | }
321 |
--------------------------------------------------------------------------------
/halfDemoWithoutH5/VKSafariDomainBridge.xcodeproj/xcuserdata/Awhisper.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
24 |
36 |
37 |
38 |
40 |
52 |
53 |
54 |
56 |
68 |
69 |
70 |
72 |
84 |
85 |
99 |
100 |
114 |
115 |
116 |
117 |
118 |
120 |
132 |
133 |
134 |
136 |
148 |
149 |
163 |
164 |
178 |
179 |
180 |
181 |
182 |
184 |
196 |
197 |
198 |
200 |
212 |
213 |
214 |
216 |
228 |
229 |
243 |
244 |
258 |
259 |
260 |
261 |
262 |
264 |
276 |
277 |
278 |
280 |
292 |
293 |
294 |
296 |
308 |
309 |
310 |
312 |
324 |
325 |
326 |
327 |
328 |
--------------------------------------------------------------------------------