lizhihui

海南游爱 iOS SDK

Showing 141 changed files with 7395 additions and 0 deletions
No preview for this file type
No preview for this file type
No preview for this file type
1 +// !$*UTF8*$!
2 +{
3 + archiveVersion = 1;
4 + classes = {
5 + };
6 + objectVersion = 46;
7 + objects = {
8 +
9 +/* Begin PBXBuildFile section */
10 + 2622C83022002B3300BF5D56 /* HNYouai.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2622C82F22002B3300BF5D56 /* HNYouai.framework */; };
11 + 269F653821B6613F006AEC88 /* HaiBaoJuheSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */; };
12 + 845D18221C8D778400F27EB9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 845D181B1C8D778400F27EB9 /* Images.xcassets */; };
13 + 846BD2241EE9342700E89A1D /* haibao_setting in Resources */ = {isa = PBXBuildFile; fileRef = 846BD21F1EE9342700E89A1D /* haibao_setting */; };
14 + 846BD2261EE9342700E89A1D /* SDKInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 846BD2231EE9342700E89A1D /* SDKInterface.m */; };
15 + 847EE5E21EE9007E003A4B7B /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 847EE5E11EE9007E003A4B7B /* MainViewController.m */; };
16 + 8484E4F51EE7E0DC00B402D1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8484E4F21EE7E0DC00B402D1 /* AppDelegate.m */; };
17 + 8484E4F61EE7E0DC00B402D1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8484E4F41EE7E0DC00B402D1 /* ViewController.m */; };
18 + 8484E4FC1EE7E1D800B402D1 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E4FB1EE7E1D800B402D1 /* libsqlite3.dylib */; };
19 + 8484E4FE1EE7E1F700B402D1 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E4FD1EE7E1F700B402D1 /* CoreTelephony.framework */; };
20 + 8484E5001EE7E20C00B402D1 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E4FF1EE7E20C00B402D1 /* CFNetwork.framework */; };
21 + 8484E5021EE7E21F00B402D1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5011EE7E21F00B402D1 /* UIKit.framework */; };
22 + 8484E5041EE7E24400B402D1 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5031EE7E24400B402D1 /* StoreKit.framework */; };
23 + 8484E5061EE7E24A00B402D1 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5051EE7E24A00B402D1 /* CoreMotion.framework */; };
24 + 8484E5081EE7E25600B402D1 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5071EE7E25600B402D1 /* CoreText.framework */; };
25 + 8484E50A1EE7E26200B402D1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5091EE7E26200B402D1 /* Security.framework */; };
26 + 8484E50C1EE7E27100B402D1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E50B1EE7E27100B402D1 /* CoreGraphics.framework */; };
27 + 8484E50E1EE7E28000B402D1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E50D1EE7E28000B402D1 /* QuartzCore.framework */; };
28 + 8484E5101EE7E29A00B402D1 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E50F1EE7E29A00B402D1 /* libc++.1.dylib */; };
29 + 8484E5121EE7E2B800B402D1 /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5111EE7E2B800B402D1 /* libz.1.dylib */; };
30 + 8484E5141EE7E2DE00B402D1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5131EE7E2DE00B402D1 /* Foundation.framework */; };
31 + 8484E5161EE7E36800B402D1 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5151EE7E36800B402D1 /* SystemConfiguration.framework */; };
32 + 84A090AB1F160A69003D23FB /* TrackingIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84A090AA1F160A69003D23FB /* TrackingIO.a */; };
33 + BB5F3C8E1C1811BC00DA339D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BB5F3C8D1C1811BC00DA339D /* main.m */; };
34 + BB5F3C971C1811BC00DA339D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BB5F3C951C1811BC00DA339D /* Main.storyboard */; };
35 + BB5F3CA81C1811BC00DA339D /* DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BB5F3CA71C1811BC00DA339D /* DemoTests.m */; };
36 +/* End PBXBuildFile section */
37 +
38 +/* Begin PBXContainerItemProxy section */
39 + BB5F3CA21C1811BC00DA339D /* PBXContainerItemProxy */ = {
40 + isa = PBXContainerItemProxy;
41 + containerPortal = BB5F3C801C1811BC00DA339D /* Project object */;
42 + proxyType = 1;
43 + remoteGlobalIDString = BB5F3C871C1811BC00DA339D;
44 + remoteInfo = Demo;
45 + };
46 +/* End PBXContainerItemProxy section */
47 +
48 +/* Begin PBXCopyFilesBuildPhase section */
49 + 84398BFB1C4C83EC0082D774 /* Embed Frameworks */ = {
50 + isa = PBXCopyFilesBuildPhase;
51 + buildActionMask = 2147483647;
52 + dstPath = "";
53 + dstSubfolderSpec = 10;
54 + files = (
55 + );
56 + name = "Embed Frameworks";
57 + runOnlyForDeploymentPostprocessing = 0;
58 + };
59 +/* End PBXCopyFilesBuildPhase section */
60 +
61 +/* Begin PBXFileReference section */
62 + 2622C82F22002B3300BF5D56 /* HNYouai.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = HNYouai.framework; sourceTree = "<group>"; };
63 + 269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = HaiBaoJuheSDK.framework; sourceTree = "<group>"; };
64 + 845D181B1C8D778400F27EB9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = poolsdk_file/poolsdk/Images.xcassets; sourceTree = "<group>"; };
65 + 845D181C1C8D778400F27EB9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = poolsdk_file/poolsdk/Info.plist; sourceTree = "<group>"; };
66 + 846BD21F1EE9342700E89A1D /* haibao_setting */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = haibao_setting; path = poolsdk_file/poolsdk/haibao_setting; sourceTree = "<group>"; };
67 + 846BD2221EE9342700E89A1D /* SDKInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDKInterface.h; path = poolsdk_file/poolsdk/SDKInterface.h; sourceTree = "<group>"; };
68 + 846BD2231EE9342700E89A1D /* SDKInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDKInterface.m; path = poolsdk_file/poolsdk/SDKInterface.m; sourceTree = "<group>"; };
69 + 847EE5E01EE9007E003A4B7B /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
70 + 847EE5E11EE9007E003A4B7B /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
71 + 8484E4F11EE7E0DC00B402D1 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
72 + 8484E4F21EE7E0DC00B402D1 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
73 + 8484E4F31EE7E0DC00B402D1 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
74 + 8484E4F41EE7E0DC00B402D1 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
75 + 8484E4FB1EE7E1D800B402D1 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = ../../../../../../../../usr/lib/libsqlite3.dylib; sourceTree = "<group>"; };
76 + 8484E4FD1EE7E1F700B402D1 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
77 + 8484E4FF1EE7E20C00B402D1 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
78 + 8484E5011EE7E21F00B402D1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
79 + 8484E5031EE7E24400B402D1 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
80 + 8484E5051EE7E24A00B402D1 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
81 + 8484E5071EE7E25600B402D1 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
82 + 8484E5091EE7E26200B402D1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
83 + 8484E50B1EE7E27100B402D1 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
84 + 8484E50D1EE7E28000B402D1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
85 + 8484E50F1EE7E29A00B402D1 /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "../../../../../../../../usr/lib/libc++.1.dylib"; sourceTree = "<group>"; };
86 + 8484E5111EE7E2B800B402D1 /* libz.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.dylib; path = ../../../../../../../../usr/lib/libz.1.dylib; sourceTree = "<group>"; };
87 + 8484E5131EE7E2DE00B402D1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
88 + 8484E5151EE7E36800B402D1 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
89 + 84A090AA1F160A69003D23FB /* TrackingIO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = TrackingIO.a; path = poolsdk_file/poolsdk/TrackingIO.a; sourceTree = "<group>"; };
90 + 84A090AC1F174E21003D23FB /* TrackingIO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TrackingIO.h; path = poolsdk_file/poolsdk/TrackingIO.h; sourceTree = "<group>"; };
91 + BB5F3C881C1811BC00DA339D /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
92 + BB5F3C8D1C1811BC00DA339D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
93 + BB5F3C961C1811BC00DA339D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
94 + BB5F3C9B1C1811BC00DA339D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
95 + BB5F3CA11C1811BC00DA339D /* DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
96 + BB5F3CA61C1811BC00DA339D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
97 + BB5F3CA71C1811BC00DA339D /* DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoTests.m; sourceTree = "<group>"; };
98 +/* End PBXFileReference section */
99 +
100 +/* Begin PBXFrameworksBuildPhase section */
101 + BB5F3C851C1811BC00DA339D /* Frameworks */ = {
102 + isa = PBXFrameworksBuildPhase;
103 + buildActionMask = 2147483647;
104 + files = (
105 + 8484E5161EE7E36800B402D1 /* SystemConfiguration.framework in Frameworks */,
106 + 269F653821B6613F006AEC88 /* HaiBaoJuheSDK.framework in Frameworks */,
107 + 8484E4FC1EE7E1D800B402D1 /* libsqlite3.dylib in Frameworks */,
108 + 8484E5121EE7E2B800B402D1 /* libz.1.dylib in Frameworks */,
109 + 8484E5101EE7E29A00B402D1 /* libc++.1.dylib in Frameworks */,
110 + 8484E5001EE7E20C00B402D1 /* CFNetwork.framework in Frameworks */,
111 + 8484E5061EE7E24A00B402D1 /* CoreMotion.framework in Frameworks */,
112 + 2622C83022002B3300BF5D56 /* HNYouai.framework in Frameworks */,
113 + 8484E5021EE7E21F00B402D1 /* UIKit.framework in Frameworks */,
114 + 8484E50C1EE7E27100B402D1 /* CoreGraphics.framework in Frameworks */,
115 + 8484E5081EE7E25600B402D1 /* CoreText.framework in Frameworks */,
116 + 8484E50E1EE7E28000B402D1 /* QuartzCore.framework in Frameworks */,
117 + 8484E5141EE7E2DE00B402D1 /* Foundation.framework in Frameworks */,
118 + 8484E50A1EE7E26200B402D1 /* Security.framework in Frameworks */,
119 + 8484E5041EE7E24400B402D1 /* StoreKit.framework in Frameworks */,
120 + 8484E4FE1EE7E1F700B402D1 /* CoreTelephony.framework in Frameworks */,
121 + 84A090AB1F160A69003D23FB /* TrackingIO.a in Frameworks */,
122 + );
123 + runOnlyForDeploymentPostprocessing = 0;
124 + };
125 + BB5F3C9E1C1811BC00DA339D /* Frameworks */ = {
126 + isa = PBXFrameworksBuildPhase;
127 + buildActionMask = 2147483647;
128 + files = (
129 + );
130 + runOnlyForDeploymentPostprocessing = 0;
131 + };
132 +/* End PBXFrameworksBuildPhase section */
133 +
134 +/* Begin PBXGroup section */
135 + 8476DF631C4DD70500EC42BA /* poolsdk_file */ = {
136 + isa = PBXGroup;
137 + children = (
138 + 8476DF641C4DD71D00EC42BA /* poolsdk */,
139 + );
140 + name = poolsdk_file;
141 + sourceTree = "<group>";
142 + };
143 + 8476DF641C4DD71D00EC42BA /* poolsdk */ = {
144 + isa = PBXGroup;
145 + children = (
146 + 2622C82F22002B3300BF5D56 /* HNYouai.framework */,
147 + 84A090AC1F174E21003D23FB /* TrackingIO.h */,
148 + 84A090AA1F160A69003D23FB /* TrackingIO.a */,
149 + 846BD21F1EE9342700E89A1D /* haibao_setting */,
150 + 846BD2221EE9342700E89A1D /* SDKInterface.h */,
151 + 846BD2231EE9342700E89A1D /* SDKInterface.m */,
152 + 845D181B1C8D778400F27EB9 /* Images.xcassets */,
153 + 845D181C1C8D778400F27EB9 /* Info.plist */,
154 + );
155 + name = poolsdk;
156 + sourceTree = "<group>";
157 + };
158 + BB5F3C7F1C1811BC00DA339D = {
159 + isa = PBXGroup;
160 + children = (
161 + 8484E5151EE7E36800B402D1 /* SystemConfiguration.framework */,
162 + 8484E5131EE7E2DE00B402D1 /* Foundation.framework */,
163 + 8484E5111EE7E2B800B402D1 /* libz.1.dylib */,
164 + 8484E50F1EE7E29A00B402D1 /* libc++.1.dylib */,
165 + 8484E50D1EE7E28000B402D1 /* QuartzCore.framework */,
166 + 8484E50B1EE7E27100B402D1 /* CoreGraphics.framework */,
167 + 8484E5091EE7E26200B402D1 /* Security.framework */,
168 + 8484E5071EE7E25600B402D1 /* CoreText.framework */,
169 + 8484E5051EE7E24A00B402D1 /* CoreMotion.framework */,
170 + 8484E5031EE7E24400B402D1 /* StoreKit.framework */,
171 + 8484E5011EE7E21F00B402D1 /* UIKit.framework */,
172 + 8484E4FF1EE7E20C00B402D1 /* CFNetwork.framework */,
173 + 8484E4FD1EE7E1F700B402D1 /* CoreTelephony.framework */,
174 + 8484E4FB1EE7E1D800B402D1 /* libsqlite3.dylib */,
175 + 8476DF631C4DD70500EC42BA /* poolsdk_file */,
176 + BB5F3C8A1C1811BC00DA339D /* Demo */,
177 + BB5F3CA41C1811BC00DA339D /* DemoTests */,
178 + BB5F3C891C1811BC00DA339D /* Products */,
179 + );
180 + sourceTree = "<group>";
181 + };
182 + BB5F3C891C1811BC00DA339D /* Products */ = {
183 + isa = PBXGroup;
184 + children = (
185 + BB5F3C881C1811BC00DA339D /* Demo.app */,
186 + BB5F3CA11C1811BC00DA339D /* DemoTests.xctest */,
187 + );
188 + name = Products;
189 + sourceTree = "<group>";
190 + };
191 + BB5F3C8A1C1811BC00DA339D /* Demo */ = {
192 + isa = PBXGroup;
193 + children = (
194 + 269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */,
195 + 8484E4F11EE7E0DC00B402D1 /* AppDelegate.h */,
196 + 8484E4F21EE7E0DC00B402D1 /* AppDelegate.m */,
197 + 8484E4F31EE7E0DC00B402D1 /* ViewController.h */,
198 + 8484E4F41EE7E0DC00B402D1 /* ViewController.m */,
199 + 847EE5E01EE9007E003A4B7B /* MainViewController.h */,
200 + 847EE5E11EE9007E003A4B7B /* MainViewController.m */,
201 + BB5F3C951C1811BC00DA339D /* Main.storyboard */,
202 + BB5F3C9A1C1811BC00DA339D /* LaunchScreen.xib */,
203 + BB5F3C8B1C1811BC00DA339D /* Supporting Files */,
204 + );
205 + path = Demo;
206 + sourceTree = "<group>";
207 + };
208 + BB5F3C8B1C1811BC00DA339D /* Supporting Files */ = {
209 + isa = PBXGroup;
210 + children = (
211 + BB5F3C8D1C1811BC00DA339D /* main.m */,
212 + );
213 + name = "Supporting Files";
214 + sourceTree = "<group>";
215 + };
216 + BB5F3CA41C1811BC00DA339D /* DemoTests */ = {
217 + isa = PBXGroup;
218 + children = (
219 + BB5F3CA71C1811BC00DA339D /* DemoTests.m */,
220 + BB5F3CA51C1811BC00DA339D /* Supporting Files */,
221 + );
222 + path = DemoTests;
223 + sourceTree = "<group>";
224 + };
225 + BB5F3CA51C1811BC00DA339D /* Supporting Files */ = {
226 + isa = PBXGroup;
227 + children = (
228 + BB5F3CA61C1811BC00DA339D /* Info.plist */,
229 + );
230 + name = "Supporting Files";
231 + sourceTree = "<group>";
232 + };
233 +/* End PBXGroup section */
234 +
235 +/* Begin PBXNativeTarget section */
236 + BB5F3C871C1811BC00DA339D /* Demo */ = {
237 + isa = PBXNativeTarget;
238 + buildConfigurationList = BB5F3CAB1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "Demo" */;
239 + buildPhases = (
240 + BB5F3C841C1811BC00DA339D /* Sources */,
241 + BB5F3C851C1811BC00DA339D /* Frameworks */,
242 + BB5F3C861C1811BC00DA339D /* Resources */,
243 + 84398BFB1C4C83EC0082D774 /* Embed Frameworks */,
244 + );
245 + buildRules = (
246 + );
247 + dependencies = (
248 + );
249 + name = Demo;
250 + productName = Demo;
251 + productReference = BB5F3C881C1811BC00DA339D /* Demo.app */;
252 + productType = "com.apple.product-type.application";
253 + };
254 + BB5F3CA01C1811BC00DA339D /* DemoTests */ = {
255 + isa = PBXNativeTarget;
256 + buildConfigurationList = BB5F3CAE1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "DemoTests" */;
257 + buildPhases = (
258 + BB5F3C9D1C1811BC00DA339D /* Sources */,
259 + BB5F3C9E1C1811BC00DA339D /* Frameworks */,
260 + BB5F3C9F1C1811BC00DA339D /* Resources */,
261 + );
262 + buildRules = (
263 + );
264 + dependencies = (
265 + BB5F3CA31C1811BC00DA339D /* PBXTargetDependency */,
266 + );
267 + name = DemoTests;
268 + productName = DemoTests;
269 + productReference = BB5F3CA11C1811BC00DA339D /* DemoTests.xctest */;
270 + productType = "com.apple.product-type.bundle.unit-test";
271 + };
272 +/* End PBXNativeTarget section */
273 +
274 +/* Begin PBXProject section */
275 + BB5F3C801C1811BC00DA339D /* Project object */ = {
276 + isa = PBXProject;
277 + attributes = {
278 + LastUpgradeCheck = 0640;
279 + ORGANIZATIONNAME = winFan;
280 + TargetAttributes = {
281 + BB5F3C871C1811BC00DA339D = {
282 + CreatedOnToolsVersion = 6.4;
283 + DevelopmentTeam = A3DGN26BA8;
284 + ProvisioningStyle = Manual;
285 + };
286 + BB5F3CA01C1811BC00DA339D = {
287 + CreatedOnToolsVersion = 6.4;
288 + TestTargetID = BB5F3C871C1811BC00DA339D;
289 + };
290 + };
291 + };
292 + buildConfigurationList = BB5F3C831C1811BC00DA339D /* Build configuration list for PBXProject "Demo" */;
293 + compatibilityVersion = "Xcode 3.2";
294 + developmentRegion = English;
295 + hasScannedForEncodings = 0;
296 + knownRegions = (
297 + en,
298 + Base,
299 + );
300 + mainGroup = BB5F3C7F1C1811BC00DA339D;
301 + productRefGroup = BB5F3C891C1811BC00DA339D /* Products */;
302 + projectDirPath = "";
303 + projectRoot = "";
304 + targets = (
305 + BB5F3C871C1811BC00DA339D /* Demo */,
306 + BB5F3CA01C1811BC00DA339D /* DemoTests */,
307 + );
308 + };
309 +/* End PBXProject section */
310 +
311 +/* Begin PBXResourcesBuildPhase section */
312 + BB5F3C861C1811BC00DA339D /* Resources */ = {
313 + isa = PBXResourcesBuildPhase;
314 + buildActionMask = 2147483647;
315 + files = (
316 + 845D18221C8D778400F27EB9 /* Images.xcassets in Resources */,
317 + BB5F3C971C1811BC00DA339D /* Main.storyboard in Resources */,
318 + 846BD2241EE9342700E89A1D /* haibao_setting in Resources */,
319 + );
320 + runOnlyForDeploymentPostprocessing = 0;
321 + };
322 + BB5F3C9F1C1811BC00DA339D /* Resources */ = {
323 + isa = PBXResourcesBuildPhase;
324 + buildActionMask = 2147483647;
325 + files = (
326 + );
327 + runOnlyForDeploymentPostprocessing = 0;
328 + };
329 +/* End PBXResourcesBuildPhase section */
330 +
331 +/* Begin PBXSourcesBuildPhase section */
332 + BB5F3C841C1811BC00DA339D /* Sources */ = {
333 + isa = PBXSourcesBuildPhase;
334 + buildActionMask = 2147483647;
335 + files = (
336 + 846BD2261EE9342700E89A1D /* SDKInterface.m in Sources */,
337 + 8484E4F51EE7E0DC00B402D1 /* AppDelegate.m in Sources */,
338 + 847EE5E21EE9007E003A4B7B /* MainViewController.m in Sources */,
339 + BB5F3C8E1C1811BC00DA339D /* main.m in Sources */,
340 + 8484E4F61EE7E0DC00B402D1 /* ViewController.m in Sources */,
341 + );
342 + runOnlyForDeploymentPostprocessing = 0;
343 + };
344 + BB5F3C9D1C1811BC00DA339D /* Sources */ = {
345 + isa = PBXSourcesBuildPhase;
346 + buildActionMask = 2147483647;
347 + files = (
348 + BB5F3CA81C1811BC00DA339D /* DemoTests.m in Sources */,
349 + );
350 + runOnlyForDeploymentPostprocessing = 0;
351 + };
352 +/* End PBXSourcesBuildPhase section */
353 +
354 +/* Begin PBXTargetDependency section */
355 + BB5F3CA31C1811BC00DA339D /* PBXTargetDependency */ = {
356 + isa = PBXTargetDependency;
357 + target = BB5F3C871C1811BC00DA339D /* Demo */;
358 + targetProxy = BB5F3CA21C1811BC00DA339D /* PBXContainerItemProxy */;
359 + };
360 +/* End PBXTargetDependency section */
361 +
362 +/* Begin PBXVariantGroup section */
363 + BB5F3C951C1811BC00DA339D /* Main.storyboard */ = {
364 + isa = PBXVariantGroup;
365 + children = (
366 + BB5F3C961C1811BC00DA339D /* Base */,
367 + );
368 + name = Main.storyboard;
369 + sourceTree = "<group>";
370 + };
371 + BB5F3C9A1C1811BC00DA339D /* LaunchScreen.xib */ = {
372 + isa = PBXVariantGroup;
373 + children = (
374 + BB5F3C9B1C1811BC00DA339D /* Base */,
375 + );
376 + name = LaunchScreen.xib;
377 + sourceTree = "<group>";
378 + };
379 +/* End PBXVariantGroup section */
380 +
381 +/* Begin XCBuildConfiguration section */
382 + BB5F3CA91C1811BC00DA339D /* Debug */ = {
383 + isa = XCBuildConfiguration;
384 + buildSettings = {
385 + ALWAYS_SEARCH_USER_PATHS = NO;
386 + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
387 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
388 + CLANG_CXX_LIBRARY = "libc++";
389 + CLANG_ENABLE_MODULES = YES;
390 + CLANG_ENABLE_OBJC_ARC = YES;
391 + CLANG_WARN_BOOL_CONVERSION = YES;
392 + CLANG_WARN_CONSTANT_CONVERSION = YES;
393 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
394 + CLANG_WARN_EMPTY_BODY = YES;
395 + CLANG_WARN_ENUM_CONVERSION = YES;
396 + CLANG_WARN_INT_CONVERSION = YES;
397 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
398 + CLANG_WARN_UNREACHABLE_CODE = YES;
399 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
400 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
401 + COPY_PHASE_STRIP = NO;
402 + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
403 + ENABLE_BITCODE = NO;
404 + ENABLE_STRICT_OBJC_MSGSEND = YES;
405 + GCC_C_LANGUAGE_STANDARD = gnu99;
406 + GCC_DYNAMIC_NO_PIC = NO;
407 + GCC_NO_COMMON_BLOCKS = YES;
408 + GCC_OPTIMIZATION_LEVEL = 0;
409 + GCC_PREPROCESSOR_DEFINITIONS = (
410 + "DEBUG=1",
411 + "$(inherited)",
412 + );
413 + GCC_SYMBOLS_PRIVATE_EXTERN = NO;
414 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
415 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
416 + GCC_WARN_UNDECLARED_SELECTOR = YES;
417 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
418 + GCC_WARN_UNUSED_FUNCTION = YES;
419 + GCC_WARN_UNUSED_VARIABLE = YES;
420 + IPHONEOS_DEPLOYMENT_TARGET = 8.4;
421 + MTL_ENABLE_DEBUG_INFO = YES;
422 + ONLY_ACTIVE_ARCH = YES;
423 + SDKROOT = iphoneos;
424 + };
425 + name = Debug;
426 + };
427 + BB5F3CAA1C1811BC00DA339D /* Release */ = {
428 + isa = XCBuildConfiguration;
429 + buildSettings = {
430 + ALWAYS_SEARCH_USER_PATHS = NO;
431 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
432 + CLANG_CXX_LIBRARY = "libc++";
433 + CLANG_ENABLE_MODULES = YES;
434 + CLANG_ENABLE_OBJC_ARC = YES;
435 + CLANG_WARN_BOOL_CONVERSION = YES;
436 + CLANG_WARN_CONSTANT_CONVERSION = YES;
437 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
438 + CLANG_WARN_EMPTY_BODY = YES;
439 + CLANG_WARN_ENUM_CONVERSION = YES;
440 + CLANG_WARN_INT_CONVERSION = YES;
441 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
442 + CLANG_WARN_UNREACHABLE_CODE = YES;
443 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
444 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
445 + COPY_PHASE_STRIP = NO;
446 + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
447 + ENABLE_BITCODE = NO;
448 + ENABLE_NS_ASSERTIONS = NO;
449 + ENABLE_STRICT_OBJC_MSGSEND = YES;
450 + GCC_C_LANGUAGE_STANDARD = gnu99;
451 + GCC_NO_COMMON_BLOCKS = YES;
452 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
453 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
454 + GCC_WARN_UNDECLARED_SELECTOR = YES;
455 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
456 + GCC_WARN_UNUSED_FUNCTION = YES;
457 + GCC_WARN_UNUSED_VARIABLE = YES;
458 + IPHONEOS_DEPLOYMENT_TARGET = 8.4;
459 + MTL_ENABLE_DEBUG_INFO = NO;
460 + SDKROOT = iphoneos;
461 + VALIDATE_PRODUCT = YES;
462 + };
463 + name = Release;
464 + };
465 + BB5F3CAC1C1811BC00DA339D /* Debug */ = {
466 + isa = XCBuildConfiguration;
467 + buildSettings = {
468 + CODE_SIGN_IDENTITY = "iPhone Developer";
469 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
470 + CODE_SIGN_STYLE = Manual;
471 + DEAD_CODE_STRIPPING = NO;
472 + DEVELOPMENT_TEAM = A3DGN26BA8;
473 + ENABLE_BITCODE = NO;
474 + FRAMEWORK_SEARCH_PATHS = (
475 + "$(inherited)",
476 + "$(PROJECT_DIR)/Demo",
477 + "$(PROJECT_DIR)/poolsdk_file/poolsdk",
478 + "$(PROJECT_DIR)",
479 + );
480 + INFOPLIST_FILE = poolsdk_file/poolsdk/Info.plist;
481 + IPHONEOS_DEPLOYMENT_TARGET = 8.0;
482 + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
483 + LIBRARY_SEARCH_PATHS = (
484 + "$(inherited)",
485 + "$(PROJECT_DIR)/Demo",
486 + "$(PROJECT_DIR)/poolsdk_file/poolsdk",
487 + );
488 + ONLY_ACTIVE_ARCH = NO;
489 + OTHER_LDFLAGS = "";
490 + PRODUCT_BUNDLE_IDENTIFIER = com.mihuyo.beta;
491 + PRODUCT_NAME = "$(TARGET_NAME)";
492 + PROVISIONING_PROFILE = "f5e11833-b2e3-48fd-8903-8da416b533f7";
493 + PROVISIONING_PROFILE_SPECIFIER = dev_provision;
494 + TARGETED_DEVICE_FAMILY = "1,2";
495 + VALID_ARCHS = "arm64 armv7s";
496 + };
497 + name = Debug;
498 + };
499 + BB5F3CAD1C1811BC00DA339D /* Release */ = {
500 + isa = XCBuildConfiguration;
501 + buildSettings = {
502 + CODE_SIGN_IDENTITY = "iPhone Developer";
503 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
504 + CODE_SIGN_STYLE = Manual;
505 + DEAD_CODE_STRIPPING = NO;
506 + DEVELOPMENT_TEAM = A3DGN26BA8;
507 + ENABLE_BITCODE = NO;
508 + FRAMEWORK_SEARCH_PATHS = (
509 + "$(inherited)",
510 + "$(PROJECT_DIR)/Demo",
511 + "$(PROJECT_DIR)/poolsdk_file/poolsdk",
512 + "$(PROJECT_DIR)",
513 + );
514 + INFOPLIST_FILE = poolsdk_file/poolsdk/Info.plist;
515 + IPHONEOS_DEPLOYMENT_TARGET = 8.0;
516 + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
517 + LIBRARY_SEARCH_PATHS = (
518 + "$(inherited)",
519 + "$(PROJECT_DIR)/Demo",
520 + "$(PROJECT_DIR)/poolsdk_file/poolsdk",
521 + );
522 + ONLY_ACTIVE_ARCH = NO;
523 + OTHER_LDFLAGS = "";
524 + PRODUCT_BUNDLE_IDENTIFIER = com.mihuyo.beta;
525 + PRODUCT_NAME = "$(TARGET_NAME)";
526 + PROVISIONING_PROFILE = "efde732c-987c-4f2a-bc64-c11762722e03";
527 + PROVISIONING_PROFILE_SPECIFIER = dis_provision;
528 + TARGETED_DEVICE_FAMILY = "1,2";
529 + VALID_ARCHS = "arm64 armv7s";
530 + };
531 + name = Release;
532 + };
533 + BB5F3CAF1C1811BC00DA339D /* Debug */ = {
534 + isa = XCBuildConfiguration;
535 + buildSettings = {
536 + BUNDLE_LOADER = "$(TEST_HOST)";
537 + FRAMEWORK_SEARCH_PATHS = (
538 + "$(SDKROOT)/Developer/Library/Frameworks",
539 + "$(inherited)",
540 + "$(PROJECT_DIR)",
541 + );
542 + GCC_PREPROCESSOR_DEFINITIONS = (
543 + "DEBUG=1",
544 + "$(inherited)",
545 + );
546 + INFOPLIST_FILE = DemoTests/Info.plist;
547 + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
548 + PRODUCT_NAME = "$(TARGET_NAME)";
549 + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo";
550 + };
551 + name = Debug;
552 + };
553 + BB5F3CB01C1811BC00DA339D /* Release */ = {
554 + isa = XCBuildConfiguration;
555 + buildSettings = {
556 + BUNDLE_LOADER = "$(TEST_HOST)";
557 + FRAMEWORK_SEARCH_PATHS = (
558 + "$(SDKROOT)/Developer/Library/Frameworks",
559 + "$(inherited)",
560 + "$(PROJECT_DIR)",
561 + );
562 + INFOPLIST_FILE = DemoTests/Info.plist;
563 + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
564 + PRODUCT_NAME = "$(TARGET_NAME)";
565 + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo";
566 + };
567 + name = Release;
568 + };
569 +/* End XCBuildConfiguration section */
570 +
571 +/* Begin XCConfigurationList section */
572 + BB5F3C831C1811BC00DA339D /* Build configuration list for PBXProject "Demo" */ = {
573 + isa = XCConfigurationList;
574 + buildConfigurations = (
575 + BB5F3CA91C1811BC00DA339D /* Debug */,
576 + BB5F3CAA1C1811BC00DA339D /* Release */,
577 + );
578 + defaultConfigurationIsVisible = 0;
579 + defaultConfigurationName = Release;
580 + };
581 + BB5F3CAB1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "Demo" */ = {
582 + isa = XCConfigurationList;
583 + buildConfigurations = (
584 + BB5F3CAC1C1811BC00DA339D /* Debug */,
585 + BB5F3CAD1C1811BC00DA339D /* Release */,
586 + );
587 + defaultConfigurationIsVisible = 0;
588 + defaultConfigurationName = Release;
589 + };
590 + BB5F3CAE1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "DemoTests" */ = {
591 + isa = XCConfigurationList;
592 + buildConfigurations = (
593 + BB5F3CAF1C1811BC00DA339D /* Debug */,
594 + BB5F3CB01C1811BC00DA339D /* Release */,
595 + );
596 + defaultConfigurationIsVisible = 0;
597 + defaultConfigurationName = Release;
598 + };
599 +/* End XCConfigurationList section */
600 + };
601 + rootObject = BB5F3C801C1811BC00DA339D /* Project object */;
602 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Workspace
3 + version = "1.0">
4 + <FileRef
5 + location = "self:Demo.xcodeproj">
6 + </FileRef>
7 +</Workspace>
1 +{
2 + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2",
3 + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
4 + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : {
5 +
6 + }
7 + },
8 + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
9 + "D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : 0,
10 + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : 0
11 + },
12 + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8119CC7B-EDC1-4646-9378-8ECAC2EEB94B",
13 + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
14 + "D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : "public_sdk_ios\/",
15 + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : "youai_foolsdk_ios\/"
16 + },
17 + "DVTSourceControlWorkspaceBlueprintNameKey" : "Demo",
18 + "DVTSourceControlWorkspaceBlueprintVersion" : 204,
19 + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "PoolSdk_Demo\/Demo.xcodeproj",
20 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
21 + {
22 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "svn:\/\/10.21.210.99",
23 + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
24 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5b13317c-0110-4367-8746-06bc6aadd3cd++2397"
25 + },
26 + {
27 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/106.75.192.252:10022\/public_service\/public_sdk_ios.git",
28 + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
29 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2"
30 + }
31 + ]
32 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>IDEDidComputeMac32BitWarning</key>
6 + <true/>
7 +</dict>
8 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<array/>
5 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Bucket
3 + type = "1"
4 + version = "2.0">
5 +</Bucket>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>SchemeUserState</key>
6 + <dict>
7 + <key>Demo.xcscheme</key>
8 + <dict>
9 + <key>orderHint</key>
10 + <integer>0</integer>
11 + </dict>
12 + </dict>
13 +</dict>
14 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Bucket
3 + type = "1"
4 + version = "2.0">
5 + <Breakpoints>
6 + <BreakpointProxy
7 + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8 + <BreakpointContent
9 + shouldBeEnabled = "Yes"
10 + ignoreCount = "0"
11 + continueAfterRunningActions = "No"
12 + filePath = "../PoolSdk/PoolSdk/SDKInterface.m"
13 + timestampString = "471440051.171901"
14 + startingColumnNumber = "9223372036854775807"
15 + endingColumnNumber = "9223372036854775807"
16 + startingLineNumber = "77"
17 + endingLineNumber = "77"
18 + landmarkName = "-receiveLoginMessage:"
19 + landmarkType = "5">
20 + </BreakpointContent>
21 + </BreakpointProxy>
22 + <BreakpointProxy
23 + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
24 + <BreakpointContent
25 + shouldBeEnabled = "Yes"
26 + ignoreCount = "0"
27 + continueAfterRunningActions = "No"
28 + filePath = "../PoolSdk/PoolSdk/SDKInterface.m"
29 + timestampString = "471440051.171901"
30 + startingColumnNumber = "9223372036854775807"
31 + endingColumnNumber = "9223372036854775807"
32 + startingLineNumber = "43"
33 + endingLineNumber = "43"
34 + landmarkName = "-SDKloginSDK"
35 + landmarkType = "5">
36 + </BreakpointContent>
37 + </BreakpointProxy>
38 + </Breakpoints>
39 +</Bucket>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Scheme
3 + LastUpgradeVersion = "0640"
4 + version = "1.3">
5 + <BuildAction
6 + parallelizeBuildables = "YES"
7 + buildImplicitDependencies = "YES">
8 + <BuildActionEntries>
9 + <BuildActionEntry
10 + buildForTesting = "YES"
11 + buildForRunning = "YES"
12 + buildForProfiling = "YES"
13 + buildForArchiving = "YES"
14 + buildForAnalyzing = "YES">
15 + <BuildableReference
16 + BuildableIdentifier = "primary"
17 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
18 + BuildableName = "Demo.app"
19 + BlueprintName = "Demo"
20 + ReferencedContainer = "container:Demo.xcodeproj">
21 + </BuildableReference>
22 + </BuildActionEntry>
23 + <BuildActionEntry
24 + buildForTesting = "YES"
25 + buildForRunning = "YES"
26 + buildForProfiling = "NO"
27 + buildForArchiving = "NO"
28 + buildForAnalyzing = "YES">
29 + <BuildableReference
30 + BuildableIdentifier = "primary"
31 + BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
32 + BuildableName = "DemoTests.xctest"
33 + BlueprintName = "DemoTests"
34 + ReferencedContainer = "container:Demo.xcodeproj">
35 + </BuildableReference>
36 + </BuildActionEntry>
37 + </BuildActionEntries>
38 + </BuildAction>
39 + <TestAction
40 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
41 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
42 + shouldUseLaunchSchemeArgsEnv = "YES"
43 + buildConfiguration = "Debug">
44 + <Testables>
45 + <TestableReference
46 + skipped = "NO">
47 + <BuildableReference
48 + BuildableIdentifier = "primary"
49 + BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
50 + BuildableName = "DemoTests.xctest"
51 + BlueprintName = "DemoTests"
52 + ReferencedContainer = "container:Demo.xcodeproj">
53 + </BuildableReference>
54 + </TestableReference>
55 + </Testables>
56 + <MacroExpansion>
57 + <BuildableReference
58 + BuildableIdentifier = "primary"
59 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
60 + BuildableName = "Demo.app"
61 + BlueprintName = "Demo"
62 + ReferencedContainer = "container:Demo.xcodeproj">
63 + </BuildableReference>
64 + </MacroExpansion>
65 + </TestAction>
66 + <LaunchAction
67 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
68 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
69 + launchStyle = "0"
70 + useCustomWorkingDirectory = "NO"
71 + buildConfiguration = "Debug"
72 + ignoresPersistentStateOnLaunch = "NO"
73 + debugDocumentVersioning = "YES"
74 + allowLocationSimulation = "YES">
75 + <BuildableProductRunnable
76 + runnableDebuggingMode = "0">
77 + <BuildableReference
78 + BuildableIdentifier = "primary"
79 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
80 + BuildableName = "Demo.app"
81 + BlueprintName = "Demo"
82 + ReferencedContainer = "container:Demo.xcodeproj">
83 + </BuildableReference>
84 + </BuildableProductRunnable>
85 + <AdditionalOptions>
86 + </AdditionalOptions>
87 + </LaunchAction>
88 + <ProfileAction
89 + shouldUseLaunchSchemeArgsEnv = "YES"
90 + savedToolIdentifier = ""
91 + useCustomWorkingDirectory = "NO"
92 + buildConfiguration = "Release"
93 + debugDocumentVersioning = "YES">
94 + <BuildableProductRunnable
95 + runnableDebuggingMode = "0">
96 + <BuildableReference
97 + BuildableIdentifier = "primary"
98 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
99 + BuildableName = "Demo.app"
100 + BlueprintName = "Demo"
101 + ReferencedContainer = "container:Demo.xcodeproj">
102 + </BuildableReference>
103 + </BuildableProductRunnable>
104 + </ProfileAction>
105 + <AnalyzeAction
106 + buildConfiguration = "Debug">
107 + </AnalyzeAction>
108 + <ArchiveAction
109 + buildConfiguration = "Release"
110 + revealArchiveInOrganizer = "YES">
111 + </ArchiveAction>
112 +</Scheme>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>SchemeUserState</key>
6 + <dict>
7 + <key>Demo.xcscheme</key>
8 + <dict>
9 + <key>orderHint</key>
10 + <integer>0</integer>
11 + </dict>
12 + </dict>
13 + <key>SuppressBuildableAutocreation</key>
14 + <dict>
15 + <key>BB5F3C871C1811BC00DA339D</key>
16 + <dict>
17 + <key>primary</key>
18 + <true/>
19 + </dict>
20 + <key>BB5F3CA01C1811BC00DA339D</key>
21 + <dict>
22 + <key>primary</key>
23 + <true/>
24 + </dict>
25 + </dict>
26 +</dict>
27 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Bucket
3 + type = "1"
4 + version = "2.0">
5 + <Breakpoints>
6 + <BreakpointProxy
7 + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8 + <BreakpointContent
9 + shouldBeEnabled = "No"
10 + ignoreCount = "0"
11 + continueAfterRunningActions = "No"
12 + filePath = "Demo/SDKInterface.h"
13 + timestampString = "474775745.083759"
14 + startingColumnNumber = "9223372036854775807"
15 + endingColumnNumber = "9223372036854775807"
16 + startingLineNumber = "9"
17 + endingLineNumber = "9"
18 + landmarkName = "@interface SDKInterface"
19 + landmarkType = "2">
20 + </BreakpointContent>
21 + </BreakpointProxy>
22 + </Breakpoints>
23 +</Bucket>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Scheme
3 + LastUpgradeVersion = "0700"
4 + version = "1.3">
5 + <BuildAction
6 + parallelizeBuildables = "YES"
7 + buildImplicitDependencies = "YES">
8 + <BuildActionEntries>
9 + <BuildActionEntry
10 + buildForTesting = "YES"
11 + buildForRunning = "YES"
12 + buildForProfiling = "YES"
13 + buildForArchiving = "YES"
14 + buildForAnalyzing = "YES">
15 + <BuildableReference
16 + BuildableIdentifier = "primary"
17 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
18 + BuildableName = "Demo.app"
19 + BlueprintName = "Demo"
20 + ReferencedContainer = "container:Demo.xcodeproj">
21 + </BuildableReference>
22 + </BuildActionEntry>
23 + </BuildActionEntries>
24 + </BuildAction>
25 + <TestAction
26 + buildConfiguration = "Debug"
27 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29 + shouldUseLaunchSchemeArgsEnv = "YES">
30 + <Testables>
31 + <TestableReference
32 + skipped = "NO">
33 + <BuildableReference
34 + BuildableIdentifier = "primary"
35 + BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
36 + BuildableName = "DemoTests.xctest"
37 + BlueprintName = "DemoTests"
38 + ReferencedContainer = "container:Demo.xcodeproj">
39 + </BuildableReference>
40 + </TestableReference>
41 + </Testables>
42 + <MacroExpansion>
43 + <BuildableReference
44 + BuildableIdentifier = "primary"
45 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
46 + BuildableName = "Demo.app"
47 + BlueprintName = "Demo"
48 + ReferencedContainer = "container:Demo.xcodeproj">
49 + </BuildableReference>
50 + </MacroExpansion>
51 + <AdditionalOptions>
52 + </AdditionalOptions>
53 + </TestAction>
54 + <LaunchAction
55 + buildConfiguration = "Debug"
56 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58 + launchStyle = "0"
59 + useCustomWorkingDirectory = "NO"
60 + ignoresPersistentStateOnLaunch = "NO"
61 + debugDocumentVersioning = "YES"
62 + debugServiceExtension = "internal"
63 + allowLocationSimulation = "YES">
64 + <BuildableProductRunnable
65 + runnableDebuggingMode = "0">
66 + <BuildableReference
67 + BuildableIdentifier = "primary"
68 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
69 + BuildableName = "Demo.app"
70 + BlueprintName = "Demo"
71 + ReferencedContainer = "container:Demo.xcodeproj">
72 + </BuildableReference>
73 + </BuildableProductRunnable>
74 + <AdditionalOptions>
75 + </AdditionalOptions>
76 + </LaunchAction>
77 + <ProfileAction
78 + buildConfiguration = "Release"
79 + shouldUseLaunchSchemeArgsEnv = "YES"
80 + savedToolIdentifier = ""
81 + useCustomWorkingDirectory = "NO"
82 + debugDocumentVersioning = "YES">
83 + <BuildableProductRunnable
84 + runnableDebuggingMode = "0">
85 + <BuildableReference
86 + BuildableIdentifier = "primary"
87 + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
88 + BuildableName = "Demo.app"
89 + BlueprintName = "Demo"
90 + ReferencedContainer = "container:Demo.xcodeproj">
91 + </BuildableReference>
92 + </BuildableProductRunnable>
93 + </ProfileAction>
94 + <AnalyzeAction
95 + buildConfiguration = "Debug">
96 + </AnalyzeAction>
97 + <ArchiveAction
98 + buildConfiguration = "Release"
99 + revealArchiveInOrganizer = "YES">
100 + </ArchiveAction>
101 +</Scheme>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>SchemeUserState</key>
6 + <dict>
7 + <key>Demo.xcscheme</key>
8 + <dict>
9 + <key>orderHint</key>
10 + <integer>0</integer>
11 + </dict>
12 + </dict>
13 + <key>SuppressBuildableAutocreation</key>
14 + <dict>
15 + <key>BB5F3C871C1811BC00DA339D</key>
16 + <dict>
17 + <key>primary</key>
18 + <true/>
19 + </dict>
20 + <key>BB5F3CA01C1811BC00DA339D</key>
21 + <dict>
22 + <key>primary</key>
23 + <true/>
24 + </dict>
25 + </dict>
26 +</dict>
27 +</plist>
No preview for this file type
1 +//
2 +// AppDelegate.h
3 +// publiDemo
4 +//
5 +// Created by winFan on 11/30/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import <UIKit/UIKit.h>
10 +
11 +@interface AppDelegate : UIResponder <UIApplicationDelegate>
12 +
13 +@property (strong, nonatomic) UIWindow *window;
14 +
15 +
16 +@end
17 +
1 +//
2 +// AppDelegate.m
3 +// publiDemo
4 +//
5 +// Created by winFan on 11/30/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import "AppDelegate.h"
10 +#import "ViewController.h"
11 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
12 +@interface AppDelegate ()
13 +
14 +@end
15 +
16 +@implementation AppDelegate
17 +
18 +
19 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 + // Override point for customization after application launch.
21 + NSLog(@"didFinishLaunchingWithOptions");
22 +
23 +
24 + [[HaiBaoJuheSDK shareSDK]application:application didFinishLaunchingWithOptions:launchOptions];
25 + return YES;
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 + [[HaiBaoJuheSDK shareSDK]applicationWillResignActive:application];
32 +}
33 +
34 +- (void)applicationDidEnterBackground:(UIApplication *)application {
35 + // 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.
36 + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
37 + [[HaiBaoJuheSDK shareSDK]applicationDidEnterBackground:application];
38 +}
39 +
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 + [[HaiBaoJuheSDK shareSDK]applicationDidBecomeActive:application];
45 +}
46 +
47 +- (void)applicationWillTerminate:(UIApplication *)application {
48 + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
49 +}
50 +
51 +- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
52 + NSLog(@"hanldeOpenURL%@",url.path );
53 + [[HaiBaoJuheSDK shareSDK] handleOpenurl:url];
54 + return true;
55 +}
56 +
57 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
58 +{
59 + [[HaiBaoJuheSDK shareSDK]application:app openURL:url options:options];
60 + return YES;
61 +}
62 +
63 +-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
64 +{
65 + [[HaiBaoJuheSDK shareSDK] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
66 + return YES;
67 +}
68 +
69 +- (void)applicationWillEnterForeground:(UIApplication *)application {
70 + // 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.
71 + [[HaiBaoJuheSDK shareSDK] applicationWillEnterForeground:application];
72 +}
73 +
74 +
75 +@end
No preview for this file type
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
3 + <device id="retina4_7" orientation="portrait">
4 + <adaptation id="fullscreen"/>
5 + </device>
6 + <dependencies>
7 + <deployment identifier="iOS"/>
8 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
9 + <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
10 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
11 + </dependencies>
12 + <objects>
13 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
14 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
15 + <view contentMode="scaleToFill" id="iN0-l3-epB">
16 + <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
17 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18 + <subviews>
19 + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 winFan. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
20 + <rect key="frame" x="20" y="439" width="441" height="21"/>
21 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
22 + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
23 + <nil key="highlightedColor"/>
24 + </label>
25 + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Demo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
26 + <rect key="frame" x="20" y="140" width="441" height="43"/>
27 + <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
28 + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
29 + <nil key="highlightedColor"/>
30 + </label>
31 + </subviews>
32 + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
33 + <constraints>
34 + <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
35 + <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
36 + <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
37 + <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
38 + <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
39 + <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
40 + </constraints>
41 + <nil key="simulatedStatusBarMetrics"/>
42 + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
43 + <point key="canvasLocation" x="548" y="455"/>
44 + </view>
45 + </objects>
46 +</document>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
3 + <device id="retina4_7" orientation="portrait">
4 + <adaptation id="fullscreen"/>
5 + </device>
6 + <dependencies>
7 + <deployment identifier="iOS"/>
8 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
9 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 + </dependencies>
11 + <scenes>
12 + <!--Main View Controller-->
13 + <scene sceneID="ufC-wZ-h7g">
14 + <objects>
15 + <viewController id="vXZ-lx-hvc" customClass="MainViewController" sceneMemberID="viewController">
16 + <layoutGuides>
17 + <viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
18 + <viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
19 + </layoutGuides>
20 + <view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
21 + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
22 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
23 + <subviews>
24 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GQW-et-jRb">
25 + <rect key="frame" x="44" y="85" width="208" height="30"/>
26 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
27 + <state key="normal" title="初始化"/>
28 + <connections>
29 + <action selector="actionInit:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Srh-bu-gYD"/>
30 + </connections>
31 + </button>
32 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s0O-FE-ge8">
33 + <rect key="frame" x="61" y="123" width="175" height="30"/>
34 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
35 + <state key="normal" title="登录"/>
36 + <connections>
37 + <action selector="actionLogin:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="381-gB-ImA"/>
38 + </connections>
39 + </button>
40 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JQY-uO-q36">
41 + <rect key="frame" x="53" y="166" width="191" height="30"/>
42 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
43 + <state key="normal" title="充值"/>
44 + <connections>
45 + <action selector="actionPay:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="bvf-M4-rqy"/>
46 + </connections>
47 + </button>
48 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5na-1c-IlO">
49 + <rect key="frame" x="357" y="85" width="100" height="30"/>
50 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
51 + <state key="normal" title="数据"/>
52 + <connections>
53 + <action selector="actionSubmitRoleData:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="aNf-Iw-unv"/>
54 + </connections>
55 + </button>
56 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jcX-L1-JB6">
57 + <rect key="frame" x="377" y="166" width="60" height="30"/>
58 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
59 + <state key="normal" title="切换账号"/>
60 + <connections>
61 + <action selector="actionSwitchAccount:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="miU-Hm-8cm"/>
62 + </connections>
63 + </button>
64 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q9b-py-Nk0">
65 + <rect key="frame" x="340" y="123" width="134" height="30"/>
66 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
67 + <state key="normal" title="注销"/>
68 + <connections>
69 + <action selector="actionLogout:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="t6e-7P-tJU"/>
70 + </connections>
71 + </button>
72 + </subviews>
73 + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
74 + </view>
75 + </viewController>
76 + <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
77 + </objects>
78 + <point key="canvasLocation" x="445" y="282"/>
79 + </scene>
80 + </scenes>
81 +</document>
1 +#import <Foundation/Foundation.h>
2 +#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
3 +#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
4 +#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
5 +#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
6 +#import "HaiBaoJuheReportInfo.h"
7 +#import "HaiBaoJuheSDKDelegate.h"
8 +
9 +@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
10 +@property(nonatomic, strong)NSString *userId;
11 +@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
12 +
13 +@property bool onlyOneTimeGzyazf;
14 ++ (HaiBaoJuheChecker *)getInstance;
15 +- (void)initChecker;
16 +- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
17 +- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
18 +- (void) RailwayHaiBaoJuhereportOpen;
19 +- (void) RailwayHaiBaoJuhereportSDKOpen;
20 +- (void)RailwayHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
21 +- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
22 +- (void) RailwayHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
23 +- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
24 + notiName:(NSString *)notiName
25 + statusCode:(int)nCode
26 + description:(NSString *)szDescripton
27 + extendData:(NSObject *)extendData;
28 +
29 +- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
30 +
31 +- (void)RailwayHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
32 +
33 +/*
34 + *初始化时调用
35 + */
36 +- (void)setHaiBaoJuheSDKDelegate:(nullable id<HaiBaoJuheSDKDelegate>)HaiBaoJuheSDKDeletate;
37 +@end
38 +
39 +
40 +
41 +
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HaiBaoJuheConfig : NSObject
4 +
5 +@property(nonatomic, strong)NSString *gameSimpleName;
6 +@property(nonatomic, strong)NSString *sdkSimpleName;
7 +@property(nonatomic, strong)NSString *sdkVersionCode;
8 +@property(nonatomic, strong)NSString *loginCheckUrl;
9 +@property(nonatomic, strong)NSString *gzyazfOrderUrl;
10 +@property(nonatomic, strong)NSString *gzyazfCheckUrl;
11 +@property(nonatomic, strong)NSString *c1;
12 +@property(nonatomic, strong)NSString *c2;
13 +@property(nonatomic, strong)NSString *custom;
14 +
15 ++ (HaiBaoJuheConfig *)getInstance;
16 +
17 +- (void) loadFile:(NSString *) fileName;
18 +
19 +- (NSString *)getValueByKey:(NSString *) key;
20 +
21 +- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
22 +
23 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheCreateOrderInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic,strong)NSString *serverId;//服务器ID
5 +@property(nonatomic, strong)NSString *serverName;//服务器名称
6 +@property(nonatomic, strong)NSString *playerId;//玩家ID
7 +@property(nonatomic, strong)NSString *playerName;//玩家名称
8 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
9 +@property(nonatomic, strong)NSString *postAmount;//金额
10 +@property(nonatomic, strong)NSString *productId;//产品ID
11 +@property(nonatomic, strong)NSString *productName;//产品名称
12 +@property(nonatomic, strong)NSString *productDesc;//产品描述
13 +@property(nonatomic, strong)NSString *custom;//透传参数
14 +@property(nonatomic, strong)NSString *exchange;//兑换比例
15 +@property(nonatomic, strong)NSString *otherInfo;//扩展参数
16 +@property(nonatomic, strong)NSString *userId;//用户ID
17 +@property(nonatomic, strong)NSString *timestamp;//时间戳
18 +
19 +- (NSString *) RailwayHaiBaoJuheGetTsign ;
20 +- (NSString *) RailwayHaiBaoJuheGetTimestamp ;
21 +
22 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheGzyazfInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic, strong)NSString *serverId;
5 +@property(nonatomic, strong)NSString *queryId;
6 +@property(nonatomic, strong)NSString *playerId;
7 +@property(nonatomic, strong)NSString *playerName;
8 +@property(nonatomic, strong)NSString *postAmount;
9 +@property(nonatomic, strong)NSString *productId;
10 +@property(nonatomic, strong)NSString *products;
11 +@property(nonatomic, strong)NSString *custom;
12 +@property(nonatomic, strong)NSString *postTime;
13 +@property(nonatomic, strong)NSString *other;
14 +
15 +//游戏传递过来的原值
16 +@property(nonatomic, strong)NSString *serverName;//服务器名称
17 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
18 +@property(nonatomic, strong)NSString *productName;//产品名称
19 +@property(nonatomic, strong)NSString *productDesc;//产品描述
20 +@property(nonatomic, strong)NSString *exchange;//兑换比例
21 +
22 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheLoginInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic,strong)NSString *timestamp;
5 +@property(nonatomic, strong)NSString *sign;
6 +@property(nonatomic, strong)NSString *other;
7 +@property(nonatomic, strong)NSString *openId;
8 +@property(nonatomic, strong)NSString *userType;
9 +
10 +
11 +@end
1 +//
2 +// HaiBaoJuheNotification.h
3 +// public_i9133
4 +//
5 +// Created by winFan on 12/1/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +
11 +extern NSString * const HaiBaoJuheSDK_Notification; /**< */
12 +extern NSString * const _create_order_notification; /**< */
13 +
14 +
15 +/**
16 + 应用支持的方向
17 + */
18 +typedef NS_ENUM(int, HaiBaoJuheSDKNotificationType) {
19 + HaiBaoJuheSDKNotificationLogin = 1,//登录
20 + HaiBaoJuheSDKNotificationLogout,//注销
21 + HaiBaoJuheSDKNotificationGzyazf,//支付完成
22 + HaiBaoJuheSDKNotificationPause,//暂停退出
23 + HaiBaoJuheSDKNotificationRole,//创建角色
24 + HaiBaoJuheSDKNotificationInitSDK,//初始化SDK
25 + HaiBaoJuheSDKNotificationSwitchAccount,//切换账号
26 + HaiBaoJuheSDKNotificationExit//退出游戏
27 +};
28 +
29 +
30 +
31 +@interface HaiBaoJuheNotification : NSObject
32 +
33 +@end
34 +
35 +
36 +//////////////////////////////////////////////////////////////////////
37 +@interface HaiBaoJuheSDKResult : NSObject
38 +@property(nonatomic, assign)int statusCode;//请参照此文件下面状态标识
39 +@property(nonatomic, strong)NSString *resultDescription;
40 +@property(nonatomic, strong)NSObject *extendData;
41 +//V1.2.0新增
42 +@property(nonatomic, assign)HaiBaoJuheSDKNotificationType notiType;//消息类型
43 +@property(nonatomic, strong)NSString *notiName;//消息名称
44 +@end
45 +//////////////////////////////////////////////////////////////////////
46 +
47 +//////////////////////////////////////////////////////////////////////
48 +/* 状态标识 */
49 +#define HaiBaoJuheSDK_NO_ERROR 0 /*操作成功*/
50 +
51 +#define HaiBaoJuheSDK_ERROR_LOGIN_FAILED -100 /*登录失败*/
52 +#define HaiBaoJuheSDK_ERROR_LOGIN_CANCEL -101 /*登录取消*/
53 +#define HaiBaoJuheSDK_ERROR_LOGIN_GAMGEACCOUNT -102 /*游戏帐号登录,非平台账号*/
54 +
55 +#define HaiBaoJuheSDK_ERROR_PAY_FAILED -200 /*支付失败*/
56 +#define HaiBaoJuheSDK_ERROR_PAY_CANCEL -201 /*支付取消*/
57 +#define HaiBaoJuheSDK_ERROR_PAY_VERSIGN -202 /*支付验签失败*/
58 +#define HaiBaoJuheSDK_ERROR_CREATE_ORDER_FAILED -203 /*支付验签失败*/
59 +
60 +#define HaiBaoJuheSDK_ERROR_ROLE_CREATE_FAILED -300 /*角色创建失败*/
61 +
62 +#define HaiBaoJuheSDK_ERROR_INIT_FAILED -400 /*初始化失败*/
63 +
64 +#define HaiBaoJuheSDK_ERROR_SWICHT_ACCOUNT_FAILED -500 /*切换账号失败*/
65 +
66 +#define HaiBaoJuheSDK_ERROR_EXIT_CANCEL -600 /*退出取消*/
67 +
68 +//////////////////////////////////////////////////////////////////////
1 +//
2 +// RailwayHaiBaoJuheReportInfo.h
3 +// HaiBaoJuheSDK
4 +//
5 +// Created by winFan on 12/21/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
10 +@interface HaiBaoJuheReportInfo : RailwayHaiBaoJuheBaseModel
11 +
12 +@property(nonatomic, strong)NSString *reportType;//类型
13 +@property(nonatomic, strong)NSString *playerId;//玩家ID
14 +@property(nonatomic, strong)NSString *playerName;//玩家名称
15 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
16 +@property(nonatomic, strong)NSString *roleSex;//角色性别(1男0女)
17 +
18 +@property(nonatomic, strong)NSString *serverId;//服务器ID
19 +@property(nonatomic, strong)NSString *serverName;//服务器名称
20 +@property(nonatomic, strong)NSNumber *roleCTime;//创建角色时间(秒)
21 +@property(nonatomic, strong)NSString *partyName;//工会名称
22 +@property(nonatomic, strong)NSString *roleType;//角色类型
23 +@property(nonatomic, strong)NSNumber *roleChangeTime;//角色等级更新时间(秒)
24 +@property(nonatomic, strong)NSString *vipLevel;//vip等级
25 +@property(nonatomic, strong)NSNumber *diamond;//余额
26 +@property(nonatomic, strong)NSString *moneyType;//商品单位(元宝,金币)
27 +
28 +@property(nonatomic, strong)NSString *custom;//透传参数
29 +
30 +
31 +@property(nonatomic, strong)NSString *openId;
32 +
33 +#define REPORT_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/statistic"
34 +
35 +#define REPORT_IDFA_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
36 +
37 +#define REPORT_OPEN @"open"
38 +#define REPORT_ENTER @"enter"
39 +#define REPORT_CREATEROLE @"createrole"
40 +#define REPORT_ROLEUPGRADE @"roleupgrade"
41 +#define REPORT_SDK_OPEN @"opensdk"
42 +#define REPORT_EXIT @"exit"
43 +#define REPORT_SELECT_SERVER @"selectserver"
44 +
45 +@end
1 +#import <Foundation/Foundation.h>
2 +#import "HaiBaoJuheSDK2.h"
3 +
4 +#import <UIKit/UIKit.h>
5 +
6 +@interface HaiBaoJuheSDK : NSObject
7 +
8 +@property(nonatomic, strong, readonly)NSString *sdkVersion;
9 +
10 +
11 +@property(nonatomic, strong)NSString *urlSchemes;
12 +
13 +@property BOOL isAppleGzyazfing;
14 +
15 ++ (HaiBaoJuheSDK *)shareSDK;
16 +
17 +
18 +- (void)initSDK:(UIViewController *) control;
19 +
20 +
21 +-(void)viewDidAppear;
22 +
23 +- (void)setViewController:(UIViewController *)viewController;
24 +
25 +
26 +- (void)loginSDK;
27 +
28 +- (void)loginSDK:(UIViewController *)viewController;
29 +
30 +
31 +- (void)gzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
32 +
33 +
34 +- (BOOL)hasUserCenter;
35 +
36 +
37 +- (void)gotoUserCenter;
38 +
39 +
40 +- (void)reportSDK:(HaiBaoJuheReportInfo *)reportInfo;
41 +
42 +
43 +- (BOOL)hasLogout;
44 +
45 +
46 +- (void)logoutSDK;
47 +
48 +
49 +- (BOOL)hasSwitchAccount;
50 +
51 +
52 +- (void)switchAccount;
53 +
54 +
55 +- (BOOL)hasExit;
56 +
57 +
58 +- (void)exitSDK;
59 +
60 +- (void)destroySDK;
61 +
62 +@property(nonatomic, assign)ESDKOrientation sdkOrientation;
63 +
64 +@property(nonatomic, assign)BOOL bShowedFloat;
65 +
66 +
67 +@property(nonatomic, assign)int serverId;
68 +
69 +
70 +-(NSString *) getGameChannelId;
71 +
72 +- (NSString *) getCustomValue;
73 +
74 +- (NSString *) getChannelParameter1;
75 +
76 +- (NSString *) getChannelParameter2;
77 +
78 +-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray*)customArray;
79 +
80 +
81 +- (void)handleOpenurl:(NSURL *)url;
82 +
83 +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
84 +
85 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
86 +
87 +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
88 +
89 +
90 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
91 +
92 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
93 +
94 +
95 +- (void)applicationDidEnterBackground:(UIApplication *)application;
96 +
97 +- (void)applicationDidBecomeActive:(UIApplication *)application;
98 +
99 +- (void)applicationWillEnterForeground:(UIApplication *)application;
100 +
101 +- (void)applicationWillResignActive:(UIApplication *)application;
102 +
103 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
104 +
105 +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
106 +
107 +@end
1 +#import <UIKit/UIKit.h>
2 +#import "HaiBaoJuheChecker.h"
3 +#import "HaiBaoJuheReportInfo.h"
4 +#import "HaiBaoJuheLoginInfo.h"
5 +#import "Interface.h"
6 +#import "HaiBaoJuheNotification.h"
7 +#import "HaiBaoJuheGzyazfInfo.h"
8 +#import "UnionInterface.h"
9 +#import "HaiBaoJuheCreateOrderInfo.h"
10 +#import "HaiBaoJuheConfig.h"
11 +#import "HaiBaoJuheUtils.h"
12 +#import "NetCenter.h"
13 +#import "HaiBaoJuheSDK.h"
14 +#import "HaiBaoJuheSDKDelegate.h"
1 +#import <Foundation/Foundation.h>
2 +
3 +@protocol HaiBaoJuheSDKDelegate <NSObject>
4 +@optional
5 +-(void)HaiBaoJuheSDKLoginSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
6 +-(void)HaiBaoJuheSDKLoginFail:(NSString*)msg;
7 +
8 +-(void)HaiBaoJuheSDKSwitchAccountSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
9 +-(void)HaiBaoJuheSDKSwitchAccountFail:(NSString*)msg;
10 +@end
1 +#import <Foundation/Foundation.h>
2 +#import <UIKit/UIKit.h>
3 +
4 +@interface HaiBaoJuheUtils : NSObject
5 +
6 ++(NSString *)md5:(NSString *)str;
7 ++ (NSDictionary *)RailwayHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
8 ++(NSString *)createGzyazfOrderUrl;
9 +//*充值回调地址
10 ++(NSString *)createGzyazfUrl;
11 +
12 ++(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
13 ++(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
14 +
15 +@end
1 +//
2 +// Interface.h
3 +// HaiBaoJuheSDK
4 +//
5 +// Created by winFan on 12/10/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +
10 +#include "UnionInterface.h"
11 +#import <SafariServices/SafariServices.h>
12 +@interface Interface : NSObject <UnionInterface>
13 +@property(nonatomic, strong)UIViewController *controller;
14 +
15 +
16 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface NetCenter : NSObject
4 +
5 +@property(nonatomic,retain) NSMutableData *receiveData;
6 +
7 +@property(nonatomic,assign)int dataPackSerialNo;
8 +
9 +
10 ++ (NetCenter *)getInstance;
11 +
12 +- (NSString *)httpGetSyn:(NSString *) getUrl;
13 +
14 +- (NSString *)httpPostSyn:(NSString *) postUrl : (NSDictionary *) postData;
15 +
16 +- (void)httpGetNoSyn;
17 +
18 +- (void)httpPostNoSyn:(NSString *) postUrl :(NSDictionary *)postDict;
19 +
20 +- (void)httpPostAsync:(NSString*)postUrl :(NSDictionary*)postDict;
21 +
22 +- (void)httpPostAsyncOpen:(NSString*)postUrl :(NSDictionary*)postDict;
23 +
24 +-(void)httpGetAsync:(NSString *)url completionHandler:(void (^ __nullable)(NSURLResponse* __nullable response, NSData* __nullable data, NSError* __nullable connectionError)) handler;
25 +
26 +- (NSString * __nullable)dicToString:(NSDictionary * __nullable) dict;
27 +@end
1 +#ifndef __HaiBaoJuheSDK__OtherSetting__
2 +#define __HaiBaoJuheSDK__OtherSetting__
3 +
4 +
5 +/**
6 + 应用支持的方向
7 + */
8 +typedef NS_ENUM(NSUInteger, ESDKOrientation) {
9 + ESDKOrientationPortrait = 1,//竖
10 + ESDKOrientationLandscape,//横
11 + ESDKOrientationNone//自动旋转
12 +};
13 +
14 +/**
15 + 应用支持的方向
16 + */
17 +typedef NS_ENUM(NSUInteger, REPORT_TYPE) {
18 + REPORT_TYPE_OPEN = 1,//竖
19 + REPORT_TYPE_ENTER,//横
20 + REPORT_TYPE_DEFINE//自动旋转
21 +};
22 +
23 +#endif /* defined(__HaiBaoJuheSDK__OtherSetting__) */
1 +#import <Foundation/Foundation.h>
2 +#import "OtherSetting.h"
3 +
4 +@interface RailwayHaiBaoJuheBaseModel : NSObject
5 +
6 +- (NSString *)RailwayHaiBaoJuheObjectToJsonString;
7 +- (NSMutableString *)paramAddToString;
8 +- (id)initWithDiction:(NSDictionary *)diction;
9 +
10 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +void DGLog(NSString *fmt, ...);
4 +
5 +typedef NS_ENUM(NSInteger, DGLoggerLevel)
6 +{
7 + ELogVerbose = 1,
8 + ELogDebug,
9 + ELogInfo,
10 + ELogWarn,
11 + ELogError
12 +};
13 +
14 +@interface RailwayHaiBaoJuheDGLogger : NSObject
15 +
16 ++ (void)showLog:(NSString *)fmt,...;
17 +
18 ++ (void)showLog:(DGLoggerLevel)level log:(NSString *)fmt,...;
19 +
20 ++ (void)isShowLog:(BOOL)flag;
21 +
22 +@end
1 +#define TRACK_VERSION @"1.0.1"
2 +#import <Foundation/Foundation.h>
3 +#import <UIKit/UIKit.h>
4 +
5 +NS_ASSUME_NONNULL_BEGIN
6 +@interface TrackingIO : NSObject
7 ++(void) setPrintLog :(BOOL)print;
8 ++ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
9 ++ (void)setRegisterWithAccountID:(NSString *)account;
10 ++ (void)setLoginWithAccountID:(NSString *)account;
11 ++(void)setGzyazfmentStart:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
12 ++(void)setGzyazfment:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
13 ++(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
14 ++(void)setProfile:(NSDictionary *)dataDic;
15 ++(NSString*)getDeviceId;
16 +@end
17 +NS_ASSUME_NONNULL_END
1 +#import <Foundation/Foundation.h>
2 +#import <UIKit/UIKit.h>
3 +#import "HaiBaoJuheSDK2.h"
4 +
5 +@protocol UnionInterface
6 +/**
7 + 初始化SDK
8 + */
9 +
10 +//[[PoolChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationGzyazf notiName:@"" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"" extendData:order_id];
11 +
12 +- (void)SDKinit:(UIViewController *) control;
13 +
14 +
15 +- (void)setViewController:(UIViewController *) viewController;
16 +
17 +/**
18 + 登录SDK
19 + */
20 +- (void)SDKloginSDK;
21 +
22 +
23 +- (void)SDKloginSDK:(UIViewController *) control;
24 +
25 +/**
26 + *是否含有注销接口
27 + */
28 +- (BOOL)hasLogout;
29 +
30 +/**
31 + 注销
32 + */
33 +- (void)SDKlogoutSDK;
34 +
35 +
36 +/**
37 + *是否含有退出接口
38 + **/
39 +- (BOOL)hasExit;
40 +
41 +/**
42 + 退出接口
43 + */
44 +- (void)SDKexitSDK;
45 +
46 +
47 +/**
48 + *SDK销毁操作(游戏退出时调用)
49 + */
50 +
51 +- (void)destroySDK;
52 +
53 +
54 +/**
55 + *是否含有用户中心接口
56 + **/
57 +- (BOOL)hasUserCenter;
58 +
59 +/**
60 + 用户中心
61 + */
62 +- (void)SDKgotoUserCenter;
63 +
64 +/**
65 + *是否含有切换账号接口
66 + **/
67 +- (BOOL)hasSwitchAccount;
68 +
69 +/**
70 + *切换账号
71 + **/
72 +- (void)switchAccount;
73 +
74 +
75 +- (void)viewDidAppear;
76 +
77 +/**
78 + 提交数据
79 + */
80 +- (void)SDKreport:(HaiBaoJuheReportInfo *) reportInfo;
81 +
82 +/**
83 + 进行支付
84 + */
85 +
86 +- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
87 +- (void)receiveCreateOrder: (NSNotification *)notification;
88 +
89 +/**
90 + *充值统计参数
91 + *accountId 账号ID,必填项, 和登陆、注册使用的accountId保持一致即可。
92 + *orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
93 + *currencyAmount 货币金额,单位为元,支持小数
94 + *currencyType 货币类型
95 + *gzyazfType 支付类型(渠道)
96 + */
97 +-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray *)customArray;
98 +
99 +- (void)handleOpenurl:(NSURL *)url;
100 +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
101 +
102 +
103 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
104 +
105 +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
106 +
107 +//推送
108 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
109 +//推送
110 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
111 +
112 +
113 +- (void)applicationDidEnterBackground:(UIApplication *)application;
114 +
115 +- (void)applicationDidBecomeActive:(UIApplication *)application;
116 +
117 +- (void)applicationWillEnterForeground:(UIApplication *)application;
118 +
119 +- (void)applicationWillResignActive:(UIApplication *)application;
120 +
121 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
122 +
123 +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
124 +@end
1 +framework module HaiBaoJuheSDK {
2 + umbrella header "HaiBaoJuheSDK.h"
3 +
4 + export *
5 + module * { export * }
6 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>CFBundleDevelopmentRegion</key>
6 + <string>en</string>
7 + <key>CFBundleExecutable</key>
8 + <string>$(EXECUTABLE_NAME)</string>
9 + <key>CFBundleIdentifier</key>
10 + <string>com.mango.ios.fytx</string>
11 + <key>CFBundleInfoDictionaryVersion</key>
12 + <string>6.0</string>
13 + <key>CFBundleName</key>
14 + <string>$(PRODUCT_NAME)</string>
15 + <key>CFBundlePackageType</key>
16 + <string>APPL</string>
17 + <key>CFBundleShortVersionString</key>
18 + <string>1.0</string>
19 + <key>CFBundleSignature</key>
20 + <string>????</string>
21 + <key>CFBundleVersion</key>
22 + <string>1</string>
23 + <key>LSRequiresIPhoneOS</key>
24 + <true/>
25 + <key>UILaunchStoryboardName</key>
26 + <string>LaunchScreen</string>
27 + <key>UIMainStoryboardFile</key>
28 + <string>Main</string>
29 + <key>UIRequiredDeviceCapabilities</key>
30 + <array>
31 + <string>armv7</string>
32 + </array>
33 + <key>UISupportedInterfaceOrientations</key>
34 + <array>
35 + <string>UIInterfaceOrientationPortrait</string>
36 + <string>UIInterfaceOrientationLandscapeLeft</string>
37 + <string>UIInterfaceOrientationLandscapeRight</string>
38 + </array>
39 +</dict>
40 +</plist>
1 +//
2 +// MainViewController.h
3 +// Demo_qiyu
4 +//
5 +// Created by 许 on 17/6/7.
6 +// Copyright © 2017年 winFan. All rights reserved.
7 +//
8 +
9 +#import <UIKit/UIKit.h>
10 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
11 +
12 +@interface MainViewController : UIViewController
13 +
14 +@end
1 +//
2 +// MainViewController.m
3 +// Demo_qiyu
4 +//
5 +// Created by 许 on 17/6/7.
6 +// Copyright © 2017年 winFan. All rights reserved.
7 +//
8 +
9 +#import "MainViewController.h"
10 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
11 +
12 +@interface MainViewController ()
13 +
14 +@end
15 +
16 +NSString* sdkUserId = @"";
17 +
18 +@implementation MainViewController
19 +
20 +
21 +- (void)viewDidLoad {
22 + [super viewDidLoad];
23 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:HaiBaoJuheSDK_Notification object:nil];
24 + // Do any additional setup after loading the view.
25 + NSLog(@"viewDidLoad");
26 +}
27 +
28 +- (void)didReceiveMemoryWarning {
29 + [super didReceiveMemoryWarning];
30 + // Dispose of any resources that can be recreated.
31 +}
32 +
33 +/*
34 +#pragma mark - Navigation
35 +
36 +// In a storyboard-based application, you will often want to do a little preparation before navigation
37 +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
38 + // Get the new view controller using [segue destinationViewController].
39 + // Pass the selected object to the new view controller.
40 +}
41 +*/
42 +
43 +- (void)receiveSDKMessage:(NSNotification *)notification
44 +{
45 + HaiBaoJuheSDKResult *result = [notification object];
46 + if (result) {
47 + NSLog(@"notiType:%d",result.notiType);
48 + switch (result.notiType) {
49 +
50 + case HaiBaoJuheSDKNotificationInitSDK:
51 + {
52 + NSLog(@"sdk初始化成功");
53 + }
54 +
55 + break;
56 + case HaiBaoJuheSDKNotificationLogin:
57 + {
58 + NSLog(@"result state:%d",result.statusCode);
59 + if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
60 + HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
61 + sdkUserId = [loginInfo openId];
62 + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
63 + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
64 + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
65 + NSLog(@"userType:%@",[loginInfo userType]);
66 + }else{
67 + NSLog(@"登录失败:%@",[result description]);
68 + }
69 + }
70 + break;
71 + case HaiBaoJuheSDKNotificationLogout:
72 + {
73 + NSLog(@"sdk注销成功,游戏处理");
74 + }
75 + break;
76 + case HaiBaoJuheSDKNotificationSwitchAccount:
77 + NSLog(@"切换账号通知");
78 + if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
79 + HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
80 + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
81 + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
82 + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
83 + NSLog(@"userType:%@",[loginInfo userType]);
84 + }else{
85 + NSLog(@"%@",[result description]);
86 + }
87 + break;
88 + default:
89 + break;
90 + }
91 + }
92 +}
93 +
94 +- (IBAction)actionInit:(id)sender {
95 + [[HaiBaoJuheSDK shareSDK]initSDK:self];
96 +}
97 +- (IBAction)actionLogin:(id)sender {
98 + [[HaiBaoJuheSDK shareSDK] loginSDK];
99 +}
100 +
101 +- (IBAction)actionPay:(id)sender {
102 + HaiBaoJuheCreateOrderInfo *payInfo = [[HaiBaoJuheCreateOrderInfo alloc]init];
103 + [payInfo setServerId:@"99887766"];
104 + [payInfo setPlayerName:@"iamrolename"];
105 + [payInfo setPlayerLevel:@"10"];
106 + [payInfo setUserId:sdkUserId];
107 + [payInfo setPostAmount:@"1"];
108 + [payInfo setProductId:@"com.xiongdi.xunqinji.6"];
109 + [payInfo setPlayerId:@"1231241234"];
110 + [payInfo setProductName:@"com.xiongdi.xunqinji.6"];
111 + [payInfo setProductDesc:@"productDes"];
112 + [payInfo setTimestamp:@"1232134"];
113 + [payInfo setExchange:@"1"];
114 + [payInfo setServerName:@"servername"];
115 + [payInfo setCustom:@"custom"];
116 + [[HaiBaoJuheSDK shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
117 +}
118 +
119 +-(NSString*)getCurrentTimestamp{
120 + // 时间戳转时间
121 + NSTimeInterval interval = [[NSDate date] timeIntervalSince1970] * 1000;
122 + NSString* timeStr = [[NSString alloc]initWithFormat:@"%.f",interval];
123 + return timeStr;
124 +}
125 +
126 +/**
127 + serverid
128 + servername
129 + roleid
130 + rolename
131 + rolelevel
132 +*/
133 +- (IBAction)actionSubmitRoleData:(id)sender {
134 + NSLog(@"数据接口");
135 + HaiBaoJuheReportInfo *reportInfo = [[HaiBaoJuheReportInfo alloc]init];
136 + [reportInfo setReportType:REPORT_ENTER];
137 + //[reportInfo setReportType:REPORT_CREATEROLE];
138 + //[reportInfo setReportType:REPORT_ROLEUPGRADE]
139 + [reportInfo setServerId:@"28"];
140 + [reportInfo setServerName:@"serverName"];
141 + [reportInfo setPlayerId:@"1231241234"];
142 + [reportInfo setPlayerName:@"playName"];
143 + [reportInfo setPlayerLevel:@"10"];
144 + [reportInfo setPartyName:@"1345"];
145 + [reportInfo setRoleCTime:[[NSNumber alloc]initWithLong:[self getCurrentTimestamp].longLongValue]];
146 + [reportInfo setRoleChangeTime:[[NSNumber alloc]initWithLong:[self getCurrentTimestamp].longLongValue]];
147 + [[HaiBaoJuheSDK shareSDK] reportSDK:reportInfo];
148 +}
149 +
150 +- (IBAction)actionLogout:(id)sender {
151 + NSLog(@"注销");
152 + if ([[HaiBaoJuheSDK shareSDK] hasLogout]) {
153 + [[HaiBaoJuheSDK shareSDK] logoutSDK];
154 + }
155 +}
156 +
157 +- (IBAction)actionSwitchAccount:(id)sender {
158 + if([[HaiBaoJuheSDK shareSDK] hasSwitchAccount]){
159 + [[HaiBaoJuheSDK shareSDK] switchAccount];
160 + }
161 +}
162 +
163 +
164 +
165 +#pragma mark - 截屏
166 +- (void)screenShot:(UIView *)view{
167 + UIImage* image = nil;
168 + UIGraphicsBeginImageContext(view.bounds.size);
169 + [view.layer renderInContext:UIGraphicsGetCurrentContext()];
170 + image = UIGraphicsGetImageFromCurrentImageContext();
171 + UIGraphicsEndImageContext();
172 + UIGraphicsEndImageContext();
173 + if (image != nil) {
174 + NSLog(@"截图成功!");
175 + UIImageWriteToSavedPhotosAlbum(image,self,@selector(image:didFinishSavingWithError:contextInfo:),NULL);
176 + }
177 +}
178 +
179 +
180 +#pragma mark - 保存到相册
181 +-(void)image:(UIImage *)image didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo
182 +{
183 + if(!error){
184 + NSLog(@"存到相册");
185 + }else{
186 + NSLog(@"存储失败");
187 +
188 + }
189 +}
190 +
191 +//获取渠道参数
192 +-(void)getChannel{
193 + //获取channelId值
194 + [[HaiBaoJuheSDK shareSDK]getGameChannelId];
195 + //获取渠道参数1
196 + [[HaiBaoJuheSDK shareSDK]getChannelParameter1];
197 + //获取渠道参数2
198 + [[HaiBaoJuheSDK shareSDK]getChannelParameter2];
199 + //获取自定义参数
200 + [[HaiBaoJuheSDK shareSDK]getCustomValue];
201 +}
202 +
203 +
204 +@end
1 +//
2 +// ViewController.h
3 +// publiDemo
4 +//
5 +// Created by winFan on 11/30/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import <UIKit/UIKit.h>
10 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
11 +@interface ViewController : UIViewController
12 +
13 +- (void)receiveSDKMessage : (NSNotification *)notification;
14 +
15 +@end
16 +
1 +
2 +#import "ViewController.h"
3 +
4 +@interface ViewController ()
5 +
6 +@end
7 +
8 +@implementation ViewController
9 +
10 +
11 +- (void)viewDidLoad {
12 + [super viewDidLoad];
13 + // Do any additional setup after loading the view, typically from a nib.
14 + UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
15 + [button1 setTitle:@"登陆" forState:UIControlStateNormal];
16 + button1.frame = CGRectMake(50.0f, 100.0f, 50.0f, 40.0f);
17 + button1.tag = 1;
18 + [button1 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
19 + [self.view addSubview:button1];
20 +
21 + UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
22 + [button2 setTitle:@"数据" forState:UIControlStateNormal];
23 + button2.frame = CGRectMake(150.0f, 100.0f, 50.0f, 40.0f);
24 + button2.tag = 2;
25 + [button2 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
26 + [self.view addSubview:button2];
27 +
28 + UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom];
29 + [button4 setTitle:@"充值" forState:UIControlStateNormal];
30 + button4.frame = CGRectMake(150.0f, 50.0f, 50.0f, 40.0f);
31 + button4.tag = 4;
32 + [button4 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
33 + [self.view addSubview:button4];
34 +
35 +
36 + UIButton *button6 = [UIButton buttonWithType:UIButtonTypeCustom];
37 + [button6 setTitle:@"获取配置参数" forState:UIControlStateNormal];
38 + button6.frame = CGRectMake(10.0f, 50.0f, 150.0f, 40.0f);
39 + button6.tag = 6;
40 + [button6 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
41 + [self.view addSubview:button6];
42 +
43 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:HaiBaoJuheSDK_Notification object:nil];
44 +
45 + [[HaiBaoJuheSDK shareSDK]initSDK:self];
46 +}
47 +
48 +-(void)viewDidAppear:(BOOL)animated{
49 + [super viewDidAppear:animated];
50 + //[[HaiBaoJuheSDK shareSDK] viewDidAppear];
51 +}
52 +
53 +
54 +- (void) toggleButton: (UIButton *) button
55 +{
56 + int tag = (int)button.tag;
57 + if (tag == 1) {
58 + [[HaiBaoJuheSDK shareSDK] loginSDK];
59 + }
60 + else if (tag == 2)
61 + {
62 + NSLog(@"数据接口");
63 + HaiBaoJuheReportInfo *reportInfo = [[HaiBaoJuheReportInfo alloc]init];
64 + [reportInfo setReportType:REPORT_ENTER];
65 + //[reportInfo setReportType:REPORT_CREATEROLE];
66 + //[reportInfo setReportType:REPORT_ROLEUPGRADE]
67 + [reportInfo setServerId:@"9133"];
68 + [reportInfo setPlayerName:@"roleName"];
69 + [reportInfo setPlayerId:@"pserverName"];
70 + [[HaiBaoJuheSDK shareSDK] reportSDK:reportInfo];
71 + }
72 + else if (tag == 4)
73 + {
74 + HaiBaoJuheCreateOrderInfo *payInfo = [[HaiBaoJuheCreateOrderInfo alloc]init];
75 + [payInfo setServerId:@"111"];
76 + [payInfo setPostAmount:@"6"];
77 + [payInfo setPlayerId:@"1231241234"];
78 + [payInfo setTimestamp:@"1232134"];
79 + [payInfo setExchange:@"10"];
80 + [payInfo setCustom:@"custom"];
81 + NSLog(@"start pay");
82 + [[HaiBaoJuheSDK shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
83 + }
84 + else if(tag == 6){
85 + HaiBaoJuheSDK *haiBaoJuheSDK = [HaiBaoJuheSDK shareSDK];
86 + NSLog(@"channelId:%@parame1:%@parame2:%@custom:%@",[haiBaoJuheSDK getGameChannelId],[haiBaoJuheSDK getChannelParameter1],[haiBaoJuheSDK getChannelParameter2],[haiBaoJuheSDK getCustomValue]);
87 + }
88 +}
89 +
90 +
91 +- (void)didReceiveMemoryWarning {
92 + [super didReceiveMemoryWarning];
93 +}
94 +
95 +- (void)receiveSDKMessage:(NSNotification *)notification
96 +{
97 + NSLog(@"receiveSDKMessage");
98 + [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
99 + HaiBaoJuheSDKResult *result = [notification object];
100 + if (result == nil ) {
101 + return;
102 + }
103 + switch (result.notiType) {
104 +
105 + case HaiBaoJuheSDKNotificationInitSDK:
106 + {
107 + NSLog(@"收到HaiBaoJuheSDKNotificationInitSDK");
108 + }
109 +
110 + break;
111 + case HaiBaoJuheSDKNotificationLogin:
112 + {
113 + NSLog(@"result state:%d",result.statusCode);
114 + if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
115 + HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
116 + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
117 + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
118 + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
119 + NSLog(@"userType:%@",[loginInfo userType]);
120 + }else{
121 + NSLog(@"%@",[result description]);
122 + }
123 + }
124 + break;
125 + case HaiBaoJuheSDKNotificationGzyazf:
126 + {
127 + NSLog(@"收到登陆信息HaiBaoJuheSDKNotificationPay");
128 + }
129 + break;
130 + default:
131 + break;
132 + }
133 +}
134 +
135 +@end
1 +//
2 +// main.m
3 +// Demo
4 +//
5 +// Created by winFan on 12/9/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import <UIKit/UIKit.h>
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 +}
No preview for this file type
1 +//
2 +// DemoTests.m
3 +// DemoTests
4 +//
5 +// Created by winFan on 12/9/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import <UIKit/UIKit.h>
10 +#import <XCTest/XCTest.h>
11 +
12 +@interface DemoTests : XCTestCase
13 +
14 +@end
15 +
16 +@implementation DemoTests
17 +
18 +- (void)setUp {
19 + [super setUp];
20 + // Put setup code here. This method is called before the invocation of each test method in the class.
21 +}
22 +
23 +- (void)tearDown {
24 + // Put teardown code here. This method is called after the invocation of each test method in the class.
25 + [super tearDown];
26 +}
27 +
28 +- (void)testExample {
29 + // This is an example of a functional test case.
30 + XCTAssert(YES, @"Pass");
31 +}
32 +
33 +- (void)testPerformanceExample {
34 + // This is an example of a performance test case.
35 + [self measureBlock:^{
36 + // Put the code you want to measure the time of here.
37 + }];
38 +}
39 +
40 +@end
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>CFBundleDevelopmentRegion</key>
6 + <string>en</string>
7 + <key>CFBundleExecutable</key>
8 + <string>$(EXECUTABLE_NAME)</string>
9 + <key>CFBundleIdentifier</key>
10 + <string>com.mango.ios.fytx.$(PRODUCT_NAME:rfc1034identifier)</string>
11 + <key>CFBundleInfoDictionaryVersion</key>
12 + <string>6.0</string>
13 + <key>CFBundleName</key>
14 + <string>$(PRODUCT_NAME)</string>
15 + <key>CFBundlePackageType</key>
16 + <string>BNDL</string>
17 + <key>CFBundleShortVersionString</key>
18 + <string>1.0</string>
19 + <key>CFBundleSignature</key>
20 + <string>????</string>
21 + <key>CFBundleVersion</key>
22 + <string>1</string>
23 +</dict>
24 +</plist>
No preview for this file type
1 +#import <UIKit/UIKit.h>
2 +
3 +@interface HNYouaiIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
4 +
5 +@property(nonatomic,strong) NSString* HNYouaiDingDanHao;
6 +@property(nonatomic,strong) NSDictionary* HNYouaiHuoWuLieBiao;
7 +@property(nonatomic,strong) NSMutableArray* HNYouaiHuoWuIDLieBiao;
8 +@property(nonatomic, strong) UITableView *HNYouaiHuoWuLieBiaoView;
9 +
10 +- (void)HNYouaiHuaQianView:(UIViewController*)controller HNYouaiHuoWuD:(NSString*)products HNYouaiQian:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*)DingDanHao;
11 +
12 +@end
1 +#import <UIKit/UIKit.h>
2 +#import "StoreKit/StoreKit.h"
3 +
4 +@interface HNYouaiAllManager : NSObject
5 +{
6 + NSString* HNYouaiAPPID_;
7 + NSString* HNYouaiAPPKEY_;
8 +
9 + NSString* HNYouaiInviterCode_;
10 +}
11 +
12 +@property bool HNYouaiGeiWoHuaQianBa;
13 +
14 ++ (HNYouaiAllManager *)HNYouaiInstance;
15 +
16 +- (void)HNYouaiChuShiHua;
17 +
18 +- (void)HNYouaiDengLu:(NSString *)HNYouaiAPPID : (NSString *)HNYouaiAPPKEY : (UIViewController *)controller;
19 +
20 +- (void)HNYouaiYangShi:(NSString*)HNYouaiLeiXing;
21 +
22 +- (void)HNYouaiQuery: (NSString *)HNYouaiFuWuQiID : (NSString *)HNYouaiNickName : (NSNumber *)HNYouaiAmount : (NSString *)HNYouaiCallBack : (UIViewController *)controller : (NSString *)HNYouaiServerName;
23 +
24 +- (void)HNYouaiQueryOperation:(UIViewController*)controll HNYouaiHuoWuID:(NSString*)products HNYouaiJiaGe:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*) DingDanHao;
25 +
26 +
27 +
28 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +extern NSString * const HNYouaiExitNotification;
4 +extern NSString * const HNYouaiLoginNotification;
5 +extern NSString * const HNYouaiErrorNotification;
6 +
7 +
8 +@interface HNYouaiHuiTiaoNotification : NSObject
9 +
10 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HNYouaiInformation : NSObject
4 +{
5 +//
6 +NSString *openId;
7 +NSString *token;
8 +NSString *timestamp;
9 +
10 +}
11 +
12 +@property(retain,nonatomic) NSString *openId;
13 +@property(retain,nonatomic) NSString *token;
14 +@property(retain,nonatomic) NSString *timestamp;
15 ++ (HNYouaiInformation *)getInstance;
16 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HNYouaiInformationJM : NSObject
4 +
5 ++(NSString *)HNYouaiJM:(NSString *)jm;
6 +
7 +@end
1 +#import <UIKit/UIKit.h>
2 +
3 +@interface HNYouaiLocation : NSObject
4 +
5 ++ (NSString *)HNYouaiSKCloudServiceSetupOptionsKey;
6 +@end
7 +
1 +#import <UIKit/UIKit.h>
2 +#import "HNYouaiInformation.h"
3 +#import <JavaScriptCore/JavaScriptCore.h>
4 +
5 +@interface HNYouaiMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
6 +{
7 + UIWebView *webView_;
8 + UIActivityIndicatorView *activityIndicator;
9 +}
10 +
11 +@property(assign) BOOL HNYouaiYouYuanJiao;
12 +
13 +- (void)HNYouaiSettingCKAssetsView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
14 +- (void)HNYouaiChuShiHuaWebView;
15 +- (void)loadWebPageWithString:(NSString *)url;
16 +- (void)loadWebPageWithJs:(NSString *)content;
17 +- (void)postNotification:(NSString *)name : (NSString *)code;
18 +- (void)receiveIap:(NSNotification *)notification;
19 +
20 +@end
1 +//
2 +// IAPHelper.h
3 +//
4 +// Original Created by Ray Wenderlich on 2/28/11.
5 +// Created by saturngod on 7/9/12.
6 +// Copyright 2011 Ray Wenderlich. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +#import "StoreKit/StoreKit.h"
11 +
12 +
13 +typedef void (^IAPProductsResponseBlock)(SKProductsRequest* request , SKProductsResponse* response);
14 +
15 +typedef void (^IAPbuyProductCompleteResponseBlock)(SKPaymentTransaction* transcation);
16 +
17 +typedef void (^checkReceiptCompleteResponseBlock)(NSString* response,NSError* error);
18 +
19 +typedef void (^resoreProductsCompleteResponseBlock) (SKPaymentQueue* payment,NSError* error);
20 +
21 +@interface IAPHelper : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver>
22 +
23 +@property (nonatomic,strong) NSSet *productIdentifiers;
24 +@property (nonatomic,strong) NSArray * products;
25 +@property (nonatomic,strong) NSMutableSet *purchasedProducts;
26 +@property (nonatomic,strong) SKProductsRequest *request;
27 +@property (nonatomic) BOOL production;
28 +
29 +//init With Product Identifiers
30 +- (id)initWithProductIdentifiers:(NSSet *)productIdentifiers;
31 +
32 +//get Products List
33 +- (void)requestProductsWithCompletion:(IAPProductsResponseBlock)completion;
34 +
35 +
36 +//Buy Product
37 +- (void)buyProduct:(SKProduct *)productIdentifier onCompletion:(IAPbuyProductCompleteResponseBlock)completion;
38 +
39 +//restore Products
40 +- (void)restoreProductsWithCompletion:(resoreProductsCompleteResponseBlock)completion;
41 +
42 +//check isPurchased or not
43 +- (BOOL)isPurchasedProductsIdentifier:(NSString*)productID;
44 +
45 +//check receipt but recommend to use in server side instead of using this function
46 +- (void)checkReceipt:(NSData*)receiptData onCompletion:(checkReceiptCompleteResponseBlock)completion;
47 +
48 +- (void)checkReceipt:(NSData*)receiptData AndSharedSecret:(NSString*)secretKey onCompletion:(checkReceiptCompleteResponseBlock)completion;
49 +
50 +
51 +//saved purchased product
52 +- (void)provideContentWithTransaction:(SKPaymentTransaction *)transaction;
53 +
54 +- (void)provideContent:(NSString *)productIdentifier __deprecated_msg("use provideContentWithTransaction: instead.");
55 +
56 +//clear the saved products
57 +- (void)clearSavedPurchasedProducts;
58 +- (void)clearSavedPurchasedProductByID:(NSString*)productIdentifier;
59 +
60 +
61 +//Get The Price with local currency
62 +- (NSString *)getLocalePrice:(SKProduct *)product;
63 +
64 +@end
1 +//
2 +// IAPShare.h
3 +// ;
4 +//
5 +// Created by Htain Lin Shwe on 10/7/12.
6 +// Copyright (c) 2012 Edenpod. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +#import "IAPHelper.h"
11 +@interface IAPShare : NSObject
12 +@property (nonatomic,strong) IAPHelper *iap;
13 +
14 ++ (IAPShare *) sharedHelper;
15 +
16 ++(id)toJSON:(NSString*)json;
17 +@end
1 +//
2 +// NSString+Base64.h
3 +// Newsstand
4 +//
5 +// Created by Carlo Vigiani on 29/Oct/11.
6 +// Copyright (c) 2011 viggiosoft. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +
11 +@interface NSString (Base64)
12 +
13 ++ (NSString *) base64StringFromData:(NSData *)data length:(long)length;
14 +
15 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface NSURLRequest (SSL)
4 ++(BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
5 +
6 ++(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
7 +@end
1 +//
2 +// SFHFKeychainUtils.h
3 +//
4 +// Created by Buzz Andersen on 10/20/08.
5 +// Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone.
6 +// Copyright 2008 Sci-Fi Hi-Fi. All rights reserved.
7 +//
8 +// Permission is hereby granted, free of charge, to any person
9 +// obtaining a copy of this software and associated documentation
10 +// files (the "Software"), to deal in the Software without
11 +// restriction, including without limitation the rights to use,
12 +// copy, modify, merge, publish, distribute, sublicense, and/or sell
13 +// copies of the Software, and to permit persons to whom the
14 +// Software is furnished to do so, subject to the following
15 +// conditions:
16 +//
17 +// The above copyright notice and this permission notice shall be
18 +// included in all copies or substantial portions of the Software.
19 +//
20 +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22 +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25 +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 +// OTHER DEALINGS IN THE SOFTWARE.
28 +//
29 +
30 +#import <UIKit/UIKit.h>
31 +
32 +
33 +@interface SFHFKeychainUtils : NSObject {
34 +
35 +}
36 +
37 ++ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
38 ++ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
39 ++ (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
40 +
41 +@end
...\ No newline at end of file ...\ No newline at end of file
No preview for this file type
1 +channelRootPath = "poolsdk_file"
2 +gameProjName = 'Demo'
...\ No newline at end of file ...\ No newline at end of file
No preview for this file type
1 +# Copyright 2012 Calvin Rien
2 +#
3 +# Licensed under the Apache License, Version 2.0 (the "License");
4 +# you may not use this file except in compliance with the License.
5 +# You may obtain a copy of the License at
6 +#
7 +# http://www.apache.org/licenses/LICENSE-2.0
8 +#
9 +# Unless required by applicable law or agreed to in writing, software
10 +# distributed under the License is distributed on an "AS IS" BASIS,
11 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 +# See the License for the specific language governing permissions and
13 +# limitations under the License.
14 +
15 +# A pbxproj file is an OpenStep format plist
16 +# {} represents dictionary of key=value pairs delimited by ;
17 +# () represents list of values delimited by ,
18 +# file starts with a comment specifying the character type
19 +# // !$*UTF8*$!
20 +
21 +# when adding a file to a project, create the PBXFileReference
22 +# add the PBXFileReference's guid to a group
23 +# create a PBXBuildFile with the PBXFileReference's guid
24 +# add the PBXBuildFile to the appropriate build phase
25 +
26 +# when adding a header search path add
27 +# HEADER_SEARCH_PATHS = "path/**";
28 +# to each XCBuildConfiguration object
29 +
30 +# Xcode4 will read either a OpenStep or XML plist.
31 +# this script uses `plutil` to validate, read and write
32 +# the pbxproj file. Plutil is available in OS X 10.2 and higher
33 +# Plutil can't write OpenStep plists, so I save as XML
34 +
35 +import datetime
36 +import json
37 +import ntpath
38 +import os
39 +import plistlib
40 +import re
41 +import shutil
42 +import subprocess
43 +import uuid
44 +
45 +from UserDict import IterableUserDict
46 +from UserList import UserList
47 +
48 +regex = '[a-zA-Z0-9\\._/-]*'
49 +
50 +
51 +class PBXEncoder(json.JSONEncoder):
52 + def default(self, obj):
53 + """Tests the input object, obj, to encode as JSON."""
54 +
55 + if isinstance(obj, (PBXList, PBXDict)):
56 + return obj.data
57 +
58 + return json.JSONEncoder.default(self, obj)
59 +
60 +
61 +class PBXDict(IterableUserDict):
62 + def __init__(self, d=None):
63 + if d:
64 + d = dict([(PBXType.Convert(k), PBXType.Convert(v)) for k, v in d.items()])
65 +
66 + IterableUserDict.__init__(self, d)
67 +
68 + def __setitem__(self, key, value):
69 + IterableUserDict.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
70 +
71 + def remove(self, key):
72 + self.data.pop(PBXType.Convert(key), None)
73 +
74 +
75 +class PBXList(UserList):
76 + def __init__(self, l=None):
77 + if isinstance(l, basestring):
78 + UserList.__init__(self)
79 + self.add(l)
80 + return
81 + elif l:
82 + l = [PBXType.Convert(v) for v in l]
83 +
84 + UserList.__init__(self, l)
85 +
86 + def add(self, value):
87 + value = PBXType.Convert(value)
88 +
89 + if value in self.data:
90 + return False
91 +
92 + self.data.append(value)
93 + return True
94 +
95 + def remove(self, value):
96 + value = PBXType.Convert(value)
97 +
98 + if value in self.data:
99 + self.data.remove(value)
100 + return True
101 + return False
102 +
103 + def __setitem__(self, key, value):
104 + UserList.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
105 +
106 +
107 +class PBXType(PBXDict):
108 + def __init__(self, d=None):
109 + PBXDict.__init__(self, d)
110 +
111 + if 'isa' not in self:
112 + self['isa'] = self.__class__.__name__
113 + self.id = None
114 +
115 + @staticmethod
116 + def Convert(o):
117 + if isinstance(o, list):
118 + return PBXList(o)
119 + elif isinstance(o, dict):
120 + isa = o.get('isa')
121 +
122 + if not isa:
123 + return PBXDict(o)
124 +
125 + cls = globals().get(isa)
126 +
127 + if cls and issubclass(cls, PBXType):
128 + return cls(o)
129 +
130 + print 'warning: unknown PBX type: %s' % isa
131 + return PBXDict(o)
132 + else:
133 + return o
134 +
135 + @staticmethod
136 + def IsGuid(o):
137 + return re.match('^[A-F0-9]{24}$', str(o))
138 +
139 + @classmethod
140 + def GenerateId(cls):
141 + return ''.join(str(uuid.uuid4()).upper().split('-')[1:])
142 +
143 + @classmethod
144 + def Create(cls, *args, **kwargs):
145 + return cls(*args, **kwargs)
146 +
147 +
148 +class PBXFileReference(PBXType):
149 + def __init__(self, d=None):
150 + PBXType.__init__(self, d)
151 + self.build_phase = None
152 +
153 + types = {
154 + '.a': ('archive.ar', 'PBXFrameworksBuildPhase'),
155 + '.app': ('wrapper.application', None),
156 + '.s': ('sourcecode.asm', 'PBXSourcesBuildPhase'),
157 + '.c': ('sourcecode.c.c', 'PBXSourcesBuildPhase'),
158 + '.cpp': ('sourcecode.cpp.cpp', 'PBXSourcesBuildPhase'),
159 + '.framework': ('wrapper.framework', 'PBXFrameworksBuildPhase'),
160 + '.h': ('sourcecode.c.h', None),
161 + '.hpp': ('sourcecode.c.h', None),
162 + '.d': ('sourcecode.dtrace', 'PBXSourcesBuildPhase'),
163 + '.swift': ('sourcecode.swift', 'PBXSourcesBuildPhase'),
164 + '.icns': ('image.icns', 'PBXResourcesBuildPhase'),
165 + '.m': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
166 + '.j': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
167 + '.mm': ('sourcecode.cpp.objcpp', 'PBXSourcesBuildPhase'),
168 + '.nib': ('wrapper.nib', 'PBXResourcesBuildPhase'),
169 + '.plist': ('text.plist.xml', 'PBXResourcesBuildPhase'),
170 + '.json': ('text.json', 'PBXResourcesBuildPhase'),
171 + '.png': ('image.png', 'PBXResourcesBuildPhase'),
172 + '.rtf': ('text.rtf', 'PBXResourcesBuildPhase'),
173 + '.tiff': ('image.tiff', 'PBXResourcesBuildPhase'),
174 + '.txt': ('text', 'PBXResourcesBuildPhase'),
175 + '.xcodeproj': ('wrapper.pb-project', None),
176 + '.xib': ('file.xib', 'PBXResourcesBuildPhase'),
177 + '.strings': ('text.plist.strings', 'PBXResourcesBuildPhase'),
178 + '.bundle': ('wrapper.plug-in', 'PBXResourcesBuildPhase'),
179 + '.dylib': ('compiled.mach-o.dylib', 'PBXFrameworksBuildPhase'),
180 + '.xcdatamodeld': ('wrapper.xcdatamodel', 'PBXSourcesBuildPhase'),
181 + '.xcassets': ('folder.assetcatalog', 'PBXResourcesBuildPhase'),
182 + '.tbd': ('sourcecode.text-based-dylib-definition', 'PBXFrameworksBuildPhase'),
183 + }
184 +
185 + trees = [
186 + '<absolute>',
187 + '<group>',
188 + 'BUILT_PRODUCTS_DIR',
189 + 'DEVELOPER_DIR',
190 + 'SDKROOT',
191 + 'SOURCE_ROOT',
192 + ]
193 +
194 + def guess_file_type(self, ignore_unknown_type=False):
195 + self.remove('explicitFileType')
196 + self.remove('lastKnownFileType')
197 +
198 +
199 + ext = os.path.splitext(self.get('name', ''))[1]
200 + if os.path.isdir(self.get('path')) and ext not in XcodeProject.special_folders:
201 + f_type = 'folder'
202 + build_phase = None
203 + ext = ''
204 + else:
205 + f_type, build_phase = PBXFileReference.types.get(ext, ('?', 'PBXResourcesBuildPhase'))
206 +
207 + self['lastKnownFileType'] = f_type
208 + self.build_phase = build_phase
209 +
210 + if f_type == '?' and not ignore_unknown_type:
211 + print 'unknown file extension: %s' % ext
212 + print 'please add extension and Xcode type to PBXFileReference.types'
213 +
214 + return f_type
215 +
216 + def set_file_type(self, ft):
217 + self.remove('explicitFileType')
218 + self.remove('lastKnownFileType')
219 +
220 + self['explicitFileType'] = ft
221 +
222 + @classmethod
223 + def Create(cls, os_path, tree='SOURCE_ROOT', ignore_unknown_type=False):
224 + if tree not in cls.trees:
225 + print 'Not a valid sourceTree type: %s' % tree
226 + return None
227 +
228 + fr = cls()
229 + fr.id = cls.GenerateId()
230 + fr['path'] = os_path
231 + fr['name'] = os.path.split(os_path)[1]
232 + fr['sourceTree'] = '<absolute>' if os.path.isabs(os_path) else tree
233 + fr.guess_file_type(ignore_unknown_type=ignore_unknown_type)
234 +
235 + return fr
236 +
237 +
238 +class PBXBuildFile(PBXType):
239 + def set_weak_link(self, weak=False):
240 + k_settings = 'settings'
241 + k_attributes = 'ATTRIBUTES'
242 +
243 + s = self.get(k_settings)
244 +
245 + if not s:
246 + if weak:
247 + self[k_settings] = PBXDict({k_attributes: PBXList(['Weak'])})
248 +
249 + return True
250 +
251 + atr = s.get(k_attributes)
252 +
253 + if not atr:
254 + if weak:
255 + atr = PBXList()
256 + else:
257 + return False
258 +
259 + if weak:
260 + atr.add('Weak')
261 + else:
262 + atr.remove('Weak')
263 +
264 + self[k_settings][k_attributes] = atr
265 +
266 + return True
267 +
268 + def add_compiler_flag(self, flag):
269 + k_settings = 'settings'
270 + k_attributes = 'COMPILER_FLAGS'
271 +
272 + if k_settings not in self:
273 + self[k_settings] = PBXDict()
274 +
275 + if k_attributes not in self[k_settings]:
276 + self[k_settings][k_attributes] = flag
277 + return True
278 +
279 + flags = self[k_settings][k_attributes].split(' ')
280 +
281 + if flag in flags:
282 + return False
283 +
284 + flags.append(flag)
285 +
286 + self[k_settings][k_attributes] = ' '.join(flags)
287 +
288 + @classmethod
289 + def Create(cls, file_ref, weak=False):
290 + if isinstance(file_ref, PBXFileReference):
291 + file_ref = file_ref.id
292 +
293 + bf = cls()
294 + bf.id = cls.GenerateId()
295 + bf['fileRef'] = file_ref
296 +
297 + if weak:
298 + bf.set_weak_link(True)
299 +
300 + return bf
301 +
302 +
303 +class PBXGroup(PBXType):
304 + def add_child(self, ref):
305 + if not isinstance(ref, PBXDict):
306 + return None
307 +
308 + isa = ref.get('isa')
309 +
310 + if isa != 'PBXFileReference' and isa != 'PBXGroup':
311 + return None
312 +
313 + if 'children' not in self:
314 + self['children'] = PBXList()
315 +
316 + self['children'].add(ref.id)
317 +
318 + return ref.id
319 +
320 + def remove_child(self, id):
321 + if 'children' not in self:
322 + self['children'] = PBXList()
323 + return
324 +
325 + if not PBXType.IsGuid(id):
326 + id = id.id
327 +
328 + self['children'].remove(id)
329 +
330 + def has_child(self, id):
331 + if 'children' not in self:
332 + self['children'] = PBXList()
333 + return False
334 +
335 + if not PBXType.IsGuid(id):
336 + id = id.id
337 +
338 + return id in self['children']
339 +
340 + def get_name(self):
341 + path_name = os.path.split(self.get('path', ''))[1]
342 + return self.get('name', path_name)
343 +
344 + @classmethod
345 + def Create(cls, name, path=None, tree='SOURCE_ROOT'):
346 + grp = cls()
347 + grp.id = cls.GenerateId()
348 + grp['name'] = name
349 + grp['children'] = PBXList()
350 +
351 + if path:
352 + grp['path'] = path
353 + grp['sourceTree'] = tree
354 + else:
355 + grp['sourceTree'] = '<group>'
356 +
357 + return grp
358 +
359 +
360 +class PBXNativeTarget(PBXType):
361 + pass
362 +
363 +
364 +class PBXProject(PBXType):
365 + pass
366 +
367 +
368 +class PBXContainerItemProxy(PBXType):
369 + pass
370 +
371 +
372 +class PBXReferenceProxy(PBXType):
373 + pass
374 +
375 +
376 +class PBXVariantGroup(PBXType):
377 + pass
378 +
379 +
380 +class PBXTargetDependency(PBXType):
381 + pass
382 +
383 +
384 +class PBXAggregateTarget(PBXType):
385 + pass
386 +
387 +
388 +class PBXHeadersBuildPhase(PBXType):
389 + pass
390 +
391 +class XCVersionGroup(PBXType):
392 + pass
393 +
394 +class PBXBuildPhase(PBXType):
395 + def add_build_file(self, bf):
396 + if bf.get('isa') != 'PBXBuildFile':
397 + return False
398 +
399 + if 'files' not in self:
400 + self['files'] = PBXList()
401 +
402 + self['files'].add(bf.id)
403 +
404 + return True
405 +
406 + def remove_build_file(self, id):
407 + if 'files' not in self:
408 + self['files'] = PBXList()
409 + return
410 +
411 + self['files'].remove(id)
412 +
413 + def has_build_file(self, id):
414 + if 'files' not in self:
415 + self['files'] = PBXList()
416 + return False
417 +
418 + if not PBXType.IsGuid(id):
419 + id = id.id
420 +
421 + return id in self['files']
422 +
423 +
424 +class PBXFrameworksBuildPhase(PBXBuildPhase):
425 + pass
426 +
427 +
428 +class PBXResourcesBuildPhase(PBXBuildPhase):
429 + pass
430 +
431 +
432 +class PBXShellScriptBuildPhase(PBXBuildPhase):
433 + @classmethod
434 + def Create(cls, script, shell="/bin/sh", files=[], input_paths=[], output_paths=[], show_in_log = '0'):
435 + bf = cls()
436 + bf.id = cls.GenerateId()
437 + bf['files'] = files
438 + bf['inputPaths'] = input_paths
439 + bf['outputPaths'] = output_paths
440 + bf['runOnlyForDeploymentPostprocessing'] = '0';
441 + bf['shellPath'] = shell
442 + bf['shellScript'] = script
443 + bf['showEnvVarsInLog'] = show_in_log
444 +
445 + return bf
446 +
447 +
448 +class PBXSourcesBuildPhase(PBXBuildPhase):
449 + pass
450 +
451 +
452 +class PBXCopyFilesBuildPhase(PBXBuildPhase):
453 + pass
454 +
455 +
456 +class XCBuildConfiguration(PBXType):
457 + def add_search_paths(self, paths, base, key, recursive=True, escape=True):
458 + modified = False
459 +
460 + if not isinstance(paths, list):
461 + paths = [paths]
462 +
463 + if base not in self:
464 + self[base] = PBXDict()
465 +
466 + for path in paths:
467 + if recursive and not path.endswith('/**'):
468 + path = os.path.join(path, '**')
469 +
470 + if key not in self[base]:
471 + self[base][key] = PBXList()
472 + elif isinstance(self[base][key], basestring):
473 + self[base][key] = PBXList(self[base][key])
474 +
475 + if path == '$(inherited)':
476 + escape = False
477 +
478 + if escape:
479 + if self[base][key].add('"%s"' % path): # '\\"%s\\"' % path
480 + modified = True
481 + else:
482 + if self[base][key].add(path): # '\\"%s\\"' % path
483 + modified = True
484 +
485 + return modified
486 +
487 + def add_header_search_paths(self, paths, recursive=True):
488 + return self.add_search_paths(paths, 'buildSettings', 'HEADER_SEARCH_PATHS', recursive=recursive)
489 +
490 + def add_library_search_paths(self, paths, recursive=True):
491 + return self.add_search_paths(paths, 'buildSettings', 'LIBRARY_SEARCH_PATHS', recursive=recursive)
492 +
493 + def add_framework_search_paths(self, paths, recursive=True):
494 + return self.add_search_paths(paths, 'buildSettings', 'FRAMEWORK_SEARCH_PATHS', recursive=recursive)
495 +
496 + def add_other_cflags(self, flags):
497 + return self.add_flag('OTHER_CFLAGS', flags)
498 +
499 + def add_other_ldflags(self, flags):
500 + return self.add_flag('OTHER_LDFLAGS', flags)
501 +
502 + def add_flag(self, key, flags):
503 + modified = False
504 + base = 'buildSettings'
505 +
506 + if isinstance(flags, basestring):
507 + flags = PBXList(flags)
508 +
509 + if base not in self:
510 + self[base] = PBXDict()
511 +
512 + for flag in flags:
513 + if key not in self[base]:
514 + self[base][key] = PBXList()
515 + elif isinstance(self[base][key], basestring):
516 + self[base][key] = PBXList(self[base][key])
517 +
518 + if self[base][key].add(flag):
519 + self[base][key] = [e for e in self[base][key] if e]
520 + modified = True
521 +
522 + return modified
523 +
524 + def remove_flag(self, key, flags):
525 + modified = False
526 + base = 'buildSettings'
527 +
528 + if isinstance(flags, basestring):
529 + flags = PBXList(flags)
530 +
531 + if base in self: # there are flags, so we can "remove" something
532 + for flag in flags:
533 + if key not in self[base]:
534 + return False
535 + elif isinstance(self[base][key], basestring):
536 + self[base][key] = PBXList(self[base][key])
537 +
538 + if self[base][key].remove(flag):
539 + self[base][key] = [e for e in self[base][key] if e]
540 + modified = True
541 +
542 + if len(self[base][key]) == 0:
543 + self[base].pop(key, None)
544 +
545 + return modified
546 +
547 + def remove_other_ldflags(self, flags):
548 + return self.remove_flag('OTHER_LD_FLAGS', flags)
549 +
550 + # Set a single-valued flag under buildSettings
551 + def add_single_valued_flag(self, flag, value):
552 + modified = False
553 + base = 'buildSettings'
554 + key = flag
555 +
556 + if not self.has_key(base):
557 + self[base] = PBXDict()
558 + if self[base].has_key(key):
559 + if self[base][key] == value:
560 + return False
561 + self[base][key] = value
562 + modified = True
563 + return modified
564 +
565 + # Remove a single-valued flag under buildSettings
566 + def remove_single_valued_flag(self, flag):
567 + modified = False
568 + base = 'buildSettings'
569 + key = flag
570 +
571 + if self.has_key(base) and self[base].has_key(key):
572 + self[base].pop(key, None)
573 + modified = True
574 + return modified
575 +
576 +class XCConfigurationList(PBXType):
577 + pass
578 +
579 +
580 +class XcodeProject(PBXDict):
581 + plutil_path = 'plutil'
582 + special_folders = ['.bundle', '.framework', '.xcodeproj', '.xcassets', '.xcdatamodeld']
583 +
584 + def __init__(self, d=None, path=None):
585 + if not path:
586 + path = os.path.join(os.getcwd(), 'project.pbxproj')
587 +
588 + self.pbxproj_path = os.path.abspath(path)
589 + self.source_root = os.path.abspath(os.path.join(os.path.split(path)[0], '..'))
590 +
591 + IterableUserDict.__init__(self, d)
592 +
593 + self.data = PBXDict(self.data)
594 + self.objects = self.get('objects')
595 + self.modified = False
596 +
597 + root_id = self.get('rootObject')
598 +
599 + if root_id:
600 + self.root_object = self.objects[root_id]
601 + root_group_id = self.root_object.get('mainGroup')
602 + self.root_group = self.objects[root_group_id]
603 + else:
604 + print "error: project has no root object"
605 + self.root_object = None
606 + self.root_group = None
607 +
608 + for k, v in self.objects.iteritems():
609 + v.id = k
610 +
611 + def add_other_cflags(self, flags):
612 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
613 +
614 + for b in build_configs:
615 + if b.add_other_cflags(flags):
616 + self.modified = True
617 +
618 + def add_other_ldflags(self, flags):
619 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
620 +
621 + for b in build_configs:
622 + if b.add_other_ldflags(flags):
623 + self.modified = True
624 +
625 + def remove_other_ldflags(self, flags):
626 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
627 +
628 + for b in build_configs:
629 + if b.remove_other_ldflags(flags):
630 + self.modified = True
631 +
632 + def add_header_search_paths(self, paths, recursive=True):
633 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
634 +
635 + for b in build_configs:
636 + if b.add_header_search_paths(paths, recursive):
637 + self.modified = True
638 +
639 + def add_framework_search_paths(self, paths, recursive=True):
640 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
641 +
642 + for b in build_configs:
643 + if b.add_framework_search_paths(paths, recursive):
644 + self.modified = True
645 +
646 + def add_library_search_paths(self, paths, recursive=True):
647 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
648 +
649 + for b in build_configs:
650 + if b.add_library_search_paths(paths, recursive):
651 + self.modified = True
652 +
653 + def add_flags(self, pairs, configuration='All'):
654 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
655 +
656 + # iterate over all the pairs of configurations
657 + for b in build_configs:
658 + if configuration != "All" and b.get('name') != configuration :
659 + continue
660 +
661 + for k in pairs:
662 + if b.add_flag(k, pairs[k]):
663 + self.modified = True
664 +
665 + def remove_flags(self, pairs, configuration='All'):
666 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
667 +
668 + # iterate over all the pairs of configurations
669 + for b in build_configs:
670 + if configuration != "All" and b.get('name') != configuration :
671 + continue
672 + for k in pairs:
673 + if b.remove_flag(k, pairs[k]):
674 + self.modified = True
675 +
676 + # Set a single-valued flag (whereas add_flags adds a flag to a list of flags with a given key)
677 + def add_single_valued_flag(self, flag, value, configuration='All'):
678 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
679 +
680 + for b in build_configs:
681 + if configuration != "All" and b.get('name') != configuration :
682 + continue
683 +
684 + if b.add_single_valued_flag(flag, value):
685 + self.modified = True
686 +
687 + # Remove a single-valued flag (whereas remove_flags deletes a flag from a list of flags with a given key)
688 + def remove_single_valued_flag(self, flag, configuration='All'):
689 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
690 +
691 + for b in build_configs:
692 + if configuration != "All" and b.get('name') != configuration :
693 + continue
694 +
695 + if b.remove_single_valued_flag(flag):
696 + self.modified = True
697 +
698 + def get_obj(self, id):
699 + return self.objects.get(id)
700 +
701 + def get_ids(self):
702 + return self.objects.keys()
703 +
704 + def get_files_by_os_path(self, os_path, tree='SOURCE_ROOT'):
705 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
706 + and f.get('path') == os_path
707 + and f.get('sourceTree') == tree]
708 +
709 + return files
710 +
711 + def get_files_by_name(self, name, parent=None):
712 + if parent:
713 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
714 + and f.get('name') == name
715 + and parent.has_child(f)]
716 + else:
717 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
718 + and f.get('name') == name]
719 +
720 + return files
721 +
722 + def get_keys_for_files_by_name(self, name):
723 + keys = [key for key in self.objects if self.objects.data[key].get('name') == name
724 + and self.objects.data[key].get('isa') == 'PBXFileReference']
725 + return keys
726 +
727 +
728 + def get_build_files(self, id):
729 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile'
730 + and f.get('fileRef') == id]
731 + return files
732 +
733 + def get_groups_by_name(self, name, parent=None):
734 + if parent:
735 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
736 + and g.get_name() == name
737 + and parent.has_child(g)]
738 + else:
739 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
740 + and g.get_name() == name]
741 +
742 + return groups
743 +
744 + def get_or_create_group(self, name, path=None, parent=None):
745 + if not name:
746 + return None
747 +
748 + if not parent:
749 + parent = self.root_group
750 + elif not isinstance(parent, PBXGroup):
751 + # assume it's an id
752 + parent = self.objects.get(parent, self.root_group)
753 +
754 + groups = self.get_groups_by_name(name)
755 +
756 + for grp in groups:
757 + if parent.has_child(grp.id):
758 + return grp
759 +
760 + grp = PBXGroup.Create(name, path)
761 + parent.add_child(grp)
762 +
763 + self.objects[grp.id] = grp
764 +
765 + self.modified = True
766 +
767 + return grp
768 +
769 + def get_groups_by_os_path(self, path):
770 + path = os.path.abspath(path)
771 +
772 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
773 + and os.path.abspath(g.get('path', '/dev/null')) == path]
774 +
775 + return groups
776 +
777 + def get_build_phases(self, phase_name):
778 + phases = [p for p in self.objects.values() if p.get('isa') == phase_name]
779 +
780 + return phases
781 +
782 + def get_target_by_name(self, name):
783 + targets = self.get_build_phases('PBXNativeTarget')
784 + target = None
785 + for t in targets:
786 + if t.get("name") == name:
787 + target = t
788 + break
789 + return target
790 +
791 + def get_relative_path(self, os_path):
792 + return os.path.relpath(os_path, self.source_root)
793 +
794 + def verify_files(self, file_list, parent=None):
795 + # returns list of files not in the current project.
796 + if not file_list:
797 + return []
798 +
799 + if parent:
800 + exists_list = [f.get('name') for f in self.objects.values() if f.get('isa') == 'PBXFileReference' and f.get('name') in file_list and parent.has_child(f)]
801 + else:
802 + exists_list = [f.get('name') for f in self.objects.values() if f.get('isa') == 'PBXFileReference' and f.get('name') in file_list]
803 +
804 + return set(file_list).difference(exists_list)
805 +
806 + def add_run_script(self, target, script=None, insert_before_compile=False):
807 + result = []
808 + targets = [t for t in self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget') if t.get('name') == target]
809 + if len(targets) != 0 :
810 + script_phase = PBXShellScriptBuildPhase.Create(script)
811 + for t in targets:
812 + skip = False
813 + for buildPhase in t['buildPhases']:
814 + if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
815 + skip = True
816 +
817 + if not skip:
818 + if insert_before_compile:
819 + t['buildPhases'].insert(0, script_phase.id)
820 + else:
821 + t['buildPhases'].add(script_phase.id)
822 + self.objects[script_phase.id] = script_phase
823 + result.append(script_phase)
824 +
825 + return result
826 +
827 + def add_run_script_all_targets(self, script=None):
828 + result = []
829 + targets = self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget')
830 + if len(targets) != 0 :
831 + script_phase = PBXShellScriptBuildPhase.Create(script)
832 + for t in targets:
833 + skip = False
834 + for buildPhase in t['buildPhases']:
835 + if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
836 + skip = True
837 +
838 + if not skip:
839 + t['buildPhases'].add(script_phase.id)
840 + self.objects[script_phase.id] = script_phase
841 + result.append(script_phase)
842 +
843 + return result
844 +
845 + def add_folder(self, os_path, parent=None, excludes=None, recursive=True, create_build_files=True):
846 + if not os.path.isdir(os_path):
847 + return []
848 +
849 + if not excludes:
850 + excludes = []
851 +
852 + results = []
853 +
854 + if not parent:
855 + parent = self.root_group
856 + elif not isinstance(parent, PBXGroup):
857 + # assume it's an id
858 + parent = self.objects.get(parent, self.root_group)
859 +
860 + path_dict = {os.path.split(os_path)[0]: parent}
861 + special_list = []
862 +
863 + for (grp_path, subdirs, files) in os.walk(os_path):
864 + parent_folder, folder_name = os.path.split(grp_path)
865 + parent = path_dict.get(parent_folder, parent)
866 +
867 + if [sp for sp in special_list if parent_folder.startswith(sp)]:
868 + continue
869 +
870 + if folder_name.startswith('.'):
871 + special_list.append(grp_path)
872 + continue
873 +
874 + if os.path.splitext(grp_path)[1] in XcodeProject.special_folders:
875 + # if this file has a special extension (bundle or framework mainly) treat it as a file
876 + special_list.append(grp_path)
877 + new_files = self.verify_files([folder_name], parent=parent)
878 +
879 + # Ignore this file if it is in excludes
880 + if new_files and not [m for m in excludes if re.match(m, grp_path)]:
881 + results.extend(self.add_file(grp_path, parent, create_build_files=create_build_files))
882 +
883 + continue
884 +
885 + # create group
886 + grp = self.get_or_create_group(folder_name, path=self.get_relative_path(grp_path), parent=parent)
887 + path_dict[grp_path] = grp
888 +
889 + results.append(grp)
890 +
891 + file_dict = {}
892 +
893 + for f in files:
894 + if f[0] == '.' or [m for m in excludes if re.match(m, f)]:
895 + continue
896 +
897 + kwds = {
898 + 'create_build_files': create_build_files,
899 + 'parent': grp,
900 + 'name': f
901 + }
902 +
903 + f_path = os.path.join(grp_path, f)
904 + file_dict[f_path] = kwds
905 +
906 + new_files = self.verify_files([n.get('name') for n in file_dict.values()], parent=grp)
907 + add_files = [(k, v) for k, v in file_dict.items() if v.get('name') in new_files]
908 +
909 + for path, kwds in add_files:
910 + kwds.pop('name', None)
911 + self.add_file(path, **kwds)
912 +
913 + if not recursive:
914 + break
915 +
916 + for r in results:
917 + self.objects[r.id] = r
918 +
919 + return results
920 +
921 + def path_leaf(self, path):
922 + head, tail = ntpath.split(path)
923 + return tail or ntpath.basename(head)
924 +
925 + def add_file_if_doesnt_exist(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False):
926 + for obj in self.objects.values():
927 + if 'path' in obj:
928 + if self.path_leaf(f_path) == self.path_leaf(obj.get('path')):
929 + return []
930 +
931 + return self.add_file(f_path, parent, tree, create_build_files, weak, ignore_unknown_type=ignore_unknown_type)
932 +
933 + def add_file(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False, target=None):
934 + results = []
935 + abs_path = ''
936 +
937 + if os.path.isabs(f_path):
938 + abs_path = f_path
939 +
940 + if not os.path.exists(f_path):
941 + return results
942 + elif tree == 'SOURCE_ROOT':
943 + f_path = os.path.relpath(f_path, self.source_root)
944 + else:
945 + tree = '<absolute>'
946 +
947 + if not parent:
948 + parent = self.root_group
949 + elif not isinstance(parent, PBXGroup):
950 + # assume it's an id
951 + parent = self.objects.get(parent, self.root_group)
952 +
953 + file_ref = PBXFileReference.Create(f_path, tree, ignore_unknown_type=ignore_unknown_type)
954 + parent.add_child(file_ref)
955 + results.append(file_ref)
956 +
957 + # create a build file for the file ref
958 + if file_ref.build_phase and create_build_files:
959 + phases = self.get_build_phases(file_ref.build_phase)
960 + if target:
961 + target = self.get_target_by_name(target)
962 +
963 + for phase in phases:
964 + if (not target) or (phase.id in target.get('buildPhases')):
965 + build_file = PBXBuildFile.Create(file_ref, weak=weak)
966 + phase.add_build_file(build_file)
967 + results.append(build_file)
968 +
969 + if abs_path and tree == 'SOURCE_ROOT' \
970 + and os.path.isfile(abs_path) \
971 + and file_ref.build_phase == 'PBXFrameworksBuildPhase':
972 + library_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
973 + self.add_library_search_paths([library_path], recursive=False)
974 +
975 + if abs_path and tree == 'SOURCE_ROOT' \
976 + and not os.path.isfile(abs_path) \
977 + and file_ref.build_phase == 'PBXFrameworksBuildPhase':
978 + framework_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
979 + self.add_framework_search_paths([framework_path, '$(inherited)'], recursive=False)
980 +
981 + for r in results:
982 + self.objects[r.id] = r
983 +
984 + if results:
985 + self.modified = True
986 +
987 + return results
988 +
989 + def check_and_repair_framework(self, base):
990 + name = os.path.basename(base)
991 +
992 + if ".framework" in name:
993 + basename = name[:-len(".framework")]
994 +
995 + finalHeaders = os.path.join(base, "Headers")
996 + finalCurrent = os.path.join(base, "Versions/Current")
997 + finalLib = os.path.join(base, basename)
998 + srcHeaders = "Versions/A/Headers"
999 + srcCurrent = "A"
1000 + srcLib = "Versions/A/" + basename
1001 +
1002 + if not os.path.exists(finalHeaders):
1003 + os.symlink(srcHeaders, finalHeaders)
1004 + if not os.path.exists(finalCurrent):
1005 + os.symlink(srcCurrent, finalCurrent)
1006 + if not os.path.exists(finalLib):
1007 + os.symlink(srcLib, finalLib)
1008 +
1009 +
1010 + def get_file_id_by_path(self, f_path):
1011 + for k, v in self.objects.iteritems():
1012 + if str(v.get('path')) == f_path:
1013 + return k
1014 + return 0
1015 +
1016 +
1017 + def remove_file_by_path(self, f_path, recursive=True):
1018 + id = self.get_file_id_by_path(f_path)
1019 + if id != 0:
1020 + self.remove_file(id, recursive=recursive)
1021 + return
1022 +
1023 +
1024 + def remove_file(self, id, recursive=True):
1025 + if not PBXType.IsGuid(id):
1026 + id = id.id
1027 +
1028 + if id in self.objects:
1029 + self.objects.remove(id)
1030 + # Remove from PBXResourcesBuildPhase and PBXSourcesBuildPhase if necessary
1031 + buildFiles = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile']
1032 + for buildFile in buildFiles:
1033 + if id == buildFile.get('fileRef'):
1034 + key = buildFile.id
1035 + PBXRBP = [f for f in self.objects.values() if f.get('isa') == 'PBXResourcesBuildPhase']
1036 + PBXSBP = [f for f in self.objects.values() if f.get('isa') == 'PBXSourcesBuildPhase']
1037 + self.objects.remove(key)
1038 + if len(PBXSBP) and PBXSBP[0].has_build_file(key):
1039 + PBXSBP[0].remove_build_file(key)
1040 + if len(PBXRBP) and PBXRBP[0].has_build_file(key):
1041 + PBXRBP[0].remove_build_file(key)
1042 + if recursive:
1043 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup']
1044 +
1045 + for group in groups:
1046 + if id in group['children']:
1047 + group.remove_child(id)
1048 +
1049 + self.modified = True
1050 +
1051 + def remove_group(self, id, recursive = True):
1052 + if not PBXType.IsGuid(id):
1053 + id = id.id
1054 + name = self.objects.get(id).get('path')
1055 + children = self.objects.get(id).get('children')
1056 + if name is None:
1057 + name = id
1058 + if id in self.objects:
1059 + if recursive:
1060 + for childKey in children:
1061 + childValue = self.objects.get(childKey)
1062 + if childValue.get('isa') == 'PBXGroup':
1063 + self.remove_group(childKey, True)
1064 + else:
1065 + self.remove_file(childKey, False)
1066 +
1067 + self.objects.remove(id);
1068 +
1069 + def remove_group_by_name(self, name, recursive = True):
1070 + groups = self.get_groups_by_name(name)
1071 + if len(groups):
1072 + for group in groups:
1073 + self.remove_group(group.id, recursive)
1074 +
1075 + def move_file(self, id, dest_grp=None):
1076 + pass
1077 +
1078 + def apply_patch(self, patch_path, xcode_path):
1079 + if not os.path.isfile(patch_path) or not os.path.isdir(xcode_path):
1080 + print 'ERROR: couldn\'t apply "%s" to "%s"' % (patch_path, xcode_path)
1081 + return
1082 +
1083 + print 'applying "%s" to "%s"' % (patch_path, xcode_path)
1084 +
1085 + return subprocess.call(['patch', '-p1', '--forward', '--directory=%s' % xcode_path, '--input=%s' % patch_path])
1086 +
1087 + def apply_mods(self, mod_dict, default_path=None):
1088 + if not default_path:
1089 + default_path = os.getcwd()
1090 +
1091 + keys = mod_dict.keys()
1092 +
1093 + for k in keys:
1094 + v = mod_dict.pop(k)
1095 + mod_dict[k.lower()] = v
1096 +
1097 + parent = mod_dict.pop('group', None)
1098 +
1099 + if parent:
1100 + parent = self.get_or_create_group(parent)
1101 +
1102 + excludes = mod_dict.pop('excludes', [])
1103 +
1104 + if excludes:
1105 + excludes = [re.compile(e) for e in excludes]
1106 +
1107 + compiler_flags = mod_dict.pop('compiler_flags', {})
1108 +
1109 + for k, v in mod_dict.items():
1110 + if k == 'patches':
1111 + for p in v:
1112 + if not os.path.isabs(p):
1113 + p = os.path.join(default_path, p)
1114 +
1115 + self.apply_patch(p, self.source_root)
1116 + elif k == 'folders':
1117 + # get and compile excludes list
1118 + # do each folder individually
1119 + for folder in v:
1120 + kwds = {}
1121 +
1122 + # if path contains ':' remove it and set recursive to False
1123 + if ':' in folder:
1124 + args = folder.split(':')
1125 + kwds['recursive'] = False
1126 + folder = args.pop(0)
1127 +
1128 + if os.path.isabs(folder) and os.path.isdir(folder):
1129 + pass
1130 + else:
1131 + folder = os.path.join(default_path, folder)
1132 + if not os.path.isdir(folder):
1133 + continue
1134 +
1135 + if parent:
1136 + kwds['parent'] = parent
1137 +
1138 + if excludes:
1139 + kwds['excludes'] = excludes
1140 +
1141 + self.add_folder(folder, **kwds)
1142 + elif k == 'headerpaths' or k == 'librarypaths':
1143 + paths = []
1144 +
1145 + for p in v:
1146 + if p.endswith('/**'):
1147 + p = os.path.split(p)[0]
1148 +
1149 + if not os.path.isabs(p):
1150 + p = os.path.join(default_path, p)
1151 +
1152 + if not os.path.exists(p):
1153 + continue
1154 +
1155 + p = self.get_relative_path(p)
1156 + paths.append(os.path.join('$(SRCROOT)', p, "**"))
1157 +
1158 + if k == 'headerpaths':
1159 + self.add_header_search_paths(paths)
1160 + else:
1161 + self.add_library_search_paths(paths)
1162 + elif k == 'other_cflags':
1163 + self.add_other_cflags(v)
1164 + elif k == 'other_ldflags':
1165 + self.add_other_ldflags(v)
1166 + elif k == 'libs' or k == 'frameworks' or k == 'files':
1167 + paths = {}
1168 +
1169 + for p in v:
1170 + kwds = {}
1171 +
1172 + if ':' in p:
1173 + args = p.split(':')
1174 + p = args.pop(0)
1175 +
1176 + if 'weak' in args:
1177 + kwds['weak'] = True
1178 +
1179 + file_path = os.path.join(default_path, p)
1180 + search_path, file_name = os.path.split(file_path)
1181 +
1182 + if [m for m in excludes if re.match(m, file_name)]:
1183 + continue
1184 +
1185 + try:
1186 + expr = re.compile(file_name)
1187 + except re.error:
1188 + expr = None
1189 +
1190 + if expr and os.path.isdir(search_path):
1191 + file_list = os.listdir(search_path)
1192 +
1193 + for f in file_list:
1194 + if [m for m in excludes if re.match(m, f)]:
1195 + continue
1196 +
1197 + if re.search(expr, f):
1198 + kwds['name'] = f
1199 + paths[os.path.join(search_path, f)] = kwds
1200 + p = None
1201 +
1202 + if k == 'libs':
1203 + kwds['parent'] = self.get_or_create_group('Libraries', parent=parent)
1204 + elif k == 'frameworks':
1205 + kwds['parent'] = self.get_or_create_group('Frameworks', parent=parent)
1206 +
1207 + if p:
1208 + kwds['name'] = file_name
1209 +
1210 + if k == 'libs':
1211 + p = os.path.join('usr', 'lib', p)
1212 + kwds['tree'] = 'SDKROOT'
1213 + elif k == 'frameworks':
1214 + p = os.path.join('System', 'Library', 'Frameworks', p)
1215 + kwds['tree'] = 'SDKROOT'
1216 + elif k == 'files' and not os.path.exists(file_path):
1217 + # don't add non-existent files to the project.
1218 + continue
1219 +
1220 + paths[p] = kwds
1221 +
1222 + new_files = self.verify_files([n.get('name') for n in paths.values()])
1223 + add_files = [(k, v) for k, v in paths.items() if v.get('name') in new_files]
1224 +
1225 + for path, kwds in add_files:
1226 + kwds.pop('name', None)
1227 +
1228 + if 'parent' not in kwds and parent:
1229 + kwds['parent'] = parent
1230 +
1231 + self.add_file(path, **kwds)
1232 +
1233 + if compiler_flags:
1234 + for k, v in compiler_flags.items():
1235 + filerefs = []
1236 +
1237 + for f in v:
1238 + filerefs.extend([fr.id for fr in self.objects.values() if fr.get('isa') == 'PBXFileReference'
1239 + and fr.get('name') == f])
1240 +
1241 + buildfiles = [bf for bf in self.objects.values() if bf.get('isa') == 'PBXBuildFile'
1242 + and bf.get('fileRef') in filerefs]
1243 +
1244 + for bf in buildfiles:
1245 + if bf.add_compiler_flag(k):
1246 + self.modified = True
1247 +
1248 + def backup(self, file_name=None, backup_name=None):
1249 + if not file_name:
1250 + file_name = self.pbxproj_path
1251 +
1252 + if not backup_name:
1253 + backup_name = "%s.%s.backup" % (file_name, datetime.datetime.now().strftime('%d%m%y-%H%M%S'))
1254 +
1255 + shutil.copy2(file_name, backup_name)
1256 + return backup_name
1257 +
1258 + def save(self, file_name=None, old_format=False, sort=False):
1259 + if old_format :
1260 + self.save_format_xml(file_name)
1261 + else:
1262 + self.save_new_format(file_name, sort)
1263 +
1264 + def save_format_xml(self, file_name=None):
1265 + """Saves in old (xml) format"""
1266 + if not file_name:
1267 + file_name = self.pbxproj_path
1268 +
1269 + # This code is adapted from plistlib.writePlist
1270 + with open(file_name, "w") as f:
1271 + writer = PBXWriter(f)
1272 + writer.writeln("<plist version=\"1.0\">")
1273 + writer.writeValue(self.data)
1274 + writer.writeln("</plist>")
1275 +
1276 + def save_new_format(self, file_name=None, sort=False):
1277 + """Save in Xcode 3.2 compatible (new) format"""
1278 + if not file_name:
1279 + file_name = self.pbxproj_path
1280 +
1281 + # process to get the section's info and names
1282 + objs = self.data.get('objects')
1283 + sections = dict()
1284 + uuids = dict()
1285 +
1286 + for key in objs:
1287 + l = list()
1288 +
1289 + if objs.get(key).get('isa') in sections:
1290 + l = sections.get(objs.get(key).get('isa'))
1291 +
1292 + l.append(tuple([key, objs.get(key)]))
1293 + sections[objs.get(key).get('isa')] = l
1294 +
1295 + if 'name' in objs.get(key):
1296 + uuids[key] = objs.get(key).get('name')
1297 + elif 'path' in objs.get(key):
1298 + uuids[key] = objs.get(key).get('path')
1299 + else:
1300 + if objs.get(key).get('isa') == 'PBXProject':
1301 + uuids[objs.get(key).get('buildConfigurationList')] = 'Build configuration list for PBXProject "Unity-iPhone"'
1302 + elif objs.get(key).get('isa')[0:3] == 'PBX':
1303 + uuids[key] = objs.get(key).get('isa')[3:-10]
1304 + else:
1305 + uuids[key] = 'Build configuration list for PBXNativeTarget "TARGET_NAME"'
1306 +
1307 + ro = self.data.get('rootObject')
1308 + uuids[ro] = 'Project object'
1309 +
1310 + for key in objs:
1311 + # transitive references (used in the BuildFile section)
1312 + if 'fileRef' in objs.get(key) and objs.get(key).get('fileRef') in uuids:
1313 + uuids[key] = uuids[objs.get(key).get('fileRef')]
1314 +
1315 + # transitive reference to the target name (used in the Native target section)
1316 + if objs.get(key).get('isa') == 'PBXNativeTarget':
1317 + uuids[objs.get(key).get('buildConfigurationList')] = uuids[objs.get(key).get('buildConfigurationList')].replace('TARGET_NAME', uuids[key])
1318 +
1319 + self.uuids = uuids
1320 + self.sections = sections
1321 +
1322 + out = open(file_name, 'w')
1323 + out.write('// !$*UTF8*$!\n')
1324 + self._printNewXCodeFormat(out, self.data, '', enters=True, sort=sort)
1325 + out.close()
1326 +
1327 + @classmethod
1328 + def addslashes(cls, s):
1329 + d = {'"': '\\"', "'": "\\'", "\0": "\\\0", "\\": "\\\\", "\n":"\\n"}
1330 + return ''.join(d.get(c, c) for c in s)
1331 +
1332 + def _printNewXCodeFormat(self, out, root, deep, enters=True, sort=False):
1333 + if isinstance(root, IterableUserDict):
1334 + out.write('{')
1335 +
1336 + if enters:
1337 + out.write('\n')
1338 +
1339 + isa = root.pop('isa', '')
1340 +
1341 + if isa != '': # keep the isa in the first spot
1342 + if enters:
1343 + out.write('\t' + deep)
1344 +
1345 + out.write('isa = ')
1346 + self._printNewXCodeFormat(out, isa, '\t' + deep, enters=enters)
1347 + out.write(';')
1348 +
1349 + if enters:
1350 + out.write('\n')
1351 + else:
1352 + out.write(' ')
1353 +
1354 + for key in sorted(root.iterkeys()): # keep the same order as Apple.
1355 + if enters:
1356 + out.write('\t' + deep)
1357 +
1358 + if re.match(regex, key).group(0) == key:
1359 + out.write(key.encode("utf-8") + ' = ')
1360 + else:
1361 + out.write('"' + key.encode("utf-8") + '" = ')
1362 +
1363 + if key == 'objects':
1364 + out.write('{') # open the objects section
1365 +
1366 + if enters:
1367 + out.write('\n')
1368 + #root.remove('objects') # remove it to avoid problems
1369 +
1370 + sections = [
1371 + ('PBXBuildFile', False),
1372 + ('PBXCopyFilesBuildPhase', True),
1373 + ('PBXFileReference', False),
1374 + ('PBXFrameworksBuildPhase', True),
1375 + ('PBXGroup', True),
1376 + ('PBXAggregateTarget', True),
1377 + ('PBXNativeTarget', True),
1378 + ('PBXProject', True),
1379 + ('PBXResourcesBuildPhase', True),
1380 + ('PBXShellScriptBuildPhase', True),
1381 + ('PBXSourcesBuildPhase', True),
1382 + ('XCBuildConfiguration', True),
1383 + ('XCConfigurationList', True),
1384 + ('PBXTargetDependency', True),
1385 + ('PBXVariantGroup', True),
1386 + ('PBXReferenceProxy', True),
1387 + ('PBXContainerItemProxy', True),
1388 + ('XCVersionGroup', True)]
1389 +
1390 + for section in sections: # iterate over the sections
1391 + if self.sections.get(section[0]) is None:
1392 + continue
1393 +
1394 + out.write('\n/* Begin %s section */' % section[0].encode("utf-8"))
1395 + self.sections.get(section[0]).sort(cmp=lambda x, y: cmp(x[0], y[0]))
1396 +
1397 + if sort and section[0] == 'PBXGroup':
1398 + for entry in self.sections.get(section[0]):
1399 + entry[1]['children'] = sorted(entry[1]['children'],
1400 + key=lambda x: self.uuids[x].encode("utf-8"))
1401 +
1402 + for pair in self.sections.get(section[0]):
1403 + key = pair[0]
1404 + value = pair[1]
1405 + out.write('\n')
1406 +
1407 + if enters:
1408 + out.write('\t\t' + deep)
1409 +
1410 + out.write(key.encode("utf-8"))
1411 +
1412 + if key in self.uuids:
1413 + out.write(" /* " + self.uuids[key].encode("utf-8") + " */")
1414 +
1415 + out.write(" = ")
1416 + self._printNewXCodeFormat(out, value, '\t\t' + deep, enters=section[1])
1417 + out.write(';')
1418 +
1419 + out.write('\n/* End %s section */\n' % section[0].encode("utf-8"))
1420 +
1421 + out.write(deep + '\t}') # close of the objects section
1422 + else:
1423 + self._printNewXCodeFormat(out, root[key], '\t' + deep, enters=enters)
1424 +
1425 + out.write(';')
1426 +
1427 + if enters:
1428 + out.write('\n')
1429 + else:
1430 + out.write(' ')
1431 +
1432 + root['isa'] = isa # restore the isa for further calls
1433 +
1434 + if enters:
1435 + out.write(deep)
1436 +
1437 + out.write('}')
1438 +
1439 + elif isinstance(root, UserList):
1440 + out.write('(')
1441 +
1442 + if enters:
1443 + out.write('\n')
1444 +
1445 + for value in root:
1446 + if enters:
1447 + out.write('\t' + deep)
1448 +
1449 + self._printNewXCodeFormat(out, value, '\t' + deep, enters=enters)
1450 + out.write(',')
1451 +
1452 + if enters:
1453 + out.write('\n')
1454 +
1455 + if enters:
1456 + out.write(deep)
1457 +
1458 + out.write(')')
1459 +
1460 + else:
1461 + if len(root) > 0 and re.match(regex, root).group(0) == root:
1462 + out.write(root.encode("utf-8"))
1463 + else:
1464 + out.write('"' + XcodeProject.addslashes(root.encode("utf-8")) + '"')
1465 +
1466 + if root in self.uuids:
1467 + out.write(" /* " + self.uuids[root].encode("utf-8") + " */")
1468 +
1469 + @classmethod
1470 + def Load(cls, path, pure_python=False):
1471 + if pure_python:
1472 + import openstep_parser as osp
1473 + tree = osp.OpenStepDecoder.ParseFromFile(open(path, 'r'))
1474 + else:
1475 + cls.plutil_path = os.path.join(os.path.split(__file__)[0], 'plutil')
1476 +
1477 + if not os.path.isfile(XcodeProject.plutil_path):
1478 + cls.plutil_path = 'plutil'
1479 +
1480 + # load project by converting to xml and then convert that using plistlib
1481 + p = subprocess.Popen([XcodeProject.plutil_path, '-convert', 'xml1', '-o', '-', path], stdout=subprocess.PIPE)
1482 + stdout, stderr = p.communicate()
1483 +
1484 + # If the plist was malformed, return code will be non-zero
1485 + if p.returncode != 0:
1486 + print stdout
1487 + return None
1488 +
1489 + tree = plistlib.readPlistFromString(stdout)
1490 +
1491 + return XcodeProject(tree, path)
1492 +
1493 + @classmethod
1494 + def LoadFromXML(cls, path):
1495 + tree = plistlib.readPlist(path)
1496 + return XcodeProject(tree, path)
1497 +
1498 +
1499 +# The code below was adapted from plistlib.py.
1500 +
1501 +class PBXWriter(plistlib.PlistWriter):
1502 + def writeValue(self, value):
1503 + if isinstance(value, (PBXList, PBXDict)):
1504 + plistlib.PlistWriter.writeValue(self, value.data)
1505 + else:
1506 + plistlib.PlistWriter.writeValue(self, value)
1507 +
1508 + def simpleElement(self, element, value=None):
1509 + """
1510 + We have to override this method to deal with Unicode text correctly.
1511 + Non-ascii characters have to get encoded as character references.
1512 + """
1513 + if value is not None:
1514 + value = _escapeAndEncode(value)
1515 + self.writeln("<%s>%s</%s>" % (element, value, element))
1516 + else:
1517 + self.writeln("<%s/>" % element)
1518 +
1519 +
1520 +# Regex to find any control chars, except for \t \n and \r
1521 +_controlCharPat = re.compile(
1522 + r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"
1523 + r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
1524 +
1525 +
1526 +def _escapeAndEncode(text):
1527 + m = _controlCharPat.search(text)
1528 + if m is not None:
1529 + raise ValueError("strings can't contains control characters; "
1530 + "use plistlib.Data instead")
1531 + text = text.replace("\r\n", "\n") # convert DOS line endings
1532 + text = text.replace("\r", "\n") # convert Mac line endings
1533 + text = text.replace("&", "&amp;") # escape '&'
1534 + text = text.replace("<", "&lt;") # escape '<'
1535 + text = text.replace(">", "&gt;") # escape '>'
1536 + return text.encode("ascii", "xmlcharrefreplace") # encode as ascii with xml character references
No preview for this file type
1 +import os
2 +
3 +import commands
4 +
5 +
6 +buildProjName = ''
7 +targetName = ''
8 +import shutil
9 +import os
10 +
11 +def buildProj():
12 +
13 + if buildProjName == '':
14 + print('buildProjName is not define')
15 +
16 + else:
17 + #build project
18 + print('start build proj')
19 + commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj')
20 + releaseDir = os.path.abspath('.') + '/Release'
21 + if not os.path.exists(releaseDir):
22 + os.mkdir(releaseDir)
23 +
24 + ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa'
25 + buildPath = os.path.abspath('.') + '/build'
26 + if os.path.exists(ipaPath):
27 + os.remove(ipaPath)
28 +
29 + resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath)
30 + #print(resultStr)
31 +
32 + if os.path.exists(buildPath):
33 + shutil.rmtree(buildPath)
34 +
No preview for this file type
No preview for this file type
No preview for this file type
1 +{
2 + "images" : [
3 + {
4 + "idiom" : "iphone",
5 + "size" : "20x20",
6 + "scale" : "2x"
7 + },
8 + {
9 + "idiom" : "iphone",
10 + "size" : "20x20",
11 + "scale" : "3x"
12 + },
13 + {
14 + "idiom" : "iphone",
15 + "size" : "29x29",
16 + "scale" : "2x"
17 + },
18 + {
19 + "idiom" : "iphone",
20 + "size" : "29x29",
21 + "scale" : "3x"
22 + },
23 + {
24 + "idiom" : "iphone",
25 + "size" : "40x40",
26 + "scale" : "2x"
27 + },
28 + {
29 + "idiom" : "iphone",
30 + "size" : "40x40",
31 + "scale" : "3x"
32 + },
33 + {
34 + "idiom" : "iphone",
35 + "size" : "60x60",
36 + "scale" : "2x"
37 + },
38 + {
39 + "idiom" : "iphone",
40 + "size" : "60x60",
41 + "scale" : "3x"
42 + },
43 + {
44 + "idiom" : "ios-marketing",
45 + "size" : "1024x1024",
46 + "scale" : "1x"
47 + }
48 + ],
49 + "info" : {
50 + "version" : 1,
51 + "author" : "xcode"
52 + }
53 +}
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "images" : [
3 + {
4 + "orientation" : "portrait",
5 + "idiom" : "iphone",
6 + "minimum-system-version" : "7.0",
7 + "scale" : "2x"
8 + },
9 + {
10 + "orientation" : "portrait",
11 + "idiom" : "iphone",
12 + "minimum-system-version" : "7.0",
13 + "subtype" : "retina4",
14 + "scale" : "2x"
15 + }
16 + ],
17 + "info" : {
18 + "version" : 1,
19 + "author" : "xcode"
20 + }
21 +}
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "info" : {
3 + "version" : 1,
4 + "author" : "xcode"
5 + }
6 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>CFBundleDevelopmentRegion</key>
6 + <string>en</string>
7 + <key>CFBundleDisplayName</key>
8 + <string>海豹DEMO</string>
9 + <key>CFBundleExecutable</key>
10 + <string>$(EXECUTABLE_NAME)</string>
11 + <key>CFBundleIdentifier</key>
12 + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13 + <key>CFBundleInfoDictionaryVersion</key>
14 + <string>6.0</string>
15 + <key>CFBundleName</key>
16 + <string>$(PRODUCT_NAME)</string>
17 + <key>CFBundlePackageType</key>
18 + <string>APPL</string>
19 + <key>CFBundleShortVersionString</key>
20 + <string>1.1.408</string>
21 + <key>CFBundleSignature</key>
22 + <string>????</string>
23 + <key>CFBundleURLTypes</key>
24 + <array>
25 + <dict>
26 + <key>CFBundleTypeRole</key>
27 + <string>Editor</string>
28 + <key>CFBundleURLSchemes</key>
29 + <array>
30 + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
31 + </array>
32 + </dict>
33 + <dict>
34 + <key>CFBundleTypeRole</key>
35 + <string>Editor</string>
36 + <key>CFBundleURLSchemes</key>
37 + <array>
38 + <string>sdk.uuufish.com</string>
39 + </array>
40 + </dict>
41 + </array>
42 + <key>CFBundleVersion</key>
43 + <string>1</string>
44 + <key>LSRequiresIPhoneOS</key>
45 + <true/>
46 + <key>NSAppTransportSecurity</key>
47 + <dict>
48 + <key>NSAllowsArbitraryLoads</key>
49 + <true/>
50 + </dict>
51 + <key>UIMainStoryboardFile</key>
52 + <string>Main</string>
53 + <key>UIRequiredDeviceCapabilities</key>
54 + <array>
55 + <string>armv7</string>
56 + </array>
57 + <key>UISupportedInterfaceOrientations</key>
58 + <array>
59 + <string>UIInterfaceOrientationPortrait</string>
60 + <string>UIInterfaceOrientationPortraitUpsideDown</string>
61 + </array>
62 +</dict>
63 +</plist>
1 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
2 +@interface SDKInterface : Interface
3 +
4 +@end
1 +#include "SDKInterface.h"
2 +#import <UIKit/UIKit.h>
3 +
4 +#import "HNYouai/HNYouaiAllManager.h"
5 +#import "HNYouai/HNYouaiHuiTiaoNotification.h"
6 +#import "HNYouai/HNYouaiInformation.h"
7 +
8 +#import "TrackingIO.h"
9 +
10 +@implementation SDKInterface : Interface
11 +
12 +int mExchange;
13 +NSString *HNYouaiAppId;
14 +NSString *HNYouaiAppKey;
15 +
16 +- (void)SDKinit:(UIViewController *) control
17 +{
18 +
19 + [super SDKinit:control];
20 +
21 + [HaiBaoJuheConfig getInstance];
22 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiChuShiHua];
23 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiYangShi:@"sdk"];
24 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:HNYouaiLoginNotification object:nil];
25 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"HNYouaiToolCallBack" object:nil];
26 +
27 + [[HaiBaoJuheChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
28 +
29 + NSString* channelId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
30 + if(channelId == nil || [channelId length] <= 0){
31 + channelId = @"unknown";
32 + }
33 + [TrackingIO initWithappKey:[[HaiBaoJuheConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
34 +}
35 +
36 +/**
37 + 登录SDK
38 + */
39 +- (void)SDKloginSDK
40 +{
41 + //APPID APPKEY
42 + HNYouaiAppId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_ID"];
43 + HNYouaiAppKey =[[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_KEY"];
44 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiDengLu:HNYouaiAppId :HNYouaiAppKey :self.controller];
45 +
46 +}
47 +
48 +/**
49 + loginCheck
50 + */
51 +- (void)receiveLoginMessage:(NSNotification *)notification
52 +{
53 + NSLog(@"loginchek");
54 + HaiBaoJuheLoginInfo *loginInfo = [HaiBaoJuheLoginInfo alloc];
55 + loginInfo.openId = [[HNYouaiInformation getInstance]openId];
56 + loginInfo.sign = [[HNYouaiInformation getInstance] token];
57 + loginInfo.timestamp = [[HNYouaiInformation getInstance] timestamp];
58 +
59 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
60 + [[HaiBaoJuheChecker getInstance] startCheck:loginInfo];
61 + });
62 +
63 +}
64 +
65 +
66 +-(NSString*)DataTojsonString:(id)object
67 +{
68 + NSString *jsonString = nil;
69 + NSError *error;
70 + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
71 + options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
72 + error:&error];
73 + jsonString = [jsonData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
74 + return jsonString;
75 +}
76 +
77 +/**
78 + 苹果支付结果回调
79 + */
80 +
81 +- (void)HCKAssetsToolCallBack:(NSNotification *)notification
82 +{
83 + NSDictionary* payResultDic = notification.object;
84 +
85 + NSString* receiptStr = [payResultDic objectForKey:@"HNYouaiToolResult"];
86 + NSString* queryId = [payResultDic objectForKey:@"query_id"];
87 +
88 + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
89 + NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
90 +
91 +
92 + if([@"success" isEqualToString:result]){//确认订单成功
93 + }else{//失败
94 + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
95 + NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"];
96 +
97 + NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10];
98 +
99 + if (queryIdArray) {
100 + }else{
101 + queryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
102 + }
103 +
104 + for (NSString* arrayQueryId in queryIdArray) {
105 + [tempQueryIdArray addObject:arrayQueryId];
106 + }
107 +
108 + [tempQueryIdArray addObject:queryId];
109 + [userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
110 + [userDefaults setObject:receiptStr forKey:queryId];
111 + [userDefaults synchronize];
112 + }
113 +}
114 +
115 +/**
116 + 支付 创建订单
117 + */
118 +- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)payInfo
119 +{
120 + mExchange = [payInfo exchange].intValue;
121 + [super SDKgzyazfWithGzyazfmentInfo:payInfo];
122 +}
123 +
124 +/**
125 + SDK
126 + */
127 +- (void)SDKgotoUserCenter
128 +{
129 +}
130 +
131 +- (void)SDKreport:(HaiBaoJuheReportInfo *)reportInfo
132 +{
133 + NSLog(@"reportInfo");
134 + NSString* reportType = [reportInfo reportType];
135 + if (reportInfo) {
136 + if ([reportType isEqualToString:REPORT_ENTER]) {
137 + [TrackingIO setLoginWithAccountID:[reportInfo playerId]];
138 +
139 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
140 + [self handlerLeakOrder];
141 + });
142 + }else if ([reportType isEqualToString:REPORT_CREATEROLE]){
143 + [TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
144 + }
145 + }
146 +}
147 +
148 +/**
149 + SDK
150 + */
151 +- (void)SDKexitSDK
152 +{
153 +
154 +}
155 +
156 +- (void)SDKlogoutSDK
157 +{
158 + NSLog(@"切换账号");
159 +}
160 +
161 +- (void)handleOpenurl:(NSURL *)url
162 +{
163 +}
164 +
165 +- (void)receivePayMessage : (NSNotification *)notification;
166 +{
167 + NSString *order_id = [notification object];
168 + NSLog(@"订单ID:%@", order_id);
169 +}
170 +
171 +//补单处理
172 +- (void) handlerLeakOrder{
173 + NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults];
174 + NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"];
175 +
176 + NSLog(@"orderDic%@",queryIdArray);
177 + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
178 + NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
179 +
180 + if(queryIdArray){
181 + for (NSString* queryId in queryIdArray) {
182 + NSString* receiptStr = [userDefaults valueForKey:queryId];
183 + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
184 + NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
185 + if([@"success" isEqualToString:result]){//成功
186 + [userDefaults removeObjectForKey:queryId];
187 + }else{//补单失败
188 + [failQueryIdArray addObject:queryId];
189 + }
190 + }
191 +
192 + if([failQueryIdArray count] > 0){//含有补单失败项
193 + [userDefaults setObject:failQueryIdArray forKey:@"queryIds"];
194 + }else{//全部补单成功
195 + [userDefaults removeObjectForKey:@"queryIds"];
196 + }
197 + [userDefaults synchronize];
198 + }
199 +}
200 +
201 +
202 +- (void)receiveCreateOrder:(NSNotification *)notification
203 +{
204 + NSLog(@"创建订单成功");
205 + HaiBaoJuheGzyazfInfo *payInfo = [notification object];
206 +
207 + NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
208 + NSString *serverId = [payInfo serverId];
209 + NSString *roleName = [payInfo playerName];
210 + NSString *queryId = [payInfo queryId];
211 +
212 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
213 + [self handlerLeakOrder];
214 + });
215 +
216 + NSString *other = [payInfo other];
217 +
218 + if (other && [other length] > 0) {
219 + [[HNYouaiAllManager HNYouaiInstance] HNYouaiQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
220 + }else{
221 + NSString* products = [payInfo products];
222 + [[HNYouaiAllManager HNYouaiInstance] HNYouaiQueryOperation:self.controller HNYouaiHuoWuID:products HNYouaiJiaGe:[payInfo postAmount] HNYouaiHuoWuMing:[payInfo productName] HNYouaiDingDanHao:queryId];
223 + }
224 +}
225 +
226 +-(void)paymentSuccess:(NSString *)accountId orderId:(NSString *)orderId currencyAmount:(double)amount currencyType:(NSString *)currencyType payType:(NSString *)payType custom:(NSArray *)customArray
227 +{
228 + [TrackingIO setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
229 +}
230 +
231 +@end
232 +
No preview for this file type
1 +//
2 +// NewTtack.h
3 +// NewTtack
4 +//
5 +// Created by yun on 16/1/11.
6 +// Copyright © 2016年 yun. All rights reserved.
7 +//
8 +#define TRACK_VERSION @"1.0.1"
9 +
10 +#import <Foundation/Foundation.h>
11 +#import <UIKit/UIKit.h>
12 +
13 +
14 +/*
15 + 热云移动广告效果监测 平台 api 请选择对应的api进行使用
16 + */
17 +NS_ASSUME_NONNULL_BEGIN
18 +@interface TrackingIO : NSObject
19 +//开启打印日志 正式上线包请关掉
20 ++(void) setPrintLog :(BOOL)print;
21 +// 开启数据统计
22 ++ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
23 +//注册成功后调用
24 ++ (void)setRegisterWithAccountID:(NSString *)account;
25 +//登陆成功后调用
26 ++ (void)setLoginWithAccountID:(NSString *)account;
27 +//开始付费时 调用(人民币单位是元)
28 ++(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
29 +// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
30 ++(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
31 +//自定义事件
32 ++(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
33 +//标准接口
34 ++(void)setProfile:(NSDictionary *)dataDic;
35 +//获取设备信息
36 ++(NSString*)getDeviceId;
37 +@end
38 +NS_ASSUME_NONNULL_END
1 +{"renyunAppKey": "false", "payorderurl": "https://public.sdk.haibaoyouxi.com/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "736b4d81e2f7da30faea1eaa90afa522", "custom": "{}", "sdkVersionCode": "V1_1", "loginCheckUrl": "https://public.sdk.haibaoyouxi.com/logincheck/check", "appScheme": "com.jghb.xinqinji", "c2": "", "c1": "", "APP_ID": "5c3eb15b48d88d102762a7e5", "paycheckurl": "https://public.sdk.haibaoyouxi.com/paycheck/confirm", "gameSimpleName": "testest"}
1 +新接入请参考对接文档和demo<br>
2 +
3 +曾接入公共SDK的快速更新海豹聚合SDK 2018年12月05日版本<br>
4 +1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
5 +2、``` 引入poolsdk_file文件夹中Sprite.framework ``` <br>
6 +3、``` 替换SDKInterface.m文件 ``` <br>
7 +4、``` 删除 PoolSdk.framework ``` <br>
8 +5、``` 引入HaiBaoJuheSDK.framework ``` <br>
9 +6、``` 原pool_setting文件 替换成新 haibao_setting文件 ``` <br>
10 +7、``` 所有接口PoolSdk 替换成 HaiBaoJuheSDK(如不理解可以参考demo或者详细文档) ``` <br>
11 +
12 +
13 +已更新 海豹聚合SDK 2018年12月05日版本 快速更新到 2019年01月25日版本方法<br>
14 +1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
15 +2、``` 引入poolsdk_file文件夹中Railway.framework ``` <br>
16 +3、``` 替换SDKInterface.m文件 ``` <br>
17 +4、``` 替换HaiBaoJuheSDK.framework ``` <br>
18 +5、``` 原 URL Schemes 中的 i9133public 改为 sdk.uuufish.com (可参考demo中info设置) ``` <br>
...\ No newline at end of file ...\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
1 +# 公共SDK服务端接入文档
2 +
3 +### 1.登录验证
4 + 客户端发送请求参数给服务端,服务端对参数进行 MD5 加密,如果加密结果和serverSign 一致,则验证通过,否则不通过
5 +参数 | 类型 | 描述
6 +------------ | ------------- | ------------
7 +userType | int | 用户类型 ID(渠道类型,兼容以 前帐号体系)
8 +openId | string | 平台渠道方返回用户ID
9 +timestamp | string | 时间戳,公共SDK发送到客户端的参数timestamp, 服务端可以判断 timestamp 是否 在有效的登录时间内
10 +serverSign | string | 验证密钥,公共 SDK 发送到 客户端的参数 serverSign,加密串:gameAppkey=%s&userType=% s&openId=%s&timestamp=%s注意:(改为游戏本身的gameAppkey值)
11 +
12 +验证方式:
13 +serverSign=MD5(gameAppkey=%s&userType=%s&openId=%s&timestamp=%s) 如:
14 +md5("gameAppkey=xxxx&userType=1&openId=123&timestamp=111111111111")
15 +gameAppkey : 在公共SDK后台的 Md5加密的KEY
16 +
17 +`注意!CP必须要以userType+openId保证帐号唯一性`
18 +
19 +### 2. 充值验证(通知游戏方发货)
20 + 公共SDK服务器接收到渠道服务器充值回调,对回调进行 MD5 验证,如果验证通过, 则采用Post方式马上回调给游戏充值服务器,否则不会回调充值服务器,然后再返回 信息给渠道服务器。回调参数如下:
21 +参数 | 类型 | 描述
22 +------------ | -------------| ------------
23 +serverId | int | 服务器 ID
24 +playerId | int | 角色 ID
25 +orderId | string | 渠道方订单 ID
26 +payAmount | double | 充值金额(如有商品 ID,此值为商 品的金额)
27 +currency | string | 充值货币(CNY:人民币)
28 +goodsId | string | 商品ID,参数对一些有商品列表 的充值有效
29 +goodsName | string | 商品名称
30 +remoteIp | string | 客户端充值 IP
31 +custom | string | 透传参数 ,长度 512
32 +serverSign | string | 发给充值服务器验证的注意:(改为游戏本身的 gameAppkey 值)
33 +uId | string | 平台渠道帐号 ID
34 +gameSimpleName | string | 平台SDK后台游戏代号名
35 +sdkSimpleName | string | 平台SDK代号
36 +queryId | string | 平台SDK订单号
37 +postTime | string | 订单创建时间戳
38 +
39 +验证方式:
40 +旧:serverSign=MD5(serverId=%s&playerId=%s&orderId=%s&gameAppKey=%s)
41 +升级:sign=Md5('serverId=%s&playerId=%s&orderId=%s&payAmount=%s&goodsId=%s&sdkSimpleName=%s&gameAppKey=%s')
42 +%s:为相应的值
43 +gameAppkey : 在公共SDK后台的Md5加密的KEY
44 +验证通过后,返回公共 SDK 服务器数据,数据格式:{"code":0,"message":"无订 单"}。code:0 表示失败,1 表示成功,message:描述原因。
45 +
46 +`注意!CP必须要以orderId+sdkSimpleName保证订单唯一性,建议使用sign验证`
...\ No newline at end of file ...\ No newline at end of file
1 +channelRootPath = "poolsdk_file"
2 +gameProjName = 'Demo'
...\ No newline at end of file ...\ No newline at end of file
1 +# Copyright 2012 Calvin Rien
2 +#
3 +# Licensed under the Apache License, Version 2.0 (the "License");
4 +# you may not use this file except in compliance with the License.
5 +# You may obtain a copy of the License at
6 +#
7 +# http://www.apache.org/licenses/LICENSE-2.0
8 +#
9 +# Unless required by applicable law or agreed to in writing, software
10 +# distributed under the License is distributed on an "AS IS" BASIS,
11 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 +# See the License for the specific language governing permissions and
13 +# limitations under the License.
14 +
15 +# A pbxproj file is an OpenStep format plist
16 +# {} represents dictionary of key=value pairs delimited by ;
17 +# () represents list of values delimited by ,
18 +# file starts with a comment specifying the character type
19 +# // !$*UTF8*$!
20 +
21 +# when adding a file to a project, create the PBXFileReference
22 +# add the PBXFileReference's guid to a group
23 +# create a PBXBuildFile with the PBXFileReference's guid
24 +# add the PBXBuildFile to the appropriate build phase
25 +
26 +# when adding a header search path add
27 +# HEADER_SEARCH_PATHS = "path/**";
28 +# to each XCBuildConfiguration object
29 +
30 +# Xcode4 will read either a OpenStep or XML plist.
31 +# this script uses `plutil` to validate, read and write
32 +# the pbxproj file. Plutil is available in OS X 10.2 and higher
33 +# Plutil can't write OpenStep plists, so I save as XML
34 +
35 +import datetime
36 +import json
37 +import ntpath
38 +import os
39 +import plistlib
40 +import re
41 +import shutil
42 +import subprocess
43 +import uuid
44 +
45 +from UserDict import IterableUserDict
46 +from UserList import UserList
47 +
48 +regex = '[a-zA-Z0-9\\._/-]*'
49 +
50 +
51 +class PBXEncoder(json.JSONEncoder):
52 + def default(self, obj):
53 + """Tests the input object, obj, to encode as JSON."""
54 +
55 + if isinstance(obj, (PBXList, PBXDict)):
56 + return obj.data
57 +
58 + return json.JSONEncoder.default(self, obj)
59 +
60 +
61 +class PBXDict(IterableUserDict):
62 + def __init__(self, d=None):
63 + if d:
64 + d = dict([(PBXType.Convert(k), PBXType.Convert(v)) for k, v in d.items()])
65 +
66 + IterableUserDict.__init__(self, d)
67 +
68 + def __setitem__(self, key, value):
69 + IterableUserDict.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
70 +
71 + def remove(self, key):
72 + self.data.pop(PBXType.Convert(key), None)
73 +
74 +
75 +class PBXList(UserList):
76 + def __init__(self, l=None):
77 + if isinstance(l, basestring):
78 + UserList.__init__(self)
79 + self.add(l)
80 + return
81 + elif l:
82 + l = [PBXType.Convert(v) for v in l]
83 +
84 + UserList.__init__(self, l)
85 +
86 + def add(self, value):
87 + value = PBXType.Convert(value)
88 +
89 + if value in self.data:
90 + return False
91 +
92 + self.data.append(value)
93 + return True
94 +
95 + def remove(self, value):
96 + value = PBXType.Convert(value)
97 +
98 + if value in self.data:
99 + self.data.remove(value)
100 + return True
101 + return False
102 +
103 + def __setitem__(self, key, value):
104 + UserList.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
105 +
106 +
107 +class PBXType(PBXDict):
108 + def __init__(self, d=None):
109 + PBXDict.__init__(self, d)
110 +
111 + if 'isa' not in self:
112 + self['isa'] = self.__class__.__name__
113 + self.id = None
114 +
115 + @staticmethod
116 + def Convert(o):
117 + if isinstance(o, list):
118 + return PBXList(o)
119 + elif isinstance(o, dict):
120 + isa = o.get('isa')
121 +
122 + if not isa:
123 + return PBXDict(o)
124 +
125 + cls = globals().get(isa)
126 +
127 + if cls and issubclass(cls, PBXType):
128 + return cls(o)
129 +
130 + print 'warning: unknown PBX type: %s' % isa
131 + return PBXDict(o)
132 + else:
133 + return o
134 +
135 + @staticmethod
136 + def IsGuid(o):
137 + return re.match('^[A-F0-9]{24}$', str(o))
138 +
139 + @classmethod
140 + def GenerateId(cls):
141 + return ''.join(str(uuid.uuid4()).upper().split('-')[1:])
142 +
143 + @classmethod
144 + def Create(cls, *args, **kwargs):
145 + return cls(*args, **kwargs)
146 +
147 +
148 +class PBXFileReference(PBXType):
149 + def __init__(self, d=None):
150 + PBXType.__init__(self, d)
151 + self.build_phase = None
152 +
153 + types = {
154 + '.a': ('archive.ar', 'PBXFrameworksBuildPhase'),
155 + '.app': ('wrapper.application', None),
156 + '.s': ('sourcecode.asm', 'PBXSourcesBuildPhase'),
157 + '.c': ('sourcecode.c.c', 'PBXSourcesBuildPhase'),
158 + '.cpp': ('sourcecode.cpp.cpp', 'PBXSourcesBuildPhase'),
159 + '.framework': ('wrapper.framework', 'PBXFrameworksBuildPhase'),
160 + '.h': ('sourcecode.c.h', None),
161 + '.hpp': ('sourcecode.c.h', None),
162 + '.d': ('sourcecode.dtrace', 'PBXSourcesBuildPhase'),
163 + '.swift': ('sourcecode.swift', 'PBXSourcesBuildPhase'),
164 + '.icns': ('image.icns', 'PBXResourcesBuildPhase'),
165 + '.m': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
166 + '.j': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
167 + '.mm': ('sourcecode.cpp.objcpp', 'PBXSourcesBuildPhase'),
168 + '.nib': ('wrapper.nib', 'PBXResourcesBuildPhase'),
169 + '.plist': ('text.plist.xml', 'PBXResourcesBuildPhase'),
170 + '.json': ('text.json', 'PBXResourcesBuildPhase'),
171 + '.png': ('image.png', 'PBXResourcesBuildPhase'),
172 + '.rtf': ('text.rtf', 'PBXResourcesBuildPhase'),
173 + '.tiff': ('image.tiff', 'PBXResourcesBuildPhase'),
174 + '.txt': ('text', 'PBXResourcesBuildPhase'),
175 + '.xcodeproj': ('wrapper.pb-project', None),
176 + '.xib': ('file.xib', 'PBXResourcesBuildPhase'),
177 + '.strings': ('text.plist.strings', 'PBXResourcesBuildPhase'),
178 + '.bundle': ('wrapper.plug-in', 'PBXResourcesBuildPhase'),
179 + '.dylib': ('compiled.mach-o.dylib', 'PBXFrameworksBuildPhase'),
180 + '.xcdatamodeld': ('wrapper.xcdatamodel', 'PBXSourcesBuildPhase'),
181 + '.xcassets': ('folder.assetcatalog', 'PBXResourcesBuildPhase'),
182 + '.tbd': ('sourcecode.text-based-dylib-definition', 'PBXFrameworksBuildPhase'),
183 + }
184 +
185 + trees = [
186 + '<absolute>',
187 + '<group>',
188 + 'BUILT_PRODUCTS_DIR',
189 + 'DEVELOPER_DIR',
190 + 'SDKROOT',
191 + 'SOURCE_ROOT',
192 + ]
193 +
194 + def guess_file_type(self, ignore_unknown_type=False):
195 + self.remove('explicitFileType')
196 + self.remove('lastKnownFileType')
197 +
198 +
199 + ext = os.path.splitext(self.get('name', ''))[1]
200 + if os.path.isdir(self.get('path')) and ext not in XcodeProject.special_folders:
201 + f_type = 'folder'
202 + build_phase = None
203 + ext = ''
204 + else:
205 + f_type, build_phase = PBXFileReference.types.get(ext, ('?', 'PBXResourcesBuildPhase'))
206 +
207 + self['lastKnownFileType'] = f_type
208 + self.build_phase = build_phase
209 +
210 + if f_type == '?' and not ignore_unknown_type:
211 + print 'unknown file extension: %s' % ext
212 + print 'please add extension and Xcode type to PBXFileReference.types'
213 +
214 + return f_type
215 +
216 + def set_file_type(self, ft):
217 + self.remove('explicitFileType')
218 + self.remove('lastKnownFileType')
219 +
220 + self['explicitFileType'] = ft
221 +
222 + @classmethod
223 + def Create(cls, os_path, tree='SOURCE_ROOT', ignore_unknown_type=False):
224 + if tree not in cls.trees:
225 + print 'Not a valid sourceTree type: %s' % tree
226 + return None
227 +
228 + fr = cls()
229 + fr.id = cls.GenerateId()
230 + fr['path'] = os_path
231 + fr['name'] = os.path.split(os_path)[1]
232 + fr['sourceTree'] = '<absolute>' if os.path.isabs(os_path) else tree
233 + fr.guess_file_type(ignore_unknown_type=ignore_unknown_type)
234 +
235 + return fr
236 +
237 +
238 +class PBXBuildFile(PBXType):
239 + def set_weak_link(self, weak=False):
240 + k_settings = 'settings'
241 + k_attributes = 'ATTRIBUTES'
242 +
243 + s = self.get(k_settings)
244 +
245 + if not s:
246 + if weak:
247 + self[k_settings] = PBXDict({k_attributes: PBXList(['Weak'])})
248 +
249 + return True
250 +
251 + atr = s.get(k_attributes)
252 +
253 + if not atr:
254 + if weak:
255 + atr = PBXList()
256 + else:
257 + return False
258 +
259 + if weak:
260 + atr.add('Weak')
261 + else:
262 + atr.remove('Weak')
263 +
264 + self[k_settings][k_attributes] = atr
265 +
266 + return True
267 +
268 + def add_compiler_flag(self, flag):
269 + k_settings = 'settings'
270 + k_attributes = 'COMPILER_FLAGS'
271 +
272 + if k_settings not in self:
273 + self[k_settings] = PBXDict()
274 +
275 + if k_attributes not in self[k_settings]:
276 + self[k_settings][k_attributes] = flag
277 + return True
278 +
279 + flags = self[k_settings][k_attributes].split(' ')
280 +
281 + if flag in flags:
282 + return False
283 +
284 + flags.append(flag)
285 +
286 + self[k_settings][k_attributes] = ' '.join(flags)
287 +
288 + @classmethod
289 + def Create(cls, file_ref, weak=False):
290 + if isinstance(file_ref, PBXFileReference):
291 + file_ref = file_ref.id
292 +
293 + bf = cls()
294 + bf.id = cls.GenerateId()
295 + bf['fileRef'] = file_ref
296 +
297 + if weak:
298 + bf.set_weak_link(True)
299 +
300 + return bf
301 +
302 +
303 +class PBXGroup(PBXType):
304 + def add_child(self, ref):
305 + if not isinstance(ref, PBXDict):
306 + return None
307 +
308 + isa = ref.get('isa')
309 +
310 + if isa != 'PBXFileReference' and isa != 'PBXGroup':
311 + return None
312 +
313 + if 'children' not in self:
314 + self['children'] = PBXList()
315 +
316 + self['children'].add(ref.id)
317 +
318 + return ref.id
319 +
320 + def remove_child(self, id):
321 + if 'children' not in self:
322 + self['children'] = PBXList()
323 + return
324 +
325 + if not PBXType.IsGuid(id):
326 + id = id.id
327 +
328 + self['children'].remove(id)
329 +
330 + def has_child(self, id):
331 + if 'children' not in self:
332 + self['children'] = PBXList()
333 + return False
334 +
335 + if not PBXType.IsGuid(id):
336 + id = id.id
337 +
338 + return id in self['children']
339 +
340 + def get_name(self):
341 + path_name = os.path.split(self.get('path', ''))[1]
342 + return self.get('name', path_name)
343 +
344 + @classmethod
345 + def Create(cls, name, path=None, tree='SOURCE_ROOT'):
346 + grp = cls()
347 + grp.id = cls.GenerateId()
348 + grp['name'] = name
349 + grp['children'] = PBXList()
350 +
351 + if path:
352 + grp['path'] = path
353 + grp['sourceTree'] = tree
354 + else:
355 + grp['sourceTree'] = '<group>'
356 +
357 + return grp
358 +
359 +
360 +class PBXNativeTarget(PBXType):
361 + pass
362 +
363 +
364 +class PBXProject(PBXType):
365 + pass
366 +
367 +
368 +class PBXContainerItemProxy(PBXType):
369 + pass
370 +
371 +
372 +class PBXReferenceProxy(PBXType):
373 + pass
374 +
375 +
376 +class PBXVariantGroup(PBXType):
377 + pass
378 +
379 +
380 +class PBXTargetDependency(PBXType):
381 + pass
382 +
383 +
384 +class PBXAggregateTarget(PBXType):
385 + pass
386 +
387 +
388 +class PBXHeadersBuildPhase(PBXType):
389 + pass
390 +
391 +class XCVersionGroup(PBXType):
392 + pass
393 +
394 +class PBXBuildPhase(PBXType):
395 + def add_build_file(self, bf):
396 + if bf.get('isa') != 'PBXBuildFile':
397 + return False
398 +
399 + if 'files' not in self:
400 + self['files'] = PBXList()
401 +
402 + self['files'].add(bf.id)
403 +
404 + return True
405 +
406 + def remove_build_file(self, id):
407 + if 'files' not in self:
408 + self['files'] = PBXList()
409 + return
410 +
411 + self['files'].remove(id)
412 +
413 + def has_build_file(self, id):
414 + if 'files' not in self:
415 + self['files'] = PBXList()
416 + return False
417 +
418 + if not PBXType.IsGuid(id):
419 + id = id.id
420 +
421 + return id in self['files']
422 +
423 +
424 +class PBXFrameworksBuildPhase(PBXBuildPhase):
425 + pass
426 +
427 +
428 +class PBXResourcesBuildPhase(PBXBuildPhase):
429 + pass
430 +
431 +
432 +class PBXShellScriptBuildPhase(PBXBuildPhase):
433 + @classmethod
434 + def Create(cls, script, shell="/bin/sh", files=[], input_paths=[], output_paths=[], show_in_log = '0'):
435 + bf = cls()
436 + bf.id = cls.GenerateId()
437 + bf['files'] = files
438 + bf['inputPaths'] = input_paths
439 + bf['outputPaths'] = output_paths
440 + bf['runOnlyForDeploymentPostprocessing'] = '0';
441 + bf['shellPath'] = shell
442 + bf['shellScript'] = script
443 + bf['showEnvVarsInLog'] = show_in_log
444 +
445 + return bf
446 +
447 +
448 +class PBXSourcesBuildPhase(PBXBuildPhase):
449 + pass
450 +
451 +
452 +class PBXCopyFilesBuildPhase(PBXBuildPhase):
453 + pass
454 +
455 +
456 +class XCBuildConfiguration(PBXType):
457 + def add_search_paths(self, paths, base, key, recursive=True, escape=True):
458 + modified = False
459 +
460 + if not isinstance(paths, list):
461 + paths = [paths]
462 +
463 + if base not in self:
464 + self[base] = PBXDict()
465 +
466 + for path in paths:
467 + if recursive and not path.endswith('/**'):
468 + path = os.path.join(path, '**')
469 +
470 + if key not in self[base]:
471 + self[base][key] = PBXList()
472 + elif isinstance(self[base][key], basestring):
473 + self[base][key] = PBXList(self[base][key])
474 +
475 + if path == '$(inherited)':
476 + escape = False
477 +
478 + if escape:
479 + if self[base][key].add('"%s"' % path): # '\\"%s\\"' % path
480 + modified = True
481 + else:
482 + if self[base][key].add(path): # '\\"%s\\"' % path
483 + modified = True
484 +
485 + return modified
486 +
487 + def add_header_search_paths(self, paths, recursive=True):
488 + return self.add_search_paths(paths, 'buildSettings', 'HEADER_SEARCH_PATHS', recursive=recursive)
489 +
490 + def add_library_search_paths(self, paths, recursive=True):
491 + return self.add_search_paths(paths, 'buildSettings', 'LIBRARY_SEARCH_PATHS', recursive=recursive)
492 +
493 + def add_framework_search_paths(self, paths, recursive=True):
494 + return self.add_search_paths(paths, 'buildSettings', 'FRAMEWORK_SEARCH_PATHS', recursive=recursive)
495 +
496 + def add_other_cflags(self, flags):
497 + return self.add_flag('OTHER_CFLAGS', flags)
498 +
499 + def add_other_ldflags(self, flags):
500 + return self.add_flag('OTHER_LDFLAGS', flags)
501 +
502 + def add_flag(self, key, flags):
503 + modified = False
504 + base = 'buildSettings'
505 +
506 + if isinstance(flags, basestring):
507 + flags = PBXList(flags)
508 +
509 + if base not in self:
510 + self[base] = PBXDict()
511 +
512 + for flag in flags:
513 + if key not in self[base]:
514 + self[base][key] = PBXList()
515 + elif isinstance(self[base][key], basestring):
516 + self[base][key] = PBXList(self[base][key])
517 +
518 + if self[base][key].add(flag):
519 + self[base][key] = [e for e in self[base][key] if e]
520 + modified = True
521 +
522 + return modified
523 +
524 + def remove_flag(self, key, flags):
525 + modified = False
526 + base = 'buildSettings'
527 +
528 + if isinstance(flags, basestring):
529 + flags = PBXList(flags)
530 +
531 + if base in self: # there are flags, so we can "remove" something
532 + for flag in flags:
533 + if key not in self[base]:
534 + return False
535 + elif isinstance(self[base][key], basestring):
536 + self[base][key] = PBXList(self[base][key])
537 +
538 + if self[base][key].remove(flag):
539 + self[base][key] = [e for e in self[base][key] if e]
540 + modified = True
541 +
542 + if len(self[base][key]) == 0:
543 + self[base].pop(key, None)
544 +
545 + return modified
546 +
547 + def remove_other_ldflags(self, flags):
548 + return self.remove_flag('OTHER_LD_FLAGS', flags)
549 +
550 + # Set a single-valued flag under buildSettings
551 + def add_single_valued_flag(self, flag, value):
552 + modified = False
553 + base = 'buildSettings'
554 + key = flag
555 +
556 + if not self.has_key(base):
557 + self[base] = PBXDict()
558 + if self[base].has_key(key):
559 + if self[base][key] == value:
560 + return False
561 + self[base][key] = value
562 + modified = True
563 + return modified
564 +
565 + # Remove a single-valued flag under buildSettings
566 + def remove_single_valued_flag(self, flag):
567 + modified = False
568 + base = 'buildSettings'
569 + key = flag
570 +
571 + if self.has_key(base) and self[base].has_key(key):
572 + self[base].pop(key, None)
573 + modified = True
574 + return modified
575 +
576 +class XCConfigurationList(PBXType):
577 + pass
578 +
579 +
580 +class XcodeProject(PBXDict):
581 + plutil_path = 'plutil'
582 + special_folders = ['.bundle', '.framework', '.xcodeproj', '.xcassets', '.xcdatamodeld']
583 +
584 + def __init__(self, d=None, path=None):
585 + if not path:
586 + path = os.path.join(os.getcwd(), 'project.pbxproj')
587 +
588 + self.pbxproj_path = os.path.abspath(path)
589 + self.source_root = os.path.abspath(os.path.join(os.path.split(path)[0], '..'))
590 +
591 + IterableUserDict.__init__(self, d)
592 +
593 + self.data = PBXDict(self.data)
594 + self.objects = self.get('objects')
595 + self.modified = False
596 +
597 + root_id = self.get('rootObject')
598 +
599 + if root_id:
600 + self.root_object = self.objects[root_id]
601 + root_group_id = self.root_object.get('mainGroup')
602 + self.root_group = self.objects[root_group_id]
603 + else:
604 + print "error: project has no root object"
605 + self.root_object = None
606 + self.root_group = None
607 +
608 + for k, v in self.objects.iteritems():
609 + v.id = k
610 +
611 + def add_other_cflags(self, flags):
612 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
613 +
614 + for b in build_configs:
615 + if b.add_other_cflags(flags):
616 + self.modified = True
617 +
618 + def add_other_ldflags(self, flags):
619 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
620 +
621 + for b in build_configs:
622 + if b.add_other_ldflags(flags):
623 + self.modified = True
624 +
625 + def remove_other_ldflags(self, flags):
626 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
627 +
628 + for b in build_configs:
629 + if b.remove_other_ldflags(flags):
630 + self.modified = True
631 +
632 + def add_header_search_paths(self, paths, recursive=True):
633 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
634 +
635 + for b in build_configs:
636 + if b.add_header_search_paths(paths, recursive):
637 + self.modified = True
638 +
639 + def add_framework_search_paths(self, paths, recursive=True):
640 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
641 +
642 + for b in build_configs:
643 + if b.add_framework_search_paths(paths, recursive):
644 + self.modified = True
645 +
646 + def add_library_search_paths(self, paths, recursive=True):
647 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
648 +
649 + for b in build_configs:
650 + if b.add_library_search_paths(paths, recursive):
651 + self.modified = True
652 +
653 + def add_flags(self, pairs, configuration='All'):
654 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
655 +
656 + # iterate over all the pairs of configurations
657 + for b in build_configs:
658 + if configuration != "All" and b.get('name') != configuration :
659 + continue
660 +
661 + for k in pairs:
662 + if b.add_flag(k, pairs[k]):
663 + self.modified = True
664 +
665 + def remove_flags(self, pairs, configuration='All'):
666 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
667 +
668 + # iterate over all the pairs of configurations
669 + for b in build_configs:
670 + if configuration != "All" and b.get('name') != configuration :
671 + continue
672 + for k in pairs:
673 + if b.remove_flag(k, pairs[k]):
674 + self.modified = True
675 +
676 + # Set a single-valued flag (whereas add_flags adds a flag to a list of flags with a given key)
677 + def add_single_valued_flag(self, flag, value, configuration='All'):
678 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
679 +
680 + for b in build_configs:
681 + if configuration != "All" and b.get('name') != configuration :
682 + continue
683 +
684 + if b.add_single_valued_flag(flag, value):
685 + self.modified = True
686 +
687 + # Remove a single-valued flag (whereas remove_flags deletes a flag from a list of flags with a given key)
688 + def remove_single_valued_flag(self, flag, configuration='All'):
689 + build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
690 +
691 + for b in build_configs:
692 + if configuration != "All" and b.get('name') != configuration :
693 + continue
694 +
695 + if b.remove_single_valued_flag(flag):
696 + self.modified = True
697 +
698 + def get_obj(self, id):
699 + return self.objects.get(id)
700 +
701 + def get_ids(self):
702 + return self.objects.keys()
703 +
704 + def get_files_by_os_path(self, os_path, tree='SOURCE_ROOT'):
705 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
706 + and f.get('path') == os_path
707 + and f.get('sourceTree') == tree]
708 +
709 + return files
710 +
711 + def get_files_by_name(self, name, parent=None):
712 + if parent:
713 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
714 + and f.get('name') == name
715 + and parent.has_child(f)]
716 + else:
717 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
718 + and f.get('name') == name]
719 +
720 + return files
721 +
722 + def get_keys_for_files_by_name(self, name):
723 + keys = [key for key in self.objects if self.objects.data[key].get('name') == name
724 + and self.objects.data[key].get('isa') == 'PBXFileReference']
725 + return keys
726 +
727 +
728 + def get_build_files(self, id):
729 + files = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile'
730 + and f.get('fileRef') == id]
731 + return files
732 +
733 + def get_groups_by_name(self, name, parent=None):
734 + if parent:
735 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
736 + and g.get_name() == name
737 + and parent.has_child(g)]
738 + else:
739 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
740 + and g.get_name() == name]
741 +
742 + return groups
743 +
744 + def get_or_create_group(self, name, path=None, parent=None):
745 + if not name:
746 + return None
747 +
748 + if not parent:
749 + parent = self.root_group
750 + elif not isinstance(parent, PBXGroup):
751 + # assume it's an id
752 + parent = self.objects.get(parent, self.root_group)
753 +
754 + groups = self.get_groups_by_name(name)
755 +
756 + for grp in groups:
757 + if parent.has_child(grp.id):
758 + return grp
759 +
760 + grp = PBXGroup.Create(name, path)
761 + parent.add_child(grp)
762 +
763 + self.objects[grp.id] = grp
764 +
765 + self.modified = True
766 +
767 + return grp
768 +
769 + def get_groups_by_os_path(self, path):
770 + path = os.path.abspath(path)
771 +
772 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
773 + and os.path.abspath(g.get('path', '/dev/null')) == path]
774 +
775 + return groups
776 +
777 + def get_build_phases(self, phase_name):
778 + phases = [p for p in self.objects.values() if p.get('isa') == phase_name]
779 +
780 + return phases
781 +
782 + def get_target_by_name(self, name):
783 + targets = self.get_build_phases('PBXNativeTarget')
784 + target = None
785 + for t in targets:
786 + if t.get("name") == name:
787 + target = t
788 + break
789 + return target
790 +
791 + def get_relative_path(self, os_path):
792 + return os.path.relpath(os_path, self.source_root)
793 +
794 + def verify_files(self, file_list, parent=None):
795 + # returns list of files not in the current project.
796 + if not file_list:
797 + return []
798 +
799 + if parent:
800 + exists_list = [f.get('name') for f in self.objects.values() if f.get('isa') == 'PBXFileReference' and f.get('name') in file_list and parent.has_child(f)]
801 + else:
802 + exists_list = [f.get('name') for f in self.objects.values() if f.get('isa') == 'PBXFileReference' and f.get('name') in file_list]
803 +
804 + return set(file_list).difference(exists_list)
805 +
806 + def add_run_script(self, target, script=None, insert_before_compile=False):
807 + result = []
808 + targets = [t for t in self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget') if t.get('name') == target]
809 + if len(targets) != 0 :
810 + script_phase = PBXShellScriptBuildPhase.Create(script)
811 + for t in targets:
812 + skip = False
813 + for buildPhase in t['buildPhases']:
814 + if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
815 + skip = True
816 +
817 + if not skip:
818 + if insert_before_compile:
819 + t['buildPhases'].insert(0, script_phase.id)
820 + else:
821 + t['buildPhases'].add(script_phase.id)
822 + self.objects[script_phase.id] = script_phase
823 + result.append(script_phase)
824 +
825 + return result
826 +
827 + def add_run_script_all_targets(self, script=None):
828 + result = []
829 + targets = self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget')
830 + if len(targets) != 0 :
831 + script_phase = PBXShellScriptBuildPhase.Create(script)
832 + for t in targets:
833 + skip = False
834 + for buildPhase in t['buildPhases']:
835 + if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
836 + skip = True
837 +
838 + if not skip:
839 + t['buildPhases'].add(script_phase.id)
840 + self.objects[script_phase.id] = script_phase
841 + result.append(script_phase)
842 +
843 + return result
844 +
845 + def add_folder(self, os_path, parent=None, excludes=None, recursive=True, create_build_files=True):
846 + if not os.path.isdir(os_path):
847 + return []
848 +
849 + if not excludes:
850 + excludes = []
851 +
852 + results = []
853 +
854 + if not parent:
855 + parent = self.root_group
856 + elif not isinstance(parent, PBXGroup):
857 + # assume it's an id
858 + parent = self.objects.get(parent, self.root_group)
859 +
860 + path_dict = {os.path.split(os_path)[0]: parent}
861 + special_list = []
862 +
863 + for (grp_path, subdirs, files) in os.walk(os_path):
864 + parent_folder, folder_name = os.path.split(grp_path)
865 + parent = path_dict.get(parent_folder, parent)
866 +
867 + if [sp for sp in special_list if parent_folder.startswith(sp)]:
868 + continue
869 +
870 + if folder_name.startswith('.'):
871 + special_list.append(grp_path)
872 + continue
873 +
874 + if os.path.splitext(grp_path)[1] in XcodeProject.special_folders:
875 + # if this file has a special extension (bundle or framework mainly) treat it as a file
876 + special_list.append(grp_path)
877 + new_files = self.verify_files([folder_name], parent=parent)
878 +
879 + # Ignore this file if it is in excludes
880 + if new_files and not [m for m in excludes if re.match(m, grp_path)]:
881 + results.extend(self.add_file(grp_path, parent, create_build_files=create_build_files))
882 +
883 + continue
884 +
885 + # create group
886 + grp = self.get_or_create_group(folder_name, path=self.get_relative_path(grp_path), parent=parent)
887 + path_dict[grp_path] = grp
888 +
889 + results.append(grp)
890 +
891 + file_dict = {}
892 +
893 + for f in files:
894 + if f[0] == '.' or [m for m in excludes if re.match(m, f)]:
895 + continue
896 +
897 + kwds = {
898 + 'create_build_files': create_build_files,
899 + 'parent': grp,
900 + 'name': f
901 + }
902 +
903 + f_path = os.path.join(grp_path, f)
904 + file_dict[f_path] = kwds
905 +
906 + new_files = self.verify_files([n.get('name') for n in file_dict.values()], parent=grp)
907 + add_files = [(k, v) for k, v in file_dict.items() if v.get('name') in new_files]
908 +
909 + for path, kwds in add_files:
910 + kwds.pop('name', None)
911 + self.add_file(path, **kwds)
912 +
913 + if not recursive:
914 + break
915 +
916 + for r in results:
917 + self.objects[r.id] = r
918 +
919 + return results
920 +
921 + def path_leaf(self, path):
922 + head, tail = ntpath.split(path)
923 + return tail or ntpath.basename(head)
924 +
925 + def add_file_if_doesnt_exist(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False):
926 + for obj in self.objects.values():
927 + if 'path' in obj:
928 + if self.path_leaf(f_path) == self.path_leaf(obj.get('path')):
929 + return []
930 +
931 + return self.add_file(f_path, parent, tree, create_build_files, weak, ignore_unknown_type=ignore_unknown_type)
932 +
933 + def add_file(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False, target=None):
934 + results = []
935 + abs_path = ''
936 +
937 + if os.path.isabs(f_path):
938 + abs_path = f_path
939 +
940 + if not os.path.exists(f_path):
941 + return results
942 + elif tree == 'SOURCE_ROOT':
943 + f_path = os.path.relpath(f_path, self.source_root)
944 + else:
945 + tree = '<absolute>'
946 +
947 + if not parent:
948 + parent = self.root_group
949 + elif not isinstance(parent, PBXGroup):
950 + # assume it's an id
951 + parent = self.objects.get(parent, self.root_group)
952 +
953 + file_ref = PBXFileReference.Create(f_path, tree, ignore_unknown_type=ignore_unknown_type)
954 + parent.add_child(file_ref)
955 + results.append(file_ref)
956 +
957 + # create a build file for the file ref
958 + if file_ref.build_phase and create_build_files:
959 + phases = self.get_build_phases(file_ref.build_phase)
960 + if target:
961 + target = self.get_target_by_name(target)
962 +
963 + for phase in phases:
964 + if (not target) or (phase.id in target.get('buildPhases')):
965 + build_file = PBXBuildFile.Create(file_ref, weak=weak)
966 + phase.add_build_file(build_file)
967 + results.append(build_file)
968 +
969 + if abs_path and tree == 'SOURCE_ROOT' \
970 + and os.path.isfile(abs_path) \
971 + and file_ref.build_phase == 'PBXFrameworksBuildPhase':
972 + library_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
973 + self.add_library_search_paths([library_path], recursive=False)
974 +
975 + if abs_path and tree == 'SOURCE_ROOT' \
976 + and not os.path.isfile(abs_path) \
977 + and file_ref.build_phase == 'PBXFrameworksBuildPhase':
978 + framework_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
979 + self.add_framework_search_paths([framework_path, '$(inherited)'], recursive=False)
980 +
981 + for r in results:
982 + self.objects[r.id] = r
983 +
984 + if results:
985 + self.modified = True
986 +
987 + return results
988 +
989 + def check_and_repair_framework(self, base):
990 + name = os.path.basename(base)
991 +
992 + if ".framework" in name:
993 + basename = name[:-len(".framework")]
994 +
995 + finalHeaders = os.path.join(base, "Headers")
996 + finalCurrent = os.path.join(base, "Versions/Current")
997 + finalLib = os.path.join(base, basename)
998 + srcHeaders = "Versions/A/Headers"
999 + srcCurrent = "A"
1000 + srcLib = "Versions/A/" + basename
1001 +
1002 + if not os.path.exists(finalHeaders):
1003 + os.symlink(srcHeaders, finalHeaders)
1004 + if not os.path.exists(finalCurrent):
1005 + os.symlink(srcCurrent, finalCurrent)
1006 + if not os.path.exists(finalLib):
1007 + os.symlink(srcLib, finalLib)
1008 +
1009 +
1010 + def get_file_id_by_path(self, f_path):
1011 + for k, v in self.objects.iteritems():
1012 + if str(v.get('path')) == f_path:
1013 + return k
1014 + return 0
1015 +
1016 +
1017 + def remove_file_by_path(self, f_path, recursive=True):
1018 + id = self.get_file_id_by_path(f_path)
1019 + if id != 0:
1020 + self.remove_file(id, recursive=recursive)
1021 + return
1022 +
1023 +
1024 + def remove_file(self, id, recursive=True):
1025 + if not PBXType.IsGuid(id):
1026 + id = id.id
1027 +
1028 + if id in self.objects:
1029 + self.objects.remove(id)
1030 + # Remove from PBXResourcesBuildPhase and PBXSourcesBuildPhase if necessary
1031 + buildFiles = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile']
1032 + for buildFile in buildFiles:
1033 + if id == buildFile.get('fileRef'):
1034 + key = buildFile.id
1035 + PBXRBP = [f for f in self.objects.values() if f.get('isa') == 'PBXResourcesBuildPhase']
1036 + PBXSBP = [f for f in self.objects.values() if f.get('isa') == 'PBXSourcesBuildPhase']
1037 + self.objects.remove(key)
1038 + if len(PBXSBP) and PBXSBP[0].has_build_file(key):
1039 + PBXSBP[0].remove_build_file(key)
1040 + if len(PBXRBP) and PBXRBP[0].has_build_file(key):
1041 + PBXRBP[0].remove_build_file(key)
1042 + if recursive:
1043 + groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup']
1044 +
1045 + for group in groups:
1046 + if id in group['children']:
1047 + group.remove_child(id)
1048 +
1049 + self.modified = True
1050 +
1051 + def remove_group(self, id, recursive = True):
1052 + if not PBXType.IsGuid(id):
1053 + id = id.id
1054 + name = self.objects.get(id).get('path')
1055 + children = self.objects.get(id).get('children')
1056 + if name is None:
1057 + name = id
1058 + if id in self.objects:
1059 + if recursive:
1060 + for childKey in children:
1061 + childValue = self.objects.get(childKey)
1062 + if childValue.get('isa') == 'PBXGroup':
1063 + self.remove_group(childKey, True)
1064 + else:
1065 + self.remove_file(childKey, False)
1066 +
1067 + self.objects.remove(id);
1068 +
1069 + def remove_group_by_name(self, name, recursive = True):
1070 + groups = self.get_groups_by_name(name)
1071 + if len(groups):
1072 + for group in groups:
1073 + self.remove_group(group.id, recursive)
1074 +
1075 + def move_file(self, id, dest_grp=None):
1076 + pass
1077 +
1078 + def apply_patch(self, patch_path, xcode_path):
1079 + if not os.path.isfile(patch_path) or not os.path.isdir(xcode_path):
1080 + print 'ERROR: couldn\'t apply "%s" to "%s"' % (patch_path, xcode_path)
1081 + return
1082 +
1083 + print 'applying "%s" to "%s"' % (patch_path, xcode_path)
1084 +
1085 + return subprocess.call(['patch', '-p1', '--forward', '--directory=%s' % xcode_path, '--input=%s' % patch_path])
1086 +
1087 + def apply_mods(self, mod_dict, default_path=None):
1088 + if not default_path:
1089 + default_path = os.getcwd()
1090 +
1091 + keys = mod_dict.keys()
1092 +
1093 + for k in keys:
1094 + v = mod_dict.pop(k)
1095 + mod_dict[k.lower()] = v
1096 +
1097 + parent = mod_dict.pop('group', None)
1098 +
1099 + if parent:
1100 + parent = self.get_or_create_group(parent)
1101 +
1102 + excludes = mod_dict.pop('excludes', [])
1103 +
1104 + if excludes:
1105 + excludes = [re.compile(e) for e in excludes]
1106 +
1107 + compiler_flags = mod_dict.pop('compiler_flags', {})
1108 +
1109 + for k, v in mod_dict.items():
1110 + if k == 'patches':
1111 + for p in v:
1112 + if not os.path.isabs(p):
1113 + p = os.path.join(default_path, p)
1114 +
1115 + self.apply_patch(p, self.source_root)
1116 + elif k == 'folders':
1117 + # get and compile excludes list
1118 + # do each folder individually
1119 + for folder in v:
1120 + kwds = {}
1121 +
1122 + # if path contains ':' remove it and set recursive to False
1123 + if ':' in folder:
1124 + args = folder.split(':')
1125 + kwds['recursive'] = False
1126 + folder = args.pop(0)
1127 +
1128 + if os.path.isabs(folder) and os.path.isdir(folder):
1129 + pass
1130 + else:
1131 + folder = os.path.join(default_path, folder)
1132 + if not os.path.isdir(folder):
1133 + continue
1134 +
1135 + if parent:
1136 + kwds['parent'] = parent
1137 +
1138 + if excludes:
1139 + kwds['excludes'] = excludes
1140 +
1141 + self.add_folder(folder, **kwds)
1142 + elif k == 'headerpaths' or k == 'librarypaths':
1143 + paths = []
1144 +
1145 + for p in v:
1146 + if p.endswith('/**'):
1147 + p = os.path.split(p)[0]
1148 +
1149 + if not os.path.isabs(p):
1150 + p = os.path.join(default_path, p)
1151 +
1152 + if not os.path.exists(p):
1153 + continue
1154 +
1155 + p = self.get_relative_path(p)
1156 + paths.append(os.path.join('$(SRCROOT)', p, "**"))
1157 +
1158 + if k == 'headerpaths':
1159 + self.add_header_search_paths(paths)
1160 + else:
1161 + self.add_library_search_paths(paths)
1162 + elif k == 'other_cflags':
1163 + self.add_other_cflags(v)
1164 + elif k == 'other_ldflags':
1165 + self.add_other_ldflags(v)
1166 + elif k == 'libs' or k == 'frameworks' or k == 'files':
1167 + paths = {}
1168 +
1169 + for p in v:
1170 + kwds = {}
1171 +
1172 + if ':' in p:
1173 + args = p.split(':')
1174 + p = args.pop(0)
1175 +
1176 + if 'weak' in args:
1177 + kwds['weak'] = True
1178 +
1179 + file_path = os.path.join(default_path, p)
1180 + search_path, file_name = os.path.split(file_path)
1181 +
1182 + if [m for m in excludes if re.match(m, file_name)]:
1183 + continue
1184 +
1185 + try:
1186 + expr = re.compile(file_name)
1187 + except re.error:
1188 + expr = None
1189 +
1190 + if expr and os.path.isdir(search_path):
1191 + file_list = os.listdir(search_path)
1192 +
1193 + for f in file_list:
1194 + if [m for m in excludes if re.match(m, f)]:
1195 + continue
1196 +
1197 + if re.search(expr, f):
1198 + kwds['name'] = f
1199 + paths[os.path.join(search_path, f)] = kwds
1200 + p = None
1201 +
1202 + if k == 'libs':
1203 + kwds['parent'] = self.get_or_create_group('Libraries', parent=parent)
1204 + elif k == 'frameworks':
1205 + kwds['parent'] = self.get_or_create_group('Frameworks', parent=parent)
1206 +
1207 + if p:
1208 + kwds['name'] = file_name
1209 +
1210 + if k == 'libs':
1211 + p = os.path.join('usr', 'lib', p)
1212 + kwds['tree'] = 'SDKROOT'
1213 + elif k == 'frameworks':
1214 + p = os.path.join('System', 'Library', 'Frameworks', p)
1215 + kwds['tree'] = 'SDKROOT'
1216 + elif k == 'files' and not os.path.exists(file_path):
1217 + # don't add non-existent files to the project.
1218 + continue
1219 +
1220 + paths[p] = kwds
1221 +
1222 + new_files = self.verify_files([n.get('name') for n in paths.values()])
1223 + add_files = [(k, v) for k, v in paths.items() if v.get('name') in new_files]
1224 +
1225 + for path, kwds in add_files:
1226 + kwds.pop('name', None)
1227 +
1228 + if 'parent' not in kwds and parent:
1229 + kwds['parent'] = parent
1230 +
1231 + self.add_file(path, **kwds)
1232 +
1233 + if compiler_flags:
1234 + for k, v in compiler_flags.items():
1235 + filerefs = []
1236 +
1237 + for f in v:
1238 + filerefs.extend([fr.id for fr in self.objects.values() if fr.get('isa') == 'PBXFileReference'
1239 + and fr.get('name') == f])
1240 +
1241 + buildfiles = [bf for bf in self.objects.values() if bf.get('isa') == 'PBXBuildFile'
1242 + and bf.get('fileRef') in filerefs]
1243 +
1244 + for bf in buildfiles:
1245 + if bf.add_compiler_flag(k):
1246 + self.modified = True
1247 +
1248 + def backup(self, file_name=None, backup_name=None):
1249 + if not file_name:
1250 + file_name = self.pbxproj_path
1251 +
1252 + if not backup_name:
1253 + backup_name = "%s.%s.backup" % (file_name, datetime.datetime.now().strftime('%d%m%y-%H%M%S'))
1254 +
1255 + shutil.copy2(file_name, backup_name)
1256 + return backup_name
1257 +
1258 + def save(self, file_name=None, old_format=False, sort=False):
1259 + if old_format :
1260 + self.save_format_xml(file_name)
1261 + else:
1262 + self.save_new_format(file_name, sort)
1263 +
1264 + def save_format_xml(self, file_name=None):
1265 + """Saves in old (xml) format"""
1266 + if not file_name:
1267 + file_name = self.pbxproj_path
1268 +
1269 + # This code is adapted from plistlib.writePlist
1270 + with open(file_name, "w") as f:
1271 + writer = PBXWriter(f)
1272 + writer.writeln("<plist version=\"1.0\">")
1273 + writer.writeValue(self.data)
1274 + writer.writeln("</plist>")
1275 +
1276 + def save_new_format(self, file_name=None, sort=False):
1277 + """Save in Xcode 3.2 compatible (new) format"""
1278 + if not file_name:
1279 + file_name = self.pbxproj_path
1280 +
1281 + # process to get the section's info and names
1282 + objs = self.data.get('objects')
1283 + sections = dict()
1284 + uuids = dict()
1285 +
1286 + for key in objs:
1287 + l = list()
1288 +
1289 + if objs.get(key).get('isa') in sections:
1290 + l = sections.get(objs.get(key).get('isa'))
1291 +
1292 + l.append(tuple([key, objs.get(key)]))
1293 + sections[objs.get(key).get('isa')] = l
1294 +
1295 + if 'name' in objs.get(key):
1296 + uuids[key] = objs.get(key).get('name')
1297 + elif 'path' in objs.get(key):
1298 + uuids[key] = objs.get(key).get('path')
1299 + else:
1300 + if objs.get(key).get('isa') == 'PBXProject':
1301 + uuids[objs.get(key).get('buildConfigurationList')] = 'Build configuration list for PBXProject "Unity-iPhone"'
1302 + elif objs.get(key).get('isa')[0:3] == 'PBX':
1303 + uuids[key] = objs.get(key).get('isa')[3:-10]
1304 + else:
1305 + uuids[key] = 'Build configuration list for PBXNativeTarget "TARGET_NAME"'
1306 +
1307 + ro = self.data.get('rootObject')
1308 + uuids[ro] = 'Project object'
1309 +
1310 + for key in objs:
1311 + # transitive references (used in the BuildFile section)
1312 + if 'fileRef' in objs.get(key) and objs.get(key).get('fileRef') in uuids:
1313 + uuids[key] = uuids[objs.get(key).get('fileRef')]
1314 +
1315 + # transitive reference to the target name (used in the Native target section)
1316 + if objs.get(key).get('isa') == 'PBXNativeTarget':
1317 + uuids[objs.get(key).get('buildConfigurationList')] = uuids[objs.get(key).get('buildConfigurationList')].replace('TARGET_NAME', uuids[key])
1318 +
1319 + self.uuids = uuids
1320 + self.sections = sections
1321 +
1322 + out = open(file_name, 'w')
1323 + out.write('// !$*UTF8*$!\n')
1324 + self._printNewXCodeFormat(out, self.data, '', enters=True, sort=sort)
1325 + out.close()
1326 +
1327 + @classmethod
1328 + def addslashes(cls, s):
1329 + d = {'"': '\\"', "'": "\\'", "\0": "\\\0", "\\": "\\\\", "\n":"\\n"}
1330 + return ''.join(d.get(c, c) for c in s)
1331 +
1332 + def _printNewXCodeFormat(self, out, root, deep, enters=True, sort=False):
1333 + if isinstance(root, IterableUserDict):
1334 + out.write('{')
1335 +
1336 + if enters:
1337 + out.write('\n')
1338 +
1339 + isa = root.pop('isa', '')
1340 +
1341 + if isa != '': # keep the isa in the first spot
1342 + if enters:
1343 + out.write('\t' + deep)
1344 +
1345 + out.write('isa = ')
1346 + self._printNewXCodeFormat(out, isa, '\t' + deep, enters=enters)
1347 + out.write(';')
1348 +
1349 + if enters:
1350 + out.write('\n')
1351 + else:
1352 + out.write(' ')
1353 +
1354 + for key in sorted(root.iterkeys()): # keep the same order as Apple.
1355 + if enters:
1356 + out.write('\t' + deep)
1357 +
1358 + if re.match(regex, key).group(0) == key:
1359 + out.write(key.encode("utf-8") + ' = ')
1360 + else:
1361 + out.write('"' + key.encode("utf-8") + '" = ')
1362 +
1363 + if key == 'objects':
1364 + out.write('{') # open the objects section
1365 +
1366 + if enters:
1367 + out.write('\n')
1368 + #root.remove('objects') # remove it to avoid problems
1369 +
1370 + sections = [
1371 + ('PBXBuildFile', False),
1372 + ('PBXCopyFilesBuildPhase', True),
1373 + ('PBXFileReference', False),
1374 + ('PBXFrameworksBuildPhase', True),
1375 + ('PBXGroup', True),
1376 + ('PBXAggregateTarget', True),
1377 + ('PBXNativeTarget', True),
1378 + ('PBXProject', True),
1379 + ('PBXResourcesBuildPhase', True),
1380 + ('PBXShellScriptBuildPhase', True),
1381 + ('PBXSourcesBuildPhase', True),
1382 + ('XCBuildConfiguration', True),
1383 + ('XCConfigurationList', True),
1384 + ('PBXTargetDependency', True),
1385 + ('PBXVariantGroup', True),
1386 + ('PBXReferenceProxy', True),
1387 + ('PBXContainerItemProxy', True),
1388 + ('XCVersionGroup', True)]
1389 +
1390 + for section in sections: # iterate over the sections
1391 + if self.sections.get(section[0]) is None:
1392 + continue
1393 +
1394 + out.write('\n/* Begin %s section */' % section[0].encode("utf-8"))
1395 + self.sections.get(section[0]).sort(cmp=lambda x, y: cmp(x[0], y[0]))
1396 +
1397 + if sort and section[0] == 'PBXGroup':
1398 + for entry in self.sections.get(section[0]):
1399 + entry[1]['children'] = sorted(entry[1]['children'],
1400 + key=lambda x: self.uuids[x].encode("utf-8"))
1401 +
1402 + for pair in self.sections.get(section[0]):
1403 + key = pair[0]
1404 + value = pair[1]
1405 + out.write('\n')
1406 +
1407 + if enters:
1408 + out.write('\t\t' + deep)
1409 +
1410 + out.write(key.encode("utf-8"))
1411 +
1412 + if key in self.uuids:
1413 + out.write(" /* " + self.uuids[key].encode("utf-8") + " */")
1414 +
1415 + out.write(" = ")
1416 + self._printNewXCodeFormat(out, value, '\t\t' + deep, enters=section[1])
1417 + out.write(';')
1418 +
1419 + out.write('\n/* End %s section */\n' % section[0].encode("utf-8"))
1420 +
1421 + out.write(deep + '\t}') # close of the objects section
1422 + else:
1423 + self._printNewXCodeFormat(out, root[key], '\t' + deep, enters=enters)
1424 +
1425 + out.write(';')
1426 +
1427 + if enters:
1428 + out.write('\n')
1429 + else:
1430 + out.write(' ')
1431 +
1432 + root['isa'] = isa # restore the isa for further calls
1433 +
1434 + if enters:
1435 + out.write(deep)
1436 +
1437 + out.write('}')
1438 +
1439 + elif isinstance(root, UserList):
1440 + out.write('(')
1441 +
1442 + if enters:
1443 + out.write('\n')
1444 +
1445 + for value in root:
1446 + if enters:
1447 + out.write('\t' + deep)
1448 +
1449 + self._printNewXCodeFormat(out, value, '\t' + deep, enters=enters)
1450 + out.write(',')
1451 +
1452 + if enters:
1453 + out.write('\n')
1454 +
1455 + if enters:
1456 + out.write(deep)
1457 +
1458 + out.write(')')
1459 +
1460 + else:
1461 + if len(root) > 0 and re.match(regex, root).group(0) == root:
1462 + out.write(root.encode("utf-8"))
1463 + else:
1464 + out.write('"' + XcodeProject.addslashes(root.encode("utf-8")) + '"')
1465 +
1466 + if root in self.uuids:
1467 + out.write(" /* " + self.uuids[root].encode("utf-8") + " */")
1468 +
1469 + @classmethod
1470 + def Load(cls, path, pure_python=False):
1471 + if pure_python:
1472 + import openstep_parser as osp
1473 + tree = osp.OpenStepDecoder.ParseFromFile(open(path, 'r'))
1474 + else:
1475 + cls.plutil_path = os.path.join(os.path.split(__file__)[0], 'plutil')
1476 +
1477 + if not os.path.isfile(XcodeProject.plutil_path):
1478 + cls.plutil_path = 'plutil'
1479 +
1480 + # load project by converting to xml and then convert that using plistlib
1481 + p = subprocess.Popen([XcodeProject.plutil_path, '-convert', 'xml1', '-o', '-', path], stdout=subprocess.PIPE)
1482 + stdout, stderr = p.communicate()
1483 +
1484 + # If the plist was malformed, return code will be non-zero
1485 + if p.returncode != 0:
1486 + print stdout
1487 + return None
1488 +
1489 + tree = plistlib.readPlistFromString(stdout)
1490 +
1491 + return XcodeProject(tree, path)
1492 +
1493 + @classmethod
1494 + def LoadFromXML(cls, path):
1495 + tree = plistlib.readPlist(path)
1496 + return XcodeProject(tree, path)
1497 +
1498 +
1499 +# The code below was adapted from plistlib.py.
1500 +
1501 +class PBXWriter(plistlib.PlistWriter):
1502 + def writeValue(self, value):
1503 + if isinstance(value, (PBXList, PBXDict)):
1504 + plistlib.PlistWriter.writeValue(self, value.data)
1505 + else:
1506 + plistlib.PlistWriter.writeValue(self, value)
1507 +
1508 + def simpleElement(self, element, value=None):
1509 + """
1510 + We have to override this method to deal with Unicode text correctly.
1511 + Non-ascii characters have to get encoded as character references.
1512 + """
1513 + if value is not None:
1514 + value = _escapeAndEncode(value)
1515 + self.writeln("<%s>%s</%s>" % (element, value, element))
1516 + else:
1517 + self.writeln("<%s/>" % element)
1518 +
1519 +
1520 +# Regex to find any control chars, except for \t \n and \r
1521 +_controlCharPat = re.compile(
1522 + r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"
1523 + r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
1524 +
1525 +
1526 +def _escapeAndEncode(text):
1527 + m = _controlCharPat.search(text)
1528 + if m is not None:
1529 + raise ValueError("strings can't contains control characters; "
1530 + "use plistlib.Data instead")
1531 + text = text.replace("\r\n", "\n") # convert DOS line endings
1532 + text = text.replace("\r", "\n") # convert Mac line endings
1533 + text = text.replace("&", "&amp;") # escape '&'
1534 + text = text.replace("<", "&lt;") # escape '<'
1535 + text = text.replace(">", "&gt;") # escape '>'
1536 + return text.encode("ascii", "xmlcharrefreplace") # encode as ascii with xml character references
1 +import os
2 +
3 +import commands
4 +
5 +
6 +buildProjName = ''
7 +targetName = ''
8 +import shutil
9 +import os
10 +
11 +def buildProj():
12 +
13 + if buildProjName == '':
14 + print('buildProjName is not define')
15 +
16 + else:
17 + #build project
18 + print('start build proj')
19 + commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj')
20 + releaseDir = os.path.abspath('.') + '/Release'
21 + if not os.path.exists(releaseDir):
22 + os.mkdir(releaseDir)
23 +
24 + ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa'
25 + buildPath = os.path.abspath('.') + '/build'
26 + if os.path.exists(ipaPath):
27 + os.remove(ipaPath)
28 +
29 + resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath)
30 + #print(resultStr)
31 +
32 + if os.path.exists(buildPath):
33 + shutil.rmtree(buildPath)
34 +
No preview for this file type
1 +#import <Foundation/Foundation.h>
2 +#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
3 +#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
4 +#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
5 +#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
6 +#import "HaiBaoJuheReportInfo.h"
7 +#import "HaiBaoJuheSDKDelegate.h"
8 +
9 +@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
10 +@property(nonatomic, strong)NSString *userId;
11 +@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
12 +
13 +@property bool onlyOneTimeGzyazf;
14 ++ (HaiBaoJuheChecker *)getInstance;
15 +- (void)initChecker;
16 +- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
17 +- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
18 +- (void) RailwayHaiBaoJuhereportOpen;
19 +- (void) RailwayHaiBaoJuhereportSDKOpen;
20 +- (void)RailwayHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
21 +- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
22 +- (void) RailwayHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
23 +- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
24 + notiName:(NSString *)notiName
25 + statusCode:(int)nCode
26 + description:(NSString *)szDescripton
27 + extendData:(NSObject *)extendData;
28 +
29 +- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
30 +
31 +- (void)RailwayHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
32 +
33 +/*
34 + *初始化时调用
35 + */
36 +- (void)setHaiBaoJuheSDKDelegate:(nullable id<HaiBaoJuheSDKDelegate>)HaiBaoJuheSDKDeletate;
37 +@end
38 +
39 +
40 +
41 +
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HaiBaoJuheConfig : NSObject
4 +
5 +@property(nonatomic, strong)NSString *gameSimpleName;
6 +@property(nonatomic, strong)NSString *sdkSimpleName;
7 +@property(nonatomic, strong)NSString *sdkVersionCode;
8 +@property(nonatomic, strong)NSString *loginCheckUrl;
9 +@property(nonatomic, strong)NSString *gzyazfOrderUrl;
10 +@property(nonatomic, strong)NSString *gzyazfCheckUrl;
11 +@property(nonatomic, strong)NSString *c1;
12 +@property(nonatomic, strong)NSString *c2;
13 +@property(nonatomic, strong)NSString *custom;
14 +
15 ++ (HaiBaoJuheConfig *)getInstance;
16 +
17 +- (void) loadFile:(NSString *) fileName;
18 +
19 +- (NSString *)getValueByKey:(NSString *) key;
20 +
21 +- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
22 +
23 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheCreateOrderInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic,strong)NSString *serverId;//服务器ID
5 +@property(nonatomic, strong)NSString *serverName;//服务器名称
6 +@property(nonatomic, strong)NSString *playerId;//玩家ID
7 +@property(nonatomic, strong)NSString *playerName;//玩家名称
8 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
9 +@property(nonatomic, strong)NSString *postAmount;//金额
10 +@property(nonatomic, strong)NSString *productId;//产品ID
11 +@property(nonatomic, strong)NSString *productName;//产品名称
12 +@property(nonatomic, strong)NSString *productDesc;//产品描述
13 +@property(nonatomic, strong)NSString *custom;//透传参数
14 +@property(nonatomic, strong)NSString *exchange;//兑换比例
15 +@property(nonatomic, strong)NSString *otherInfo;//扩展参数
16 +@property(nonatomic, strong)NSString *userId;//用户ID
17 +@property(nonatomic, strong)NSString *timestamp;//时间戳
18 +
19 +- (NSString *) RailwayHaiBaoJuheGetTsign ;
20 +- (NSString *) RailwayHaiBaoJuheGetTimestamp ;
21 +
22 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheGzyazfInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic, strong)NSString *serverId;
5 +@property(nonatomic, strong)NSString *queryId;
6 +@property(nonatomic, strong)NSString *playerId;
7 +@property(nonatomic, strong)NSString *playerName;
8 +@property(nonatomic, strong)NSString *postAmount;
9 +@property(nonatomic, strong)NSString *productId;
10 +@property(nonatomic, strong)NSString *products;
11 +@property(nonatomic, strong)NSString *custom;
12 +@property(nonatomic, strong)NSString *postTime;
13 +@property(nonatomic, strong)NSString *other;
14 +
15 +//游戏传递过来的原值
16 +@property(nonatomic, strong)NSString *serverName;//服务器名称
17 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
18 +@property(nonatomic, strong)NSString *productName;//产品名称
19 +@property(nonatomic, strong)NSString *productDesc;//产品描述
20 +@property(nonatomic, strong)NSString *exchange;//兑换比例
21 +
22 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheLoginInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic,strong)NSString *timestamp;
5 +@property(nonatomic, strong)NSString *sign;
6 +@property(nonatomic, strong)NSString *other;
7 +@property(nonatomic, strong)NSString *openId;
8 +@property(nonatomic, strong)NSString *userType;
9 +
10 +
11 +@end
1 +//
2 +// HaiBaoJuheNotification.h
3 +// public_i9133
4 +//
5 +// Created by winFan on 12/1/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +
11 +extern NSString * const HaiBaoJuheSDK_Notification; /**< */
12 +extern NSString * const _create_order_notification; /**< */
13 +
14 +
15 +/**
16 + 应用支持的方向
17 + */
18 +typedef NS_ENUM(int, HaiBaoJuheSDKNotificationType) {
19 + HaiBaoJuheSDKNotificationLogin = 1,//登录
20 + HaiBaoJuheSDKNotificationLogout,//注销
21 + HaiBaoJuheSDKNotificationGzyazf,//支付完成
22 + HaiBaoJuheSDKNotificationPause,//暂停退出
23 + HaiBaoJuheSDKNotificationRole,//创建角色
24 + HaiBaoJuheSDKNotificationInitSDK,//初始化SDK
25 + HaiBaoJuheSDKNotificationSwitchAccount,//切换账号
26 + HaiBaoJuheSDKNotificationExit//退出游戏
27 +};
28 +
29 +
30 +
31 +@interface HaiBaoJuheNotification : NSObject
32 +
33 +@end
34 +
35 +
36 +//////////////////////////////////////////////////////////////////////
37 +@interface HaiBaoJuheSDKResult : NSObject
38 +@property(nonatomic, assign)int statusCode;//请参照此文件下面状态标识
39 +@property(nonatomic, strong)NSString *resultDescription;
40 +@property(nonatomic, strong)NSObject *extendData;
41 +//V1.2.0新增
42 +@property(nonatomic, assign)HaiBaoJuheSDKNotificationType notiType;//消息类型
43 +@property(nonatomic, strong)NSString *notiName;//消息名称
44 +@end
45 +//////////////////////////////////////////////////////////////////////
46 +
47 +//////////////////////////////////////////////////////////////////////
48 +/* 状态标识 */
49 +#define HaiBaoJuheSDK_NO_ERROR 0 /*操作成功*/
50 +
51 +#define HaiBaoJuheSDK_ERROR_LOGIN_FAILED -100 /*登录失败*/
52 +#define HaiBaoJuheSDK_ERROR_LOGIN_CANCEL -101 /*登录取消*/
53 +#define HaiBaoJuheSDK_ERROR_LOGIN_GAMGEACCOUNT -102 /*游戏帐号登录,非平台账号*/
54 +
55 +#define HaiBaoJuheSDK_ERROR_PAY_FAILED -200 /*支付失败*/
56 +#define HaiBaoJuheSDK_ERROR_PAY_CANCEL -201 /*支付取消*/
57 +#define HaiBaoJuheSDK_ERROR_PAY_VERSIGN -202 /*支付验签失败*/
58 +#define HaiBaoJuheSDK_ERROR_CREATE_ORDER_FAILED -203 /*支付验签失败*/
59 +
60 +#define HaiBaoJuheSDK_ERROR_ROLE_CREATE_FAILED -300 /*角色创建失败*/
61 +
62 +#define HaiBaoJuheSDK_ERROR_INIT_FAILED -400 /*初始化失败*/
63 +
64 +#define HaiBaoJuheSDK_ERROR_SWICHT_ACCOUNT_FAILED -500 /*切换账号失败*/
65 +
66 +#define HaiBaoJuheSDK_ERROR_EXIT_CANCEL -600 /*退出取消*/
67 +
68 +//////////////////////////////////////////////////////////////////////
1 +//
2 +// RailwayHaiBaoJuheReportInfo.h
3 +// HaiBaoJuheSDK
4 +//
5 +// Created by winFan on 12/21/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
10 +@interface HaiBaoJuheReportInfo : RailwayHaiBaoJuheBaseModel
11 +
12 +@property(nonatomic, strong)NSString *reportType;//类型
13 +@property(nonatomic, strong)NSString *playerId;//玩家ID
14 +@property(nonatomic, strong)NSString *playerName;//玩家名称
15 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
16 +@property(nonatomic, strong)NSString *roleSex;//角色性别(1男0女)
17 +
18 +@property(nonatomic, strong)NSString *serverId;//服务器ID
19 +@property(nonatomic, strong)NSString *serverName;//服务器名称
20 +@property(nonatomic, strong)NSNumber *roleCTime;//创建角色时间(秒)
21 +@property(nonatomic, strong)NSString *partyName;//工会名称
22 +@property(nonatomic, strong)NSString *roleType;//角色类型
23 +@property(nonatomic, strong)NSNumber *roleChangeTime;//角色等级更新时间(秒)
24 +@property(nonatomic, strong)NSString *vipLevel;//vip等级
25 +@property(nonatomic, strong)NSNumber *diamond;//余额
26 +@property(nonatomic, strong)NSString *moneyType;//商品单位(元宝,金币)
27 +
28 +@property(nonatomic, strong)NSString *custom;//透传参数
29 +
30 +
31 +@property(nonatomic, strong)NSString *openId;
32 +
33 +#define REPORT_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/statistic"
34 +
35 +#define REPORT_IDFA_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
36 +
37 +#define REPORT_OPEN @"open"
38 +#define REPORT_ENTER @"enter"
39 +#define REPORT_CREATEROLE @"createrole"
40 +#define REPORT_ROLEUPGRADE @"roleupgrade"
41 +#define REPORT_SDK_OPEN @"opensdk"
42 +#define REPORT_EXIT @"exit"
43 +#define REPORT_SELECT_SERVER @"selectserver"
44 +
45 +@end
1 +#import <Foundation/Foundation.h>
2 +#import "HaiBaoJuheSDK2.h"
3 +
4 +#import <UIKit/UIKit.h>
5 +
6 +@interface HaiBaoJuheSDK : NSObject
7 +
8 +@property(nonatomic, strong, readonly)NSString *sdkVersion;
9 +
10 +
11 +@property(nonatomic, strong)NSString *urlSchemes;
12 +
13 +@property BOOL isAppleGzyazfing;
14 +
15 ++ (HaiBaoJuheSDK *)shareSDK;
16 +
17 +
18 +- (void)initSDK:(UIViewController *) control;
19 +
20 +
21 +-(void)viewDidAppear;
22 +
23 +- (void)setViewController:(UIViewController *)viewController;
24 +
25 +
26 +- (void)loginSDK;
27 +
28 +- (void)loginSDK:(UIViewController *)viewController;
29 +
30 +
31 +- (void)gzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
32 +
33 +
34 +- (BOOL)hasUserCenter;
35 +
36 +
37 +- (void)gotoUserCenter;
38 +
39 +
40 +- (void)reportSDK:(HaiBaoJuheReportInfo *)reportInfo;
41 +
42 +
43 +- (BOOL)hasLogout;
44 +
45 +
46 +- (void)logoutSDK;
47 +
48 +
49 +- (BOOL)hasSwitchAccount;
50 +
51 +
52 +- (void)switchAccount;
53 +
54 +
55 +- (BOOL)hasExit;
56 +
57 +
58 +- (void)exitSDK;
59 +
60 +- (void)destroySDK;
61 +
62 +@property(nonatomic, assign)ESDKOrientation sdkOrientation;
63 +
64 +@property(nonatomic, assign)BOOL bShowedFloat;
65 +
66 +
67 +@property(nonatomic, assign)int serverId;
68 +
69 +
70 +-(NSString *) getGameChannelId;
71 +
72 +- (NSString *) getCustomValue;
73 +
74 +- (NSString *) getChannelParameter1;
75 +
76 +- (NSString *) getChannelParameter2;
77 +
78 +-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray*)customArray;
79 +
80 +
81 +- (void)handleOpenurl:(NSURL *)url;
82 +
83 +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
84 +
85 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
86 +
87 +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
88 +
89 +
90 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
91 +
92 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
93 +
94 +
95 +- (void)applicationDidEnterBackground:(UIApplication *)application;
96 +
97 +- (void)applicationDidBecomeActive:(UIApplication *)application;
98 +
99 +- (void)applicationWillEnterForeground:(UIApplication *)application;
100 +
101 +- (void)applicationWillResignActive:(UIApplication *)application;
102 +
103 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
104 +
105 +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
106 +
107 +@end
1 +#import <UIKit/UIKit.h>
2 +#import "HaiBaoJuheChecker.h"
3 +#import "HaiBaoJuheReportInfo.h"
4 +#import "HaiBaoJuheLoginInfo.h"
5 +#import "Interface.h"
6 +#import "HaiBaoJuheNotification.h"
7 +#import "HaiBaoJuheGzyazfInfo.h"
8 +#import "UnionInterface.h"
9 +#import "HaiBaoJuheCreateOrderInfo.h"
10 +#import "HaiBaoJuheConfig.h"
11 +#import "HaiBaoJuheUtils.h"
12 +#import "NetCenter.h"
13 +#import "HaiBaoJuheSDK.h"
14 +#import "HaiBaoJuheSDKDelegate.h"
1 +#import <Foundation/Foundation.h>
2 +
3 +@protocol HaiBaoJuheSDKDelegate <NSObject>
4 +@optional
5 +-(void)HaiBaoJuheSDKLoginSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
6 +-(void)HaiBaoJuheSDKLoginFail:(NSString*)msg;
7 +
8 +-(void)HaiBaoJuheSDKSwitchAccountSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
9 +-(void)HaiBaoJuheSDKSwitchAccountFail:(NSString*)msg;
10 +@end
1 +#import <Foundation/Foundation.h>
2 +#import <UIKit/UIKit.h>
3 +
4 +@interface HaiBaoJuheUtils : NSObject
5 +
6 ++(NSString *)md5:(NSString *)str;
7 ++ (NSDictionary *)RailwayHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
8 ++(NSString *)createGzyazfOrderUrl;
9 +//*充值回调地址
10 ++(NSString *)createGzyazfUrl;
11 +
12 ++(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
13 ++(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
14 +
15 +@end
1 +//
2 +// Interface.h
3 +// HaiBaoJuheSDK
4 +//
5 +// Created by winFan on 12/10/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +
10 +#include "UnionInterface.h"
11 +#import <SafariServices/SafariServices.h>
12 +@interface Interface : NSObject <UnionInterface>
13 +@property(nonatomic, strong)UIViewController *controller;
14 +
15 +
16 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface NetCenter : NSObject
4 +
5 +@property(nonatomic,retain) NSMutableData *receiveData;
6 +
7 +@property(nonatomic,assign)int dataPackSerialNo;
8 +
9 +
10 ++ (NetCenter *)getInstance;
11 +
12 +- (NSString *)httpGetSyn:(NSString *) getUrl;
13 +
14 +- (NSString *)httpPostSyn:(NSString *) postUrl : (NSDictionary *) postData;
15 +
16 +- (void)httpGetNoSyn;
17 +
18 +- (void)httpPostNoSyn:(NSString *) postUrl :(NSDictionary *)postDict;
19 +
20 +- (void)httpPostAsync:(NSString*)postUrl :(NSDictionary*)postDict;
21 +
22 +- (void)httpPostAsyncOpen:(NSString*)postUrl :(NSDictionary*)postDict;
23 +
24 +-(void)httpGetAsync:(NSString *)url completionHandler:(void (^ __nullable)(NSURLResponse* __nullable response, NSData* __nullable data, NSError* __nullable connectionError)) handler;
25 +
26 +- (NSString * __nullable)dicToString:(NSDictionary * __nullable) dict;
27 +@end
1 +#ifndef __HaiBaoJuheSDK__OtherSetting__
2 +#define __HaiBaoJuheSDK__OtherSetting__
3 +
4 +
5 +/**
6 + 应用支持的方向
7 + */
8 +typedef NS_ENUM(NSUInteger, ESDKOrientation) {
9 + ESDKOrientationPortrait = 1,//竖
10 + ESDKOrientationLandscape,//横
11 + ESDKOrientationNone//自动旋转
12 +};
13 +
14 +/**
15 + 应用支持的方向
16 + */
17 +typedef NS_ENUM(NSUInteger, REPORT_TYPE) {
18 + REPORT_TYPE_OPEN = 1,//竖
19 + REPORT_TYPE_ENTER,//横
20 + REPORT_TYPE_DEFINE//自动旋转
21 +};
22 +
23 +#endif /* defined(__HaiBaoJuheSDK__OtherSetting__) */
1 +#import <Foundation/Foundation.h>
2 +#import "OtherSetting.h"
3 +
4 +@interface RailwayHaiBaoJuheBaseModel : NSObject
5 +
6 +- (NSString *)RailwayHaiBaoJuheObjectToJsonString;
7 +- (NSMutableString *)paramAddToString;
8 +- (id)initWithDiction:(NSDictionary *)diction;
9 +
10 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +void DGLog(NSString *fmt, ...);
4 +
5 +typedef NS_ENUM(NSInteger, DGLoggerLevel)
6 +{
7 + ELogVerbose = 1,
8 + ELogDebug,
9 + ELogInfo,
10 + ELogWarn,
11 + ELogError
12 +};
13 +
14 +@interface RailwayHaiBaoJuheDGLogger : NSObject
15 +
16 ++ (void)showLog:(NSString *)fmt,...;
17 +
18 ++ (void)showLog:(DGLoggerLevel)level log:(NSString *)fmt,...;
19 +
20 ++ (void)isShowLog:(BOOL)flag;
21 +
22 +@end
1 +#define TRACK_VERSION @"1.0.1"
2 +#import <Foundation/Foundation.h>
3 +#import <UIKit/UIKit.h>
4 +
5 +NS_ASSUME_NONNULL_BEGIN
6 +@interface TrackingIO : NSObject
7 ++(void) setPrintLog :(BOOL)print;
8 ++ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
9 ++ (void)setRegisterWithAccountID:(NSString *)account;
10 ++ (void)setLoginWithAccountID:(NSString *)account;
11 ++(void)setGzyazfmentStart:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
12 ++(void)setGzyazfment:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
13 ++(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
14 ++(void)setProfile:(NSDictionary *)dataDic;
15 ++(NSString*)getDeviceId;
16 +@end
17 +NS_ASSUME_NONNULL_END
1 +#import <Foundation/Foundation.h>
2 +#import <UIKit/UIKit.h>
3 +#import "HaiBaoJuheSDK2.h"
4 +
5 +@protocol UnionInterface
6 +/**
7 + 初始化SDK
8 + */
9 +
10 +//[[PoolChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationGzyazf notiName:@"" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"" extendData:order_id];
11 +
12 +- (void)SDKinit:(UIViewController *) control;
13 +
14 +
15 +- (void)setViewController:(UIViewController *) viewController;
16 +
17 +/**
18 + 登录SDK
19 + */
20 +- (void)SDKloginSDK;
21 +
22 +
23 +- (void)SDKloginSDK:(UIViewController *) control;
24 +
25 +/**
26 + *是否含有注销接口
27 + */
28 +- (BOOL)hasLogout;
29 +
30 +/**
31 + 注销
32 + */
33 +- (void)SDKlogoutSDK;
34 +
35 +
36 +/**
37 + *是否含有退出接口
38 + **/
39 +- (BOOL)hasExit;
40 +
41 +/**
42 + 退出接口
43 + */
44 +- (void)SDKexitSDK;
45 +
46 +
47 +/**
48 + *SDK销毁操作(游戏退出时调用)
49 + */
50 +
51 +- (void)destroySDK;
52 +
53 +
54 +/**
55 + *是否含有用户中心接口
56 + **/
57 +- (BOOL)hasUserCenter;
58 +
59 +/**
60 + 用户中心
61 + */
62 +- (void)SDKgotoUserCenter;
63 +
64 +/**
65 + *是否含有切换账号接口
66 + **/
67 +- (BOOL)hasSwitchAccount;
68 +
69 +/**
70 + *切换账号
71 + **/
72 +- (void)switchAccount;
73 +
74 +
75 +- (void)viewDidAppear;
76 +
77 +/**
78 + 提交数据
79 + */
80 +- (void)SDKreport:(HaiBaoJuheReportInfo *) reportInfo;
81 +
82 +/**
83 + 进行支付
84 + */
85 +
86 +- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
87 +- (void)receiveCreateOrder: (NSNotification *)notification;
88 +
89 +/**
90 + *充值统计参数
91 + *accountId 账号ID,必填项, 和登陆、注册使用的accountId保持一致即可。
92 + *orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
93 + *currencyAmount 货币金额,单位为元,支持小数
94 + *currencyType 货币类型
95 + *gzyazfType 支付类型(渠道)
96 + */
97 +-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray *)customArray;
98 +
99 +- (void)handleOpenurl:(NSURL *)url;
100 +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
101 +
102 +
103 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
104 +
105 +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
106 +
107 +//推送
108 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
109 +//推送
110 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
111 +
112 +
113 +- (void)applicationDidEnterBackground:(UIApplication *)application;
114 +
115 +- (void)applicationDidBecomeActive:(UIApplication *)application;
116 +
117 +- (void)applicationWillEnterForeground:(UIApplication *)application;
118 +
119 +- (void)applicationWillResignActive:(UIApplication *)application;
120 +
121 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
122 +
123 +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
124 +@end
No preview for this file type
1 +framework module HaiBaoJuheSDK {
2 + umbrella header "HaiBaoJuheSDK.h"
3 +
4 + export *
5 + module * { export * }
6 +}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
1 +#import <UIKit/UIKit.h>
2 +
3 +@interface HNYouaiIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
4 +
5 +@property(nonatomic,strong) NSString* HNYouaiDingDanHao;
6 +@property(nonatomic,strong) NSDictionary* HNYouaiHuoWuLieBiao;
7 +@property(nonatomic,strong) NSMutableArray* HNYouaiHuoWuIDLieBiao;
8 +@property(nonatomic, strong) UITableView *HNYouaiHuoWuLieBiaoView;
9 +
10 +- (void)HNYouaiHuaQianView:(UIViewController*)controller HNYouaiHuoWuD:(NSString*)products HNYouaiQian:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*)DingDanHao;
11 +
12 +@end
1 +#import <UIKit/UIKit.h>
2 +#import "StoreKit/StoreKit.h"
3 +
4 +@interface HNYouaiAllManager : NSObject
5 +{
6 + NSString* HNYouaiAPPID_;
7 + NSString* HNYouaiAPPKEY_;
8 +
9 + NSString* HNYouaiInviterCode_;
10 +}
11 +
12 +@property bool HNYouaiGeiWoHuaQianBa;
13 +
14 ++ (HNYouaiAllManager *)HNYouaiInstance;
15 +
16 +- (void)HNYouaiChuShiHua;
17 +
18 +- (void)HNYouaiDengLu:(NSString *)HNYouaiAPPID : (NSString *)HNYouaiAPPKEY : (UIViewController *)controller;
19 +
20 +- (void)HNYouaiYangShi:(NSString*)HNYouaiLeiXing;
21 +
22 +- (void)HNYouaiQuery: (NSString *)HNYouaiFuWuQiID : (NSString *)HNYouaiNickName : (NSNumber *)HNYouaiAmount : (NSString *)HNYouaiCallBack : (UIViewController *)controller : (NSString *)HNYouaiServerName;
23 +
24 +- (void)HNYouaiQueryOperation:(UIViewController*)controll HNYouaiHuoWuID:(NSString*)products HNYouaiJiaGe:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*) DingDanHao;
25 +
26 +
27 +
28 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +extern NSString * const HNYouaiExitNotification;
4 +extern NSString * const HNYouaiLoginNotification;
5 +extern NSString * const HNYouaiErrorNotification;
6 +
7 +
8 +@interface HNYouaiHuiTiaoNotification : NSObject
9 +
10 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HNYouaiInformation : NSObject
4 +{
5 +//
6 +NSString *openId;
7 +NSString *token;
8 +NSString *timestamp;
9 +
10 +}
11 +
12 +@property(retain,nonatomic) NSString *openId;
13 +@property(retain,nonatomic) NSString *token;
14 +@property(retain,nonatomic) NSString *timestamp;
15 ++ (HNYouaiInformation *)getInstance;
16 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HNYouaiInformationJM : NSObject
4 +
5 ++(NSString *)HNYouaiJM:(NSString *)jm;
6 +
7 +@end
1 +#import <UIKit/UIKit.h>
2 +
3 +@interface HNYouaiLocation : NSObject
4 +
5 ++ (NSString *)HNYouaiSKCloudServiceSetupOptionsKey;
6 +@end
7 +
1 +#import <UIKit/UIKit.h>
2 +#import "HNYouaiInformation.h"
3 +#import <JavaScriptCore/JavaScriptCore.h>
4 +
5 +@interface HNYouaiMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
6 +{
7 + UIWebView *webView_;
8 + UIActivityIndicatorView *activityIndicator;
9 +}
10 +
11 +@property(assign) BOOL HNYouaiYouYuanJiao;
12 +
13 +- (void)HNYouaiSettingCKAssetsView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
14 +- (void)HNYouaiChuShiHuaWebView;
15 +- (void)loadWebPageWithString:(NSString *)url;
16 +- (void)loadWebPageWithJs:(NSString *)content;
17 +- (void)postNotification:(NSString *)name : (NSString *)code;
18 +- (void)receiveIap:(NSNotification *)notification;
19 +
20 +@end
1 +//
2 +// IAPHelper.h
3 +//
4 +// Original Created by Ray Wenderlich on 2/28/11.
5 +// Created by saturngod on 7/9/12.
6 +// Copyright 2011 Ray Wenderlich. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +#import "StoreKit/StoreKit.h"
11 +
12 +
13 +typedef void (^IAPProductsResponseBlock)(SKProductsRequest* request , SKProductsResponse* response);
14 +
15 +typedef void (^IAPbuyProductCompleteResponseBlock)(SKPaymentTransaction* transcation);
16 +
17 +typedef void (^checkReceiptCompleteResponseBlock)(NSString* response,NSError* error);
18 +
19 +typedef void (^resoreProductsCompleteResponseBlock) (SKPaymentQueue* payment,NSError* error);
20 +
21 +@interface IAPHelper : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver>
22 +
23 +@property (nonatomic,strong) NSSet *productIdentifiers;
24 +@property (nonatomic,strong) NSArray * products;
25 +@property (nonatomic,strong) NSMutableSet *purchasedProducts;
26 +@property (nonatomic,strong) SKProductsRequest *request;
27 +@property (nonatomic) BOOL production;
28 +
29 +//init With Product Identifiers
30 +- (id)initWithProductIdentifiers:(NSSet *)productIdentifiers;
31 +
32 +//get Products List
33 +- (void)requestProductsWithCompletion:(IAPProductsResponseBlock)completion;
34 +
35 +
36 +//Buy Product
37 +- (void)buyProduct:(SKProduct *)productIdentifier onCompletion:(IAPbuyProductCompleteResponseBlock)completion;
38 +
39 +//restore Products
40 +- (void)restoreProductsWithCompletion:(resoreProductsCompleteResponseBlock)completion;
41 +
42 +//check isPurchased or not
43 +- (BOOL)isPurchasedProductsIdentifier:(NSString*)productID;
44 +
45 +//check receipt but recommend to use in server side instead of using this function
46 +- (void)checkReceipt:(NSData*)receiptData onCompletion:(checkReceiptCompleteResponseBlock)completion;
47 +
48 +- (void)checkReceipt:(NSData*)receiptData AndSharedSecret:(NSString*)secretKey onCompletion:(checkReceiptCompleteResponseBlock)completion;
49 +
50 +
51 +//saved purchased product
52 +- (void)provideContentWithTransaction:(SKPaymentTransaction *)transaction;
53 +
54 +- (void)provideContent:(NSString *)productIdentifier __deprecated_msg("use provideContentWithTransaction: instead.");
55 +
56 +//clear the saved products
57 +- (void)clearSavedPurchasedProducts;
58 +- (void)clearSavedPurchasedProductByID:(NSString*)productIdentifier;
59 +
60 +
61 +//Get The Price with local currency
62 +- (NSString *)getLocalePrice:(SKProduct *)product;
63 +
64 +@end
1 +//
2 +// IAPShare.h
3 +// ;
4 +//
5 +// Created by Htain Lin Shwe on 10/7/12.
6 +// Copyright (c) 2012 Edenpod. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +#import "IAPHelper.h"
11 +@interface IAPShare : NSObject
12 +@property (nonatomic,strong) IAPHelper *iap;
13 +
14 ++ (IAPShare *) sharedHelper;
15 +
16 ++(id)toJSON:(NSString*)json;
17 +@end
1 +//
2 +// NSString+Base64.h
3 +// Newsstand
4 +//
5 +// Created by Carlo Vigiani on 29/Oct/11.
6 +// Copyright (c) 2011 viggiosoft. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +
11 +@interface NSString (Base64)
12 +
13 ++ (NSString *) base64StringFromData:(NSData *)data length:(long)length;
14 +
15 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface NSURLRequest (SSL)
4 ++(BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
5 +
6 ++(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
7 +@end
1 +//
2 +// SFHFKeychainUtils.h
3 +//
4 +// Created by Buzz Andersen on 10/20/08.
5 +// Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone.
6 +// Copyright 2008 Sci-Fi Hi-Fi. All rights reserved.
7 +//
8 +// Permission is hereby granted, free of charge, to any person
9 +// obtaining a copy of this software and associated documentation
10 +// files (the "Software"), to deal in the Software without
11 +// restriction, including without limitation the rights to use,
12 +// copy, modify, merge, publish, distribute, sublicense, and/or sell
13 +// copies of the Software, and to permit persons to whom the
14 +// Software is furnished to do so, subject to the following
15 +// conditions:
16 +//
17 +// The above copyright notice and this permission notice shall be
18 +// included in all copies or substantial portions of the Software.
19 +//
20 +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22 +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25 +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 +// OTHER DEALINGS IN THE SOFTWARE.
28 +//
29 +
30 +#import <UIKit/UIKit.h>
31 +
32 +
33 +@interface SFHFKeychainUtils : NSObject {
34 +
35 +}
36 +
37 ++ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
38 ++ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
39 ++ (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
40 +
41 +@end
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>CFBundleDevelopmentRegion</key>
6 + <string>en</string>
7 + <key>CFBundleExecutable</key>
8 + <string>$(EXECUTABLE_NAME)</string>
9 + <key>CFBundleIdentifier</key>
10 + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11 + <key>CFBundleInfoDictionaryVersion</key>
12 + <string>6.0</string>
13 + <key>CFBundleName</key>
14 + <string>$(PRODUCT_NAME)</string>
15 + <key>CFBundlePackageType</key>
16 + <string>APPL</string>
17 + <key>CFBundleShortVersionString</key>
18 + <string>1.0</string>
19 + <key>CFBundleSignature</key>
20 + <string>????</string>
21 + <key>CFBundleURLTypes</key>
22 + <array>
23 + <dict>
24 + <key>CFBundleTypeRole</key>
25 + <string>Editor</string>
26 + <key>CFBundleURLSchemes</key>
27 + <array>
28 + <string>com.youai.sdk</string>
29 + </array>
30 + </dict>
31 + </array>
32 + <key>CFBundleVersion</key>
33 + <string>1</string>
34 + <key>LSRequiresIPhoneOS</key>
35 + <true/>
36 + <key>UILaunchStoryboardName</key>
37 + <string>LaunchScreen</string>
38 + <key>UIMainStoryboardFile</key>
39 + <string>Main</string>
40 + <key>UIRequiredDeviceCapabilities</key>
41 + <array>
42 + <string>armv7</string>
43 + </array>
44 + <key>UISupportedInterfaceOrientations</key>
45 + <array>
46 + <string>UIInterfaceOrientationLandscapeLeft</string>
47 + <string>UIInterfaceOrientationLandscapeRight</string>
48 + </array>
49 +</dict>
50 +</plist>
1 +#import <PoolSdk/PoolSdk2.h>
2 +@interface SDKInterface : Interface
3 +
4 +@end
1 +#include "SDKInterface.h"
2 +#import <UIKit/UIKit.h>
3 +
4 +#import "HNYouai/HNYouaiAllManager.h"
5 +#import "HNYouai/HNYouaiHuiTiaoNotification.h"
6 +#import "HNYouai/HNYouaiInformation.h"
7 +
8 +#import "TrackingIO.h"
9 +
10 +@implementation SDKInterface : Interface
11 +
12 +int mExchange;
13 +NSString *HNYouaiAppId;
14 +NSString *HNYouaiAppKey;
15 +
16 +- (void)SDKinit:(UIViewController *) control
17 +{
18 +
19 + [super SDKinit:control];
20 +
21 + [HaiBaoJuheConfig getInstance];
22 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiChuShiHua];
23 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiYangShi:@"sdk"];
24 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:HNYouaiLoginNotification object:nil];
25 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"HNYouaiToolCallBack" object:nil];
26 +
27 + [[HaiBaoJuheChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
28 +
29 + NSString* channelId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
30 + if(channelId == nil || [channelId length] <= 0){
31 + channelId = @"unknown";
32 + }
33 + [TrackingIO initWithappKey:[[HaiBaoJuheConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
34 +}
35 +
36 +/**
37 + 登录SDK
38 + */
39 +- (void)SDKloginSDK
40 +{
41 + //APPID APPKEY
42 + HNYouaiAppId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_ID"];
43 + HNYouaiAppKey =[[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_KEY"];
44 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiDengLu:HNYouaiAppId :HNYouaiAppKey :self.controller];
45 +
46 +}
47 +
48 +/**
49 + loginCheck
50 + */
51 +- (void)receiveLoginMessage:(NSNotification *)notification
52 +{
53 + NSLog(@"loginchek");
54 + HaiBaoJuheLoginInfo *loginInfo = [HaiBaoJuheLoginInfo alloc];
55 + loginInfo.openId = [[HNYouaiInformation getInstance]openId];
56 + loginInfo.sign = [[HNYouaiInformation getInstance] token];
57 + loginInfo.timestamp = [[HNYouaiInformation getInstance] timestamp];
58 +
59 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
60 + [[HaiBaoJuheChecker getInstance] startCheck:loginInfo];
61 + });
62 +
63 +}
64 +
65 +
66 +-(NSString*)DataTojsonString:(id)object
67 +{
68 + NSString *jsonString = nil;
69 + NSError *error;
70 + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
71 + options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
72 + error:&error];
73 + jsonString = [jsonData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
74 + return jsonString;
75 +}
76 +
77 +/**
78 + 苹果支付结果回调
79 + */
80 +
81 +- (void)HCKAssetsToolCallBack:(NSNotification *)notification
82 +{
83 + NSDictionary* payResultDic = notification.object;
84 +
85 + NSString* receiptStr = [payResultDic objectForKey:@"HNYouaiToolResult"];
86 + NSString* queryId = [payResultDic objectForKey:@"query_id"];
87 +
88 + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
89 + NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
90 +
91 +
92 + if([@"success" isEqualToString:result]){//确认订单成功
93 + }else{//失败
94 + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
95 + NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"];
96 +
97 + NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10];
98 +
99 + if (queryIdArray) {
100 + }else{
101 + queryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
102 + }
103 +
104 + for (NSString* arrayQueryId in queryIdArray) {
105 + [tempQueryIdArray addObject:arrayQueryId];
106 + }
107 +
108 + [tempQueryIdArray addObject:queryId];
109 + [userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
110 + [userDefaults setObject:receiptStr forKey:queryId];
111 + [userDefaults synchronize];
112 + }
113 +}
114 +
115 +/**
116 + 支付 创建订单
117 + */
118 +- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)payInfo
119 +{
120 + mExchange = [payInfo exchange].intValue;
121 + [super SDKgzyazfWithGzyazfmentInfo:payInfo];
122 +}
123 +
124 +/**
125 + SDK
126 + */
127 +- (void)SDKgotoUserCenter
128 +{
129 +}
130 +
131 +- (void)SDKreport:(HaiBaoJuheReportInfo *)reportInfo
132 +{
133 + NSLog(@"reportInfo");
134 + NSString* reportType = [reportInfo reportType];
135 + if (reportInfo) {
136 + if ([reportType isEqualToString:REPORT_ENTER]) {
137 + [TrackingIO setLoginWithAccountID:[reportInfo playerId]];
138 +
139 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
140 + [self handlerLeakOrder];
141 + });
142 + }else if ([reportType isEqualToString:REPORT_CREATEROLE]){
143 + [TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
144 + }
145 + }
146 +}
147 +
148 +/**
149 + SDK
150 + */
151 +- (void)SDKexitSDK
152 +{
153 +
154 +}
155 +
156 +- (void)SDKlogoutSDK
157 +{
158 + NSLog(@"切换账号");
159 +}
160 +
161 +- (void)handleOpenurl:(NSURL *)url
162 +{
163 +}
164 +
165 +- (void)receivePayMessage : (NSNotification *)notification;
166 +{
167 + NSString *order_id = [notification object];
168 + NSLog(@"订单ID:%@", order_id);
169 +}
170 +
171 +//补单处理
172 +- (void) handlerLeakOrder{
173 + NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults];
174 + NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"];
175 +
176 + NSLog(@"orderDic%@",queryIdArray);
177 + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
178 + NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
179 +
180 + if(queryIdArray){
181 + for (NSString* queryId in queryIdArray) {
182 + NSString* receiptStr = [userDefaults valueForKey:queryId];
183 + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
184 + NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
185 + if([@"success" isEqualToString:result]){//成功
186 + [userDefaults removeObjectForKey:queryId];
187 + }else{//补单失败
188 + [failQueryIdArray addObject:queryId];
189 + }
190 + }
191 +
192 + if([failQueryIdArray count] > 0){//含有补单失败项
193 + [userDefaults setObject:failQueryIdArray forKey:@"queryIds"];
194 + }else{//全部补单成功
195 + [userDefaults removeObjectForKey:@"queryIds"];
196 + }
197 + [userDefaults synchronize];
198 + }
199 +}
200 +
201 +
202 +- (void)receiveCreateOrder:(NSNotification *)notification
203 +{
204 + NSLog(@"创建订单成功");
205 + HaiBaoJuheGzyazfInfo *payInfo = [notification object];
206 +
207 + NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
208 + NSString *serverId = [payInfo serverId];
209 + NSString *roleName = [payInfo playerName];
210 + NSString *queryId = [payInfo queryId];
211 +
212 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
213 + [self handlerLeakOrder];
214 + });
215 +
216 + NSString *other = [payInfo other];
217 +
218 + if (other && [other length] > 0) {
219 + [[HNYouaiAllManager HNYouaiInstance] HNYouaiQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
220 + }else{
221 + NSString* products = [payInfo products];
222 + [[HNYouaiAllManager HNYouaiInstance] HNYouaiQueryOperation:self.controller HNYouaiHuoWuID:products HNYouaiJiaGe:[payInfo postAmount] HNYouaiHuoWuMing:[payInfo productName] HNYouaiDingDanHao:queryId];
223 + }
224 +}
225 +
226 +-(void)paymentSuccess:(NSString *)accountId orderId:(NSString *)orderId currencyAmount:(double)amount currencyType:(NSString *)currencyType payType:(NSString *)payType custom:(NSArray *)customArray
227 +{
228 + [TrackingIO setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
229 +}
230 +
231 +@end
232 +
No preview for this file type
1 +//
2 +// NewTtack.h
3 +// NewTtack
4 +//
5 +// Created by yun on 16/1/11.
6 +// Copyright © 2016年 yun. All rights reserved.
7 +//
8 +#define TRACK_VERSION @"1.0.1"
9 +
10 +#import <Foundation/Foundation.h>
11 +#import <UIKit/UIKit.h>
12 +
13 +
14 +/*
15 + 热云移动广告效果监测 平台 api 请选择对应的api进行使用
16 + */
17 +NS_ASSUME_NONNULL_BEGIN
18 +@interface TrackingIO : NSObject
19 +//开启打印日志 正式上线包请关掉
20 ++(void) setPrintLog :(BOOL)print;
21 +// 开启数据统计
22 ++ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
23 +//注册成功后调用
24 ++ (void)setRegisterWithAccountID:(NSString *)account;
25 +//登陆成功后调用
26 ++ (void)setLoginWithAccountID:(NSString *)account;
27 +//开始付费时 调用(人民币单位是元)
28 ++(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
29 +// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
30 ++(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
31 +//自定义事件
32 ++(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
33 +//标准接口
34 ++(void)setProfile:(NSDictionary *)dataDic;
35 +//获取设备信息
36 ++(NSString*)getDeviceId;
37 +@end
38 +NS_ASSUME_NONNULL_END
1 +{"renyunAppKey": "false", "payorderurl": "https://public.sdk.haibaoyouxi.com/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "86b7374239263b915a9ce54d26467942", "custom": "{}", "sdkVersionCode": "V1_1", "loginCheckUrl": "https://public.sdk.haibaoyouxi.com/logincheck/check", "appScheme": "com.jghb.xinqinji", "c2": "", "c1": "", "APP_ID": "5aa743d7f0d770694f4d466d", "paycheckurl": "https://public.sdk.haibaoyouxi.com/paycheck/confirm", "gameSimpleName": "testest"}