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
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
2622C83022002B3300BF5D56 /* HNYouai.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2622C82F22002B3300BF5D56 /* HNYouai.framework */; };
269F653821B6613F006AEC88 /* HaiBaoJuheSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */; };
845D18221C8D778400F27EB9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 845D181B1C8D778400F27EB9 /* Images.xcassets */; };
846BD2241EE9342700E89A1D /* haibao_setting in Resources */ = {isa = PBXBuildFile; fileRef = 846BD21F1EE9342700E89A1D /* haibao_setting */; };
846BD2261EE9342700E89A1D /* SDKInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 846BD2231EE9342700E89A1D /* SDKInterface.m */; };
847EE5E21EE9007E003A4B7B /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 847EE5E11EE9007E003A4B7B /* MainViewController.m */; };
8484E4F51EE7E0DC00B402D1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8484E4F21EE7E0DC00B402D1 /* AppDelegate.m */; };
8484E4F61EE7E0DC00B402D1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8484E4F41EE7E0DC00B402D1 /* ViewController.m */; };
8484E4FC1EE7E1D800B402D1 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E4FB1EE7E1D800B402D1 /* libsqlite3.dylib */; };
8484E4FE1EE7E1F700B402D1 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E4FD1EE7E1F700B402D1 /* CoreTelephony.framework */; };
8484E5001EE7E20C00B402D1 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E4FF1EE7E20C00B402D1 /* CFNetwork.framework */; };
8484E5021EE7E21F00B402D1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5011EE7E21F00B402D1 /* UIKit.framework */; };
8484E5041EE7E24400B402D1 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5031EE7E24400B402D1 /* StoreKit.framework */; };
8484E5061EE7E24A00B402D1 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5051EE7E24A00B402D1 /* CoreMotion.framework */; };
8484E5081EE7E25600B402D1 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5071EE7E25600B402D1 /* CoreText.framework */; };
8484E50A1EE7E26200B402D1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5091EE7E26200B402D1 /* Security.framework */; };
8484E50C1EE7E27100B402D1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E50B1EE7E27100B402D1 /* CoreGraphics.framework */; };
8484E50E1EE7E28000B402D1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E50D1EE7E28000B402D1 /* QuartzCore.framework */; };
8484E5101EE7E29A00B402D1 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E50F1EE7E29A00B402D1 /* libc++.1.dylib */; };
8484E5121EE7E2B800B402D1 /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5111EE7E2B800B402D1 /* libz.1.dylib */; };
8484E5141EE7E2DE00B402D1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5131EE7E2DE00B402D1 /* Foundation.framework */; };
8484E5161EE7E36800B402D1 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8484E5151EE7E36800B402D1 /* SystemConfiguration.framework */; };
84A090AB1F160A69003D23FB /* TrackingIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84A090AA1F160A69003D23FB /* TrackingIO.a */; };
BB5F3C8E1C1811BC00DA339D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BB5F3C8D1C1811BC00DA339D /* main.m */; };
BB5F3C971C1811BC00DA339D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BB5F3C951C1811BC00DA339D /* Main.storyboard */; };
BB5F3CA81C1811BC00DA339D /* DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BB5F3CA71C1811BC00DA339D /* DemoTests.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
BB5F3CA21C1811BC00DA339D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BB5F3C801C1811BC00DA339D /* Project object */;
proxyType = 1;
remoteGlobalIDString = BB5F3C871C1811BC00DA339D;
remoteInfo = Demo;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
84398BFB1C4C83EC0082D774 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
2622C82F22002B3300BF5D56 /* HNYouai.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = HNYouai.framework; sourceTree = "<group>"; };
269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = HaiBaoJuheSDK.framework; sourceTree = "<group>"; };
845D181B1C8D778400F27EB9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = poolsdk_file/poolsdk/Images.xcassets; sourceTree = "<group>"; };
845D181C1C8D778400F27EB9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = poolsdk_file/poolsdk/Info.plist; sourceTree = "<group>"; };
846BD21F1EE9342700E89A1D /* haibao_setting */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = haibao_setting; path = poolsdk_file/poolsdk/haibao_setting; sourceTree = "<group>"; };
846BD2221EE9342700E89A1D /* SDKInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDKInterface.h; path = poolsdk_file/poolsdk/SDKInterface.h; sourceTree = "<group>"; };
846BD2231EE9342700E89A1D /* SDKInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDKInterface.m; path = poolsdk_file/poolsdk/SDKInterface.m; sourceTree = "<group>"; };
847EE5E01EE9007E003A4B7B /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
847EE5E11EE9007E003A4B7B /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
8484E4F11EE7E0DC00B402D1 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
8484E4F21EE7E0DC00B402D1 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8484E4F31EE7E0DC00B402D1 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
8484E4F41EE7E0DC00B402D1 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
8484E4FB1EE7E1D800B402D1 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = ../../../../../../../../usr/lib/libsqlite3.dylib; sourceTree = "<group>"; };
8484E4FD1EE7E1F700B402D1 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
8484E4FF1EE7E20C00B402D1 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
8484E5011EE7E21F00B402D1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
8484E5031EE7E24400B402D1 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
8484E5051EE7E24A00B402D1 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
8484E5071EE7E25600B402D1 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
8484E5091EE7E26200B402D1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
8484E50B1EE7E27100B402D1 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
8484E50D1EE7E28000B402D1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
8484E50F1EE7E29A00B402D1 /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "../../../../../../../../usr/lib/libc++.1.dylib"; sourceTree = "<group>"; };
8484E5111EE7E2B800B402D1 /* libz.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.dylib; path = ../../../../../../../../usr/lib/libz.1.dylib; sourceTree = "<group>"; };
8484E5131EE7E2DE00B402D1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
8484E5151EE7E36800B402D1 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
84A090AA1F160A69003D23FB /* TrackingIO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = TrackingIO.a; path = poolsdk_file/poolsdk/TrackingIO.a; sourceTree = "<group>"; };
84A090AC1F174E21003D23FB /* TrackingIO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TrackingIO.h; path = poolsdk_file/poolsdk/TrackingIO.h; sourceTree = "<group>"; };
BB5F3C881C1811BC00DA339D /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
BB5F3C8D1C1811BC00DA339D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
BB5F3C961C1811BC00DA339D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
BB5F3C9B1C1811BC00DA339D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
BB5F3CA11C1811BC00DA339D /* DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
BB5F3CA61C1811BC00DA339D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BB5F3CA71C1811BC00DA339D /* DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoTests.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
BB5F3C851C1811BC00DA339D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8484E5161EE7E36800B402D1 /* SystemConfiguration.framework in Frameworks */,
269F653821B6613F006AEC88 /* HaiBaoJuheSDK.framework in Frameworks */,
8484E4FC1EE7E1D800B402D1 /* libsqlite3.dylib in Frameworks */,
8484E5121EE7E2B800B402D1 /* libz.1.dylib in Frameworks */,
8484E5101EE7E29A00B402D1 /* libc++.1.dylib in Frameworks */,
8484E5001EE7E20C00B402D1 /* CFNetwork.framework in Frameworks */,
8484E5061EE7E24A00B402D1 /* CoreMotion.framework in Frameworks */,
2622C83022002B3300BF5D56 /* HNYouai.framework in Frameworks */,
8484E5021EE7E21F00B402D1 /* UIKit.framework in Frameworks */,
8484E50C1EE7E27100B402D1 /* CoreGraphics.framework in Frameworks */,
8484E5081EE7E25600B402D1 /* CoreText.framework in Frameworks */,
8484E50E1EE7E28000B402D1 /* QuartzCore.framework in Frameworks */,
8484E5141EE7E2DE00B402D1 /* Foundation.framework in Frameworks */,
8484E50A1EE7E26200B402D1 /* Security.framework in Frameworks */,
8484E5041EE7E24400B402D1 /* StoreKit.framework in Frameworks */,
8484E4FE1EE7E1F700B402D1 /* CoreTelephony.framework in Frameworks */,
84A090AB1F160A69003D23FB /* TrackingIO.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
BB5F3C9E1C1811BC00DA339D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8476DF631C4DD70500EC42BA /* poolsdk_file */ = {
isa = PBXGroup;
children = (
8476DF641C4DD71D00EC42BA /* poolsdk */,
);
name = poolsdk_file;
sourceTree = "<group>";
};
8476DF641C4DD71D00EC42BA /* poolsdk */ = {
isa = PBXGroup;
children = (
2622C82F22002B3300BF5D56 /* HNYouai.framework */,
84A090AC1F174E21003D23FB /* TrackingIO.h */,
84A090AA1F160A69003D23FB /* TrackingIO.a */,
846BD21F1EE9342700E89A1D /* haibao_setting */,
846BD2221EE9342700E89A1D /* SDKInterface.h */,
846BD2231EE9342700E89A1D /* SDKInterface.m */,
845D181B1C8D778400F27EB9 /* Images.xcassets */,
845D181C1C8D778400F27EB9 /* Info.plist */,
);
name = poolsdk;
sourceTree = "<group>";
};
BB5F3C7F1C1811BC00DA339D = {
isa = PBXGroup;
children = (
8484E5151EE7E36800B402D1 /* SystemConfiguration.framework */,
8484E5131EE7E2DE00B402D1 /* Foundation.framework */,
8484E5111EE7E2B800B402D1 /* libz.1.dylib */,
8484E50F1EE7E29A00B402D1 /* libc++.1.dylib */,
8484E50D1EE7E28000B402D1 /* QuartzCore.framework */,
8484E50B1EE7E27100B402D1 /* CoreGraphics.framework */,
8484E5091EE7E26200B402D1 /* Security.framework */,
8484E5071EE7E25600B402D1 /* CoreText.framework */,
8484E5051EE7E24A00B402D1 /* CoreMotion.framework */,
8484E5031EE7E24400B402D1 /* StoreKit.framework */,
8484E5011EE7E21F00B402D1 /* UIKit.framework */,
8484E4FF1EE7E20C00B402D1 /* CFNetwork.framework */,
8484E4FD1EE7E1F700B402D1 /* CoreTelephony.framework */,
8484E4FB1EE7E1D800B402D1 /* libsqlite3.dylib */,
8476DF631C4DD70500EC42BA /* poolsdk_file */,
BB5F3C8A1C1811BC00DA339D /* Demo */,
BB5F3CA41C1811BC00DA339D /* DemoTests */,
BB5F3C891C1811BC00DA339D /* Products */,
);
sourceTree = "<group>";
};
BB5F3C891C1811BC00DA339D /* Products */ = {
isa = PBXGroup;
children = (
BB5F3C881C1811BC00DA339D /* Demo.app */,
BB5F3CA11C1811BC00DA339D /* DemoTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
BB5F3C8A1C1811BC00DA339D /* Demo */ = {
isa = PBXGroup;
children = (
269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */,
8484E4F11EE7E0DC00B402D1 /* AppDelegate.h */,
8484E4F21EE7E0DC00B402D1 /* AppDelegate.m */,
8484E4F31EE7E0DC00B402D1 /* ViewController.h */,
8484E4F41EE7E0DC00B402D1 /* ViewController.m */,
847EE5E01EE9007E003A4B7B /* MainViewController.h */,
847EE5E11EE9007E003A4B7B /* MainViewController.m */,
BB5F3C951C1811BC00DA339D /* Main.storyboard */,
BB5F3C9A1C1811BC00DA339D /* LaunchScreen.xib */,
BB5F3C8B1C1811BC00DA339D /* Supporting Files */,
);
path = Demo;
sourceTree = "<group>";
};
BB5F3C8B1C1811BC00DA339D /* Supporting Files */ = {
isa = PBXGroup;
children = (
BB5F3C8D1C1811BC00DA339D /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
BB5F3CA41C1811BC00DA339D /* DemoTests */ = {
isa = PBXGroup;
children = (
BB5F3CA71C1811BC00DA339D /* DemoTests.m */,
BB5F3CA51C1811BC00DA339D /* Supporting Files */,
);
path = DemoTests;
sourceTree = "<group>";
};
BB5F3CA51C1811BC00DA339D /* Supporting Files */ = {
isa = PBXGroup;
children = (
BB5F3CA61C1811BC00DA339D /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
BB5F3C871C1811BC00DA339D /* Demo */ = {
isa = PBXNativeTarget;
buildConfigurationList = BB5F3CAB1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "Demo" */;
buildPhases = (
BB5F3C841C1811BC00DA339D /* Sources */,
BB5F3C851C1811BC00DA339D /* Frameworks */,
BB5F3C861C1811BC00DA339D /* Resources */,
84398BFB1C4C83EC0082D774 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Demo;
productName = Demo;
productReference = BB5F3C881C1811BC00DA339D /* Demo.app */;
productType = "com.apple.product-type.application";
};
BB5F3CA01C1811BC00DA339D /* DemoTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = BB5F3CAE1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "DemoTests" */;
buildPhases = (
BB5F3C9D1C1811BC00DA339D /* Sources */,
BB5F3C9E1C1811BC00DA339D /* Frameworks */,
BB5F3C9F1C1811BC00DA339D /* Resources */,
);
buildRules = (
);
dependencies = (
BB5F3CA31C1811BC00DA339D /* PBXTargetDependency */,
);
name = DemoTests;
productName = DemoTests;
productReference = BB5F3CA11C1811BC00DA339D /* DemoTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
BB5F3C801C1811BC00DA339D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0640;
ORGANIZATIONNAME = winFan;
TargetAttributes = {
BB5F3C871C1811BC00DA339D = {
CreatedOnToolsVersion = 6.4;
DevelopmentTeam = A3DGN26BA8;
ProvisioningStyle = Manual;
};
BB5F3CA01C1811BC00DA339D = {
CreatedOnToolsVersion = 6.4;
TestTargetID = BB5F3C871C1811BC00DA339D;
};
};
};
buildConfigurationList = BB5F3C831C1811BC00DA339D /* Build configuration list for PBXProject "Demo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = BB5F3C7F1C1811BC00DA339D;
productRefGroup = BB5F3C891C1811BC00DA339D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
BB5F3C871C1811BC00DA339D /* Demo */,
BB5F3CA01C1811BC00DA339D /* DemoTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
BB5F3C861C1811BC00DA339D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
845D18221C8D778400F27EB9 /* Images.xcassets in Resources */,
BB5F3C971C1811BC00DA339D /* Main.storyboard in Resources */,
846BD2241EE9342700E89A1D /* haibao_setting in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
BB5F3C9F1C1811BC00DA339D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
BB5F3C841C1811BC00DA339D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
846BD2261EE9342700E89A1D /* SDKInterface.m in Sources */,
8484E4F51EE7E0DC00B402D1 /* AppDelegate.m in Sources */,
847EE5E21EE9007E003A4B7B /* MainViewController.m in Sources */,
BB5F3C8E1C1811BC00DA339D /* main.m in Sources */,
8484E4F61EE7E0DC00B402D1 /* ViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
BB5F3C9D1C1811BC00DA339D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BB5F3CA81C1811BC00DA339D /* DemoTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
BB5F3CA31C1811BC00DA339D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = BB5F3C871C1811BC00DA339D /* Demo */;
targetProxy = BB5F3CA21C1811BC00DA339D /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
BB5F3C951C1811BC00DA339D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
BB5F3C961C1811BC00DA339D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
BB5F3C9A1C1811BC00DA339D /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
BB5F3C9B1C1811BC00DA339D /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
BB5F3CA91C1811BC00DA339D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
BB5F3CAA1C1811BC00DA339D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
BB5F3CAC1C1811BC00DA339D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = A3DGN26BA8;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Demo",
"$(PROJECT_DIR)/poolsdk_file/poolsdk",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = poolsdk_file/poolsdk/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Demo",
"$(PROJECT_DIR)/poolsdk_file/poolsdk",
);
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.mihuyo.beta;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "f5e11833-b2e3-48fd-8903-8da416b533f7";
PROVISIONING_PROFILE_SPECIFIER = dev_provision;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 armv7s";
};
name = Debug;
};
BB5F3CAD1C1811BC00DA339D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = A3DGN26BA8;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Demo",
"$(PROJECT_DIR)/poolsdk_file/poolsdk",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = poolsdk_file/poolsdk/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Demo",
"$(PROJECT_DIR)/poolsdk_file/poolsdk",
);
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.mihuyo.beta;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "efde732c-987c-4f2a-bc64-c11762722e03";
PROVISIONING_PROFILE_SPECIFIER = dis_provision;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 armv7s";
};
name = Release;
};
BB5F3CAF1C1811BC00DA339D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(PROJECT_DIR)",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = DemoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo";
};
name = Debug;
};
BB5F3CB01C1811BC00DA339D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = DemoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
BB5F3C831C1811BC00DA339D /* Build configuration list for PBXProject "Demo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BB5F3CA91C1811BC00DA339D /* Debug */,
BB5F3CAA1C1811BC00DA339D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BB5F3CAB1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "Demo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BB5F3CAC1C1811BC00DA339D /* Debug */,
BB5F3CAD1C1811BC00DA339D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BB5F3CAE1C1811BC00DA339D /* Build configuration list for PBXNativeTarget "DemoTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BB5F3CAF1C1811BC00DA339D /* Debug */,
BB5F3CB01C1811BC00DA339D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = BB5F3C801C1811BC00DA339D /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Demo.xcodeproj">
</FileRef>
</Workspace>
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : {
}
},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : 0,
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8119CC7B-EDC1-4646-9378-8ECAC2EEB94B",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : "public_sdk_ios\/",
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : "youai_foolsdk_ios\/"
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "Demo",
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "PoolSdk_Demo\/Demo.xcodeproj",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "svn:\/\/10.21.210.99",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5b13317c-0110-4367-8746-06bc6aadd3cd++2397"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/106.75.192.252:10022\/public_service\/public_sdk_ios.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Demo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../PoolSdk/PoolSdk/SDKInterface.m"
timestampString = "471440051.171901"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "77"
endingLineNumber = "77"
landmarkName = "-receiveLoginMessage:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../PoolSdk/PoolSdk/SDKInterface.m"
timestampString = "471440051.171901"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "43"
endingLineNumber = "43"
landmarkName = "-SDKloginSDK"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
BuildableName = "DemoTests.xctest"
BlueprintName = "DemoTests"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
BuildableName = "DemoTests.xctest"
BlueprintName = "DemoTests"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Demo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>BB5F3C871C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>BB5F3CA01C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Demo/SDKInterface.h"
timestampString = "474775745.083759"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "9"
endingLineNumber = "9"
landmarkName = "@interface SDKInterface"
landmarkType = "2">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
BuildableName = "DemoTests.xctest"
BlueprintName = "DemoTests"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Demo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>BB5F3C871C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>BB5F3CA01C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
No preview for this file type
//
// AppDelegate.h
// publiDemo
//
// Created by winFan on 11/30/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
//
// AppDelegate.m
// publiDemo
//
// Created by winFan on 11/30/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "AppDelegate.h"
#import "ViewController.h"
#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSLog(@"didFinishLaunchingWithOptions");
[[HaiBaoJuheSDK shareSDK]application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// 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.
// 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.
[[HaiBaoJuheSDK shareSDK]applicationWillResignActive:application];
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
[[HaiBaoJuheSDK shareSDK]applicationDidEnterBackground:application];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// 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.
[[HaiBaoJuheSDK shareSDK]applicationDidBecomeActive:application];
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
NSLog(@"hanldeOpenURL%@",url.path );
[[HaiBaoJuheSDK shareSDK] handleOpenurl:url];
return true;
}
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
{
[[HaiBaoJuheSDK shareSDK]application:app openURL:url options:options];
return YES;
}
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
[[HaiBaoJuheSDK shareSDK] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
return YES;
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// 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.
[[HaiBaoJuheSDK shareSDK] applicationWillEnterForeground:application];
}
@end
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<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">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<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">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<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">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<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">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Main View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="MainViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GQW-et-jRb">
<rect key="frame" x="44" y="85" width="208" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="初始化"/>
<connections>
<action selector="actionInit:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Srh-bu-gYD"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s0O-FE-ge8">
<rect key="frame" x="61" y="123" width="175" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="登录"/>
<connections>
<action selector="actionLogin:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="381-gB-ImA"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JQY-uO-q36">
<rect key="frame" x="53" y="166" width="191" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="充值"/>
<connections>
<action selector="actionPay:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="bvf-M4-rqy"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5na-1c-IlO">
<rect key="frame" x="357" y="85" width="100" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="数据"/>
<connections>
<action selector="actionSubmitRoleData:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="aNf-Iw-unv"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jcX-L1-JB6">
<rect key="frame" x="377" y="166" width="60" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="切换账号"/>
<connections>
<action selector="actionSwitchAccount:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="miU-Hm-8cm"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q9b-py-Nk0">
<rect key="frame" x="340" y="123" width="134" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="注销"/>
<connections>
<action selector="actionLogout:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="t6e-7P-tJU"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="445" y="282"/>
</scene>
</scenes>
</document>
#import <Foundation/Foundation.h>
#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheSDKDelegate.h"
@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
@property(nonatomic, strong)NSString *userId;
@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
@property bool onlyOneTimeGzyazf;
+ (HaiBaoJuheChecker *)getInstance;
- (void)initChecker;
- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (void) RailwayHaiBaoJuhereportOpen;
- (void) RailwayHaiBaoJuhereportSDKOpen;
- (void)RailwayHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
- (void) RailwayHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
notiName:(NSString *)notiName
statusCode:(int)nCode
description:(NSString *)szDescripton
extendData:(NSObject *)extendData;
- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
- (void)RailwayHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
/*
*初始化时调用
*/
- (void)setHaiBaoJuheSDKDelegate:(nullable id<HaiBaoJuheSDKDelegate>)HaiBaoJuheSDKDeletate;
@end
#import <Foundation/Foundation.h>
@interface HaiBaoJuheConfig : NSObject
@property(nonatomic, strong)NSString *gameSimpleName;
@property(nonatomic, strong)NSString *sdkSimpleName;
@property(nonatomic, strong)NSString *sdkVersionCode;
@property(nonatomic, strong)NSString *loginCheckUrl;
@property(nonatomic, strong)NSString *gzyazfOrderUrl;
@property(nonatomic, strong)NSString *gzyazfCheckUrl;
@property(nonatomic, strong)NSString *c1;
@property(nonatomic, strong)NSString *c2;
@property(nonatomic, strong)NSString *custom;
+ (HaiBaoJuheConfig *)getInstance;
- (void) loadFile:(NSString *) fileName;
- (NSString *)getValueByKey:(NSString *) key;
- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
@end
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheCreateOrderInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic,strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
@property(nonatomic, strong)NSString *playerId;//玩家ID
@property(nonatomic, strong)NSString *playerName;//玩家名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *postAmount;//金额
@property(nonatomic, strong)NSString *productId;//产品ID
@property(nonatomic, strong)NSString *productName;//产品名称
@property(nonatomic, strong)NSString *productDesc;//产品描述
@property(nonatomic, strong)NSString *custom;//透传参数
@property(nonatomic, strong)NSString *exchange;//兑换比例
@property(nonatomic, strong)NSString *otherInfo;//扩展参数
@property(nonatomic, strong)NSString *userId;//用户ID
@property(nonatomic, strong)NSString *timestamp;//时间戳
- (NSString *) RailwayHaiBaoJuheGetTsign ;
- (NSString *) RailwayHaiBaoJuheGetTimestamp ;
@end
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheGzyazfInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic, strong)NSString *serverId;
@property(nonatomic, strong)NSString *queryId;
@property(nonatomic, strong)NSString *playerId;
@property(nonatomic, strong)NSString *playerName;
@property(nonatomic, strong)NSString *postAmount;
@property(nonatomic, strong)NSString *productId;
@property(nonatomic, strong)NSString *products;
@property(nonatomic, strong)NSString *custom;
@property(nonatomic, strong)NSString *postTime;
@property(nonatomic, strong)NSString *other;
//游戏传递过来的原值
@property(nonatomic, strong)NSString *serverName;//服务器名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *productName;//产品名称
@property(nonatomic, strong)NSString *productDesc;//产品描述
@property(nonatomic, strong)NSString *exchange;//兑换比例
@end
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheLoginInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic,strong)NSString *timestamp;
@property(nonatomic, strong)NSString *sign;
@property(nonatomic, strong)NSString *other;
@property(nonatomic, strong)NSString *openId;
@property(nonatomic, strong)NSString *userType;
@end
//
// HaiBaoJuheNotification.h
// public_i9133
//
// Created by winFan on 12/1/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * const HaiBaoJuheSDK_Notification; /**< */
extern NSString * const _create_order_notification; /**< */
/**
应用支持的方向
*/
typedef NS_ENUM(int, HaiBaoJuheSDKNotificationType) {
HaiBaoJuheSDKNotificationLogin = 1,//登录
HaiBaoJuheSDKNotificationLogout,//注销
HaiBaoJuheSDKNotificationGzyazf,//支付完成
HaiBaoJuheSDKNotificationPause,//暂停退出
HaiBaoJuheSDKNotificationRole,//创建角色
HaiBaoJuheSDKNotificationInitSDK,//初始化SDK
HaiBaoJuheSDKNotificationSwitchAccount,//切换账号
HaiBaoJuheSDKNotificationExit//退出游戏
};
@interface HaiBaoJuheNotification : NSObject
@end
//////////////////////////////////////////////////////////////////////
@interface HaiBaoJuheSDKResult : NSObject
@property(nonatomic, assign)int statusCode;//请参照此文件下面状态标识
@property(nonatomic, strong)NSString *resultDescription;
@property(nonatomic, strong)NSObject *extendData;
//V1.2.0新增
@property(nonatomic, assign)HaiBaoJuheSDKNotificationType notiType;//消息类型
@property(nonatomic, strong)NSString *notiName;//消息名称
@end
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/* 状态标识 */
#define HaiBaoJuheSDK_NO_ERROR 0 /*操作成功*/
#define HaiBaoJuheSDK_ERROR_LOGIN_FAILED -100 /*登录失败*/
#define HaiBaoJuheSDK_ERROR_LOGIN_CANCEL -101 /*登录取消*/
#define HaiBaoJuheSDK_ERROR_LOGIN_GAMGEACCOUNT -102 /*游戏帐号登录,非平台账号*/
#define HaiBaoJuheSDK_ERROR_PAY_FAILED -200 /*支付失败*/
#define HaiBaoJuheSDK_ERROR_PAY_CANCEL -201 /*支付取消*/
#define HaiBaoJuheSDK_ERROR_PAY_VERSIGN -202 /*支付验签失败*/
#define HaiBaoJuheSDK_ERROR_CREATE_ORDER_FAILED -203 /*支付验签失败*/
#define HaiBaoJuheSDK_ERROR_ROLE_CREATE_FAILED -300 /*角色创建失败*/
#define HaiBaoJuheSDK_ERROR_INIT_FAILED -400 /*初始化失败*/
#define HaiBaoJuheSDK_ERROR_SWICHT_ACCOUNT_FAILED -500 /*切换账号失败*/
#define HaiBaoJuheSDK_ERROR_EXIT_CANCEL -600 /*退出取消*/
//////////////////////////////////////////////////////////////////////
//
// RailwayHaiBaoJuheReportInfo.h
// HaiBaoJuheSDK
//
// Created by winFan on 12/21/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheReportInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic, strong)NSString *reportType;//类型
@property(nonatomic, strong)NSString *playerId;//玩家ID
@property(nonatomic, strong)NSString *playerName;//玩家名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *roleSex;//角色性别(1男0女)
@property(nonatomic, strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
@property(nonatomic, strong)NSNumber *roleCTime;//创建角色时间(秒)
@property(nonatomic, strong)NSString *partyName;//工会名称
@property(nonatomic, strong)NSString *roleType;//角色类型
@property(nonatomic, strong)NSNumber *roleChangeTime;//角色等级更新时间(秒)
@property(nonatomic, strong)NSString *vipLevel;//vip等级
@property(nonatomic, strong)NSNumber *diamond;//余额
@property(nonatomic, strong)NSString *moneyType;//商品单位(元宝,金币)
@property(nonatomic, strong)NSString *custom;//透传参数
@property(nonatomic, strong)NSString *openId;
#define REPORT_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/statistic"
#define REPORT_IDFA_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
#define REPORT_OPEN @"open"
#define REPORT_ENTER @"enter"
#define REPORT_CREATEROLE @"createrole"
#define REPORT_ROLEUPGRADE @"roleupgrade"
#define REPORT_SDK_OPEN @"opensdk"
#define REPORT_EXIT @"exit"
#define REPORT_SELECT_SERVER @"selectserver"
@end
#import <Foundation/Foundation.h>
#import "HaiBaoJuheSDK2.h"
#import <UIKit/UIKit.h>
@interface HaiBaoJuheSDK : NSObject
@property(nonatomic, strong, readonly)NSString *sdkVersion;
@property(nonatomic, strong)NSString *urlSchemes;
@property BOOL isAppleGzyazfing;
+ (HaiBaoJuheSDK *)shareSDK;
- (void)initSDK:(UIViewController *) control;
-(void)viewDidAppear;
- (void)setViewController:(UIViewController *)viewController;
- (void)loginSDK;
- (void)loginSDK:(UIViewController *)viewController;
- (void)gzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (BOOL)hasUserCenter;
- (void)gotoUserCenter;
- (void)reportSDK:(HaiBaoJuheReportInfo *)reportInfo;
- (BOOL)hasLogout;
- (void)logoutSDK;
- (BOOL)hasSwitchAccount;
- (void)switchAccount;
- (BOOL)hasExit;
- (void)exitSDK;
- (void)destroySDK;
@property(nonatomic, assign)ESDKOrientation sdkOrientation;
@property(nonatomic, assign)BOOL bShowedFloat;
@property(nonatomic, assign)int serverId;
-(NSString *) getGameChannelId;
- (NSString *) getCustomValue;
- (NSString *) getChannelParameter1;
- (NSString *) getChannelParameter2;
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray*)customArray;
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;
- (void)applicationWillResignActive:(UIApplication *)application;
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
@end
#import <UIKit/UIKit.h>
#import "HaiBaoJuheChecker.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheLoginInfo.h"
#import "Interface.h"
#import "HaiBaoJuheNotification.h"
#import "HaiBaoJuheGzyazfInfo.h"
#import "UnionInterface.h"
#import "HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheConfig.h"
#import "HaiBaoJuheUtils.h"
#import "NetCenter.h"
#import "HaiBaoJuheSDK.h"
#import "HaiBaoJuheSDKDelegate.h"
#import <Foundation/Foundation.h>
@protocol HaiBaoJuheSDKDelegate <NSObject>
@optional
-(void)HaiBaoJuheSDKLoginSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
-(void)HaiBaoJuheSDKLoginFail:(NSString*)msg;
-(void)HaiBaoJuheSDKSwitchAccountSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
-(void)HaiBaoJuheSDKSwitchAccountFail:(NSString*)msg;
@end
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface HaiBaoJuheUtils : NSObject
+(NSString *)md5:(NSString *)str;
+ (NSDictionary *)RailwayHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createGzyazfOrderUrl;
//*充值回调地址
+(NSString *)createGzyazfUrl;
+(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
+(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
@end
//
// Interface.h
// HaiBaoJuheSDK
//
// Created by winFan on 12/10/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#include "UnionInterface.h"
#import <SafariServices/SafariServices.h>
@interface Interface : NSObject <UnionInterface>
@property(nonatomic, strong)UIViewController *controller;
@end
#import <Foundation/Foundation.h>
@interface NetCenter : NSObject
@property(nonatomic,retain) NSMutableData *receiveData;
@property(nonatomic,assign)int dataPackSerialNo;
+ (NetCenter *)getInstance;
- (NSString *)httpGetSyn:(NSString *) getUrl;
- (NSString *)httpPostSyn:(NSString *) postUrl : (NSDictionary *) postData;
- (void)httpGetNoSyn;
- (void)httpPostNoSyn:(NSString *) postUrl :(NSDictionary *)postDict;
- (void)httpPostAsync:(NSString*)postUrl :(NSDictionary*)postDict;
- (void)httpPostAsyncOpen:(NSString*)postUrl :(NSDictionary*)postDict;
-(void)httpGetAsync:(NSString *)url completionHandler:(void (^ __nullable)(NSURLResponse* __nullable response, NSData* __nullable data, NSError* __nullable connectionError)) handler;
- (NSString * __nullable)dicToString:(NSDictionary * __nullable) dict;
@end
#ifndef __HaiBaoJuheSDK__OtherSetting__
#define __HaiBaoJuheSDK__OtherSetting__
/**
应用支持的方向
*/
typedef NS_ENUM(NSUInteger, ESDKOrientation) {
ESDKOrientationPortrait = 1,//竖
ESDKOrientationLandscape,//横
ESDKOrientationNone//自动旋转
};
/**
应用支持的方向
*/
typedef NS_ENUM(NSUInteger, REPORT_TYPE) {
REPORT_TYPE_OPEN = 1,//竖
REPORT_TYPE_ENTER,//横
REPORT_TYPE_DEFINE//自动旋转
};
#endif /* defined(__HaiBaoJuheSDK__OtherSetting__) */
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface RailwayHaiBaoJuheBaseModel : NSObject
- (NSString *)RailwayHaiBaoJuheObjectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
@end
#import <Foundation/Foundation.h>
void DGLog(NSString *fmt, ...);
typedef NS_ENUM(NSInteger, DGLoggerLevel)
{
ELogVerbose = 1,
ELogDebug,
ELogInfo,
ELogWarn,
ELogError
};
@interface RailwayHaiBaoJuheDGLogger : NSObject
+ (void)showLog:(NSString *)fmt,...;
+ (void)showLog:(DGLoggerLevel)level log:(NSString *)fmt,...;
+ (void)isShowLog:(BOOL)flag;
@end
#define TRACK_VERSION @"1.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
+(void) setPrintLog :(BOOL)print;
+ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
+ (void)setRegisterWithAccountID:(NSString *)account;
+ (void)setLoginWithAccountID:(NSString *)account;
+(void)setGzyazfmentStart:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
+(void)setGzyazfment:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
+(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
+(void)setProfile:(NSDictionary *)dataDic;
+(NSString*)getDeviceId;
@end
NS_ASSUME_NONNULL_END
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "HaiBaoJuheSDK2.h"
@protocol UnionInterface
/**
初始化SDK
*/
//[[PoolChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationGzyazf notiName:@"" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"" extendData:order_id];
- (void)SDKinit:(UIViewController *) control;
- (void)setViewController:(UIViewController *) viewController;
/**
登录SDK
*/
- (void)SDKloginSDK;
- (void)SDKloginSDK:(UIViewController *) control;
/**
*是否含有注销接口
*/
- (BOOL)hasLogout;
/**
注销
*/
- (void)SDKlogoutSDK;
/**
*是否含有退出接口
**/
- (BOOL)hasExit;
/**
退出接口
*/
- (void)SDKexitSDK;
/**
*SDK销毁操作(游戏退出时调用)
*/
- (void)destroySDK;
/**
*是否含有用户中心接口
**/
- (BOOL)hasUserCenter;
/**
用户中心
*/
- (void)SDKgotoUserCenter;
/**
*是否含有切换账号接口
**/
- (BOOL)hasSwitchAccount;
/**
*切换账号
**/
- (void)switchAccount;
- (void)viewDidAppear;
/**
提交数据
*/
- (void)SDKreport:(HaiBaoJuheReportInfo *) reportInfo;
/**
进行支付
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (void)receiveCreateOrder: (NSNotification *)notification;
/**
*充值统计参数
*accountId 账号ID,必填项, 和登陆、注册使用的accountId保持一致即可。
*orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
*currencyAmount 货币金额,单位为元,支持小数
*currencyType 货币类型
*gzyazfType 支付类型(渠道)
*/
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray *)customArray;
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;
- (void)applicationWillResignActive:(UIApplication *)application;
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
@end
framework module HaiBaoJuheSDK {
umbrella header "HaiBaoJuheSDK.h"
export *
module * { export * }
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.mango.ios.fytx</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// MainViewController.h
// Demo_qiyu
//
// Created by 许 on 17/6/7.
// Copyright © 2017年 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
@interface MainViewController : UIViewController
@end
//
// MainViewController.m
// Demo_qiyu
//
// Created by 许 on 17/6/7.
// Copyright © 2017年 winFan. All rights reserved.
//
#import "MainViewController.h"
#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
@interface MainViewController ()
@end
NSString* sdkUserId = @"";
@implementation MainViewController
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:HaiBaoJuheSDK_Notification object:nil];
// Do any additional setup after loading the view.
NSLog(@"viewDidLoad");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
- (void)receiveSDKMessage:(NSNotification *)notification
{
HaiBaoJuheSDKResult *result = [notification object];
if (result) {
NSLog(@"notiType:%d",result.notiType);
switch (result.notiType) {
case HaiBaoJuheSDKNotificationInitSDK:
{
NSLog(@"sdk初始化成功");
}
break;
case HaiBaoJuheSDKNotificationLogin:
{
NSLog(@"result state:%d",result.statusCode);
if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
sdkUserId = [loginInfo openId];
NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
NSLog(@"userType:%@",[loginInfo userType]);
}else{
NSLog(@"登录失败:%@",[result description]);
}
}
break;
case HaiBaoJuheSDKNotificationLogout:
{
NSLog(@"sdk注销成功,游戏处理");
}
break;
case HaiBaoJuheSDKNotificationSwitchAccount:
NSLog(@"切换账号通知");
if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
NSLog(@"userType:%@",[loginInfo userType]);
}else{
NSLog(@"%@",[result description]);
}
break;
default:
break;
}
}
}
- (IBAction)actionInit:(id)sender {
[[HaiBaoJuheSDK shareSDK]initSDK:self];
}
- (IBAction)actionLogin:(id)sender {
[[HaiBaoJuheSDK shareSDK] loginSDK];
}
- (IBAction)actionPay:(id)sender {
HaiBaoJuheCreateOrderInfo *payInfo = [[HaiBaoJuheCreateOrderInfo alloc]init];
[payInfo setServerId:@"99887766"];
[payInfo setPlayerName:@"iamrolename"];
[payInfo setPlayerLevel:@"10"];
[payInfo setUserId:sdkUserId];
[payInfo setPostAmount:@"1"];
[payInfo setProductId:@"com.xiongdi.xunqinji.6"];
[payInfo setPlayerId:@"1231241234"];
[payInfo setProductName:@"com.xiongdi.xunqinji.6"];
[payInfo setProductDesc:@"productDes"];
[payInfo setTimestamp:@"1232134"];
[payInfo setExchange:@"1"];
[payInfo setServerName:@"servername"];
[payInfo setCustom:@"custom"];
[[HaiBaoJuheSDK shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
}
-(NSString*)getCurrentTimestamp{
// 时间戳转时间
NSTimeInterval interval = [[NSDate date] timeIntervalSince1970] * 1000;
NSString* timeStr = [[NSString alloc]initWithFormat:@"%.f",interval];
return timeStr;
}
/**
serverid
servername
roleid
rolename
rolelevel
*/
- (IBAction)actionSubmitRoleData:(id)sender {
NSLog(@"数据接口");
HaiBaoJuheReportInfo *reportInfo = [[HaiBaoJuheReportInfo alloc]init];
[reportInfo setReportType:REPORT_ENTER];
//[reportInfo setReportType:REPORT_CREATEROLE];
//[reportInfo setReportType:REPORT_ROLEUPGRADE]
[reportInfo setServerId:@"28"];
[reportInfo setServerName:@"serverName"];
[reportInfo setPlayerId:@"1231241234"];
[reportInfo setPlayerName:@"playName"];
[reportInfo setPlayerLevel:@"10"];
[reportInfo setPartyName:@"1345"];
[reportInfo setRoleCTime:[[NSNumber alloc]initWithLong:[self getCurrentTimestamp].longLongValue]];
[reportInfo setRoleChangeTime:[[NSNumber alloc]initWithLong:[self getCurrentTimestamp].longLongValue]];
[[HaiBaoJuheSDK shareSDK] reportSDK:reportInfo];
}
- (IBAction)actionLogout:(id)sender {
NSLog(@"注销");
if ([[HaiBaoJuheSDK shareSDK] hasLogout]) {
[[HaiBaoJuheSDK shareSDK] logoutSDK];
}
}
- (IBAction)actionSwitchAccount:(id)sender {
if([[HaiBaoJuheSDK shareSDK] hasSwitchAccount]){
[[HaiBaoJuheSDK shareSDK] switchAccount];
}
}
#pragma mark - 截屏
- (void)screenShot:(UIView *)view{
UIImage* image = nil;
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIGraphicsEndImageContext();
if (image != nil) {
NSLog(@"截图成功!");
UIImageWriteToSavedPhotosAlbum(image,self,@selector(image:didFinishSavingWithError:contextInfo:),NULL);
}
}
#pragma mark - 保存到相册
-(void)image:(UIImage *)image didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo
{
if(!error){
NSLog(@"存到相册");
}else{
NSLog(@"存储失败");
}
}
//获取渠道参数
-(void)getChannel{
//获取channelId值
[[HaiBaoJuheSDK shareSDK]getGameChannelId];
//获取渠道参数1
[[HaiBaoJuheSDK shareSDK]getChannelParameter1];
//获取渠道参数2
[[HaiBaoJuheSDK shareSDK]getChannelParameter2];
//获取自定义参数
[[HaiBaoJuheSDK shareSDK]getCustomValue];
}
@end
//
// ViewController.h
// publiDemo
//
// Created by winFan on 11/30/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
@interface ViewController : UIViewController
- (void)receiveSDKMessage : (NSNotification *)notification;
@end
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
[button1 setTitle:@"登陆" forState:UIControlStateNormal];
button1.frame = CGRectMake(50.0f, 100.0f, 50.0f, 40.0f);
button1.tag = 1;
[button1 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button1];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
[button2 setTitle:@"数据" forState:UIControlStateNormal];
button2.frame = CGRectMake(150.0f, 100.0f, 50.0f, 40.0f);
button2.tag = 2;
[button2 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button2];
UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom];
[button4 setTitle:@"充值" forState:UIControlStateNormal];
button4.frame = CGRectMake(150.0f, 50.0f, 50.0f, 40.0f);
button4.tag = 4;
[button4 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button4];
UIButton *button6 = [UIButton buttonWithType:UIButtonTypeCustom];
[button6 setTitle:@"获取配置参数" forState:UIControlStateNormal];
button6.frame = CGRectMake(10.0f, 50.0f, 150.0f, 40.0f);
button6.tag = 6;
[button6 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button6];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:HaiBaoJuheSDK_Notification object:nil];
[[HaiBaoJuheSDK shareSDK]initSDK:self];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
//[[HaiBaoJuheSDK shareSDK] viewDidAppear];
}
- (void) toggleButton: (UIButton *) button
{
int tag = (int)button.tag;
if (tag == 1) {
[[HaiBaoJuheSDK shareSDK] loginSDK];
}
else if (tag == 2)
{
NSLog(@"数据接口");
HaiBaoJuheReportInfo *reportInfo = [[HaiBaoJuheReportInfo alloc]init];
[reportInfo setReportType:REPORT_ENTER];
//[reportInfo setReportType:REPORT_CREATEROLE];
//[reportInfo setReportType:REPORT_ROLEUPGRADE]
[reportInfo setServerId:@"9133"];
[reportInfo setPlayerName:@"roleName"];
[reportInfo setPlayerId:@"pserverName"];
[[HaiBaoJuheSDK shareSDK] reportSDK:reportInfo];
}
else if (tag == 4)
{
HaiBaoJuheCreateOrderInfo *payInfo = [[HaiBaoJuheCreateOrderInfo alloc]init];
[payInfo setServerId:@"111"];
[payInfo setPostAmount:@"6"];
[payInfo setPlayerId:@"1231241234"];
[payInfo setTimestamp:@"1232134"];
[payInfo setExchange:@"10"];
[payInfo setCustom:@"custom"];
NSLog(@"start pay");
[[HaiBaoJuheSDK shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
}
else if(tag == 6){
HaiBaoJuheSDK *haiBaoJuheSDK = [HaiBaoJuheSDK shareSDK];
NSLog(@"channelId:%@parame1:%@parame2:%@custom:%@",[haiBaoJuheSDK getGameChannelId],[haiBaoJuheSDK getChannelParameter1],[haiBaoJuheSDK getChannelParameter2],[haiBaoJuheSDK getCustomValue]);
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)receiveSDKMessage:(NSNotification *)notification
{
NSLog(@"receiveSDKMessage");
[[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
HaiBaoJuheSDKResult *result = [notification object];
if (result == nil ) {
return;
}
switch (result.notiType) {
case HaiBaoJuheSDKNotificationInitSDK:
{
NSLog(@"收到HaiBaoJuheSDKNotificationInitSDK");
}
break;
case HaiBaoJuheSDKNotificationLogin:
{
NSLog(@"result state:%d",result.statusCode);
if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
NSLog(@"userType:%@",[loginInfo userType]);
}else{
NSLog(@"%@",[result description]);
}
}
break;
case HaiBaoJuheSDKNotificationGzyazf:
{
NSLog(@"收到登陆信息HaiBaoJuheSDKNotificationPay");
}
break;
default:
break;
}
}
@end
//
// main.m
// Demo
//
// Created by winFan on 12/9/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
No preview for this file type
//
// DemoTests.m
// DemoTests
//
// Created by winFan on 12/9/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
@interface DemoTests : XCTestCase
@end
@implementation DemoTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.mango.ios.fytx.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
No preview for this file type
#import <UIKit/UIKit.h>
@interface HNYouaiIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* HNYouaiDingDanHao;
@property(nonatomic,strong) NSDictionary* HNYouaiHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* HNYouaiHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *HNYouaiHuoWuLieBiaoView;
- (void)HNYouaiHuaQianView:(UIViewController*)controller HNYouaiHuoWuD:(NSString*)products HNYouaiQian:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*)DingDanHao;
@end
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface HNYouaiAllManager : NSObject
{
NSString* HNYouaiAPPID_;
NSString* HNYouaiAPPKEY_;
NSString* HNYouaiInviterCode_;
}
@property bool HNYouaiGeiWoHuaQianBa;
+ (HNYouaiAllManager *)HNYouaiInstance;
- (void)HNYouaiChuShiHua;
- (void)HNYouaiDengLu:(NSString *)HNYouaiAPPID : (NSString *)HNYouaiAPPKEY : (UIViewController *)controller;
- (void)HNYouaiYangShi:(NSString*)HNYouaiLeiXing;
- (void)HNYouaiQuery: (NSString *)HNYouaiFuWuQiID : (NSString *)HNYouaiNickName : (NSNumber *)HNYouaiAmount : (NSString *)HNYouaiCallBack : (UIViewController *)controller : (NSString *)HNYouaiServerName;
- (void)HNYouaiQueryOperation:(UIViewController*)controll HNYouaiHuoWuID:(NSString*)products HNYouaiJiaGe:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const HNYouaiExitNotification;
extern NSString * const HNYouaiLoginNotification;
extern NSString * const HNYouaiErrorNotification;
@interface HNYouaiHuiTiaoNotification : NSObject
@end
#import <Foundation/Foundation.h>
@interface HNYouaiInformation : NSObject
{
//
NSString *openId;
NSString *token;
NSString *timestamp;
}
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (HNYouaiInformation *)getInstance;
@end
#import <Foundation/Foundation.h>
@interface HNYouaiInformationJM : NSObject
+(NSString *)HNYouaiJM:(NSString *)jm;
@end
#import <UIKit/UIKit.h>
@interface HNYouaiLocation : NSObject
+ (NSString *)HNYouaiSKCloudServiceSetupOptionsKey;
@end
#import <UIKit/UIKit.h>
#import "HNYouaiInformation.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface HNYouaiMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webView_;
UIActivityIndicatorView *activityIndicator;
}
@property(assign) BOOL HNYouaiYouYuanJiao;
- (void)HNYouaiSettingCKAssetsView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)HNYouaiChuShiHuaWebView;
- (void)loadWebPageWithString:(NSString *)url;
- (void)loadWebPageWithJs:(NSString *)content;
- (void)postNotification:(NSString *)name : (NSString *)code;
- (void)receiveIap:(NSNotification *)notification;
@end
//
// IAPHelper.h
//
// Original Created by Ray Wenderlich on 2/28/11.
// Created by saturngod on 7/9/12.
// Copyright 2011 Ray Wenderlich. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "StoreKit/StoreKit.h"
typedef void (^IAPProductsResponseBlock)(SKProductsRequest* request , SKProductsResponse* response);
typedef void (^IAPbuyProductCompleteResponseBlock)(SKPaymentTransaction* transcation);
typedef void (^checkReceiptCompleteResponseBlock)(NSString* response,NSError* error);
typedef void (^resoreProductsCompleteResponseBlock) (SKPaymentQueue* payment,NSError* error);
@interface IAPHelper : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver>
@property (nonatomic,strong) NSSet *productIdentifiers;
@property (nonatomic,strong) NSArray * products;
@property (nonatomic,strong) NSMutableSet *purchasedProducts;
@property (nonatomic,strong) SKProductsRequest *request;
@property (nonatomic) BOOL production;
//init With Product Identifiers
- (id)initWithProductIdentifiers:(NSSet *)productIdentifiers;
//get Products List
- (void)requestProductsWithCompletion:(IAPProductsResponseBlock)completion;
//Buy Product
- (void)buyProduct:(SKProduct *)productIdentifier onCompletion:(IAPbuyProductCompleteResponseBlock)completion;
//restore Products
- (void)restoreProductsWithCompletion:(resoreProductsCompleteResponseBlock)completion;
//check isPurchased or not
- (BOOL)isPurchasedProductsIdentifier:(NSString*)productID;
//check receipt but recommend to use in server side instead of using this function
- (void)checkReceipt:(NSData*)receiptData onCompletion:(checkReceiptCompleteResponseBlock)completion;
- (void)checkReceipt:(NSData*)receiptData AndSharedSecret:(NSString*)secretKey onCompletion:(checkReceiptCompleteResponseBlock)completion;
//saved purchased product
- (void)provideContentWithTransaction:(SKPaymentTransaction *)transaction;
- (void)provideContent:(NSString *)productIdentifier __deprecated_msg("use provideContentWithTransaction: instead.");
//clear the saved products
- (void)clearSavedPurchasedProducts;
- (void)clearSavedPurchasedProductByID:(NSString*)productIdentifier;
//Get The Price with local currency
- (NSString *)getLocalePrice:(SKProduct *)product;
@end
//
// IAPShare.h
// ;
//
// Created by Htain Lin Shwe on 10/7/12.
// Copyright (c) 2012 Edenpod. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IAPHelper.h"
@interface IAPShare : NSObject
@property (nonatomic,strong) IAPHelper *iap;
+ (IAPShare *) sharedHelper;
+(id)toJSON:(NSString*)json;
@end
//
// NSString+Base64.h
// Newsstand
//
// Created by Carlo Vigiani on 29/Oct/11.
// Copyright (c) 2011 viggiosoft. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Base64)
+ (NSString *) base64StringFromData:(NSData *)data length:(long)length;
@end
#import <Foundation/Foundation.h>
@interface NSURLRequest (SSL)
+(BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
+(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
@end
//
// SFHFKeychainUtils.h
//
// Created by Buzz Andersen on 10/20/08.
// Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone.
// Copyright 2008 Sci-Fi Hi-Fi. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface SFHFKeychainUtils : NSObject {
}
+ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
+ (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
@end
\ No newline at end of file
No preview for this file type
channelRootPath = "poolsdk_file"
gameProjName = 'Demo'
\ No newline at end of file
No preview for this file type
# Copyright 2012 Calvin Rien
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# A pbxproj file is an OpenStep format plist
# {} represents dictionary of key=value pairs delimited by ;
# () represents list of values delimited by ,
# file starts with a comment specifying the character type
# // !$*UTF8*$!
# when adding a file to a project, create the PBXFileReference
# add the PBXFileReference's guid to a group
# create a PBXBuildFile with the PBXFileReference's guid
# add the PBXBuildFile to the appropriate build phase
# when adding a header search path add
# HEADER_SEARCH_PATHS = "path/**";
# to each XCBuildConfiguration object
# Xcode4 will read either a OpenStep or XML plist.
# this script uses `plutil` to validate, read and write
# the pbxproj file. Plutil is available in OS X 10.2 and higher
# Plutil can't write OpenStep plists, so I save as XML
import datetime
import json
import ntpath
import os
import plistlib
import re
import shutil
import subprocess
import uuid
from UserDict import IterableUserDict
from UserList import UserList
regex = '[a-zA-Z0-9\\._/-]*'
class PBXEncoder(json.JSONEncoder):
def default(self, obj):
"""Tests the input object, obj, to encode as JSON."""
if isinstance(obj, (PBXList, PBXDict)):
return obj.data
return json.JSONEncoder.default(self, obj)
class PBXDict(IterableUserDict):
def __init__(self, d=None):
if d:
d = dict([(PBXType.Convert(k), PBXType.Convert(v)) for k, v in d.items()])
IterableUserDict.__init__(self, d)
def __setitem__(self, key, value):
IterableUserDict.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
def remove(self, key):
self.data.pop(PBXType.Convert(key), None)
class PBXList(UserList):
def __init__(self, l=None):
if isinstance(l, basestring):
UserList.__init__(self)
self.add(l)
return
elif l:
l = [PBXType.Convert(v) for v in l]
UserList.__init__(self, l)
def add(self, value):
value = PBXType.Convert(value)
if value in self.data:
return False
self.data.append(value)
return True
def remove(self, value):
value = PBXType.Convert(value)
if value in self.data:
self.data.remove(value)
return True
return False
def __setitem__(self, key, value):
UserList.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
class PBXType(PBXDict):
def __init__(self, d=None):
PBXDict.__init__(self, d)
if 'isa' not in self:
self['isa'] = self.__class__.__name__
self.id = None
@staticmethod
def Convert(o):
if isinstance(o, list):
return PBXList(o)
elif isinstance(o, dict):
isa = o.get('isa')
if not isa:
return PBXDict(o)
cls = globals().get(isa)
if cls and issubclass(cls, PBXType):
return cls(o)
print 'warning: unknown PBX type: %s' % isa
return PBXDict(o)
else:
return o
@staticmethod
def IsGuid(o):
return re.match('^[A-F0-9]{24}$', str(o))
@classmethod
def GenerateId(cls):
return ''.join(str(uuid.uuid4()).upper().split('-')[1:])
@classmethod
def Create(cls, *args, **kwargs):
return cls(*args, **kwargs)
class PBXFileReference(PBXType):
def __init__(self, d=None):
PBXType.__init__(self, d)
self.build_phase = None
types = {
'.a': ('archive.ar', 'PBXFrameworksBuildPhase'),
'.app': ('wrapper.application', None),
'.s': ('sourcecode.asm', 'PBXSourcesBuildPhase'),
'.c': ('sourcecode.c.c', 'PBXSourcesBuildPhase'),
'.cpp': ('sourcecode.cpp.cpp', 'PBXSourcesBuildPhase'),
'.framework': ('wrapper.framework', 'PBXFrameworksBuildPhase'),
'.h': ('sourcecode.c.h', None),
'.hpp': ('sourcecode.c.h', None),
'.d': ('sourcecode.dtrace', 'PBXSourcesBuildPhase'),
'.swift': ('sourcecode.swift', 'PBXSourcesBuildPhase'),
'.icns': ('image.icns', 'PBXResourcesBuildPhase'),
'.m': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
'.j': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
'.mm': ('sourcecode.cpp.objcpp', 'PBXSourcesBuildPhase'),
'.nib': ('wrapper.nib', 'PBXResourcesBuildPhase'),
'.plist': ('text.plist.xml', 'PBXResourcesBuildPhase'),
'.json': ('text.json', 'PBXResourcesBuildPhase'),
'.png': ('image.png', 'PBXResourcesBuildPhase'),
'.rtf': ('text.rtf', 'PBXResourcesBuildPhase'),
'.tiff': ('image.tiff', 'PBXResourcesBuildPhase'),
'.txt': ('text', 'PBXResourcesBuildPhase'),
'.xcodeproj': ('wrapper.pb-project', None),
'.xib': ('file.xib', 'PBXResourcesBuildPhase'),
'.strings': ('text.plist.strings', 'PBXResourcesBuildPhase'),
'.bundle': ('wrapper.plug-in', 'PBXResourcesBuildPhase'),
'.dylib': ('compiled.mach-o.dylib', 'PBXFrameworksBuildPhase'),
'.xcdatamodeld': ('wrapper.xcdatamodel', 'PBXSourcesBuildPhase'),
'.xcassets': ('folder.assetcatalog', 'PBXResourcesBuildPhase'),
'.tbd': ('sourcecode.text-based-dylib-definition', 'PBXFrameworksBuildPhase'),
}
trees = [
'<absolute>',
'<group>',
'BUILT_PRODUCTS_DIR',
'DEVELOPER_DIR',
'SDKROOT',
'SOURCE_ROOT',
]
def guess_file_type(self, ignore_unknown_type=False):
self.remove('explicitFileType')
self.remove('lastKnownFileType')
ext = os.path.splitext(self.get('name', ''))[1]
if os.path.isdir(self.get('path')) and ext not in XcodeProject.special_folders:
f_type = 'folder'
build_phase = None
ext = ''
else:
f_type, build_phase = PBXFileReference.types.get(ext, ('?', 'PBXResourcesBuildPhase'))
self['lastKnownFileType'] = f_type
self.build_phase = build_phase
if f_type == '?' and not ignore_unknown_type:
print 'unknown file extension: %s' % ext
print 'please add extension and Xcode type to PBXFileReference.types'
return f_type
def set_file_type(self, ft):
self.remove('explicitFileType')
self.remove('lastKnownFileType')
self['explicitFileType'] = ft
@classmethod
def Create(cls, os_path, tree='SOURCE_ROOT', ignore_unknown_type=False):
if tree not in cls.trees:
print 'Not a valid sourceTree type: %s' % tree
return None
fr = cls()
fr.id = cls.GenerateId()
fr['path'] = os_path
fr['name'] = os.path.split(os_path)[1]
fr['sourceTree'] = '<absolute>' if os.path.isabs(os_path) else tree
fr.guess_file_type(ignore_unknown_type=ignore_unknown_type)
return fr
class PBXBuildFile(PBXType):
def set_weak_link(self, weak=False):
k_settings = 'settings'
k_attributes = 'ATTRIBUTES'
s = self.get(k_settings)
if not s:
if weak:
self[k_settings] = PBXDict({k_attributes: PBXList(['Weak'])})
return True
atr = s.get(k_attributes)
if not atr:
if weak:
atr = PBXList()
else:
return False
if weak:
atr.add('Weak')
else:
atr.remove('Weak')
self[k_settings][k_attributes] = atr
return True
def add_compiler_flag(self, flag):
k_settings = 'settings'
k_attributes = 'COMPILER_FLAGS'
if k_settings not in self:
self[k_settings] = PBXDict()
if k_attributes not in self[k_settings]:
self[k_settings][k_attributes] = flag
return True
flags = self[k_settings][k_attributes].split(' ')
if flag in flags:
return False
flags.append(flag)
self[k_settings][k_attributes] = ' '.join(flags)
@classmethod
def Create(cls, file_ref, weak=False):
if isinstance(file_ref, PBXFileReference):
file_ref = file_ref.id
bf = cls()
bf.id = cls.GenerateId()
bf['fileRef'] = file_ref
if weak:
bf.set_weak_link(True)
return bf
class PBXGroup(PBXType):
def add_child(self, ref):
if not isinstance(ref, PBXDict):
return None
isa = ref.get('isa')
if isa != 'PBXFileReference' and isa != 'PBXGroup':
return None
if 'children' not in self:
self['children'] = PBXList()
self['children'].add(ref.id)
return ref.id
def remove_child(self, id):
if 'children' not in self:
self['children'] = PBXList()
return
if not PBXType.IsGuid(id):
id = id.id
self['children'].remove(id)
def has_child(self, id):
if 'children' not in self:
self['children'] = PBXList()
return False
if not PBXType.IsGuid(id):
id = id.id
return id in self['children']
def get_name(self):
path_name = os.path.split(self.get('path', ''))[1]
return self.get('name', path_name)
@classmethod
def Create(cls, name, path=None, tree='SOURCE_ROOT'):
grp = cls()
grp.id = cls.GenerateId()
grp['name'] = name
grp['children'] = PBXList()
if path:
grp['path'] = path
grp['sourceTree'] = tree
else:
grp['sourceTree'] = '<group>'
return grp
class PBXNativeTarget(PBXType):
pass
class PBXProject(PBXType):
pass
class PBXContainerItemProxy(PBXType):
pass
class PBXReferenceProxy(PBXType):
pass
class PBXVariantGroup(PBXType):
pass
class PBXTargetDependency(PBXType):
pass
class PBXAggregateTarget(PBXType):
pass
class PBXHeadersBuildPhase(PBXType):
pass
class XCVersionGroup(PBXType):
pass
class PBXBuildPhase(PBXType):
def add_build_file(self, bf):
if bf.get('isa') != 'PBXBuildFile':
return False
if 'files' not in self:
self['files'] = PBXList()
self['files'].add(bf.id)
return True
def remove_build_file(self, id):
if 'files' not in self:
self['files'] = PBXList()
return
self['files'].remove(id)
def has_build_file(self, id):
if 'files' not in self:
self['files'] = PBXList()
return False
if not PBXType.IsGuid(id):
id = id.id
return id in self['files']
class PBXFrameworksBuildPhase(PBXBuildPhase):
pass
class PBXResourcesBuildPhase(PBXBuildPhase):
pass
class PBXShellScriptBuildPhase(PBXBuildPhase):
@classmethod
def Create(cls, script, shell="/bin/sh", files=[], input_paths=[], output_paths=[], show_in_log = '0'):
bf = cls()
bf.id = cls.GenerateId()
bf['files'] = files
bf['inputPaths'] = input_paths
bf['outputPaths'] = output_paths
bf['runOnlyForDeploymentPostprocessing'] = '0';
bf['shellPath'] = shell
bf['shellScript'] = script
bf['showEnvVarsInLog'] = show_in_log
return bf
class PBXSourcesBuildPhase(PBXBuildPhase):
pass
class PBXCopyFilesBuildPhase(PBXBuildPhase):
pass
class XCBuildConfiguration(PBXType):
def add_search_paths(self, paths, base, key, recursive=True, escape=True):
modified = False
if not isinstance(paths, list):
paths = [paths]
if base not in self:
self[base] = PBXDict()
for path in paths:
if recursive and not path.endswith('/**'):
path = os.path.join(path, '**')
if key not in self[base]:
self[base][key] = PBXList()
elif isinstance(self[base][key], basestring):
self[base][key] = PBXList(self[base][key])
if path == '$(inherited)':
escape = False
if escape:
if self[base][key].add('"%s"' % path): # '\\"%s\\"' % path
modified = True
else:
if self[base][key].add(path): # '\\"%s\\"' % path
modified = True
return modified
def add_header_search_paths(self, paths, recursive=True):
return self.add_search_paths(paths, 'buildSettings', 'HEADER_SEARCH_PATHS', recursive=recursive)
def add_library_search_paths(self, paths, recursive=True):
return self.add_search_paths(paths, 'buildSettings', 'LIBRARY_SEARCH_PATHS', recursive=recursive)
def add_framework_search_paths(self, paths, recursive=True):
return self.add_search_paths(paths, 'buildSettings', 'FRAMEWORK_SEARCH_PATHS', recursive=recursive)
def add_other_cflags(self, flags):
return self.add_flag('OTHER_CFLAGS', flags)
def add_other_ldflags(self, flags):
return self.add_flag('OTHER_LDFLAGS', flags)
def add_flag(self, key, flags):
modified = False
base = 'buildSettings'
if isinstance(flags, basestring):
flags = PBXList(flags)
if base not in self:
self[base] = PBXDict()
for flag in flags:
if key not in self[base]:
self[base][key] = PBXList()
elif isinstance(self[base][key], basestring):
self[base][key] = PBXList(self[base][key])
if self[base][key].add(flag):
self[base][key] = [e for e in self[base][key] if e]
modified = True
return modified
def remove_flag(self, key, flags):
modified = False
base = 'buildSettings'
if isinstance(flags, basestring):
flags = PBXList(flags)
if base in self: # there are flags, so we can "remove" something
for flag in flags:
if key not in self[base]:
return False
elif isinstance(self[base][key], basestring):
self[base][key] = PBXList(self[base][key])
if self[base][key].remove(flag):
self[base][key] = [e for e in self[base][key] if e]
modified = True
if len(self[base][key]) == 0:
self[base].pop(key, None)
return modified
def remove_other_ldflags(self, flags):
return self.remove_flag('OTHER_LD_FLAGS', flags)
# Set a single-valued flag under buildSettings
def add_single_valued_flag(self, flag, value):
modified = False
base = 'buildSettings'
key = flag
if not self.has_key(base):
self[base] = PBXDict()
if self[base].has_key(key):
if self[base][key] == value:
return False
self[base][key] = value
modified = True
return modified
# Remove a single-valued flag under buildSettings
def remove_single_valued_flag(self, flag):
modified = False
base = 'buildSettings'
key = flag
if self.has_key(base) and self[base].has_key(key):
self[base].pop(key, None)
modified = True
return modified
class XCConfigurationList(PBXType):
pass
class XcodeProject(PBXDict):
plutil_path = 'plutil'
special_folders = ['.bundle', '.framework', '.xcodeproj', '.xcassets', '.xcdatamodeld']
def __init__(self, d=None, path=None):
if not path:
path = os.path.join(os.getcwd(), 'project.pbxproj')
self.pbxproj_path = os.path.abspath(path)
self.source_root = os.path.abspath(os.path.join(os.path.split(path)[0], '..'))
IterableUserDict.__init__(self, d)
self.data = PBXDict(self.data)
self.objects = self.get('objects')
self.modified = False
root_id = self.get('rootObject')
if root_id:
self.root_object = self.objects[root_id]
root_group_id = self.root_object.get('mainGroup')
self.root_group = self.objects[root_group_id]
else:
print "error: project has no root object"
self.root_object = None
self.root_group = None
for k, v in self.objects.iteritems():
v.id = k
def add_other_cflags(self, flags):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_other_cflags(flags):
self.modified = True
def add_other_ldflags(self, flags):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_other_ldflags(flags):
self.modified = True
def remove_other_ldflags(self, flags):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.remove_other_ldflags(flags):
self.modified = True
def add_header_search_paths(self, paths, recursive=True):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_header_search_paths(paths, recursive):
self.modified = True
def add_framework_search_paths(self, paths, recursive=True):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_framework_search_paths(paths, recursive):
self.modified = True
def add_library_search_paths(self, paths, recursive=True):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_library_search_paths(paths, recursive):
self.modified = True
def add_flags(self, pairs, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
# iterate over all the pairs of configurations
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
for k in pairs:
if b.add_flag(k, pairs[k]):
self.modified = True
def remove_flags(self, pairs, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
# iterate over all the pairs of configurations
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
for k in pairs:
if b.remove_flag(k, pairs[k]):
self.modified = True
# Set a single-valued flag (whereas add_flags adds a flag to a list of flags with a given key)
def add_single_valued_flag(self, flag, value, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
if b.add_single_valued_flag(flag, value):
self.modified = True
# Remove a single-valued flag (whereas remove_flags deletes a flag from a list of flags with a given key)
def remove_single_valued_flag(self, flag, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
if b.remove_single_valued_flag(flag):
self.modified = True
def get_obj(self, id):
return self.objects.get(id)
def get_ids(self):
return self.objects.keys()
def get_files_by_os_path(self, os_path, tree='SOURCE_ROOT'):
files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
and f.get('path') == os_path
and f.get('sourceTree') == tree]
return files
def get_files_by_name(self, name, parent=None):
if parent:
files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
and f.get('name') == name
and parent.has_child(f)]
else:
files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
and f.get('name') == name]
return files
def get_keys_for_files_by_name(self, name):
keys = [key for key in self.objects if self.objects.data[key].get('name') == name
and self.objects.data[key].get('isa') == 'PBXFileReference']
return keys
def get_build_files(self, id):
files = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile'
and f.get('fileRef') == id]
return files
def get_groups_by_name(self, name, parent=None):
if parent:
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
and g.get_name() == name
and parent.has_child(g)]
else:
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
and g.get_name() == name]
return groups
def get_or_create_group(self, name, path=None, parent=None):
if not name:
return None
if not parent:
parent = self.root_group
elif not isinstance(parent, PBXGroup):
# assume it's an id
parent = self.objects.get(parent, self.root_group)
groups = self.get_groups_by_name(name)
for grp in groups:
if parent.has_child(grp.id):
return grp
grp = PBXGroup.Create(name, path)
parent.add_child(grp)
self.objects[grp.id] = grp
self.modified = True
return grp
def get_groups_by_os_path(self, path):
path = os.path.abspath(path)
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
and os.path.abspath(g.get('path', '/dev/null')) == path]
return groups
def get_build_phases(self, phase_name):
phases = [p for p in self.objects.values() if p.get('isa') == phase_name]
return phases
def get_target_by_name(self, name):
targets = self.get_build_phases('PBXNativeTarget')
target = None
for t in targets:
if t.get("name") == name:
target = t
break
return target
def get_relative_path(self, os_path):
return os.path.relpath(os_path, self.source_root)
def verify_files(self, file_list, parent=None):
# returns list of files not in the current project.
if not file_list:
return []
if parent:
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)]
else:
exists_list = [f.get('name') for f in self.objects.values() if f.get('isa') == 'PBXFileReference' and f.get('name') in file_list]
return set(file_list).difference(exists_list)
def add_run_script(self, target, script=None, insert_before_compile=False):
result = []
targets = [t for t in self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget') if t.get('name') == target]
if len(targets) != 0 :
script_phase = PBXShellScriptBuildPhase.Create(script)
for t in targets:
skip = False
for buildPhase in t['buildPhases']:
if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
skip = True
if not skip:
if insert_before_compile:
t['buildPhases'].insert(0, script_phase.id)
else:
t['buildPhases'].add(script_phase.id)
self.objects[script_phase.id] = script_phase
result.append(script_phase)
return result
def add_run_script_all_targets(self, script=None):
result = []
targets = self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget')
if len(targets) != 0 :
script_phase = PBXShellScriptBuildPhase.Create(script)
for t in targets:
skip = False
for buildPhase in t['buildPhases']:
if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
skip = True
if not skip:
t['buildPhases'].add(script_phase.id)
self.objects[script_phase.id] = script_phase
result.append(script_phase)
return result
def add_folder(self, os_path, parent=None, excludes=None, recursive=True, create_build_files=True):
if not os.path.isdir(os_path):
return []
if not excludes:
excludes = []
results = []
if not parent:
parent = self.root_group
elif not isinstance(parent, PBXGroup):
# assume it's an id
parent = self.objects.get(parent, self.root_group)
path_dict = {os.path.split(os_path)[0]: parent}
special_list = []
for (grp_path, subdirs, files) in os.walk(os_path):
parent_folder, folder_name = os.path.split(grp_path)
parent = path_dict.get(parent_folder, parent)
if [sp for sp in special_list if parent_folder.startswith(sp)]:
continue
if folder_name.startswith('.'):
special_list.append(grp_path)
continue
if os.path.splitext(grp_path)[1] in XcodeProject.special_folders:
# if this file has a special extension (bundle or framework mainly) treat it as a file
special_list.append(grp_path)
new_files = self.verify_files([folder_name], parent=parent)
# Ignore this file if it is in excludes
if new_files and not [m for m in excludes if re.match(m, grp_path)]:
results.extend(self.add_file(grp_path, parent, create_build_files=create_build_files))
continue
# create group
grp = self.get_or_create_group(folder_name, path=self.get_relative_path(grp_path), parent=parent)
path_dict[grp_path] = grp
results.append(grp)
file_dict = {}
for f in files:
if f[0] == '.' or [m for m in excludes if re.match(m, f)]:
continue
kwds = {
'create_build_files': create_build_files,
'parent': grp,
'name': f
}
f_path = os.path.join(grp_path, f)
file_dict[f_path] = kwds
new_files = self.verify_files([n.get('name') for n in file_dict.values()], parent=grp)
add_files = [(k, v) for k, v in file_dict.items() if v.get('name') in new_files]
for path, kwds in add_files:
kwds.pop('name', None)
self.add_file(path, **kwds)
if not recursive:
break
for r in results:
self.objects[r.id] = r
return results
def path_leaf(self, path):
head, tail = ntpath.split(path)
return tail or ntpath.basename(head)
def add_file_if_doesnt_exist(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False):
for obj in self.objects.values():
if 'path' in obj:
if self.path_leaf(f_path) == self.path_leaf(obj.get('path')):
return []
return self.add_file(f_path, parent, tree, create_build_files, weak, ignore_unknown_type=ignore_unknown_type)
def add_file(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False, target=None):
results = []
abs_path = ''
if os.path.isabs(f_path):
abs_path = f_path
if not os.path.exists(f_path):
return results
elif tree == 'SOURCE_ROOT':
f_path = os.path.relpath(f_path, self.source_root)
else:
tree = '<absolute>'
if not parent:
parent = self.root_group
elif not isinstance(parent, PBXGroup):
# assume it's an id
parent = self.objects.get(parent, self.root_group)
file_ref = PBXFileReference.Create(f_path, tree, ignore_unknown_type=ignore_unknown_type)
parent.add_child(file_ref)
results.append(file_ref)
# create a build file for the file ref
if file_ref.build_phase and create_build_files:
phases = self.get_build_phases(file_ref.build_phase)
if target:
target = self.get_target_by_name(target)
for phase in phases:
if (not target) or (phase.id in target.get('buildPhases')):
build_file = PBXBuildFile.Create(file_ref, weak=weak)
phase.add_build_file(build_file)
results.append(build_file)
if abs_path and tree == 'SOURCE_ROOT' \
and os.path.isfile(abs_path) \
and file_ref.build_phase == 'PBXFrameworksBuildPhase':
library_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
self.add_library_search_paths([library_path], recursive=False)
if abs_path and tree == 'SOURCE_ROOT' \
and not os.path.isfile(abs_path) \
and file_ref.build_phase == 'PBXFrameworksBuildPhase':
framework_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
self.add_framework_search_paths([framework_path, '$(inherited)'], recursive=False)
for r in results:
self.objects[r.id] = r
if results:
self.modified = True
return results
def check_and_repair_framework(self, base):
name = os.path.basename(base)
if ".framework" in name:
basename = name[:-len(".framework")]
finalHeaders = os.path.join(base, "Headers")
finalCurrent = os.path.join(base, "Versions/Current")
finalLib = os.path.join(base, basename)
srcHeaders = "Versions/A/Headers"
srcCurrent = "A"
srcLib = "Versions/A/" + basename
if not os.path.exists(finalHeaders):
os.symlink(srcHeaders, finalHeaders)
if not os.path.exists(finalCurrent):
os.symlink(srcCurrent, finalCurrent)
if not os.path.exists(finalLib):
os.symlink(srcLib, finalLib)
def get_file_id_by_path(self, f_path):
for k, v in self.objects.iteritems():
if str(v.get('path')) == f_path:
return k
return 0
def remove_file_by_path(self, f_path, recursive=True):
id = self.get_file_id_by_path(f_path)
if id != 0:
self.remove_file(id, recursive=recursive)
return
def remove_file(self, id, recursive=True):
if not PBXType.IsGuid(id):
id = id.id
if id in self.objects:
self.objects.remove(id)
# Remove from PBXResourcesBuildPhase and PBXSourcesBuildPhase if necessary
buildFiles = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile']
for buildFile in buildFiles:
if id == buildFile.get('fileRef'):
key = buildFile.id
PBXRBP = [f for f in self.objects.values() if f.get('isa') == 'PBXResourcesBuildPhase']
PBXSBP = [f for f in self.objects.values() if f.get('isa') == 'PBXSourcesBuildPhase']
self.objects.remove(key)
if len(PBXSBP) and PBXSBP[0].has_build_file(key):
PBXSBP[0].remove_build_file(key)
if len(PBXRBP) and PBXRBP[0].has_build_file(key):
PBXRBP[0].remove_build_file(key)
if recursive:
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup']
for group in groups:
if id in group['children']:
group.remove_child(id)
self.modified = True
def remove_group(self, id, recursive = True):
if not PBXType.IsGuid(id):
id = id.id
name = self.objects.get(id).get('path')
children = self.objects.get(id).get('children')
if name is None:
name = id
if id in self.objects:
if recursive:
for childKey in children:
childValue = self.objects.get(childKey)
if childValue.get('isa') == 'PBXGroup':
self.remove_group(childKey, True)
else:
self.remove_file(childKey, False)
self.objects.remove(id);
def remove_group_by_name(self, name, recursive = True):
groups = self.get_groups_by_name(name)
if len(groups):
for group in groups:
self.remove_group(group.id, recursive)
def move_file(self, id, dest_grp=None):
pass
def apply_patch(self, patch_path, xcode_path):
if not os.path.isfile(patch_path) or not os.path.isdir(xcode_path):
print 'ERROR: couldn\'t apply "%s" to "%s"' % (patch_path, xcode_path)
return
print 'applying "%s" to "%s"' % (patch_path, xcode_path)
return subprocess.call(['patch', '-p1', '--forward', '--directory=%s' % xcode_path, '--input=%s' % patch_path])
def apply_mods(self, mod_dict, default_path=None):
if not default_path:
default_path = os.getcwd()
keys = mod_dict.keys()
for k in keys:
v = mod_dict.pop(k)
mod_dict[k.lower()] = v
parent = mod_dict.pop('group', None)
if parent:
parent = self.get_or_create_group(parent)
excludes = mod_dict.pop('excludes', [])
if excludes:
excludes = [re.compile(e) for e in excludes]
compiler_flags = mod_dict.pop('compiler_flags', {})
for k, v in mod_dict.items():
if k == 'patches':
for p in v:
if not os.path.isabs(p):
p = os.path.join(default_path, p)
self.apply_patch(p, self.source_root)
elif k == 'folders':
# get and compile excludes list
# do each folder individually
for folder in v:
kwds = {}
# if path contains ':' remove it and set recursive to False
if ':' in folder:
args = folder.split(':')
kwds['recursive'] = False
folder = args.pop(0)
if os.path.isabs(folder) and os.path.isdir(folder):
pass
else:
folder = os.path.join(default_path, folder)
if not os.path.isdir(folder):
continue
if parent:
kwds['parent'] = parent
if excludes:
kwds['excludes'] = excludes
self.add_folder(folder, **kwds)
elif k == 'headerpaths' or k == 'librarypaths':
paths = []
for p in v:
if p.endswith('/**'):
p = os.path.split(p)[0]
if not os.path.isabs(p):
p = os.path.join(default_path, p)
if not os.path.exists(p):
continue
p = self.get_relative_path(p)
paths.append(os.path.join('$(SRCROOT)', p, "**"))
if k == 'headerpaths':
self.add_header_search_paths(paths)
else:
self.add_library_search_paths(paths)
elif k == 'other_cflags':
self.add_other_cflags(v)
elif k == 'other_ldflags':
self.add_other_ldflags(v)
elif k == 'libs' or k == 'frameworks' or k == 'files':
paths = {}
for p in v:
kwds = {}
if ':' in p:
args = p.split(':')
p = args.pop(0)
if 'weak' in args:
kwds['weak'] = True
file_path = os.path.join(default_path, p)
search_path, file_name = os.path.split(file_path)
if [m for m in excludes if re.match(m, file_name)]:
continue
try:
expr = re.compile(file_name)
except re.error:
expr = None
if expr and os.path.isdir(search_path):
file_list = os.listdir(search_path)
for f in file_list:
if [m for m in excludes if re.match(m, f)]:
continue
if re.search(expr, f):
kwds['name'] = f
paths[os.path.join(search_path, f)] = kwds
p = None
if k == 'libs':
kwds['parent'] = self.get_or_create_group('Libraries', parent=parent)
elif k == 'frameworks':
kwds['parent'] = self.get_or_create_group('Frameworks', parent=parent)
if p:
kwds['name'] = file_name
if k == 'libs':
p = os.path.join('usr', 'lib', p)
kwds['tree'] = 'SDKROOT'
elif k == 'frameworks':
p = os.path.join('System', 'Library', 'Frameworks', p)
kwds['tree'] = 'SDKROOT'
elif k == 'files' and not os.path.exists(file_path):
# don't add non-existent files to the project.
continue
paths[p] = kwds
new_files = self.verify_files([n.get('name') for n in paths.values()])
add_files = [(k, v) for k, v in paths.items() if v.get('name') in new_files]
for path, kwds in add_files:
kwds.pop('name', None)
if 'parent' not in kwds and parent:
kwds['parent'] = parent
self.add_file(path, **kwds)
if compiler_flags:
for k, v in compiler_flags.items():
filerefs = []
for f in v:
filerefs.extend([fr.id for fr in self.objects.values() if fr.get('isa') == 'PBXFileReference'
and fr.get('name') == f])
buildfiles = [bf for bf in self.objects.values() if bf.get('isa') == 'PBXBuildFile'
and bf.get('fileRef') in filerefs]
for bf in buildfiles:
if bf.add_compiler_flag(k):
self.modified = True
def backup(self, file_name=None, backup_name=None):
if not file_name:
file_name = self.pbxproj_path
if not backup_name:
backup_name = "%s.%s.backup" % (file_name, datetime.datetime.now().strftime('%d%m%y-%H%M%S'))
shutil.copy2(file_name, backup_name)
return backup_name
def save(self, file_name=None, old_format=False, sort=False):
if old_format :
self.save_format_xml(file_name)
else:
self.save_new_format(file_name, sort)
def save_format_xml(self, file_name=None):
"""Saves in old (xml) format"""
if not file_name:
file_name = self.pbxproj_path
# This code is adapted from plistlib.writePlist
with open(file_name, "w") as f:
writer = PBXWriter(f)
writer.writeln("<plist version=\"1.0\">")
writer.writeValue(self.data)
writer.writeln("</plist>")
def save_new_format(self, file_name=None, sort=False):
"""Save in Xcode 3.2 compatible (new) format"""
if not file_name:
file_name = self.pbxproj_path
# process to get the section's info and names
objs = self.data.get('objects')
sections = dict()
uuids = dict()
for key in objs:
l = list()
if objs.get(key).get('isa') in sections:
l = sections.get(objs.get(key).get('isa'))
l.append(tuple([key, objs.get(key)]))
sections[objs.get(key).get('isa')] = l
if 'name' in objs.get(key):
uuids[key] = objs.get(key).get('name')
elif 'path' in objs.get(key):
uuids[key] = objs.get(key).get('path')
else:
if objs.get(key).get('isa') == 'PBXProject':
uuids[objs.get(key).get('buildConfigurationList')] = 'Build configuration list for PBXProject "Unity-iPhone"'
elif objs.get(key).get('isa')[0:3] == 'PBX':
uuids[key] = objs.get(key).get('isa')[3:-10]
else:
uuids[key] = 'Build configuration list for PBXNativeTarget "TARGET_NAME"'
ro = self.data.get('rootObject')
uuids[ro] = 'Project object'
for key in objs:
# transitive references (used in the BuildFile section)
if 'fileRef' in objs.get(key) and objs.get(key).get('fileRef') in uuids:
uuids[key] = uuids[objs.get(key).get('fileRef')]
# transitive reference to the target name (used in the Native target section)
if objs.get(key).get('isa') == 'PBXNativeTarget':
uuids[objs.get(key).get('buildConfigurationList')] = uuids[objs.get(key).get('buildConfigurationList')].replace('TARGET_NAME', uuids[key])
self.uuids = uuids
self.sections = sections
out = open(file_name, 'w')
out.write('// !$*UTF8*$!\n')
self._printNewXCodeFormat(out, self.data, '', enters=True, sort=sort)
out.close()
@classmethod
def addslashes(cls, s):
d = {'"': '\\"', "'": "\\'", "\0": "\\\0", "\\": "\\\\", "\n":"\\n"}
return ''.join(d.get(c, c) for c in s)
def _printNewXCodeFormat(self, out, root, deep, enters=True, sort=False):
if isinstance(root, IterableUserDict):
out.write('{')
if enters:
out.write('\n')
isa = root.pop('isa', '')
if isa != '': # keep the isa in the first spot
if enters:
out.write('\t' + deep)
out.write('isa = ')
self._printNewXCodeFormat(out, isa, '\t' + deep, enters=enters)
out.write(';')
if enters:
out.write('\n')
else:
out.write(' ')
for key in sorted(root.iterkeys()): # keep the same order as Apple.
if enters:
out.write('\t' + deep)
if re.match(regex, key).group(0) == key:
out.write(key.encode("utf-8") + ' = ')
else:
out.write('"' + key.encode("utf-8") + '" = ')
if key == 'objects':
out.write('{') # open the objects section
if enters:
out.write('\n')
#root.remove('objects') # remove it to avoid problems
sections = [
('PBXBuildFile', False),
('PBXCopyFilesBuildPhase', True),
('PBXFileReference', False),
('PBXFrameworksBuildPhase', True),
('PBXGroup', True),
('PBXAggregateTarget', True),
('PBXNativeTarget', True),
('PBXProject', True),
('PBXResourcesBuildPhase', True),
('PBXShellScriptBuildPhase', True),
('PBXSourcesBuildPhase', True),
('XCBuildConfiguration', True),
('XCConfigurationList', True),
('PBXTargetDependency', True),
('PBXVariantGroup', True),
('PBXReferenceProxy', True),
('PBXContainerItemProxy', True),
('XCVersionGroup', True)]
for section in sections: # iterate over the sections
if self.sections.get(section[0]) is None:
continue
out.write('\n/* Begin %s section */' % section[0].encode("utf-8"))
self.sections.get(section[0]).sort(cmp=lambda x, y: cmp(x[0], y[0]))
if sort and section[0] == 'PBXGroup':
for entry in self.sections.get(section[0]):
entry[1]['children'] = sorted(entry[1]['children'],
key=lambda x: self.uuids[x].encode("utf-8"))
for pair in self.sections.get(section[0]):
key = pair[0]
value = pair[1]
out.write('\n')
if enters:
out.write('\t\t' + deep)
out.write(key.encode("utf-8"))
if key in self.uuids:
out.write(" /* " + self.uuids[key].encode("utf-8") + " */")
out.write(" = ")
self._printNewXCodeFormat(out, value, '\t\t' + deep, enters=section[1])
out.write(';')
out.write('\n/* End %s section */\n' % section[0].encode("utf-8"))
out.write(deep + '\t}') # close of the objects section
else:
self._printNewXCodeFormat(out, root[key], '\t' + deep, enters=enters)
out.write(';')
if enters:
out.write('\n')
else:
out.write(' ')
root['isa'] = isa # restore the isa for further calls
if enters:
out.write(deep)
out.write('}')
elif isinstance(root, UserList):
out.write('(')
if enters:
out.write('\n')
for value in root:
if enters:
out.write('\t' + deep)
self._printNewXCodeFormat(out, value, '\t' + deep, enters=enters)
out.write(',')
if enters:
out.write('\n')
if enters:
out.write(deep)
out.write(')')
else:
if len(root) > 0 and re.match(regex, root).group(0) == root:
out.write(root.encode("utf-8"))
else:
out.write('"' + XcodeProject.addslashes(root.encode("utf-8")) + '"')
if root in self.uuids:
out.write(" /* " + self.uuids[root].encode("utf-8") + " */")
@classmethod
def Load(cls, path, pure_python=False):
if pure_python:
import openstep_parser as osp
tree = osp.OpenStepDecoder.ParseFromFile(open(path, 'r'))
else:
cls.plutil_path = os.path.join(os.path.split(__file__)[0], 'plutil')
if not os.path.isfile(XcodeProject.plutil_path):
cls.plutil_path = 'plutil'
# load project by converting to xml and then convert that using plistlib
p = subprocess.Popen([XcodeProject.plutil_path, '-convert', 'xml1', '-o', '-', path], stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
# If the plist was malformed, return code will be non-zero
if p.returncode != 0:
print stdout
return None
tree = plistlib.readPlistFromString(stdout)
return XcodeProject(tree, path)
@classmethod
def LoadFromXML(cls, path):
tree = plistlib.readPlist(path)
return XcodeProject(tree, path)
# The code below was adapted from plistlib.py.
class PBXWriter(plistlib.PlistWriter):
def writeValue(self, value):
if isinstance(value, (PBXList, PBXDict)):
plistlib.PlistWriter.writeValue(self, value.data)
else:
plistlib.PlistWriter.writeValue(self, value)
def simpleElement(self, element, value=None):
"""
We have to override this method to deal with Unicode text correctly.
Non-ascii characters have to get encoded as character references.
"""
if value is not None:
value = _escapeAndEncode(value)
self.writeln("<%s>%s</%s>" % (element, value, element))
else:
self.writeln("<%s/>" % element)
# Regex to find any control chars, except for \t \n and \r
_controlCharPat = re.compile(
r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"
r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
def _escapeAndEncode(text):
m = _controlCharPat.search(text)
if m is not None:
raise ValueError("strings can't contains control characters; "
"use plistlib.Data instead")
text = text.replace("\r\n", "\n") # convert DOS line endings
text = text.replace("\r", "\n") # convert Mac line endings
text = text.replace("&", "&amp;") # escape '&'
text = text.replace("<", "&lt;") # escape '<'
text = text.replace(">", "&gt;") # escape '>'
return text.encode("ascii", "xmlcharrefreplace") # encode as ascii with xml character references
No preview for this file type
import os
import commands
buildProjName = ''
targetName = ''
import shutil
import os
def buildProj():
if buildProjName == '':
print('buildProjName is not define')
else:
#build project
print('start build proj')
commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj')
releaseDir = os.path.abspath('.') + '/Release'
if not os.path.exists(releaseDir):
os.mkdir(releaseDir)
ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa'
buildPath = os.path.abspath('.') + '/build'
if os.path.exists(ipaPath):
os.remove(ipaPath)
resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath)
#print(resultStr)
if os.path.exists(buildPath):
shutil.rmtree(buildPath)
No preview for this file type
No preview for this file type
No preview for this file type
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>海豹DEMO</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.408</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sdk.uuufish.com</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
@interface SDKInterface : Interface
@end
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "HNYouai/HNYouaiAllManager.h"
#import "HNYouai/HNYouaiHuiTiaoNotification.h"
#import "HNYouai/HNYouaiInformation.h"
#import "TrackingIO.h"
@implementation SDKInterface : Interface
int mExchange;
NSString *HNYouaiAppId;
NSString *HNYouaiAppKey;
- (void)SDKinit:(UIViewController *) control
{
[super SDKinit:control];
[HaiBaoJuheConfig getInstance];
[[HNYouaiAllManager HNYouaiInstance]HNYouaiChuShiHua];
[[HNYouaiAllManager HNYouaiInstance]HNYouaiYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:HNYouaiLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"HNYouaiToolCallBack" object:nil];
[[HaiBaoJuheChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
if(channelId == nil || [channelId length] <= 0){
channelId = @"unknown";
}
[TrackingIO initWithappKey:[[HaiBaoJuheConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
}
/**
登录SDK
*/
- (void)SDKloginSDK
{
//APPID APPKEY
HNYouaiAppId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_ID"];
HNYouaiAppKey =[[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_KEY"];
[[HNYouaiAllManager HNYouaiInstance]HNYouaiDengLu:HNYouaiAppId :HNYouaiAppKey :self.controller];
}
/**
loginCheck
*/
- (void)receiveLoginMessage:(NSNotification *)notification
{
NSLog(@"loginchek");
HaiBaoJuheLoginInfo *loginInfo = [HaiBaoJuheLoginInfo alloc];
loginInfo.openId = [[HNYouaiInformation getInstance]openId];
loginInfo.sign = [[HNYouaiInformation getInstance] token];
loginInfo.timestamp = [[HNYouaiInformation getInstance] timestamp];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[HaiBaoJuheChecker getInstance] startCheck:loginInfo];
});
}
-(NSString*)DataTojsonString:(id)object
{
NSString *jsonString = nil;
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
error:&error];
jsonString = [jsonData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
return jsonString;
}
/**
苹果支付结果回调
*/
- (void)HCKAssetsToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"HNYouaiToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
}else{//失败
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"];
NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10];
if (queryIdArray) {
}else{
queryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
}
for (NSString* arrayQueryId in queryIdArray) {
[tempQueryIdArray addObject:arrayQueryId];
}
[tempQueryIdArray addObject:queryId];
[userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
[userDefaults setObject:receiptStr forKey:queryId];
[userDefaults synchronize];
}
}
/**
支付 创建订单
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)payInfo
{
mExchange = [payInfo exchange].intValue;
[super SDKgzyazfWithGzyazfmentInfo:payInfo];
}
/**
SDK
*/
- (void)SDKgotoUserCenter
{
}
- (void)SDKreport:(HaiBaoJuheReportInfo *)reportInfo
{
NSLog(@"reportInfo");
NSString* reportType = [reportInfo reportType];
if (reportInfo) {
if ([reportType isEqualToString:REPORT_ENTER]) {
[TrackingIO setLoginWithAccountID:[reportInfo playerId]];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
}else if ([reportType isEqualToString:REPORT_CREATEROLE]){
[TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
}
}
}
/**
SDK
*/
- (void)SDKexitSDK
{
}
- (void)SDKlogoutSDK
{
NSLog(@"切换账号");
}
- (void)handleOpenurl:(NSURL *)url
{
}
- (void)receivePayMessage : (NSNotification *)notification;
{
NSString *order_id = [notification object];
NSLog(@"订单ID:%@", order_id);
}
//补单处理
- (void) handlerLeakOrder{
NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"];
NSLog(@"orderDic%@",queryIdArray);
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
if(queryIdArray){
for (NSString* queryId in queryIdArray) {
NSString* receiptStr = [userDefaults valueForKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
if([@"success" isEqualToString:result]){//成功
[userDefaults removeObjectForKey:queryId];
}else{//补单失败
[failQueryIdArray addObject:queryId];
}
}
if([failQueryIdArray count] > 0){//含有补单失败项
[userDefaults setObject:failQueryIdArray forKey:@"queryIds"];
}else{//全部补单成功
[userDefaults removeObjectForKey:@"queryIds"];
}
[userDefaults synchronize];
}
}
- (void)receiveCreateOrder:(NSNotification *)notification
{
NSLog(@"创建订单成功");
HaiBaoJuheGzyazfInfo *payInfo = [notification object];
NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
NSString *serverId = [payInfo serverId];
NSString *roleName = [payInfo playerName];
NSString *queryId = [payInfo queryId];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[HNYouaiAllManager HNYouaiInstance] HNYouaiQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
}else{
NSString* products = [payInfo products];
[[HNYouaiAllManager HNYouaiInstance] HNYouaiQueryOperation:self.controller HNYouaiHuoWuID:products HNYouaiJiaGe:[payInfo postAmount] HNYouaiHuoWuMing:[payInfo productName] HNYouaiDingDanHao:queryId];
}
}
-(void)paymentSuccess:(NSString *)accountId orderId:(NSString *)orderId currencyAmount:(double)amount currencyType:(NSString *)currencyType payType:(NSString *)payType custom:(NSArray *)customArray
{
[TrackingIO setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
}
@end
No preview for this file type
//
// NewTtack.h
// NewTtack
//
// Created by yun on 16/1/11.
// Copyright © 2016年 yun. All rights reserved.
//
#define TRACK_VERSION @"1.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*
热云移动广告效果监测 平台 api 请选择对应的api进行使用
*/
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
//开启打印日志 正式上线包请关掉
+(void) setPrintLog :(BOOL)print;
// 开启数据统计
+ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
//注册成功后调用
+ (void)setRegisterWithAccountID:(NSString *)account;
//登陆成功后调用
+ (void)setLoginWithAccountID:(NSString *)account;
//开始付费时 调用(人民币单位是元)
+(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
+(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
//自定义事件
+(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
//标准接口
+(void)setProfile:(NSDictionary *)dataDic;
//获取设备信息
+(NSString*)getDeviceId;
@end
NS_ASSUME_NONNULL_END
{"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"}
新接入请参考对接文档和demo<br>
曾接入公共SDK的快速更新海豹聚合SDK 2018年12月05日版本<br>
1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
2、``` 引入poolsdk_file文件夹中Sprite.framework ``` <br>
3、``` 替换SDKInterface.m文件 ``` <br>
4、``` 删除 PoolSdk.framework ``` <br>
5、``` 引入HaiBaoJuheSDK.framework ``` <br>
6、``` 原pool_setting文件 替换成新 haibao_setting文件 ``` <br>
7、``` 所有接口PoolSdk 替换成 HaiBaoJuheSDK(如不理解可以参考demo或者详细文档) ``` <br>
已更新 海豹聚合SDK 2018年12月05日版本 快速更新到 2019年01月25日版本方法<br>
1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
2、``` 引入poolsdk_file文件夹中Railway.framework ``` <br>
3、``` 替换SDKInterface.m文件 ``` <br>
4、``` 替换HaiBaoJuheSDK.framework ``` <br>
5、``` 原 URL Schemes 中的 i9133public 改为 sdk.uuufish.com (可参考demo中info设置) ``` <br>
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
# 公共SDK服务端接入文档
### 1.登录验证
客户端发送请求参数给服务端,服务端对参数进行 MD5 加密,如果加密结果和serverSign 一致,则验证通过,否则不通过
参数 | 类型 | 描述
------------ | ------------- | ------------
userType | int | 用户类型 ID(渠道类型,兼容以 前帐号体系)
openId | string | 平台渠道方返回用户ID
timestamp | string | 时间戳,公共SDK发送到客户端的参数timestamp, 服务端可以判断 timestamp 是否 在有效的登录时间内
serverSign | string | 验证密钥,公共 SDK 发送到 客户端的参数 serverSign,加密串:gameAppkey=%s&userType=% s&openId=%s&timestamp=%s注意:(改为游戏本身的gameAppkey值)
验证方式:
serverSign=MD5(gameAppkey=%s&userType=%s&openId=%s&timestamp=%s) 如:
md5("gameAppkey=xxxx&userType=1&openId=123&timestamp=111111111111")
gameAppkey : 在公共SDK后台的 Md5加密的KEY
`注意!CP必须要以userType+openId保证帐号唯一性`
### 2. 充值验证(通知游戏方发货)
公共SDK服务器接收到渠道服务器充值回调,对回调进行 MD5 验证,如果验证通过, 则采用Post方式马上回调给游戏充值服务器,否则不会回调充值服务器,然后再返回 信息给渠道服务器。回调参数如下:
参数 | 类型 | 描述
------------ | -------------| ------------
serverId | int | 服务器 ID
playerId | int | 角色 ID
orderId | string | 渠道方订单 ID
payAmount | double | 充值金额(如有商品 ID,此值为商 品的金额)
currency | string | 充值货币(CNY:人民币)
goodsId | string | 商品ID,参数对一些有商品列表 的充值有效
goodsName | string | 商品名称
remoteIp | string | 客户端充值 IP
custom | string | 透传参数 ,长度 512
serverSign | string | 发给充值服务器验证的注意:(改为游戏本身的 gameAppkey 值)
uId | string | 平台渠道帐号 ID
gameSimpleName | string | 平台SDK后台游戏代号名
sdkSimpleName | string | 平台SDK代号
queryId | string | 平台SDK订单号
postTime | string | 订单创建时间戳
验证方式:
旧:serverSign=MD5(serverId=%s&playerId=%s&orderId=%s&gameAppKey=%s)
升级:sign=Md5('serverId=%s&playerId=%s&orderId=%s&payAmount=%s&goodsId=%s&sdkSimpleName=%s&gameAppKey=%s')
%s:为相应的值
gameAppkey : 在公共SDK后台的Md5加密的KEY
验证通过后,返回公共 SDK 服务器数据,数据格式:{"code":0,"message":"无订 单"}。code:0 表示失败,1 表示成功,message:描述原因。
`注意!CP必须要以orderId+sdkSimpleName保证订单唯一性,建议使用sign验证`
\ No newline at end of file
channelRootPath = "poolsdk_file"
gameProjName = 'Demo'
\ No newline at end of file
# Copyright 2012 Calvin Rien
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# A pbxproj file is an OpenStep format plist
# {} represents dictionary of key=value pairs delimited by ;
# () represents list of values delimited by ,
# file starts with a comment specifying the character type
# // !$*UTF8*$!
# when adding a file to a project, create the PBXFileReference
# add the PBXFileReference's guid to a group
# create a PBXBuildFile with the PBXFileReference's guid
# add the PBXBuildFile to the appropriate build phase
# when adding a header search path add
# HEADER_SEARCH_PATHS = "path/**";
# to each XCBuildConfiguration object
# Xcode4 will read either a OpenStep or XML plist.
# this script uses `plutil` to validate, read and write
# the pbxproj file. Plutil is available in OS X 10.2 and higher
# Plutil can't write OpenStep plists, so I save as XML
import datetime
import json
import ntpath
import os
import plistlib
import re
import shutil
import subprocess
import uuid
from UserDict import IterableUserDict
from UserList import UserList
regex = '[a-zA-Z0-9\\._/-]*'
class PBXEncoder(json.JSONEncoder):
def default(self, obj):
"""Tests the input object, obj, to encode as JSON."""
if isinstance(obj, (PBXList, PBXDict)):
return obj.data
return json.JSONEncoder.default(self, obj)
class PBXDict(IterableUserDict):
def __init__(self, d=None):
if d:
d = dict([(PBXType.Convert(k), PBXType.Convert(v)) for k, v in d.items()])
IterableUserDict.__init__(self, d)
def __setitem__(self, key, value):
IterableUserDict.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
def remove(self, key):
self.data.pop(PBXType.Convert(key), None)
class PBXList(UserList):
def __init__(self, l=None):
if isinstance(l, basestring):
UserList.__init__(self)
self.add(l)
return
elif l:
l = [PBXType.Convert(v) for v in l]
UserList.__init__(self, l)
def add(self, value):
value = PBXType.Convert(value)
if value in self.data:
return False
self.data.append(value)
return True
def remove(self, value):
value = PBXType.Convert(value)
if value in self.data:
self.data.remove(value)
return True
return False
def __setitem__(self, key, value):
UserList.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
class PBXType(PBXDict):
def __init__(self, d=None):
PBXDict.__init__(self, d)
if 'isa' not in self:
self['isa'] = self.__class__.__name__
self.id = None
@staticmethod
def Convert(o):
if isinstance(o, list):
return PBXList(o)
elif isinstance(o, dict):
isa = o.get('isa')
if not isa:
return PBXDict(o)
cls = globals().get(isa)
if cls and issubclass(cls, PBXType):
return cls(o)
print 'warning: unknown PBX type: %s' % isa
return PBXDict(o)
else:
return o
@staticmethod
def IsGuid(o):
return re.match('^[A-F0-9]{24}$', str(o))
@classmethod
def GenerateId(cls):
return ''.join(str(uuid.uuid4()).upper().split('-')[1:])
@classmethod
def Create(cls, *args, **kwargs):
return cls(*args, **kwargs)
class PBXFileReference(PBXType):
def __init__(self, d=None):
PBXType.__init__(self, d)
self.build_phase = None
types = {
'.a': ('archive.ar', 'PBXFrameworksBuildPhase'),
'.app': ('wrapper.application', None),
'.s': ('sourcecode.asm', 'PBXSourcesBuildPhase'),
'.c': ('sourcecode.c.c', 'PBXSourcesBuildPhase'),
'.cpp': ('sourcecode.cpp.cpp', 'PBXSourcesBuildPhase'),
'.framework': ('wrapper.framework', 'PBXFrameworksBuildPhase'),
'.h': ('sourcecode.c.h', None),
'.hpp': ('sourcecode.c.h', None),
'.d': ('sourcecode.dtrace', 'PBXSourcesBuildPhase'),
'.swift': ('sourcecode.swift', 'PBXSourcesBuildPhase'),
'.icns': ('image.icns', 'PBXResourcesBuildPhase'),
'.m': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
'.j': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'),
'.mm': ('sourcecode.cpp.objcpp', 'PBXSourcesBuildPhase'),
'.nib': ('wrapper.nib', 'PBXResourcesBuildPhase'),
'.plist': ('text.plist.xml', 'PBXResourcesBuildPhase'),
'.json': ('text.json', 'PBXResourcesBuildPhase'),
'.png': ('image.png', 'PBXResourcesBuildPhase'),
'.rtf': ('text.rtf', 'PBXResourcesBuildPhase'),
'.tiff': ('image.tiff', 'PBXResourcesBuildPhase'),
'.txt': ('text', 'PBXResourcesBuildPhase'),
'.xcodeproj': ('wrapper.pb-project', None),
'.xib': ('file.xib', 'PBXResourcesBuildPhase'),
'.strings': ('text.plist.strings', 'PBXResourcesBuildPhase'),
'.bundle': ('wrapper.plug-in', 'PBXResourcesBuildPhase'),
'.dylib': ('compiled.mach-o.dylib', 'PBXFrameworksBuildPhase'),
'.xcdatamodeld': ('wrapper.xcdatamodel', 'PBXSourcesBuildPhase'),
'.xcassets': ('folder.assetcatalog', 'PBXResourcesBuildPhase'),
'.tbd': ('sourcecode.text-based-dylib-definition', 'PBXFrameworksBuildPhase'),
}
trees = [
'<absolute>',
'<group>',
'BUILT_PRODUCTS_DIR',
'DEVELOPER_DIR',
'SDKROOT',
'SOURCE_ROOT',
]
def guess_file_type(self, ignore_unknown_type=False):
self.remove('explicitFileType')
self.remove('lastKnownFileType')
ext = os.path.splitext(self.get('name', ''))[1]
if os.path.isdir(self.get('path')) and ext not in XcodeProject.special_folders:
f_type = 'folder'
build_phase = None
ext = ''
else:
f_type, build_phase = PBXFileReference.types.get(ext, ('?', 'PBXResourcesBuildPhase'))
self['lastKnownFileType'] = f_type
self.build_phase = build_phase
if f_type == '?' and not ignore_unknown_type:
print 'unknown file extension: %s' % ext
print 'please add extension and Xcode type to PBXFileReference.types'
return f_type
def set_file_type(self, ft):
self.remove('explicitFileType')
self.remove('lastKnownFileType')
self['explicitFileType'] = ft
@classmethod
def Create(cls, os_path, tree='SOURCE_ROOT', ignore_unknown_type=False):
if tree not in cls.trees:
print 'Not a valid sourceTree type: %s' % tree
return None
fr = cls()
fr.id = cls.GenerateId()
fr['path'] = os_path
fr['name'] = os.path.split(os_path)[1]
fr['sourceTree'] = '<absolute>' if os.path.isabs(os_path) else tree
fr.guess_file_type(ignore_unknown_type=ignore_unknown_type)
return fr
class PBXBuildFile(PBXType):
def set_weak_link(self, weak=False):
k_settings = 'settings'
k_attributes = 'ATTRIBUTES'
s = self.get(k_settings)
if not s:
if weak:
self[k_settings] = PBXDict({k_attributes: PBXList(['Weak'])})
return True
atr = s.get(k_attributes)
if not atr:
if weak:
atr = PBXList()
else:
return False
if weak:
atr.add('Weak')
else:
atr.remove('Weak')
self[k_settings][k_attributes] = atr
return True
def add_compiler_flag(self, flag):
k_settings = 'settings'
k_attributes = 'COMPILER_FLAGS'
if k_settings not in self:
self[k_settings] = PBXDict()
if k_attributes not in self[k_settings]:
self[k_settings][k_attributes] = flag
return True
flags = self[k_settings][k_attributes].split(' ')
if flag in flags:
return False
flags.append(flag)
self[k_settings][k_attributes] = ' '.join(flags)
@classmethod
def Create(cls, file_ref, weak=False):
if isinstance(file_ref, PBXFileReference):
file_ref = file_ref.id
bf = cls()
bf.id = cls.GenerateId()
bf['fileRef'] = file_ref
if weak:
bf.set_weak_link(True)
return bf
class PBXGroup(PBXType):
def add_child(self, ref):
if not isinstance(ref, PBXDict):
return None
isa = ref.get('isa')
if isa != 'PBXFileReference' and isa != 'PBXGroup':
return None
if 'children' not in self:
self['children'] = PBXList()
self['children'].add(ref.id)
return ref.id
def remove_child(self, id):
if 'children' not in self:
self['children'] = PBXList()
return
if not PBXType.IsGuid(id):
id = id.id
self['children'].remove(id)
def has_child(self, id):
if 'children' not in self:
self['children'] = PBXList()
return False
if not PBXType.IsGuid(id):
id = id.id
return id in self['children']
def get_name(self):
path_name = os.path.split(self.get('path', ''))[1]
return self.get('name', path_name)
@classmethod
def Create(cls, name, path=None, tree='SOURCE_ROOT'):
grp = cls()
grp.id = cls.GenerateId()
grp['name'] = name
grp['children'] = PBXList()
if path:
grp['path'] = path
grp['sourceTree'] = tree
else:
grp['sourceTree'] = '<group>'
return grp
class PBXNativeTarget(PBXType):
pass
class PBXProject(PBXType):
pass
class PBXContainerItemProxy(PBXType):
pass
class PBXReferenceProxy(PBXType):
pass
class PBXVariantGroup(PBXType):
pass
class PBXTargetDependency(PBXType):
pass
class PBXAggregateTarget(PBXType):
pass
class PBXHeadersBuildPhase(PBXType):
pass
class XCVersionGroup(PBXType):
pass
class PBXBuildPhase(PBXType):
def add_build_file(self, bf):
if bf.get('isa') != 'PBXBuildFile':
return False
if 'files' not in self:
self['files'] = PBXList()
self['files'].add(bf.id)
return True
def remove_build_file(self, id):
if 'files' not in self:
self['files'] = PBXList()
return
self['files'].remove(id)
def has_build_file(self, id):
if 'files' not in self:
self['files'] = PBXList()
return False
if not PBXType.IsGuid(id):
id = id.id
return id in self['files']
class PBXFrameworksBuildPhase(PBXBuildPhase):
pass
class PBXResourcesBuildPhase(PBXBuildPhase):
pass
class PBXShellScriptBuildPhase(PBXBuildPhase):
@classmethod
def Create(cls, script, shell="/bin/sh", files=[], input_paths=[], output_paths=[], show_in_log = '0'):
bf = cls()
bf.id = cls.GenerateId()
bf['files'] = files
bf['inputPaths'] = input_paths
bf['outputPaths'] = output_paths
bf['runOnlyForDeploymentPostprocessing'] = '0';
bf['shellPath'] = shell
bf['shellScript'] = script
bf['showEnvVarsInLog'] = show_in_log
return bf
class PBXSourcesBuildPhase(PBXBuildPhase):
pass
class PBXCopyFilesBuildPhase(PBXBuildPhase):
pass
class XCBuildConfiguration(PBXType):
def add_search_paths(self, paths, base, key, recursive=True, escape=True):
modified = False
if not isinstance(paths, list):
paths = [paths]
if base not in self:
self[base] = PBXDict()
for path in paths:
if recursive and not path.endswith('/**'):
path = os.path.join(path, '**')
if key not in self[base]:
self[base][key] = PBXList()
elif isinstance(self[base][key], basestring):
self[base][key] = PBXList(self[base][key])
if path == '$(inherited)':
escape = False
if escape:
if self[base][key].add('"%s"' % path): # '\\"%s\\"' % path
modified = True
else:
if self[base][key].add(path): # '\\"%s\\"' % path
modified = True
return modified
def add_header_search_paths(self, paths, recursive=True):
return self.add_search_paths(paths, 'buildSettings', 'HEADER_SEARCH_PATHS', recursive=recursive)
def add_library_search_paths(self, paths, recursive=True):
return self.add_search_paths(paths, 'buildSettings', 'LIBRARY_SEARCH_PATHS', recursive=recursive)
def add_framework_search_paths(self, paths, recursive=True):
return self.add_search_paths(paths, 'buildSettings', 'FRAMEWORK_SEARCH_PATHS', recursive=recursive)
def add_other_cflags(self, flags):
return self.add_flag('OTHER_CFLAGS', flags)
def add_other_ldflags(self, flags):
return self.add_flag('OTHER_LDFLAGS', flags)
def add_flag(self, key, flags):
modified = False
base = 'buildSettings'
if isinstance(flags, basestring):
flags = PBXList(flags)
if base not in self:
self[base] = PBXDict()
for flag in flags:
if key not in self[base]:
self[base][key] = PBXList()
elif isinstance(self[base][key], basestring):
self[base][key] = PBXList(self[base][key])
if self[base][key].add(flag):
self[base][key] = [e for e in self[base][key] if e]
modified = True
return modified
def remove_flag(self, key, flags):
modified = False
base = 'buildSettings'
if isinstance(flags, basestring):
flags = PBXList(flags)
if base in self: # there are flags, so we can "remove" something
for flag in flags:
if key not in self[base]:
return False
elif isinstance(self[base][key], basestring):
self[base][key] = PBXList(self[base][key])
if self[base][key].remove(flag):
self[base][key] = [e for e in self[base][key] if e]
modified = True
if len(self[base][key]) == 0:
self[base].pop(key, None)
return modified
def remove_other_ldflags(self, flags):
return self.remove_flag('OTHER_LD_FLAGS', flags)
# Set a single-valued flag under buildSettings
def add_single_valued_flag(self, flag, value):
modified = False
base = 'buildSettings'
key = flag
if not self.has_key(base):
self[base] = PBXDict()
if self[base].has_key(key):
if self[base][key] == value:
return False
self[base][key] = value
modified = True
return modified
# Remove a single-valued flag under buildSettings
def remove_single_valued_flag(self, flag):
modified = False
base = 'buildSettings'
key = flag
if self.has_key(base) and self[base].has_key(key):
self[base].pop(key, None)
modified = True
return modified
class XCConfigurationList(PBXType):
pass
class XcodeProject(PBXDict):
plutil_path = 'plutil'
special_folders = ['.bundle', '.framework', '.xcodeproj', '.xcassets', '.xcdatamodeld']
def __init__(self, d=None, path=None):
if not path:
path = os.path.join(os.getcwd(), 'project.pbxproj')
self.pbxproj_path = os.path.abspath(path)
self.source_root = os.path.abspath(os.path.join(os.path.split(path)[0], '..'))
IterableUserDict.__init__(self, d)
self.data = PBXDict(self.data)
self.objects = self.get('objects')
self.modified = False
root_id = self.get('rootObject')
if root_id:
self.root_object = self.objects[root_id]
root_group_id = self.root_object.get('mainGroup')
self.root_group = self.objects[root_group_id]
else:
print "error: project has no root object"
self.root_object = None
self.root_group = None
for k, v in self.objects.iteritems():
v.id = k
def add_other_cflags(self, flags):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_other_cflags(flags):
self.modified = True
def add_other_ldflags(self, flags):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_other_ldflags(flags):
self.modified = True
def remove_other_ldflags(self, flags):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.remove_other_ldflags(flags):
self.modified = True
def add_header_search_paths(self, paths, recursive=True):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_header_search_paths(paths, recursive):
self.modified = True
def add_framework_search_paths(self, paths, recursive=True):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_framework_search_paths(paths, recursive):
self.modified = True
def add_library_search_paths(self, paths, recursive=True):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if b.add_library_search_paths(paths, recursive):
self.modified = True
def add_flags(self, pairs, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
# iterate over all the pairs of configurations
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
for k in pairs:
if b.add_flag(k, pairs[k]):
self.modified = True
def remove_flags(self, pairs, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
# iterate over all the pairs of configurations
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
for k in pairs:
if b.remove_flag(k, pairs[k]):
self.modified = True
# Set a single-valued flag (whereas add_flags adds a flag to a list of flags with a given key)
def add_single_valued_flag(self, flag, value, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
if b.add_single_valued_flag(flag, value):
self.modified = True
# Remove a single-valued flag (whereas remove_flags deletes a flag from a list of flags with a given key)
def remove_single_valued_flag(self, flag, configuration='All'):
build_configs = [b for b in self.objects.values() if b.get('isa') == 'XCBuildConfiguration']
for b in build_configs:
if configuration != "All" and b.get('name') != configuration :
continue
if b.remove_single_valued_flag(flag):
self.modified = True
def get_obj(self, id):
return self.objects.get(id)
def get_ids(self):
return self.objects.keys()
def get_files_by_os_path(self, os_path, tree='SOURCE_ROOT'):
files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
and f.get('path') == os_path
and f.get('sourceTree') == tree]
return files
def get_files_by_name(self, name, parent=None):
if parent:
files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
and f.get('name') == name
and parent.has_child(f)]
else:
files = [f for f in self.objects.values() if f.get('isa') == 'PBXFileReference'
and f.get('name') == name]
return files
def get_keys_for_files_by_name(self, name):
keys = [key for key in self.objects if self.objects.data[key].get('name') == name
and self.objects.data[key].get('isa') == 'PBXFileReference']
return keys
def get_build_files(self, id):
files = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile'
and f.get('fileRef') == id]
return files
def get_groups_by_name(self, name, parent=None):
if parent:
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
and g.get_name() == name
and parent.has_child(g)]
else:
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
and g.get_name() == name]
return groups
def get_or_create_group(self, name, path=None, parent=None):
if not name:
return None
if not parent:
parent = self.root_group
elif not isinstance(parent, PBXGroup):
# assume it's an id
parent = self.objects.get(parent, self.root_group)
groups = self.get_groups_by_name(name)
for grp in groups:
if parent.has_child(grp.id):
return grp
grp = PBXGroup.Create(name, path)
parent.add_child(grp)
self.objects[grp.id] = grp
self.modified = True
return grp
def get_groups_by_os_path(self, path):
path = os.path.abspath(path)
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup'
and os.path.abspath(g.get('path', '/dev/null')) == path]
return groups
def get_build_phases(self, phase_name):
phases = [p for p in self.objects.values() if p.get('isa') == phase_name]
return phases
def get_target_by_name(self, name):
targets = self.get_build_phases('PBXNativeTarget')
target = None
for t in targets:
if t.get("name") == name:
target = t
break
return target
def get_relative_path(self, os_path):
return os.path.relpath(os_path, self.source_root)
def verify_files(self, file_list, parent=None):
# returns list of files not in the current project.
if not file_list:
return []
if parent:
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)]
else:
exists_list = [f.get('name') for f in self.objects.values() if f.get('isa') == 'PBXFileReference' and f.get('name') in file_list]
return set(file_list).difference(exists_list)
def add_run_script(self, target, script=None, insert_before_compile=False):
result = []
targets = [t for t in self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget') if t.get('name') == target]
if len(targets) != 0 :
script_phase = PBXShellScriptBuildPhase.Create(script)
for t in targets:
skip = False
for buildPhase in t['buildPhases']:
if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
skip = True
if not skip:
if insert_before_compile:
t['buildPhases'].insert(0, script_phase.id)
else:
t['buildPhases'].add(script_phase.id)
self.objects[script_phase.id] = script_phase
result.append(script_phase)
return result
def add_run_script_all_targets(self, script=None):
result = []
targets = self.get_build_phases('PBXNativeTarget') + self.get_build_phases('PBXAggregateTarget')
if len(targets) != 0 :
script_phase = PBXShellScriptBuildPhase.Create(script)
for t in targets:
skip = False
for buildPhase in t['buildPhases']:
if self.objects[buildPhase].get('isa') == 'PBXShellScriptBuildPhase' and self.objects[buildPhase].get('shellScript') == script:
skip = True
if not skip:
t['buildPhases'].add(script_phase.id)
self.objects[script_phase.id] = script_phase
result.append(script_phase)
return result
def add_folder(self, os_path, parent=None, excludes=None, recursive=True, create_build_files=True):
if not os.path.isdir(os_path):
return []
if not excludes:
excludes = []
results = []
if not parent:
parent = self.root_group
elif not isinstance(parent, PBXGroup):
# assume it's an id
parent = self.objects.get(parent, self.root_group)
path_dict = {os.path.split(os_path)[0]: parent}
special_list = []
for (grp_path, subdirs, files) in os.walk(os_path):
parent_folder, folder_name = os.path.split(grp_path)
parent = path_dict.get(parent_folder, parent)
if [sp for sp in special_list if parent_folder.startswith(sp)]:
continue
if folder_name.startswith('.'):
special_list.append(grp_path)
continue
if os.path.splitext(grp_path)[1] in XcodeProject.special_folders:
# if this file has a special extension (bundle or framework mainly) treat it as a file
special_list.append(grp_path)
new_files = self.verify_files([folder_name], parent=parent)
# Ignore this file if it is in excludes
if new_files and not [m for m in excludes if re.match(m, grp_path)]:
results.extend(self.add_file(grp_path, parent, create_build_files=create_build_files))
continue
# create group
grp = self.get_or_create_group(folder_name, path=self.get_relative_path(grp_path), parent=parent)
path_dict[grp_path] = grp
results.append(grp)
file_dict = {}
for f in files:
if f[0] == '.' or [m for m in excludes if re.match(m, f)]:
continue
kwds = {
'create_build_files': create_build_files,
'parent': grp,
'name': f
}
f_path = os.path.join(grp_path, f)
file_dict[f_path] = kwds
new_files = self.verify_files([n.get('name') for n in file_dict.values()], parent=grp)
add_files = [(k, v) for k, v in file_dict.items() if v.get('name') in new_files]
for path, kwds in add_files:
kwds.pop('name', None)
self.add_file(path, **kwds)
if not recursive:
break
for r in results:
self.objects[r.id] = r
return results
def path_leaf(self, path):
head, tail = ntpath.split(path)
return tail or ntpath.basename(head)
def add_file_if_doesnt_exist(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False):
for obj in self.objects.values():
if 'path' in obj:
if self.path_leaf(f_path) == self.path_leaf(obj.get('path')):
return []
return self.add_file(f_path, parent, tree, create_build_files, weak, ignore_unknown_type=ignore_unknown_type)
def add_file(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False, target=None):
results = []
abs_path = ''
if os.path.isabs(f_path):
abs_path = f_path
if not os.path.exists(f_path):
return results
elif tree == 'SOURCE_ROOT':
f_path = os.path.relpath(f_path, self.source_root)
else:
tree = '<absolute>'
if not parent:
parent = self.root_group
elif not isinstance(parent, PBXGroup):
# assume it's an id
parent = self.objects.get(parent, self.root_group)
file_ref = PBXFileReference.Create(f_path, tree, ignore_unknown_type=ignore_unknown_type)
parent.add_child(file_ref)
results.append(file_ref)
# create a build file for the file ref
if file_ref.build_phase and create_build_files:
phases = self.get_build_phases(file_ref.build_phase)
if target:
target = self.get_target_by_name(target)
for phase in phases:
if (not target) or (phase.id in target.get('buildPhases')):
build_file = PBXBuildFile.Create(file_ref, weak=weak)
phase.add_build_file(build_file)
results.append(build_file)
if abs_path and tree == 'SOURCE_ROOT' \
and os.path.isfile(abs_path) \
and file_ref.build_phase == 'PBXFrameworksBuildPhase':
library_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
self.add_library_search_paths([library_path], recursive=False)
if abs_path and tree == 'SOURCE_ROOT' \
and not os.path.isfile(abs_path) \
and file_ref.build_phase == 'PBXFrameworksBuildPhase':
framework_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0])
self.add_framework_search_paths([framework_path, '$(inherited)'], recursive=False)
for r in results:
self.objects[r.id] = r
if results:
self.modified = True
return results
def check_and_repair_framework(self, base):
name = os.path.basename(base)
if ".framework" in name:
basename = name[:-len(".framework")]
finalHeaders = os.path.join(base, "Headers")
finalCurrent = os.path.join(base, "Versions/Current")
finalLib = os.path.join(base, basename)
srcHeaders = "Versions/A/Headers"
srcCurrent = "A"
srcLib = "Versions/A/" + basename
if not os.path.exists(finalHeaders):
os.symlink(srcHeaders, finalHeaders)
if not os.path.exists(finalCurrent):
os.symlink(srcCurrent, finalCurrent)
if not os.path.exists(finalLib):
os.symlink(srcLib, finalLib)
def get_file_id_by_path(self, f_path):
for k, v in self.objects.iteritems():
if str(v.get('path')) == f_path:
return k
return 0
def remove_file_by_path(self, f_path, recursive=True):
id = self.get_file_id_by_path(f_path)
if id != 0:
self.remove_file(id, recursive=recursive)
return
def remove_file(self, id, recursive=True):
if not PBXType.IsGuid(id):
id = id.id
if id in self.objects:
self.objects.remove(id)
# Remove from PBXResourcesBuildPhase and PBXSourcesBuildPhase if necessary
buildFiles = [f for f in self.objects.values() if f.get('isa') == 'PBXBuildFile']
for buildFile in buildFiles:
if id == buildFile.get('fileRef'):
key = buildFile.id
PBXRBP = [f for f in self.objects.values() if f.get('isa') == 'PBXResourcesBuildPhase']
PBXSBP = [f for f in self.objects.values() if f.get('isa') == 'PBXSourcesBuildPhase']
self.objects.remove(key)
if len(PBXSBP) and PBXSBP[0].has_build_file(key):
PBXSBP[0].remove_build_file(key)
if len(PBXRBP) and PBXRBP[0].has_build_file(key):
PBXRBP[0].remove_build_file(key)
if recursive:
groups = [g for g in self.objects.values() if g.get('isa') == 'PBXGroup']
for group in groups:
if id in group['children']:
group.remove_child(id)
self.modified = True
def remove_group(self, id, recursive = True):
if not PBXType.IsGuid(id):
id = id.id
name = self.objects.get(id).get('path')
children = self.objects.get(id).get('children')
if name is None:
name = id
if id in self.objects:
if recursive:
for childKey in children:
childValue = self.objects.get(childKey)
if childValue.get('isa') == 'PBXGroup':
self.remove_group(childKey, True)
else:
self.remove_file(childKey, False)
self.objects.remove(id);
def remove_group_by_name(self, name, recursive = True):
groups = self.get_groups_by_name(name)
if len(groups):
for group in groups:
self.remove_group(group.id, recursive)
def move_file(self, id, dest_grp=None):
pass
def apply_patch(self, patch_path, xcode_path):
if not os.path.isfile(patch_path) or not os.path.isdir(xcode_path):
print 'ERROR: couldn\'t apply "%s" to "%s"' % (patch_path, xcode_path)
return
print 'applying "%s" to "%s"' % (patch_path, xcode_path)
return subprocess.call(['patch', '-p1', '--forward', '--directory=%s' % xcode_path, '--input=%s' % patch_path])
def apply_mods(self, mod_dict, default_path=None):
if not default_path:
default_path = os.getcwd()
keys = mod_dict.keys()
for k in keys:
v = mod_dict.pop(k)
mod_dict[k.lower()] = v
parent = mod_dict.pop('group', None)
if parent:
parent = self.get_or_create_group(parent)
excludes = mod_dict.pop('excludes', [])
if excludes:
excludes = [re.compile(e) for e in excludes]
compiler_flags = mod_dict.pop('compiler_flags', {})
for k, v in mod_dict.items():
if k == 'patches':
for p in v:
if not os.path.isabs(p):
p = os.path.join(default_path, p)
self.apply_patch(p, self.source_root)
elif k == 'folders':
# get and compile excludes list
# do each folder individually
for folder in v:
kwds = {}
# if path contains ':' remove it and set recursive to False
if ':' in folder:
args = folder.split(':')
kwds['recursive'] = False
folder = args.pop(0)
if os.path.isabs(folder) and os.path.isdir(folder):
pass
else:
folder = os.path.join(default_path, folder)
if not os.path.isdir(folder):
continue
if parent:
kwds['parent'] = parent
if excludes:
kwds['excludes'] = excludes
self.add_folder(folder, **kwds)
elif k == 'headerpaths' or k == 'librarypaths':
paths = []
for p in v:
if p.endswith('/**'):
p = os.path.split(p)[0]
if not os.path.isabs(p):
p = os.path.join(default_path, p)
if not os.path.exists(p):
continue
p = self.get_relative_path(p)
paths.append(os.path.join('$(SRCROOT)', p, "**"))
if k == 'headerpaths':
self.add_header_search_paths(paths)
else:
self.add_library_search_paths(paths)
elif k == 'other_cflags':
self.add_other_cflags(v)
elif k == 'other_ldflags':
self.add_other_ldflags(v)
elif k == 'libs' or k == 'frameworks' or k == 'files':
paths = {}
for p in v:
kwds = {}
if ':' in p:
args = p.split(':')
p = args.pop(0)
if 'weak' in args:
kwds['weak'] = True
file_path = os.path.join(default_path, p)
search_path, file_name = os.path.split(file_path)
if [m for m in excludes if re.match(m, file_name)]:
continue
try:
expr = re.compile(file_name)
except re.error:
expr = None
if expr and os.path.isdir(search_path):
file_list = os.listdir(search_path)
for f in file_list:
if [m for m in excludes if re.match(m, f)]:
continue
if re.search(expr, f):
kwds['name'] = f
paths[os.path.join(search_path, f)] = kwds
p = None
if k == 'libs':
kwds['parent'] = self.get_or_create_group('Libraries', parent=parent)
elif k == 'frameworks':
kwds['parent'] = self.get_or_create_group('Frameworks', parent=parent)
if p:
kwds['name'] = file_name
if k == 'libs':
p = os.path.join('usr', 'lib', p)
kwds['tree'] = 'SDKROOT'
elif k == 'frameworks':
p = os.path.join('System', 'Library', 'Frameworks', p)
kwds['tree'] = 'SDKROOT'
elif k == 'files' and not os.path.exists(file_path):
# don't add non-existent files to the project.
continue
paths[p] = kwds
new_files = self.verify_files([n.get('name') for n in paths.values()])
add_files = [(k, v) for k, v in paths.items() if v.get('name') in new_files]
for path, kwds in add_files:
kwds.pop('name', None)
if 'parent' not in kwds and parent:
kwds['parent'] = parent
self.add_file(path, **kwds)
if compiler_flags:
for k, v in compiler_flags.items():
filerefs = []
for f in v:
filerefs.extend([fr.id for fr in self.objects.values() if fr.get('isa') == 'PBXFileReference'
and fr.get('name') == f])
buildfiles = [bf for bf in self.objects.values() if bf.get('isa') == 'PBXBuildFile'
and bf.get('fileRef') in filerefs]
for bf in buildfiles:
if bf.add_compiler_flag(k):
self.modified = True
def backup(self, file_name=None, backup_name=None):
if not file_name:
file_name = self.pbxproj_path
if not backup_name:
backup_name = "%s.%s.backup" % (file_name, datetime.datetime.now().strftime('%d%m%y-%H%M%S'))
shutil.copy2(file_name, backup_name)
return backup_name
def save(self, file_name=None, old_format=False, sort=False):
if old_format :
self.save_format_xml(file_name)
else:
self.save_new_format(file_name, sort)
def save_format_xml(self, file_name=None):
"""Saves in old (xml) format"""
if not file_name:
file_name = self.pbxproj_path
# This code is adapted from plistlib.writePlist
with open(file_name, "w") as f:
writer = PBXWriter(f)
writer.writeln("<plist version=\"1.0\">")
writer.writeValue(self.data)
writer.writeln("</plist>")
def save_new_format(self, file_name=None, sort=False):
"""Save in Xcode 3.2 compatible (new) format"""
if not file_name:
file_name = self.pbxproj_path
# process to get the section's info and names
objs = self.data.get('objects')
sections = dict()
uuids = dict()
for key in objs:
l = list()
if objs.get(key).get('isa') in sections:
l = sections.get(objs.get(key).get('isa'))
l.append(tuple([key, objs.get(key)]))
sections[objs.get(key).get('isa')] = l
if 'name' in objs.get(key):
uuids[key] = objs.get(key).get('name')
elif 'path' in objs.get(key):
uuids[key] = objs.get(key).get('path')
else:
if objs.get(key).get('isa') == 'PBXProject':
uuids[objs.get(key).get('buildConfigurationList')] = 'Build configuration list for PBXProject "Unity-iPhone"'
elif objs.get(key).get('isa')[0:3] == 'PBX':
uuids[key] = objs.get(key).get('isa')[3:-10]
else:
uuids[key] = 'Build configuration list for PBXNativeTarget "TARGET_NAME"'
ro = self.data.get('rootObject')
uuids[ro] = 'Project object'
for key in objs:
# transitive references (used in the BuildFile section)
if 'fileRef' in objs.get(key) and objs.get(key).get('fileRef') in uuids:
uuids[key] = uuids[objs.get(key).get('fileRef')]
# transitive reference to the target name (used in the Native target section)
if objs.get(key).get('isa') == 'PBXNativeTarget':
uuids[objs.get(key).get('buildConfigurationList')] = uuids[objs.get(key).get('buildConfigurationList')].replace('TARGET_NAME', uuids[key])
self.uuids = uuids
self.sections = sections
out = open(file_name, 'w')
out.write('// !$*UTF8*$!\n')
self._printNewXCodeFormat(out, self.data, '', enters=True, sort=sort)
out.close()
@classmethod
def addslashes(cls, s):
d = {'"': '\\"', "'": "\\'", "\0": "\\\0", "\\": "\\\\", "\n":"\\n"}
return ''.join(d.get(c, c) for c in s)
def _printNewXCodeFormat(self, out, root, deep, enters=True, sort=False):
if isinstance(root, IterableUserDict):
out.write('{')
if enters:
out.write('\n')
isa = root.pop('isa', '')
if isa != '': # keep the isa in the first spot
if enters:
out.write('\t' + deep)
out.write('isa = ')
self._printNewXCodeFormat(out, isa, '\t' + deep, enters=enters)
out.write(';')
if enters:
out.write('\n')
else:
out.write(' ')
for key in sorted(root.iterkeys()): # keep the same order as Apple.
if enters:
out.write('\t' + deep)
if re.match(regex, key).group(0) == key:
out.write(key.encode("utf-8") + ' = ')
else:
out.write('"' + key.encode("utf-8") + '" = ')
if key == 'objects':
out.write('{') # open the objects section
if enters:
out.write('\n')
#root.remove('objects') # remove it to avoid problems
sections = [
('PBXBuildFile', False),
('PBXCopyFilesBuildPhase', True),
('PBXFileReference', False),
('PBXFrameworksBuildPhase', True),
('PBXGroup', True),
('PBXAggregateTarget', True),
('PBXNativeTarget', True),
('PBXProject', True),
('PBXResourcesBuildPhase', True),
('PBXShellScriptBuildPhase', True),
('PBXSourcesBuildPhase', True),
('XCBuildConfiguration', True),
('XCConfigurationList', True),
('PBXTargetDependency', True),
('PBXVariantGroup', True),
('PBXReferenceProxy', True),
('PBXContainerItemProxy', True),
('XCVersionGroup', True)]
for section in sections: # iterate over the sections
if self.sections.get(section[0]) is None:
continue
out.write('\n/* Begin %s section */' % section[0].encode("utf-8"))
self.sections.get(section[0]).sort(cmp=lambda x, y: cmp(x[0], y[0]))
if sort and section[0] == 'PBXGroup':
for entry in self.sections.get(section[0]):
entry[1]['children'] = sorted(entry[1]['children'],
key=lambda x: self.uuids[x].encode("utf-8"))
for pair in self.sections.get(section[0]):
key = pair[0]
value = pair[1]
out.write('\n')
if enters:
out.write('\t\t' + deep)
out.write(key.encode("utf-8"))
if key in self.uuids:
out.write(" /* " + self.uuids[key].encode("utf-8") + " */")
out.write(" = ")
self._printNewXCodeFormat(out, value, '\t\t' + deep, enters=section[1])
out.write(';')
out.write('\n/* End %s section */\n' % section[0].encode("utf-8"))
out.write(deep + '\t}') # close of the objects section
else:
self._printNewXCodeFormat(out, root[key], '\t' + deep, enters=enters)
out.write(';')
if enters:
out.write('\n')
else:
out.write(' ')
root['isa'] = isa # restore the isa for further calls
if enters:
out.write(deep)
out.write('}')
elif isinstance(root, UserList):
out.write('(')
if enters:
out.write('\n')
for value in root:
if enters:
out.write('\t' + deep)
self._printNewXCodeFormat(out, value, '\t' + deep, enters=enters)
out.write(',')
if enters:
out.write('\n')
if enters:
out.write(deep)
out.write(')')
else:
if len(root) > 0 and re.match(regex, root).group(0) == root:
out.write(root.encode("utf-8"))
else:
out.write('"' + XcodeProject.addslashes(root.encode("utf-8")) + '"')
if root in self.uuids:
out.write(" /* " + self.uuids[root].encode("utf-8") + " */")
@classmethod
def Load(cls, path, pure_python=False):
if pure_python:
import openstep_parser as osp
tree = osp.OpenStepDecoder.ParseFromFile(open(path, 'r'))
else:
cls.plutil_path = os.path.join(os.path.split(__file__)[0], 'plutil')
if not os.path.isfile(XcodeProject.plutil_path):
cls.plutil_path = 'plutil'
# load project by converting to xml and then convert that using plistlib
p = subprocess.Popen([XcodeProject.plutil_path, '-convert', 'xml1', '-o', '-', path], stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
# If the plist was malformed, return code will be non-zero
if p.returncode != 0:
print stdout
return None
tree = plistlib.readPlistFromString(stdout)
return XcodeProject(tree, path)
@classmethod
def LoadFromXML(cls, path):
tree = plistlib.readPlist(path)
return XcodeProject(tree, path)
# The code below was adapted from plistlib.py.
class PBXWriter(plistlib.PlistWriter):
def writeValue(self, value):
if isinstance(value, (PBXList, PBXDict)):
plistlib.PlistWriter.writeValue(self, value.data)
else:
plistlib.PlistWriter.writeValue(self, value)
def simpleElement(self, element, value=None):
"""
We have to override this method to deal with Unicode text correctly.
Non-ascii characters have to get encoded as character references.
"""
if value is not None:
value = _escapeAndEncode(value)
self.writeln("<%s>%s</%s>" % (element, value, element))
else:
self.writeln("<%s/>" % element)
# Regex to find any control chars, except for \t \n and \r
_controlCharPat = re.compile(
r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"
r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
def _escapeAndEncode(text):
m = _controlCharPat.search(text)
if m is not None:
raise ValueError("strings can't contains control characters; "
"use plistlib.Data instead")
text = text.replace("\r\n", "\n") # convert DOS line endings
text = text.replace("\r", "\n") # convert Mac line endings
text = text.replace("&", "&amp;") # escape '&'
text = text.replace("<", "&lt;") # escape '<'
text = text.replace(">", "&gt;") # escape '>'
return text.encode("ascii", "xmlcharrefreplace") # encode as ascii with xml character references
import os
import commands
buildProjName = ''
targetName = ''
import shutil
import os
def buildProj():
if buildProjName == '':
print('buildProjName is not define')
else:
#build project
print('start build proj')
commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj')
releaseDir = os.path.abspath('.') + '/Release'
if not os.path.exists(releaseDir):
os.mkdir(releaseDir)
ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa'
buildPath = os.path.abspath('.') + '/build'
if os.path.exists(ipaPath):
os.remove(ipaPath)
resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath)
#print(resultStr)
if os.path.exists(buildPath):
shutil.rmtree(buildPath)
No preview for this file type
#import <Foundation/Foundation.h>
#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheSDKDelegate.h"
@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
@property(nonatomic, strong)NSString *userId;
@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
@property bool onlyOneTimeGzyazf;
+ (HaiBaoJuheChecker *)getInstance;
- (void)initChecker;
- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (void) RailwayHaiBaoJuhereportOpen;
- (void) RailwayHaiBaoJuhereportSDKOpen;
- (void)RailwayHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
- (void) RailwayHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
notiName:(NSString *)notiName
statusCode:(int)nCode
description:(NSString *)szDescripton
extendData:(NSObject *)extendData;
- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
- (void)RailwayHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
/*
*初始化时调用
*/
- (void)setHaiBaoJuheSDKDelegate:(nullable id<HaiBaoJuheSDKDelegate>)HaiBaoJuheSDKDeletate;
@end
#import <Foundation/Foundation.h>
@interface HaiBaoJuheConfig : NSObject
@property(nonatomic, strong)NSString *gameSimpleName;
@property(nonatomic, strong)NSString *sdkSimpleName;
@property(nonatomic, strong)NSString *sdkVersionCode;
@property(nonatomic, strong)NSString *loginCheckUrl;
@property(nonatomic, strong)NSString *gzyazfOrderUrl;
@property(nonatomic, strong)NSString *gzyazfCheckUrl;
@property(nonatomic, strong)NSString *c1;
@property(nonatomic, strong)NSString *c2;
@property(nonatomic, strong)NSString *custom;
+ (HaiBaoJuheConfig *)getInstance;
- (void) loadFile:(NSString *) fileName;
- (NSString *)getValueByKey:(NSString *) key;
- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
@end
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheCreateOrderInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic,strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
@property(nonatomic, strong)NSString *playerId;//玩家ID
@property(nonatomic, strong)NSString *playerName;//玩家名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *postAmount;//金额
@property(nonatomic, strong)NSString *productId;//产品ID
@property(nonatomic, strong)NSString *productName;//产品名称
@property(nonatomic, strong)NSString *productDesc;//产品描述
@property(nonatomic, strong)NSString *custom;//透传参数
@property(nonatomic, strong)NSString *exchange;//兑换比例
@property(nonatomic, strong)NSString *otherInfo;//扩展参数
@property(nonatomic, strong)NSString *userId;//用户ID
@property(nonatomic, strong)NSString *timestamp;//时间戳
- (NSString *) RailwayHaiBaoJuheGetTsign ;
- (NSString *) RailwayHaiBaoJuheGetTimestamp ;
@end
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheGzyazfInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic, strong)NSString *serverId;
@property(nonatomic, strong)NSString *queryId;
@property(nonatomic, strong)NSString *playerId;
@property(nonatomic, strong)NSString *playerName;
@property(nonatomic, strong)NSString *postAmount;
@property(nonatomic, strong)NSString *productId;
@property(nonatomic, strong)NSString *products;
@property(nonatomic, strong)NSString *custom;
@property(nonatomic, strong)NSString *postTime;
@property(nonatomic, strong)NSString *other;
//游戏传递过来的原值
@property(nonatomic, strong)NSString *serverName;//服务器名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *productName;//产品名称
@property(nonatomic, strong)NSString *productDesc;//产品描述
@property(nonatomic, strong)NSString *exchange;//兑换比例
@end
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheLoginInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic,strong)NSString *timestamp;
@property(nonatomic, strong)NSString *sign;
@property(nonatomic, strong)NSString *other;
@property(nonatomic, strong)NSString *openId;
@property(nonatomic, strong)NSString *userType;
@end
//
// HaiBaoJuheNotification.h
// public_i9133
//
// Created by winFan on 12/1/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * const HaiBaoJuheSDK_Notification; /**< */
extern NSString * const _create_order_notification; /**< */
/**
应用支持的方向
*/
typedef NS_ENUM(int, HaiBaoJuheSDKNotificationType) {
HaiBaoJuheSDKNotificationLogin = 1,//登录
HaiBaoJuheSDKNotificationLogout,//注销
HaiBaoJuheSDKNotificationGzyazf,//支付完成
HaiBaoJuheSDKNotificationPause,//暂停退出
HaiBaoJuheSDKNotificationRole,//创建角色
HaiBaoJuheSDKNotificationInitSDK,//初始化SDK
HaiBaoJuheSDKNotificationSwitchAccount,//切换账号
HaiBaoJuheSDKNotificationExit//退出游戏
};
@interface HaiBaoJuheNotification : NSObject
@end
//////////////////////////////////////////////////////////////////////
@interface HaiBaoJuheSDKResult : NSObject
@property(nonatomic, assign)int statusCode;//请参照此文件下面状态标识
@property(nonatomic, strong)NSString *resultDescription;
@property(nonatomic, strong)NSObject *extendData;
//V1.2.0新增
@property(nonatomic, assign)HaiBaoJuheSDKNotificationType notiType;//消息类型
@property(nonatomic, strong)NSString *notiName;//消息名称
@end
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/* 状态标识 */
#define HaiBaoJuheSDK_NO_ERROR 0 /*操作成功*/
#define HaiBaoJuheSDK_ERROR_LOGIN_FAILED -100 /*登录失败*/
#define HaiBaoJuheSDK_ERROR_LOGIN_CANCEL -101 /*登录取消*/
#define HaiBaoJuheSDK_ERROR_LOGIN_GAMGEACCOUNT -102 /*游戏帐号登录,非平台账号*/
#define HaiBaoJuheSDK_ERROR_PAY_FAILED -200 /*支付失败*/
#define HaiBaoJuheSDK_ERROR_PAY_CANCEL -201 /*支付取消*/
#define HaiBaoJuheSDK_ERROR_PAY_VERSIGN -202 /*支付验签失败*/
#define HaiBaoJuheSDK_ERROR_CREATE_ORDER_FAILED -203 /*支付验签失败*/
#define HaiBaoJuheSDK_ERROR_ROLE_CREATE_FAILED -300 /*角色创建失败*/
#define HaiBaoJuheSDK_ERROR_INIT_FAILED -400 /*初始化失败*/
#define HaiBaoJuheSDK_ERROR_SWICHT_ACCOUNT_FAILED -500 /*切换账号失败*/
#define HaiBaoJuheSDK_ERROR_EXIT_CANCEL -600 /*退出取消*/
//////////////////////////////////////////////////////////////////////
//
// RailwayHaiBaoJuheReportInfo.h
// HaiBaoJuheSDK
//
// Created by winFan on 12/21/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheReportInfo : RailwayHaiBaoJuheBaseModel
@property(nonatomic, strong)NSString *reportType;//类型
@property(nonatomic, strong)NSString *playerId;//玩家ID
@property(nonatomic, strong)NSString *playerName;//玩家名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *roleSex;//角色性别(1男0女)
@property(nonatomic, strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
@property(nonatomic, strong)NSNumber *roleCTime;//创建角色时间(秒)
@property(nonatomic, strong)NSString *partyName;//工会名称
@property(nonatomic, strong)NSString *roleType;//角色类型
@property(nonatomic, strong)NSNumber *roleChangeTime;//角色等级更新时间(秒)
@property(nonatomic, strong)NSString *vipLevel;//vip等级
@property(nonatomic, strong)NSNumber *diamond;//余额
@property(nonatomic, strong)NSString *moneyType;//商品单位(元宝,金币)
@property(nonatomic, strong)NSString *custom;//透传参数
@property(nonatomic, strong)NSString *openId;
#define REPORT_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/statistic"
#define REPORT_IDFA_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
#define REPORT_OPEN @"open"
#define REPORT_ENTER @"enter"
#define REPORT_CREATEROLE @"createrole"
#define REPORT_ROLEUPGRADE @"roleupgrade"
#define REPORT_SDK_OPEN @"opensdk"
#define REPORT_EXIT @"exit"
#define REPORT_SELECT_SERVER @"selectserver"
@end
#import <Foundation/Foundation.h>
#import "HaiBaoJuheSDK2.h"
#import <UIKit/UIKit.h>
@interface HaiBaoJuheSDK : NSObject
@property(nonatomic, strong, readonly)NSString *sdkVersion;
@property(nonatomic, strong)NSString *urlSchemes;
@property BOOL isAppleGzyazfing;
+ (HaiBaoJuheSDK *)shareSDK;
- (void)initSDK:(UIViewController *) control;
-(void)viewDidAppear;
- (void)setViewController:(UIViewController *)viewController;
- (void)loginSDK;
- (void)loginSDK:(UIViewController *)viewController;
- (void)gzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (BOOL)hasUserCenter;
- (void)gotoUserCenter;
- (void)reportSDK:(HaiBaoJuheReportInfo *)reportInfo;
- (BOOL)hasLogout;
- (void)logoutSDK;
- (BOOL)hasSwitchAccount;
- (void)switchAccount;
- (BOOL)hasExit;
- (void)exitSDK;
- (void)destroySDK;
@property(nonatomic, assign)ESDKOrientation sdkOrientation;
@property(nonatomic, assign)BOOL bShowedFloat;
@property(nonatomic, assign)int serverId;
-(NSString *) getGameChannelId;
- (NSString *) getCustomValue;
- (NSString *) getChannelParameter1;
- (NSString *) getChannelParameter2;
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray*)customArray;
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;
- (void)applicationWillResignActive:(UIApplication *)application;
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
@end
#import <UIKit/UIKit.h>
#import "HaiBaoJuheChecker.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheLoginInfo.h"
#import "Interface.h"
#import "HaiBaoJuheNotification.h"
#import "HaiBaoJuheGzyazfInfo.h"
#import "UnionInterface.h"
#import "HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheConfig.h"
#import "HaiBaoJuheUtils.h"
#import "NetCenter.h"
#import "HaiBaoJuheSDK.h"
#import "HaiBaoJuheSDKDelegate.h"
#import <Foundation/Foundation.h>
@protocol HaiBaoJuheSDKDelegate <NSObject>
@optional
-(void)HaiBaoJuheSDKLoginSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
-(void)HaiBaoJuheSDKLoginFail:(NSString*)msg;
-(void)HaiBaoJuheSDKSwitchAccountSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
-(void)HaiBaoJuheSDKSwitchAccountFail:(NSString*)msg;
@end
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface HaiBaoJuheUtils : NSObject
+(NSString *)md5:(NSString *)str;
+ (NSDictionary *)RailwayHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createGzyazfOrderUrl;
//*充值回调地址
+(NSString *)createGzyazfUrl;
+(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
+(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
@end
//
// Interface.h
// HaiBaoJuheSDK
//
// Created by winFan on 12/10/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#include "UnionInterface.h"
#import <SafariServices/SafariServices.h>
@interface Interface : NSObject <UnionInterface>
@property(nonatomic, strong)UIViewController *controller;
@end
#import <Foundation/Foundation.h>
@interface NetCenter : NSObject
@property(nonatomic,retain) NSMutableData *receiveData;
@property(nonatomic,assign)int dataPackSerialNo;
+ (NetCenter *)getInstance;
- (NSString *)httpGetSyn:(NSString *) getUrl;
- (NSString *)httpPostSyn:(NSString *) postUrl : (NSDictionary *) postData;
- (void)httpGetNoSyn;
- (void)httpPostNoSyn:(NSString *) postUrl :(NSDictionary *)postDict;
- (void)httpPostAsync:(NSString*)postUrl :(NSDictionary*)postDict;
- (void)httpPostAsyncOpen:(NSString*)postUrl :(NSDictionary*)postDict;
-(void)httpGetAsync:(NSString *)url completionHandler:(void (^ __nullable)(NSURLResponse* __nullable response, NSData* __nullable data, NSError* __nullable connectionError)) handler;
- (NSString * __nullable)dicToString:(NSDictionary * __nullable) dict;
@end
#ifndef __HaiBaoJuheSDK__OtherSetting__
#define __HaiBaoJuheSDK__OtherSetting__
/**
应用支持的方向
*/
typedef NS_ENUM(NSUInteger, ESDKOrientation) {
ESDKOrientationPortrait = 1,//竖
ESDKOrientationLandscape,//横
ESDKOrientationNone//自动旋转
};
/**
应用支持的方向
*/
typedef NS_ENUM(NSUInteger, REPORT_TYPE) {
REPORT_TYPE_OPEN = 1,//竖
REPORT_TYPE_ENTER,//横
REPORT_TYPE_DEFINE//自动旋转
};
#endif /* defined(__HaiBaoJuheSDK__OtherSetting__) */
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface RailwayHaiBaoJuheBaseModel : NSObject
- (NSString *)RailwayHaiBaoJuheObjectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
@end
#import <Foundation/Foundation.h>
void DGLog(NSString *fmt, ...);
typedef NS_ENUM(NSInteger, DGLoggerLevel)
{
ELogVerbose = 1,
ELogDebug,
ELogInfo,
ELogWarn,
ELogError
};
@interface RailwayHaiBaoJuheDGLogger : NSObject
+ (void)showLog:(NSString *)fmt,...;
+ (void)showLog:(DGLoggerLevel)level log:(NSString *)fmt,...;
+ (void)isShowLog:(BOOL)flag;
@end
#define TRACK_VERSION @"1.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
+(void) setPrintLog :(BOOL)print;
+ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
+ (void)setRegisterWithAccountID:(NSString *)account;
+ (void)setLoginWithAccountID:(NSString *)account;
+(void)setGzyazfmentStart:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
+(void)setGzyazfment:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
+(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
+(void)setProfile:(NSDictionary *)dataDic;
+(NSString*)getDeviceId;
@end
NS_ASSUME_NONNULL_END
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "HaiBaoJuheSDK2.h"
@protocol UnionInterface
/**
初始化SDK
*/
//[[PoolChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationGzyazf notiName:@"" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"" extendData:order_id];
- (void)SDKinit:(UIViewController *) control;
- (void)setViewController:(UIViewController *) viewController;
/**
登录SDK
*/
- (void)SDKloginSDK;
- (void)SDKloginSDK:(UIViewController *) control;
/**
*是否含有注销接口
*/
- (BOOL)hasLogout;
/**
注销
*/
- (void)SDKlogoutSDK;
/**
*是否含有退出接口
**/
- (BOOL)hasExit;
/**
退出接口
*/
- (void)SDKexitSDK;
/**
*SDK销毁操作(游戏退出时调用)
*/
- (void)destroySDK;
/**
*是否含有用户中心接口
**/
- (BOOL)hasUserCenter;
/**
用户中心
*/
- (void)SDKgotoUserCenter;
/**
*是否含有切换账号接口
**/
- (BOOL)hasSwitchAccount;
/**
*切换账号
**/
- (void)switchAccount;
- (void)viewDidAppear;
/**
提交数据
*/
- (void)SDKreport:(HaiBaoJuheReportInfo *) reportInfo;
/**
进行支付
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (void)receiveCreateOrder: (NSNotification *)notification;
/**
*充值统计参数
*accountId 账号ID,必填项, 和登陆、注册使用的accountId保持一致即可。
*orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
*currencyAmount 货币金额,单位为元,支持小数
*currencyType 货币类型
*gzyazfType 支付类型(渠道)
*/
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray *)customArray;
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;
- (void)applicationWillResignActive:(UIApplication *)application;
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
@end
No preview for this file type
framework module HaiBaoJuheSDK {
umbrella header "HaiBaoJuheSDK.h"
export *
module * { export * }
}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
#import <UIKit/UIKit.h>
@interface HNYouaiIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* HNYouaiDingDanHao;
@property(nonatomic,strong) NSDictionary* HNYouaiHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* HNYouaiHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *HNYouaiHuoWuLieBiaoView;
- (void)HNYouaiHuaQianView:(UIViewController*)controller HNYouaiHuoWuD:(NSString*)products HNYouaiQian:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*)DingDanHao;
@end
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface HNYouaiAllManager : NSObject
{
NSString* HNYouaiAPPID_;
NSString* HNYouaiAPPKEY_;
NSString* HNYouaiInviterCode_;
}
@property bool HNYouaiGeiWoHuaQianBa;
+ (HNYouaiAllManager *)HNYouaiInstance;
- (void)HNYouaiChuShiHua;
- (void)HNYouaiDengLu:(NSString *)HNYouaiAPPID : (NSString *)HNYouaiAPPKEY : (UIViewController *)controller;
- (void)HNYouaiYangShi:(NSString*)HNYouaiLeiXing;
- (void)HNYouaiQuery: (NSString *)HNYouaiFuWuQiID : (NSString *)HNYouaiNickName : (NSNumber *)HNYouaiAmount : (NSString *)HNYouaiCallBack : (UIViewController *)controller : (NSString *)HNYouaiServerName;
- (void)HNYouaiQueryOperation:(UIViewController*)controll HNYouaiHuoWuID:(NSString*)products HNYouaiJiaGe:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const HNYouaiExitNotification;
extern NSString * const HNYouaiLoginNotification;
extern NSString * const HNYouaiErrorNotification;
@interface HNYouaiHuiTiaoNotification : NSObject
@end
#import <Foundation/Foundation.h>
@interface HNYouaiInformation : NSObject
{
//
NSString *openId;
NSString *token;
NSString *timestamp;
}
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (HNYouaiInformation *)getInstance;
@end
#import <Foundation/Foundation.h>
@interface HNYouaiInformationJM : NSObject
+(NSString *)HNYouaiJM:(NSString *)jm;
@end
#import <UIKit/UIKit.h>
@interface HNYouaiLocation : NSObject
+ (NSString *)HNYouaiSKCloudServiceSetupOptionsKey;
@end
#import <UIKit/UIKit.h>
#import "HNYouaiInformation.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface HNYouaiMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webView_;
UIActivityIndicatorView *activityIndicator;
}
@property(assign) BOOL HNYouaiYouYuanJiao;
- (void)HNYouaiSettingCKAssetsView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)HNYouaiChuShiHuaWebView;
- (void)loadWebPageWithString:(NSString *)url;
- (void)loadWebPageWithJs:(NSString *)content;
- (void)postNotification:(NSString *)name : (NSString *)code;
- (void)receiveIap:(NSNotification *)notification;
@end
//
// IAPHelper.h
//
// Original Created by Ray Wenderlich on 2/28/11.
// Created by saturngod on 7/9/12.
// Copyright 2011 Ray Wenderlich. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "StoreKit/StoreKit.h"
typedef void (^IAPProductsResponseBlock)(SKProductsRequest* request , SKProductsResponse* response);
typedef void (^IAPbuyProductCompleteResponseBlock)(SKPaymentTransaction* transcation);
typedef void (^checkReceiptCompleteResponseBlock)(NSString* response,NSError* error);
typedef void (^resoreProductsCompleteResponseBlock) (SKPaymentQueue* payment,NSError* error);
@interface IAPHelper : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver>
@property (nonatomic,strong) NSSet *productIdentifiers;
@property (nonatomic,strong) NSArray * products;
@property (nonatomic,strong) NSMutableSet *purchasedProducts;
@property (nonatomic,strong) SKProductsRequest *request;
@property (nonatomic) BOOL production;
//init With Product Identifiers
- (id)initWithProductIdentifiers:(NSSet *)productIdentifiers;
//get Products List
- (void)requestProductsWithCompletion:(IAPProductsResponseBlock)completion;
//Buy Product
- (void)buyProduct:(SKProduct *)productIdentifier onCompletion:(IAPbuyProductCompleteResponseBlock)completion;
//restore Products
- (void)restoreProductsWithCompletion:(resoreProductsCompleteResponseBlock)completion;
//check isPurchased or not
- (BOOL)isPurchasedProductsIdentifier:(NSString*)productID;
//check receipt but recommend to use in server side instead of using this function
- (void)checkReceipt:(NSData*)receiptData onCompletion:(checkReceiptCompleteResponseBlock)completion;
- (void)checkReceipt:(NSData*)receiptData AndSharedSecret:(NSString*)secretKey onCompletion:(checkReceiptCompleteResponseBlock)completion;
//saved purchased product
- (void)provideContentWithTransaction:(SKPaymentTransaction *)transaction;
- (void)provideContent:(NSString *)productIdentifier __deprecated_msg("use provideContentWithTransaction: instead.");
//clear the saved products
- (void)clearSavedPurchasedProducts;
- (void)clearSavedPurchasedProductByID:(NSString*)productIdentifier;
//Get The Price with local currency
- (NSString *)getLocalePrice:(SKProduct *)product;
@end
//
// IAPShare.h
// ;
//
// Created by Htain Lin Shwe on 10/7/12.
// Copyright (c) 2012 Edenpod. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IAPHelper.h"
@interface IAPShare : NSObject
@property (nonatomic,strong) IAPHelper *iap;
+ (IAPShare *) sharedHelper;
+(id)toJSON:(NSString*)json;
@end
//
// NSString+Base64.h
// Newsstand
//
// Created by Carlo Vigiani on 29/Oct/11.
// Copyright (c) 2011 viggiosoft. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Base64)
+ (NSString *) base64StringFromData:(NSData *)data length:(long)length;
@end
#import <Foundation/Foundation.h>
@interface NSURLRequest (SSL)
+(BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
+(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
@end
//
// SFHFKeychainUtils.h
//
// Created by Buzz Andersen on 10/20/08.
// Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone.
// Copyright 2008 Sci-Fi Hi-Fi. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface SFHFKeychainUtils : NSObject {
}
+ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
+ (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
@end
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.youai.sdk</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
#import <PoolSdk/PoolSdk2.h>
@interface SDKInterface : Interface
@end
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "HNYouai/HNYouaiAllManager.h"
#import "HNYouai/HNYouaiHuiTiaoNotification.h"
#import "HNYouai/HNYouaiInformation.h"
#import "TrackingIO.h"
@implementation SDKInterface : Interface
int mExchange;
NSString *HNYouaiAppId;
NSString *HNYouaiAppKey;
- (void)SDKinit:(UIViewController *) control
{
[super SDKinit:control];
[HaiBaoJuheConfig getInstance];
[[HNYouaiAllManager HNYouaiInstance]HNYouaiChuShiHua];
[[HNYouaiAllManager HNYouaiInstance]HNYouaiYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:HNYouaiLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"HNYouaiToolCallBack" object:nil];
[[HaiBaoJuheChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
if(channelId == nil || [channelId length] <= 0){
channelId = @"unknown";
}
[TrackingIO initWithappKey:[[HaiBaoJuheConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
}
/**
登录SDK
*/
- (void)SDKloginSDK
{
//APPID APPKEY
HNYouaiAppId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_ID"];
HNYouaiAppKey =[[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_KEY"];
[[HNYouaiAllManager HNYouaiInstance]HNYouaiDengLu:HNYouaiAppId :HNYouaiAppKey :self.controller];
}
/**
loginCheck
*/
- (void)receiveLoginMessage:(NSNotification *)notification
{
NSLog(@"loginchek");
HaiBaoJuheLoginInfo *loginInfo = [HaiBaoJuheLoginInfo alloc];
loginInfo.openId = [[HNYouaiInformation getInstance]openId];
loginInfo.sign = [[HNYouaiInformation getInstance] token];
loginInfo.timestamp = [[HNYouaiInformation getInstance] timestamp];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[HaiBaoJuheChecker getInstance] startCheck:loginInfo];
});
}
-(NSString*)DataTojsonString:(id)object
{
NSString *jsonString = nil;
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
error:&error];
jsonString = [jsonData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
return jsonString;
}
/**
苹果支付结果回调
*/
- (void)HCKAssetsToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"HNYouaiToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
}else{//失败
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"];
NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10];
if (queryIdArray) {
}else{
queryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
}
for (NSString* arrayQueryId in queryIdArray) {
[tempQueryIdArray addObject:arrayQueryId];
}
[tempQueryIdArray addObject:queryId];
[userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
[userDefaults setObject:receiptStr forKey:queryId];
[userDefaults synchronize];
}
}
/**
支付 创建订单
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)payInfo
{
mExchange = [payInfo exchange].intValue;
[super SDKgzyazfWithGzyazfmentInfo:payInfo];
}
/**
SDK
*/
- (void)SDKgotoUserCenter
{
}
- (void)SDKreport:(HaiBaoJuheReportInfo *)reportInfo
{
NSLog(@"reportInfo");
NSString* reportType = [reportInfo reportType];
if (reportInfo) {
if ([reportType isEqualToString:REPORT_ENTER]) {
[TrackingIO setLoginWithAccountID:[reportInfo playerId]];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
}else if ([reportType isEqualToString:REPORT_CREATEROLE]){
[TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
}
}
}
/**
SDK
*/
- (void)SDKexitSDK
{
}
- (void)SDKlogoutSDK
{
NSLog(@"切换账号");
}
- (void)handleOpenurl:(NSURL *)url
{
}
- (void)receivePayMessage : (NSNotification *)notification;
{
NSString *order_id = [notification object];
NSLog(@"订单ID:%@", order_id);
}
//补单处理
- (void) handlerLeakOrder{
NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"];
NSLog(@"orderDic%@",queryIdArray);
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
if(queryIdArray){
for (NSString* queryId in queryIdArray) {
NSString* receiptStr = [userDefaults valueForKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
if([@"success" isEqualToString:result]){//成功
[userDefaults removeObjectForKey:queryId];
}else{//补单失败
[failQueryIdArray addObject:queryId];
}
}
if([failQueryIdArray count] > 0){//含有补单失败项
[userDefaults setObject:failQueryIdArray forKey:@"queryIds"];
}else{//全部补单成功
[userDefaults removeObjectForKey:@"queryIds"];
}
[userDefaults synchronize];
}
}
- (void)receiveCreateOrder:(NSNotification *)notification
{
NSLog(@"创建订单成功");
HaiBaoJuheGzyazfInfo *payInfo = [notification object];
NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
NSString *serverId = [payInfo serverId];
NSString *roleName = [payInfo playerName];
NSString *queryId = [payInfo queryId];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[HNYouaiAllManager HNYouaiInstance] HNYouaiQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
}else{
NSString* products = [payInfo products];
[[HNYouaiAllManager HNYouaiInstance] HNYouaiQueryOperation:self.controller HNYouaiHuoWuID:products HNYouaiJiaGe:[payInfo postAmount] HNYouaiHuoWuMing:[payInfo productName] HNYouaiDingDanHao:queryId];
}
}
-(void)paymentSuccess:(NSString *)accountId orderId:(NSString *)orderId currencyAmount:(double)amount currencyType:(NSString *)currencyType payType:(NSString *)payType custom:(NSArray *)customArray
{
[TrackingIO setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
}
@end
No preview for this file type
//
// NewTtack.h
// NewTtack
//
// Created by yun on 16/1/11.
// Copyright © 2016年 yun. All rights reserved.
//
#define TRACK_VERSION @"1.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*
热云移动广告效果监测 平台 api 请选择对应的api进行使用
*/
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
//开启打印日志 正式上线包请关掉
+(void) setPrintLog :(BOOL)print;
// 开启数据统计
+ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
//注册成功后调用
+ (void)setRegisterWithAccountID:(NSString *)account;
//登陆成功后调用
+ (void)setLoginWithAccountID:(NSString *)account;
//开始付费时 调用(人民币单位是元)
+(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
+(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
//自定义事件
+(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
//标准接口
+(void)setProfile:(NSDictionary *)dataDic;
//获取设备信息
+(NSString*)getDeviceId;
@end
NS_ASSUME_NONNULL_END
{"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"}