xuguohong

提交乐游iOS版本

Showing 115 changed files with 1203 additions and 3611 deletions
No preview for this file type
......@@ -8,10 +8,9 @@
/* Begin PBXBuildFile section */
269F653821B6613F006AEC88 /* HaiBaoJuheSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */; };
26B0A92122B1E96200FBBC10 /* Hierophant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26B0A92022B1E96200FBBC10 /* Hierophant.framework */; };
26B0AA0C22CB4AED00FBBC10 /* SDKInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 26B0AA0B22CB4AEC00FBBC10 /* SDKInterface.m */; };
845D18221C8D778400F27EB9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 845D181B1C8D778400F27EB9 /* Images.xcassets */; };
846BD2241EE9342700E89A1D /* hnyouai_config in Resources */ = {isa = PBXBuildFile; fileRef = 846BD21F1EE9342700E89A1D /* hnyouai_config */; };
846BD2261EE9342700E89A1D /* SDKInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 846BD2231EE9342700E89A1D /* SDKInterface.m */; };
846BD2241EE9342700E89A1D /* pt_config in Resources */ = {isa = PBXBuildFile; fileRef = 846BD21F1EE9342700E89A1D /* pt_config */; };
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 */; };
......@@ -29,7 +28,6 @@
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 */; };
......@@ -60,12 +58,11 @@
/* Begin PBXFileReference section */
269F653721B6613F006AEC88 /* HaiBaoJuheSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = HaiBaoJuheSDK.framework; sourceTree = "<group>"; };
26B0A92022B1E96200FBBC10 /* Hierophant.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Hierophant.framework; sourceTree = "<group>"; };
26B0AA0A22CB4AEC00FBBC10 /* SDKInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDKInterface.h; path = poolsdk_file/poolsdk/SDKInterface.h; sourceTree = "<group>"; };
26B0AA0B22CB4AEC00FBBC10 /* SDKInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDKInterface.m; path = poolsdk_file/poolsdk/SDKInterface.m; 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 /* hnyouai_config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = hnyouai_config; path = poolsdk_file/poolsdk/hnyouai_config; 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>"; };
846BD21F1EE9342700E89A1D /* pt_config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = pt_config; path = poolsdk_file/poolsdk/pt_config; 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>"; };
......@@ -86,8 +83,6 @@
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>"; };
......@@ -104,7 +99,6 @@
files = (
8484E5161EE7E36800B402D1 /* SystemConfiguration.framework in Frameworks */,
269F653821B6613F006AEC88 /* HaiBaoJuheSDK.framework in Frameworks */,
26B0A92122B1E96200FBBC10 /* Hierophant.framework in Frameworks */,
8484E4FC1EE7E1D800B402D1 /* libsqlite3.dylib in Frameworks */,
8484E5121EE7E2B800B402D1 /* libz.1.dylib in Frameworks */,
8484E5101EE7E29A00B402D1 /* libc++.1.dylib in Frameworks */,
......@@ -118,7 +112,6 @@
8484E50A1EE7E26200B402D1 /* Security.framework in Frameworks */,
8484E5041EE7E24400B402D1 /* StoreKit.framework in Frameworks */,
8484E4FE1EE7E1F700B402D1 /* CoreTelephony.framework in Frameworks */,
84A090AB1F160A69003D23FB /* TrackingIO.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -143,12 +136,9 @@
8476DF641C4DD71D00EC42BA /* poolsdk */ = {
isa = PBXGroup;
children = (
26B0A92022B1E96200FBBC10 /* Hierophant.framework */,
84A090AC1F174E21003D23FB /* TrackingIO.h */,
84A090AA1F160A69003D23FB /* TrackingIO.a */,
846BD21F1EE9342700E89A1D /* hnyouai_config */,
846BD2221EE9342700E89A1D /* SDKInterface.h */,
846BD2231EE9342700E89A1D /* SDKInterface.m */,
26B0AA0A22CB4AEC00FBBC10 /* SDKInterface.h */,
26B0AA0B22CB4AEC00FBBC10 /* SDKInterface.m */,
846BD21F1EE9342700E89A1D /* pt_config */,
845D181B1C8D778400F27EB9 /* Images.xcassets */,
845D181C1C8D778400F27EB9 /* Info.plist */,
);
......@@ -315,7 +305,7 @@
files = (
845D18221C8D778400F27EB9 /* Images.xcassets in Resources */,
BB5F3C971C1811BC00DA339D /* Main.storyboard in Resources */,
846BD2241EE9342700E89A1D /* hnyouai_config in Resources */,
846BD2241EE9342700E89A1D /* pt_config in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -333,7 +323,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
846BD2261EE9342700E89A1D /* SDKInterface.m in Sources */,
26B0AA0C22CB4AED00FBBC10 /* SDKInterface.m in Sources */,
8484E4F51EE7E0DC00B402D1 /* AppDelegate.m in Sources */,
847EE5E21EE9007E003A4B7B /* MainViewController.m in Sources */,
BB5F3C8E1C1811BC00DA339D /* main.m in Sources */,
......@@ -465,7 +455,7 @@
BB5F3CAC1C1811BC00DA339D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEAD_CODE_STRIPPING = NO;
......
#import <Foundation/Foundation.h>
@interface HierophantControl : NSObject
@interface AAAA_CalendarControl_BBBB : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HaiBaoJuheConfig : NSObject
@interface AAAA_HaiBaoJuheConfig_BBBB : NSObject
@property(nonatomic, strong)NSString *gameSimpleName;
@property(nonatomic, strong)NSString *sdkSimpleName;
......@@ -12,11 +12,11 @@
@property(nonatomic, strong)NSString *c2;
@property(nonatomic, strong)NSString *custom;
+ (HaiBaoJuheConfig *)getInstance;
+ (AAAA_HaiBaoJuheConfig_BBBB *)CCCC_getInstance_DDDD;
- (void) loadFile:(NSString *) fileName;
- (NSString *)getValueByKey:(NSString *) key;
- (NSString *)EEEE_getValueByKey_FFFF:(NSString *) key;
- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
......
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheGzyazfInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface AAAA_HaiBaoJuheGzyazfInfo_BBBB : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic, strong)NSString *serverId;
@property(nonatomic, strong)NSString *queryId;
......
//
// HaiBaoJuheNotification.h
// AAAA_HaiBaoJuheNotification_BBBB.h
// public_i9133
//
// Created by winFan on 12/1/15.
......@@ -28,7 +28,7 @@ typedef NS_ENUM(int, HaiBaoJuheSDKNotificationType) {
@interface HaiBaoJuheNotification : NSObject
@interface AAAA_HaiBaoJuheNotification_BBBB : NSObject
@end
......
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface HierophantHaiBaoJuheBaseModel : NSObject
@interface CCCC_CalendarHaiBaoJuheBaseModel_DDDD : NSObject
- (NSString *) HierophantHaiBaoJuheObjectToJsonString;
- (NSString *) CalendarHaiBaoJuheObjectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
......
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface EEEE_CalendarAllManager_FFFF : NSObject
{
NSString* CalendarAPPID_;
NSString* CalendarAPPKEY_;
NSString* CalendarInviterCode_;
}
@property(strong) NSMutableArray* CalendarList;
@property bool CalendarGeiWoHuaQianBa;
+ (EEEE_CalendarAllManager_FFFF *)GGGG_CalendarInstance_HHHH;
- (void)IIII_CalendarChuShiHua_JJJJ;
- (void)SSSS_CalendarDengLu_TTTT:(NSString *)CalendarAPPID : (NSString *)CalendarAPPKEY : (UIViewController *)controller;
- (void)KKKK_CalendarYangShi_LLLL:(NSString*)CalendarLeiXing;
- (void)CalendarQuery: (NSString *)CalendarFuWuQiID : (NSString *)CalendarNickName : (NSNumber *)CalendarAmount : (NSString *)CalendarCallBack : (UIViewController *)controller : (NSString *)CalendarServerName;
- (void)CalendarQueryOperation:(UIViewController*)controll CalendarHuoWuID:(NSString*)products CalendarJiaGe:(NSString*)amount CalendarHuoWuMing:(NSString*)productName CalendarDingDanHao:(NSString*) DingDanHao;
@end
......@@ -11,7 +11,7 @@ typedef NS_ENUM(NSInteger, DGLoggerLevel)
ELogError
};
@interface HierophantHaiBaoJuheDGLogger : NSObject
@interface EEEE_CalendarHaiBaoJuheDGLogger_FFFF : NSObject
+ (void)showLog:(NSString *)fmt,...;
......
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface EncryptTool : NSObject
+ (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth withData:(NSData *)argData;
+ (NSString *)doCipher:(NSString*)encryptValue;
+ (NSString *)decryptUseDES:(NSString *)cipherText;
@end
NS_ASSUME_NONNULL_END
#import <UIKit/UIKit.h>
@interface GGGG_CalendarIAPHelperControl_HHHH : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* CalendarDingDanHao;
@property(nonatomic,strong) NSDictionary* CalendarHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* CalendarHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *CalendarHuoWuLieBiaoView;
- (void)CalendarHuaQianView:(UIViewController*)controller CalendarHuoWuD:(NSString*)products CalendarQian:(NSString*)amount CalendarHuoWuMing:(NSString*)productName CalendarDingDanHao:(NSString*)DingDanHao;
@end
#import <Foundation/Foundation.h>
#import "GTMDefines.h"
@interface GTMBase64 : NSObject
+(NSData *)encodeData:(NSData *)data;
+(NSData *)decodeData:(NSData *)data;
+(NSData *)encodeBytes:(const void *)bytes length:(NSUInteger)length;
+(NSData *)decodeBytes:(const void *)bytes length:(NSUInteger)length;
+(NSString *)stringByEncodingData:(NSData *)data;
+(NSString *)stringByEncodingBytes:(const void *)bytes length:(NSUInteger)length;
+(NSData *)decodeString:(NSString *)string;
+(NSData *)webSafeEncodeData:(NSData *)data
padded:(BOOL)padded;
+(NSData *)webSafeDecodeData:(NSData *)data;
+(NSData *)webSafeEncodeBytes:(const void *)bytes
length:(NSUInteger)length
padded:(BOOL)padded;
+(NSData *)webSafeDecodeBytes:(const void *)bytes length:(NSUInteger)length;
+(NSString *)stringByWebSafeEncodingData:(NSData *)data
padded:(BOOL)padded;
+(NSString *)stringByWebSafeEncodingBytes:(const void *)bytes
length:(NSUInteger)length
padded:(BOOL)padded;
+(NSData *)webSafeDecodeString:(NSString *)string;
@end
#include <AvailabilityMacros.h>
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#include <Availability.h>
#endif // TARGET_OS_IPHONE
// Not all MAC_OS_X_VERSION_10_X macros defined in past SDKs
#ifndef MAC_OS_X_VERSION_10_5
#define MAC_OS_X_VERSION_10_5 1050
#endif
#ifndef MAC_OS_X_VERSION_10_6
#define MAC_OS_X_VERSION_10_6 1060
#endif
// Not all __IPHONE_X macros defined in past SDKs
#ifndef __IPHONE_2_1
#define __IPHONE_2_1 20100
#endif
#ifndef __IPHONE_2_2
#define __IPHONE_2_2 20200
#endif
#ifndef __IPHONE_3_0
#define __IPHONE_3_0 30000
#endif
#ifndef __IPHONE_3_1
#define __IPHONE_3_1 30100
#endif
#ifndef __IPHONE_3_2
#define __IPHONE_3_2 30200
#endif
#ifndef __IPHONE_4_0
#define __IPHONE_4_0 40000
#endif
// ----------------------------------------------------------------------------
// CPP symbols that can be overridden in a prefix to control how the toolbox
// is compiled.
// ----------------------------------------------------------------------------
// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and
// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens
// when a validation fails. If you implement your own validators, you may want
// to control their internals using the same macros for consistency.
#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT
#define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0
#endif
// Give ourselves a consistent way to do inlines. Apple's macros even use
// a few different actual definitions, so we're based off of the foundation
// one.
#if !defined(GTM_INLINE)
#if defined (__GNUC__) && (__GNUC__ == 4)
#define GTM_INLINE static __inline__ __attribute__((always_inline))
#else
#define GTM_INLINE static __inline__
#endif
#endif
// Give ourselves a consistent way of doing externs that links up nicely
// when mixing objc and objc++
#if !defined (GTM_EXTERN)
#if defined __cplusplus
#define GTM_EXTERN extern "C"
#define GTM_EXTERN_C_BEGIN extern "C" {
#define GTM_EXTERN_C_END }
#else
#define GTM_EXTERN extern
#define GTM_EXTERN_C_BEGIN
#define GTM_EXTERN_C_END
#endif
#endif
// Give ourselves a consistent way of exporting things if we have visibility
// set to hidden.
#if !defined (GTM_EXPORT)
#define GTM_EXPORT __attribute__((visibility("default")))
#endif
// Give ourselves a consistent way of declaring something as unused. This
// doesn't use __unused because that is only supported in gcc 4.2 and greater.
#if !defined (GTM_UNUSED)
#define GTM_UNUSED(x) ((void)(x))
#endif
// _GTMDevLog & _GTMDevAssert
//
// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for
// developer level errors. This implementation simply macros to NSLog/NSAssert.
// It is not intended to be a general logging/reporting system.
//
// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert
// for a little more background on the usage of these macros.
//
// _GTMDevLog log some error/problem in debug builds
// _GTMDevAssert assert if conditon isn't met w/in a method/function
// in all builds.
//
// To replace this system, just provide different macro definitions in your
// prefix header. Remember, any implementation you provide *must* be thread
// safe since this could be called by anything in what ever situtation it has
// been placed in.
//
// We only define the simple macros if nothing else has defined this.
#ifndef _GTMDevLog
#ifdef DEBUG
#define _GTMDevLog(...) NSLog(__VA_ARGS__)
#else
#define _GTMDevLog(...) do { } while (0)
#endif
#endif // _GTMDevLog
#ifndef _GTMDevAssert
// we directly invoke the NSAssert handler so we can pass on the varargs
// (NSAssert doesn't have a macro we can use that takes varargs)
#if !defined(NS_BLOCK_ASSERTIONS)
#define _GTMDevAssert(condition, ...) \
do { \
if (!(condition)) { \
[[NSAssertionHandler currentHandler] \
handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \
file:[NSString stringWithUTF8String:__FILE__] \
lineNumber:__LINE__ \
description:__VA_ARGS__]; \
} \
} while(0)
#else // !defined(NS_BLOCK_ASSERTIONS)
#define _GTMDevAssert(condition, ...) do { } while (0)
#endif // !defined(NS_BLOCK_ASSERTIONS)
#endif // _GTMDevAssert
// _GTMCompileAssert
// _GTMCompileAssert is an assert that is meant to fire at compile time if you
// want to check things at compile instead of runtime. For example if you
// want to check that a wchar is 4 bytes instead of 2 you would use
// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X)
// Note that the second "arg" is not in quotes, and must be a valid processor
// symbol in it's own right (no spaces, punctuation etc).
// Wrapping this in an #ifndef allows external groups to define their own
// compile time assert scheme.
#ifndef _GTMCompileAssert
// We got this technique from here:
// http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html
#define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg
#define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg)
#define _GTMCompileAssert(test, msg) \
typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ]
#endif // _GTMCompileAssert
// ----------------------------------------------------------------------------
// CPP symbols defined based on the project settings so the GTM code has
// simple things to test against w/o scattering the knowledge of project
// setting through all the code.
// ----------------------------------------------------------------------------
// Provide a single constant CPP symbol that all of GTM uses for ifdefing
// iPhone code.
#if TARGET_OS_IPHONE // iPhone SDK
// For iPhone specific stuff
#define GTM_IPHONE_SDK 1
#if TARGET_IPHONE_SIMULATOR
#define GTM_IPHONE_SIMULATOR 1
#else
#define GTM_IPHONE_DEVICE 1
#endif // TARGET_IPHONE_SIMULATOR
#else
// For MacOS specific stuff
#define GTM_MACOS_SDK 1
#endif
// Some of our own availability macros
#if GTM_MACOS_SDK
#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE
#define GTM_AVAILABLE_ONLY_ON_MACOS
#else
#define GTM_AVAILABLE_ONLY_ON_IPHONE
#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE
#endif
// Provide a symbol to include/exclude extra code for GC support. (This mainly
// just controls the inclusion of finalize methods).
#ifndef GTM_SUPPORT_GC
#if GTM_IPHONE_SDK
// iPhone never needs GC
#define GTM_SUPPORT_GC 0
#else
// We can't find a symbol to tell if GC is supported/required, so best we
// do on Mac targets is include it if we're on 10.5 or later.
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
#define GTM_SUPPORT_GC 0
#else
#define GTM_SUPPORT_GC 1
#endif
#endif
#endif
// To simplify support for 64bit (and Leopard in general), we provide the type
// defines for non Leopard SDKs
#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// NSInteger/NSUInteger and Max/Mins
#ifndef NSINTEGER_DEFINED
#if __LP64__ || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
#define NSIntegerMax LONG_MAX
#define NSIntegerMin LONG_MIN
#define NSUIntegerMax ULONG_MAX
#define NSINTEGER_DEFINED 1
#endif // NSINTEGER_DEFINED
// CGFloat
#ifndef CGFLOAT_DEFINED
#if defined(__LP64__) && __LP64__
// This really is an untested path (64bit on Tiger?)
typedef double CGFloat;
#define CGFLOAT_MIN DBL_MIN
#define CGFLOAT_MAX DBL_MAX
#define CGFLOAT_IS_DOUBLE 1
#else /* !defined(__LP64__) || !__LP64__ */
typedef float CGFloat;
#define CGFLOAT_MIN FLT_MIN
#define CGFLOAT_MAX FLT_MAX
#define CGFLOAT_IS_DOUBLE 0
#endif /* !defined(__LP64__) || !__LP64__ */
#define CGFLOAT_DEFINED 1
#endif // CGFLOAT_DEFINED
#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
// Some support for advanced clang static analysis functionality
// See http://clang-analyzer.llvm.org/annotations.html
#ifndef __has_feature // Optional.
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef NS_RETURNS_RETAINED
#if __has_feature(attribute_ns_returns_retained)
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
#else
#define NS_RETURNS_RETAINED
#endif
#endif
#ifndef NS_RETURNS_NOT_RETAINED
#if __has_feature(attribute_ns_returns_not_retained)
#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
#else
#define NS_RETURNS_NOT_RETAINED
#endif
#endif
#ifndef CF_RETURNS_RETAINED
#if __has_feature(attribute_cf_returns_retained)
#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
#else
#define CF_RETURNS_RETAINED
#endif
#endif
#ifndef CF_RETURNS_NOT_RETAINED
#if __has_feature(attribute_cf_returns_not_retained)
#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
#else
#define CF_RETURNS_NOT_RETAINED
#endif
#endif
// Defined on 10.6 and above.
#ifndef NS_FORMAT_ARGUMENT
#define NS_FORMAT_ARGUMENT(A)
#endif
// Defined on 10.6 and above.
#ifndef NS_FORMAT_FUNCTION
#define NS_FORMAT_FUNCTION(F,A)
#endif
// Defined on 10.6 and above.
#ifndef CF_FORMAT_ARGUMENT
#define CF_FORMAT_ARGUMENT(A)
#endif
// Defined on 10.6 and above.
#ifndef CF_FORMAT_FUNCTION
#define CF_FORMAT_FUNCTION(F,A)
#endif
#ifndef GTM_NONNULL
#define GTM_NONNULL(x) __attribute__((nonnull(x)))
#endif
#ifdef __OBJC__
// Declared here so that it can easily be used for logging tracking if
// necessary. See GTMUnitTestDevLog.h for details.
@class NSString;
GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...);
// Macro to allow you to create NSStrings out of other macros.
// #define FOO foo
// NSString *fooString = GTM_NSSTRINGIFY(FOO);
#if !defined (GTM_NSSTRINGIFY)
#define GTM_NSSTRINGIFY_INNER(x) @#x
#define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x)
#endif
// Macro to allow fast enumeration when building for 10.5 or later, and
// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration
// does keys, so pick the right thing, nothing is done on the FastEnumeration
// side to be sure you're getting what you wanted.
#ifndef GTM_FOREACH_OBJECT
#if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
#define GTM_FOREACH_ENUMEREE(element, enumeration) \
for (element in enumeration)
#define GTM_FOREACH_OBJECT(element, collection) \
for (element in collection)
#define GTM_FOREACH_KEY(element, collection) \
for (element in collection)
#else
#define GTM_FOREACH_ENUMEREE(element, enumeration) \
for (NSEnumerator *_ ## element ## _enum = enumeration; \
(element = [_ ## element ## _enum nextObject]) != nil; )
#define GTM_FOREACH_OBJECT(element, collection) \
GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator])
#define GTM_FOREACH_KEY(element, collection) \
GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator])
#endif
#endif
// ============================================================================
// To simplify support for both Leopard and Snow Leopard we declare
// the Snow Leopard protocols that we need here.
#if !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
#define GTM_10_6_PROTOCOLS_DEFINED 1
@protocol NSConnectionDelegate
@end
@protocol NSAnimationDelegate
@end
@protocol NSImageDelegate
@end
@protocol NSTabViewDelegate
@end
#endif // !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
// GTM_SEL_STRING is for specifying selector (usually property) names to KVC
// or KVO methods.
// In debug it will generate warnings for undeclared selectors if
// -Wunknown-selector is turned on.
// In release it will have no runtime overhead.
#ifndef GTM_SEL_STRING
#ifdef DEBUG
#define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName))
#else
#define GTM_SEL_STRING(selName) @#selName
#endif // DEBUG
#endif // GTM_SEL_STRING
#endif // __OBJC__
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheCreateOrderInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface HaiBaoJuheCreateOrderInfo : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic,strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
......@@ -16,7 +16,7 @@
@property(nonatomic, strong)NSString *userId;//用户ID
@property(nonatomic, strong)NSString *timestamp;//时间戳
- (NSString *) HierophantHaiBaoJuheGetTsign ;
- (NSString *) HierophantHaiBaoJuheGetTimestamp ;
- (NSString *) CalendarHaiBaoJuheGetTsign ;
- (NSString *) CalendarHaiBaoJuheGetTimestamp ;
@end
......
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheLoginInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface HaiBaoJuheLoginInfo : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic,strong)NSString *timestamp;
@property(nonatomic, strong)NSString *sign;
......
//
// HierophantHaiBaoJuheReportInfo.h
// CalendarHaiBaoJuheReportInfo.h
// HaiBaoJuheSDK
//
// Created by winFan on 12/21/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheReportInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface HaiBaoJuheReportInfo : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic, strong)NSString *reportType;//类型
@property(nonatomic, strong)NSString *playerId;//玩家ID
......@@ -30,9 +30,9 @@
@property(nonatomic, strong)NSString *openId;
#define REPORT_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/statistic"
//#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_IDFA_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
#define REPORT_OPEN @"open"
#define REPORT_ENTER @"enter"
......
......@@ -10,7 +10,7 @@
@property(nonatomic, strong)NSString *urlSchemes;
@property(strong) NSMutableArray* HierophantList;
@property(strong) NSMutableArray* CalendarList;
@property BOOL isAppleGzyazfing;
......
#import <UIKit/UIKit.h>
#import "HaiBaoJuheChecker.h"
#import "OOOO_HaiBaoJuheChecker_PPPP.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheLoginInfo.h"
#import "Interface.h"
#import "HaiBaoJuheNotification.h"
#import "HaiBaoJuheGzyazfInfo.h"
#import "AAAA_HaiBaoJuheNotification_BBBB.h"
#import "AAAA_HaiBaoJuheGzyazfInfo_BBBB.h"
#import "UnionInterface.h"
#import "HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheConfig.h"
#import "HaiBaoJuheUtils.h"
#import "AAAA_HaiBaoJuheConfig_BBBB.h"
#import "MMMM_HaiBaoJuheUtils_NNNN.h"
#import "NetCenter.h"
#import "HaiBaoJuheSDK.h"
#import "HaiBaoJuheSDKDelegate.h"
......
#import <Foundation/Foundation.h>
@interface HierophantInformation : NSObject
@interface IIII_CalendarInformation_JJJJ : NSObject
{
//
NSString *openId;
......@@ -12,5 +12,5 @@ NSString *timestamp;
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (HierophantInformation *)getInstance;
+ (IIII_CalendarInformation_JJJJ *)getInstance;
@end
......
#import <Foundation/Foundation.h>
@interface HierophantControl1 : NSObject
@interface KKKK_CalendarControl_LLLL : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HierophantInformationJM : NSObject
@interface KKKK_CalendarInformationJM_LLLL : NSObject
+(NSString *)HierophantJM:(NSString *)jm;
+(NSString *)CalendarJM:(NSString *)jm;
@end
......
#import <UIKit/UIKit.h>
#import "HierophantInformation.h"
#import "IIII_CalendarInformation_JJJJ.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface HierophantMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
@interface MMMM_CalendarMain_NNNN : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webHierophantView_;
UIWebView *webCalendarView_;
UIActivityIndicatorView *activityIndicator;
}
@property(assign) BOOL HierophantYouYuanJiao;
@property(assign) BOOL CalendarYouYuanJiao;
- (void)HierophantSettingHierophantView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)HierophantInitWebView;
- (void)CalendarSettingCalendarView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)CalendarInitWebView;
- (void)loadWebPageWithString:(NSString *)url;
- (void)loadWebPageWithJs:(NSString *)content;
- (void)postNotification:(NSString *)name : (NSString *)code;
......
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface HaiBaoJuheUtils : NSObject
@interface MMMM_HaiBaoJuheUtils_NNNN : NSObject
+(NSString *)md5:(NSString *)str;
+ (NSDictionary *) HierophantHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
+ (NSDictionary *) CalendarHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createGzyazfOrderUrl;
//*充值回调地址
+(NSString *)createGzyazfUrl;
+(NSString *)AAAA_createGzyazfUrl_BBBB;
+(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
+(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
......
#import <UIKit/UIKit.h>
@interface HierophantLocation : NSObject
@interface OOOO_CalendarLocation_PPPP : NSObject
+ (NSString *)HierophantSKCloudServiceSetupOptionsKey;
+ (NSString *)CalendarSKCloudServiceSetupOptionsKey;
@end
......
#import <Foundation/Foundation.h>
#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
#import "HaiBaoJuheLoginInfo.h"
#import "AAAA_HaiBaoJuheNotification_BBBB.h"
#import "HaiBaoJuheCreateOrderInfo.h"
#import "AAAA_HaiBaoJuheGzyazfInfo_BBBB.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheSDKDelegate.h"
@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
@interface OOOO_HaiBaoJuheChecker_PPPP : NSObject<HaiBaoJuheSDKDelegate>
@property(nonatomic, strong)NSString *userId;
@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
@property bool onlyOneTimeGzyazf;
+ (HaiBaoJuheChecker *)getInstance;
+ (OOOO_HaiBaoJuheChecker_PPPP *)QQQQ_getInstance_RRRR;
- (void)initChecker;
- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (void) HierophantHaiBaoJuhereportOpen;
- (void) HierophantHaiBaoJuhereportSDKOpen;
- (void) HierophantHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
- (void) CalendarHaiBaoJuhereportOpen;
- (void) CalendarHaiBaoJuhereportSDKOpen;
- (void) CalendarHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
- (void) HierophantHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
- (void) CalendarHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
notiName:(NSString *)notiName
statusCode:(int)nCode
......@@ -28,7 +28,7 @@
- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
- (void) HierophantHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
- (void) CalendarHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
/*
*初始化时调用
......
#import <Foundation/Foundation.h>
@interface HierophantControl2 : NSObject
@interface QQQQ_CalendarControl_RRRR : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HierophantControl3 : NSObject
@interface SSSS_CalendarControl_TTTT : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HierophantControl4 : NSObject
@interface UUUU_CalendarControl_VVVV : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
extern NSString * const EEEE_CalendarExitNotification_FFFF;
extern NSString * const AAAA_CalendarLoginNotification_BBBB;
extern NSString * const CCCC_CalendarErrorNotification_DDDD;
@interface UUUU_CalendarHuiTiaoNotification_VVVV : NSObject
@end
framework module HaiBaoJuheSDK {
umbrella header "HaiBaoJuheSDK.h"
export *
module * { export * }
}
......@@ -104,13 +104,13 @@ NSString* sdkUserId = @"";
[payInfo setPlayerName:@"iamrolename"];
[payInfo setPlayerLevel:@"10"];
[payInfo setUserId:sdkUserId];
[payInfo setPostAmount:@"1"];
[payInfo setProductId:@"com.xiongdi.xunqinji.6"];
[payInfo setPostAmount:@"6"];
[payInfo setProductId:@"com.gzss.rsrzrcj.6"];
[payInfo setPlayerId:@"1231241234"];
[payInfo setProductName:@"com.xiongdi.xunqinji.6"];
[payInfo setProductName:@"60金币"];
[payInfo setProductDesc:@"productDes"];
[payInfo setTimestamp:@"1232134"];
[payInfo setExchange:@"1"];
[payInfo setExchange:@"10"];
[payInfo setServerName:@"servername"];
[payInfo setCustom:@"custom"];
[[HaiBaoJuheSDK shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
......
......@@ -95,7 +95,7 @@
- (void)receiveSDKMessage:(NSNotification *)notification
{
NSLog(@"receiveSDKMessage");
[[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
//[[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
HaiBaoJuheSDKResult *result = [notification object];
if (result == nil ) {
return;
......
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface HierophantAllManager : NSObject
{
NSString* HierophantAPPID_;
NSString* HierophantAPPKEY_;
NSString* HierophantInviterCode_;
}
@property(strong) NSMutableArray* HierophantList;
@property bool HierophantGeiWoHuaQianBa;
+ (HierophantAllManager *)HierophantInstance;
- (void)HierophantChuShiHua;
- (void)HierophantDengLu:(NSString *)HierophantAPPID : (NSString *)HierophantAPPKEY : (UIViewController *)controller;
- (void)HierophantYangShi:(NSString*)HierophantLeiXing;
- (void)HierophantQuery: (NSString *)HierophantFuWuQiID : (NSString *)HierophantNickName : (NSNumber *)HierophantAmount : (NSString *)HierophantCallBack : (UIViewController *)controller : (NSString *)HierophantServerName;
- (void)HierophantQueryOperation:(UIViewController*)controll HierophantHuoWuID:(NSString*)products HierophantJiaGe:(NSString*)amount HierophantHuoWuMing:(NSString*)productName HierophantDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const HierophantExitNotification;
extern NSString * const HierophantLoginNotification;
extern NSString * const HierophantErrorNotification;
@interface HierophantHuiTiaoNotification : NSObject
@end
#import <UIKit/UIKit.h>
@interface HierophantIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* HierophantDingDanHao;
@property(nonatomic,strong) NSDictionary* HierophantHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* HierophantHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *HierophantHuoWuLieBiaoView;
- (void)HierophantHuaQianView:(UIViewController*)controller HierophantHuoWuD:(NSString*)products HierophantQian:(NSString*)amount HierophantHuoWuMing:(NSString*)productName HierophantDingDanHao:(NSString*)DingDanHao;
@end
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
......@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>海南游爱DEMO</string>
<string>神手DEMO</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.408</string>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
......
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "Hierophant/HierophantAllManager.h"
#import "Hierophant/HierophantHuiTiaoNotification.h"
#import "Hierophant/HierophantInformation.h"
#import "TrackingIO.h"
#import "HaiBaoJuheSDK/EEEE_CalendarAllManager_FFFF.h"
#import "HaiBaoJuheSDK/UUUU_CalendarHuiTiaoNotification_VVVV.h"
#import "HaiBaoJuheSDK/IIII_CalendarInformation_JJJJ.h"
@implementation SDKInterface : Interface
int mExchange;
NSString *HierophantAppId;
NSString *HierophantAppKey;
NSString *HierophantLeakOrderUrl;
NSString *CalendarAppId;
NSString *CalendarAppKey;
NSString *CalendarLeakOrderUrl;
- (void)SDKinit:(UIViewController *) control
{
[super SDKinit:control];
[HaiBaoJuheConfig getInstance];
[[HierophantAllManager HierophantInstance]HierophantChuShiHua];
[[HierophantAllManager HierophantInstance]HierophantYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:HierophantLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"HierophantToolCallBack" object:nil];
[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH]IIII_CalendarChuShiHua_JJJJ];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH]KKKK_CalendarYangShi_LLLL:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:AAAA_CalendarLoginNotification_BBBB object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"CalendarToolCallBack" object:nil];
[[HaiBaoJuheChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
[[OOOO_HaiBaoJuheChecker_PPPP QQQQ_getInstance_RRRR] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
NSString* channelId = [[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD] EEEE_getValueByKey_FFFF:@"gamechannelid"];
if(channelId == nil || [channelId length] <= 0){
channelId = @"unknown";
}
[TrackingIO initWithappKey:[[HaiBaoJuheConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
}
/**
......@@ -40,9 +37,9 @@ NSString *HierophantLeakOrderUrl;
- (void)SDKloginSDK
{
//APPID APPKEY
HierophantAppId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_ID"];
HierophantAppKey =[[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_KEY"];
[[HierophantAllManager HierophantInstance]HierophantDengLu:HierophantAppId :HierophantAppKey :self.controller];
CalendarAppId = [[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD] EEEE_getValueByKey_FFFF:@"APP_ID"];
CalendarAppKey =[[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD] EEEE_getValueByKey_FFFF:@"APP_KEY"];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH]SSSS_CalendarDengLu_TTTT:CalendarAppId :CalendarAppKey :self.controller];
}
......@@ -53,12 +50,12 @@ NSString *HierophantLeakOrderUrl;
{
NSLog(@"loginchek");
HaiBaoJuheLoginInfo *loginInfo = [HaiBaoJuheLoginInfo alloc];
loginInfo.openId = [[HierophantInformation getInstance]openId];
loginInfo.sign = [[HierophantInformation getInstance] token];
loginInfo.timestamp = [[HierophantInformation getInstance] timestamp];
loginInfo.openId = [[IIII_CalendarInformation_JJJJ getInstance]openId];
loginInfo.sign = [[IIII_CalendarInformation_JJJJ getInstance] token];
loginInfo.timestamp = [[IIII_CalendarInformation_JJJJ getInstance] timestamp];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[HaiBaoJuheChecker getInstance] startCheck:loginInfo];
[[OOOO_HaiBaoJuheChecker_PPPP QQQQ_getInstance_RRRR] startCheck:loginInfo];
});
}
......@@ -82,7 +79,7 @@ NSString *HierophantLeakOrderUrl;
- (void)HCKAssetsToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"HierophantToolResult"];
NSString* receiptStr = [payResultDic objectForKey:@"CalendarToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
//收到回调,保存queryid和data
......@@ -101,9 +98,10 @@ NSString *HierophantLeakOrderUrl;
[userDefaults setObject:receiptStr forKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:HierophantLeakOrderUrl :receiptDic];
NSString* result = [[NetCenter getInstance] httpPostSyn:CalendarLeakOrderUrl :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
[[OOOO_HaiBaoJuheChecker_PPPP QQQQ_getInstance_RRRR] sendNotice:HaiBaoJuheSDKNotificationGzyazf notiName:@"success" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"success" extendData:nil];
//删除已保存的
[userDefaults removeObjectForKey:queryId];
[tempQueryIdArray removeObject:queryId];
......@@ -121,11 +119,11 @@ NSString *HierophantLeakOrderUrl;
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSString* lastqueryid = [userDefaults objectForKey:@"lastqueryid"];
HierophantLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[HaiBaoJuheUtils createGzyazfUrl],
CalendarLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[MMMM_HaiBaoJuheUtils_NNNN AAAA_createGzyazfUrl_BBBB],
[payInfo userId],
[payInfo playerId]];
[userDefaults setObject:HierophantLeakOrderUrl forKey:@"lastHierophantLeakOrderUrl"];
[userDefaults setObject:CalendarLeakOrderUrl forKey:@"lastCalendarLeakOrderUrl"];
if (lastqueryid!=nil) {
//创建订单前进行补单
......@@ -135,7 +133,7 @@ NSString *HierophantLeakOrderUrl;
receiptStr = [receiptStr stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
//如果不为空,进行最后一次补单
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",lastqueryid,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:HierophantLeakOrderUrl :receiptDic];
NSString* result = [[NetCenter getInstance] httpPostSyn:CalendarLeakOrderUrl :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
//删除已保存的
[userDefaults removeObjectForKey:@"lastqueryid"];
......@@ -145,8 +143,8 @@ NSString *HierophantLeakOrderUrl;
mExchange = [payInfo exchange].intValue;
[super SDKgzyazfWithGzyazfmentInfo:payInfo];
HierophantLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[HaiBaoJuheUtils createGzyazfUrl],
CalendarLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[MMMM_HaiBaoJuheUtils_NNNN AAAA_createGzyazfUrl_BBBB],
[payInfo userId],
[payInfo playerId]];
[userDefaults synchronize];
......@@ -165,13 +163,10 @@ NSString *HierophantLeakOrderUrl;
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]];
}
}
}
......@@ -212,12 +207,12 @@ NSString *HierophantLeakOrderUrl;
for (NSString* queryId in queryIdArray) {
NSString* receiptStr = [userDefaults valueForKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* lastHierophantLeakOrderUrl = [userDefaults objectForKey:@"lastHierophantLeakOrderUrl"];
NSString* lastCalendarLeakOrderUrl = [userDefaults objectForKey:@"lastCalendarLeakOrderUrl"];
NSString* result;
if (lastHierophantLeakOrderUrl!=nil) {
result = [[NetCenter getInstance] httpPostSyn:lastHierophantLeakOrderUrl :receiptDic];
if (lastCalendarLeakOrderUrl!=nil) {
result = [[NetCenter getInstance] httpPostSyn:lastCalendarLeakOrderUrl :receiptDic];
}else{
result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
result = [[NetCenter getInstance] httpPostSyn:[MMMM_HaiBaoJuheUtils_NNNN AAAA_createGzyazfUrl_BBBB] :receiptDic];
}
if([@"success" isEqualToString:result]){//成功
[userDefaults removeObjectForKey:queryId];
......@@ -239,34 +234,25 @@ NSString *HierophantLeakOrderUrl;
- (void)receiveCreateOrder:(NSNotification *)notification
{
NSLog(@"创建订单成功");
HaiBaoJuheGzyazfInfo *payInfo = [notification object];
AAAA_HaiBaoJuheGzyazfInfo_BBBB *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) {
[[HierophantAllManager HierophantInstance] HierophantQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
}else{
NSString* products = [payInfo products];
//保存订单号到本地
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:queryId forKey:@"lastqueryid"];
[userDefaults synchronize];
[[HierophantAllManager HierophantInstance] HierophantQueryOperation:self.controller HierophantHuoWuID:products HierophantJiaGe:[payInfo postAmount] HierophantHuoWuMing:[payInfo productName] HierophantDingDanHao:queryId];
}
NSString* products = [payInfo products];
//保存订单号到本地
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:queryId forKey:@"lastqueryid"];
[userDefaults synchronize];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH] CalendarQueryOperation:self.controller CalendarHuoWuID:products CalendarJiaGe:[payInfo postAmount] CalendarHuoWuMing:[payInfo productName] CalendarDingDanHao: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
......
//
// 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": "", "payorderurl": "https://public.sdk.haibaoyouxi.com/paycheck/create", "usertype": 527, "sdkSimpleName": "apple_hainanyouai", "gamechannelid": "", "APP_KEY": "3ffc998a226aded345f668fe3b6d1f39", "custom": "{}", "sdkVersionCode": "V1_2", "loginCheckUrl": "https://public.sdk.haibaoyouxi.com/logincheck/check", "appScheme": "com.IOshv.hlTcv", "c2": "", "c1": "", "APP_ID": "5c6e4b4448d88d469e322b8a", "paycheckurl": "https://public.sdk.haibaoyouxi.com/paycheck/confirm", "gameSimpleName": "dqqmzz"}
{"payorderurl": "https://pay.public.hkleyougame.com/paycheck/create", "usertype": 5, "sdkSimpleName": "apple_leyou", "gamechannelid": "", "APP_KEY": "b1b13ca8609d29036ceae3c565647d6a", "custom": "{}","logReportUrl": "https://statistic.public.hkleyougame.com/sdk/statistic", "encode": "0", "sdkVersionCode": "V1_2", "loginCheckUrl": "https://login.public.hkleyougame.com/logincheck/check", "appScheme": "com.xxx.xxx11", "descode": "12345678", "c2": "", "c1": "", "APP_ID": "5cecee0487192a3460670102", "paycheckurl": "https://pay.public.hkleyougame.com/paycheck/confirm", "gameSimpleName": "fytx_test"}
#海外SDK
\ No newline at end of file
新接入请参考对接文档和demo<br>
## 曾接入公共SDK的快速更新 聚合SDK <br>
1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
3、``` 替换SDKInterface.m文件 ``` <br>
4、``` 删除 PoolSdk.framework ``` <br>
5、``` 引入HaiBaoJuheSDK.framework ``` <br>
6、``` 原pool_setting文件 替换成新 pt_config 文件 ``` <br>
7、``` 所有接口PoolSdk 替换成 HaiBaoJuheSDK(如不理解可以参考demo或者详细文档) ```
\ No newline at end of file
......
No preview for this file type
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
No preview for this file type
#import <Foundation/Foundation.h>
@interface HierophantControl : NSObject
@interface AAAA_CalendarControl_BBBB : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HaiBaoJuheConfig : NSObject
@interface AAAA_HaiBaoJuheConfig_BBBB : NSObject
@property(nonatomic, strong)NSString *gameSimpleName;
@property(nonatomic, strong)NSString *sdkSimpleName;
......@@ -12,11 +12,11 @@
@property(nonatomic, strong)NSString *c2;
@property(nonatomic, strong)NSString *custom;
+ (HaiBaoJuheConfig *)getInstance;
+ (AAAA_HaiBaoJuheConfig_BBBB *)CCCC_getInstance_DDDD;
- (void) loadFile:(NSString *) fileName;
- (NSString *)getValueByKey:(NSString *) key;
- (NSString *)EEEE_getValueByKey_FFFF:(NSString *) key;
- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
......
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheGzyazfInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface AAAA_HaiBaoJuheGzyazfInfo_BBBB : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic, strong)NSString *serverId;
@property(nonatomic, strong)NSString *queryId;
......
//
// HaiBaoJuheNotification.h
// AAAA_HaiBaoJuheNotification_BBBB.h
// public_i9133
//
// Created by winFan on 12/1/15.
......@@ -28,7 +28,7 @@ typedef NS_ENUM(int, HaiBaoJuheSDKNotificationType) {
@interface HaiBaoJuheNotification : NSObject
@interface AAAA_HaiBaoJuheNotification_BBBB : NSObject
@end
......
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface HierophantHaiBaoJuheBaseModel : NSObject
@interface CCCC_CalendarHaiBaoJuheBaseModel_DDDD : NSObject
- (NSString *) HierophantHaiBaoJuheObjectToJsonString;
- (NSString *) CalendarHaiBaoJuheObjectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
......
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface EEEE_CalendarAllManager_FFFF : NSObject
{
NSString* CalendarAPPID_;
NSString* CalendarAPPKEY_;
NSString* CalendarInviterCode_;
}
@property(strong) NSMutableArray* CalendarList;
@property bool CalendarGeiWoHuaQianBa;
+ (EEEE_CalendarAllManager_FFFF *)GGGG_CalendarInstance_HHHH;
- (void)IIII_CalendarChuShiHua_JJJJ;
- (void)SSSS_CalendarDengLu_TTTT:(NSString *)CalendarAPPID : (NSString *)CalendarAPPKEY : (UIViewController *)controller;
- (void)KKKK_CalendarYangShi_LLLL:(NSString*)CalendarLeiXing;
- (void)CalendarQuery: (NSString *)CalendarFuWuQiID : (NSString *)CalendarNickName : (NSNumber *)CalendarAmount : (NSString *)CalendarCallBack : (UIViewController *)controller : (NSString *)CalendarServerName;
- (void)CalendarQueryOperation:(UIViewController*)controll CalendarHuoWuID:(NSString*)products CalendarJiaGe:(NSString*)amount CalendarHuoWuMing:(NSString*)productName CalendarDingDanHao:(NSString*) DingDanHao;
@end
......@@ -11,7 +11,7 @@ typedef NS_ENUM(NSInteger, DGLoggerLevel)
ELogError
};
@interface HierophantHaiBaoJuheDGLogger : NSObject
@interface EEEE_CalendarHaiBaoJuheDGLogger_FFFF : NSObject
+ (void)showLog:(NSString *)fmt,...;
......
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface EncryptTool : NSObject
+ (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth withData:(NSData *)argData;
+ (NSString *)doCipher:(NSString*)encryptValue;
+ (NSString *)decryptUseDES:(NSString *)cipherText;
@end
NS_ASSUME_NONNULL_END
#import <UIKit/UIKit.h>
@interface GGGG_CalendarIAPHelperControl_HHHH : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* CalendarDingDanHao;
@property(nonatomic,strong) NSDictionary* CalendarHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* CalendarHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *CalendarHuoWuLieBiaoView;
- (void)CalendarHuaQianView:(UIViewController*)controller CalendarHuoWuD:(NSString*)products CalendarQian:(NSString*)amount CalendarHuoWuMing:(NSString*)productName CalendarDingDanHao:(NSString*)DingDanHao;
@end
#import <Foundation/Foundation.h>
#import "GTMDefines.h"
@interface GTMBase64 : NSObject
+(NSData *)encodeData:(NSData *)data;
+(NSData *)decodeData:(NSData *)data;
+(NSData *)encodeBytes:(const void *)bytes length:(NSUInteger)length;
+(NSData *)decodeBytes:(const void *)bytes length:(NSUInteger)length;
+(NSString *)stringByEncodingData:(NSData *)data;
+(NSString *)stringByEncodingBytes:(const void *)bytes length:(NSUInteger)length;
+(NSData *)decodeString:(NSString *)string;
+(NSData *)webSafeEncodeData:(NSData *)data
padded:(BOOL)padded;
+(NSData *)webSafeDecodeData:(NSData *)data;
+(NSData *)webSafeEncodeBytes:(const void *)bytes
length:(NSUInteger)length
padded:(BOOL)padded;
+(NSData *)webSafeDecodeBytes:(const void *)bytes length:(NSUInteger)length;
+(NSString *)stringByWebSafeEncodingData:(NSData *)data
padded:(BOOL)padded;
+(NSString *)stringByWebSafeEncodingBytes:(const void *)bytes
length:(NSUInteger)length
padded:(BOOL)padded;
+(NSData *)webSafeDecodeString:(NSString *)string;
@end
#include <AvailabilityMacros.h>
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#include <Availability.h>
#endif // TARGET_OS_IPHONE
// Not all MAC_OS_X_VERSION_10_X macros defined in past SDKs
#ifndef MAC_OS_X_VERSION_10_5
#define MAC_OS_X_VERSION_10_5 1050
#endif
#ifndef MAC_OS_X_VERSION_10_6
#define MAC_OS_X_VERSION_10_6 1060
#endif
// Not all __IPHONE_X macros defined in past SDKs
#ifndef __IPHONE_2_1
#define __IPHONE_2_1 20100
#endif
#ifndef __IPHONE_2_2
#define __IPHONE_2_2 20200
#endif
#ifndef __IPHONE_3_0
#define __IPHONE_3_0 30000
#endif
#ifndef __IPHONE_3_1
#define __IPHONE_3_1 30100
#endif
#ifndef __IPHONE_3_2
#define __IPHONE_3_2 30200
#endif
#ifndef __IPHONE_4_0
#define __IPHONE_4_0 40000
#endif
// ----------------------------------------------------------------------------
// CPP symbols that can be overridden in a prefix to control how the toolbox
// is compiled.
// ----------------------------------------------------------------------------
// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and
// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens
// when a validation fails. If you implement your own validators, you may want
// to control their internals using the same macros for consistency.
#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT
#define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0
#endif
// Give ourselves a consistent way to do inlines. Apple's macros even use
// a few different actual definitions, so we're based off of the foundation
// one.
#if !defined(GTM_INLINE)
#if defined (__GNUC__) && (__GNUC__ == 4)
#define GTM_INLINE static __inline__ __attribute__((always_inline))
#else
#define GTM_INLINE static __inline__
#endif
#endif
// Give ourselves a consistent way of doing externs that links up nicely
// when mixing objc and objc++
#if !defined (GTM_EXTERN)
#if defined __cplusplus
#define GTM_EXTERN extern "C"
#define GTM_EXTERN_C_BEGIN extern "C" {
#define GTM_EXTERN_C_END }
#else
#define GTM_EXTERN extern
#define GTM_EXTERN_C_BEGIN
#define GTM_EXTERN_C_END
#endif
#endif
// Give ourselves a consistent way of exporting things if we have visibility
// set to hidden.
#if !defined (GTM_EXPORT)
#define GTM_EXPORT __attribute__((visibility("default")))
#endif
// Give ourselves a consistent way of declaring something as unused. This
// doesn't use __unused because that is only supported in gcc 4.2 and greater.
#if !defined (GTM_UNUSED)
#define GTM_UNUSED(x) ((void)(x))
#endif
// _GTMDevLog & _GTMDevAssert
//
// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for
// developer level errors. This implementation simply macros to NSLog/NSAssert.
// It is not intended to be a general logging/reporting system.
//
// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert
// for a little more background on the usage of these macros.
//
// _GTMDevLog log some error/problem in debug builds
// _GTMDevAssert assert if conditon isn't met w/in a method/function
// in all builds.
//
// To replace this system, just provide different macro definitions in your
// prefix header. Remember, any implementation you provide *must* be thread
// safe since this could be called by anything in what ever situtation it has
// been placed in.
//
// We only define the simple macros if nothing else has defined this.
#ifndef _GTMDevLog
#ifdef DEBUG
#define _GTMDevLog(...) NSLog(__VA_ARGS__)
#else
#define _GTMDevLog(...) do { } while (0)
#endif
#endif // _GTMDevLog
#ifndef _GTMDevAssert
// we directly invoke the NSAssert handler so we can pass on the varargs
// (NSAssert doesn't have a macro we can use that takes varargs)
#if !defined(NS_BLOCK_ASSERTIONS)
#define _GTMDevAssert(condition, ...) \
do { \
if (!(condition)) { \
[[NSAssertionHandler currentHandler] \
handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \
file:[NSString stringWithUTF8String:__FILE__] \
lineNumber:__LINE__ \
description:__VA_ARGS__]; \
} \
} while(0)
#else // !defined(NS_BLOCK_ASSERTIONS)
#define _GTMDevAssert(condition, ...) do { } while (0)
#endif // !defined(NS_BLOCK_ASSERTIONS)
#endif // _GTMDevAssert
// _GTMCompileAssert
// _GTMCompileAssert is an assert that is meant to fire at compile time if you
// want to check things at compile instead of runtime. For example if you
// want to check that a wchar is 4 bytes instead of 2 you would use
// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X)
// Note that the second "arg" is not in quotes, and must be a valid processor
// symbol in it's own right (no spaces, punctuation etc).
// Wrapping this in an #ifndef allows external groups to define their own
// compile time assert scheme.
#ifndef _GTMCompileAssert
// We got this technique from here:
// http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html
#define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg
#define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg)
#define _GTMCompileAssert(test, msg) \
typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ]
#endif // _GTMCompileAssert
// ----------------------------------------------------------------------------
// CPP symbols defined based on the project settings so the GTM code has
// simple things to test against w/o scattering the knowledge of project
// setting through all the code.
// ----------------------------------------------------------------------------
// Provide a single constant CPP symbol that all of GTM uses for ifdefing
// iPhone code.
#if TARGET_OS_IPHONE // iPhone SDK
// For iPhone specific stuff
#define GTM_IPHONE_SDK 1
#if TARGET_IPHONE_SIMULATOR
#define GTM_IPHONE_SIMULATOR 1
#else
#define GTM_IPHONE_DEVICE 1
#endif // TARGET_IPHONE_SIMULATOR
#else
// For MacOS specific stuff
#define GTM_MACOS_SDK 1
#endif
// Some of our own availability macros
#if GTM_MACOS_SDK
#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE
#define GTM_AVAILABLE_ONLY_ON_MACOS
#else
#define GTM_AVAILABLE_ONLY_ON_IPHONE
#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE
#endif
// Provide a symbol to include/exclude extra code for GC support. (This mainly
// just controls the inclusion of finalize methods).
#ifndef GTM_SUPPORT_GC
#if GTM_IPHONE_SDK
// iPhone never needs GC
#define GTM_SUPPORT_GC 0
#else
// We can't find a symbol to tell if GC is supported/required, so best we
// do on Mac targets is include it if we're on 10.5 or later.
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
#define GTM_SUPPORT_GC 0
#else
#define GTM_SUPPORT_GC 1
#endif
#endif
#endif
// To simplify support for 64bit (and Leopard in general), we provide the type
// defines for non Leopard SDKs
#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// NSInteger/NSUInteger and Max/Mins
#ifndef NSINTEGER_DEFINED
#if __LP64__ || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
#define NSIntegerMax LONG_MAX
#define NSIntegerMin LONG_MIN
#define NSUIntegerMax ULONG_MAX
#define NSINTEGER_DEFINED 1
#endif // NSINTEGER_DEFINED
// CGFloat
#ifndef CGFLOAT_DEFINED
#if defined(__LP64__) && __LP64__
// This really is an untested path (64bit on Tiger?)
typedef double CGFloat;
#define CGFLOAT_MIN DBL_MIN
#define CGFLOAT_MAX DBL_MAX
#define CGFLOAT_IS_DOUBLE 1
#else /* !defined(__LP64__) || !__LP64__ */
typedef float CGFloat;
#define CGFLOAT_MIN FLT_MIN
#define CGFLOAT_MAX FLT_MAX
#define CGFLOAT_IS_DOUBLE 0
#endif /* !defined(__LP64__) || !__LP64__ */
#define CGFLOAT_DEFINED 1
#endif // CGFLOAT_DEFINED
#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
// Some support for advanced clang static analysis functionality
// See http://clang-analyzer.llvm.org/annotations.html
#ifndef __has_feature // Optional.
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef NS_RETURNS_RETAINED
#if __has_feature(attribute_ns_returns_retained)
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
#else
#define NS_RETURNS_RETAINED
#endif
#endif
#ifndef NS_RETURNS_NOT_RETAINED
#if __has_feature(attribute_ns_returns_not_retained)
#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
#else
#define NS_RETURNS_NOT_RETAINED
#endif
#endif
#ifndef CF_RETURNS_RETAINED
#if __has_feature(attribute_cf_returns_retained)
#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
#else
#define CF_RETURNS_RETAINED
#endif
#endif
#ifndef CF_RETURNS_NOT_RETAINED
#if __has_feature(attribute_cf_returns_not_retained)
#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
#else
#define CF_RETURNS_NOT_RETAINED
#endif
#endif
// Defined on 10.6 and above.
#ifndef NS_FORMAT_ARGUMENT
#define NS_FORMAT_ARGUMENT(A)
#endif
// Defined on 10.6 and above.
#ifndef NS_FORMAT_FUNCTION
#define NS_FORMAT_FUNCTION(F,A)
#endif
// Defined on 10.6 and above.
#ifndef CF_FORMAT_ARGUMENT
#define CF_FORMAT_ARGUMENT(A)
#endif
// Defined on 10.6 and above.
#ifndef CF_FORMAT_FUNCTION
#define CF_FORMAT_FUNCTION(F,A)
#endif
#ifndef GTM_NONNULL
#define GTM_NONNULL(x) __attribute__((nonnull(x)))
#endif
#ifdef __OBJC__
// Declared here so that it can easily be used for logging tracking if
// necessary. See GTMUnitTestDevLog.h for details.
@class NSString;
GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...);
// Macro to allow you to create NSStrings out of other macros.
// #define FOO foo
// NSString *fooString = GTM_NSSTRINGIFY(FOO);
#if !defined (GTM_NSSTRINGIFY)
#define GTM_NSSTRINGIFY_INNER(x) @#x
#define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x)
#endif
// Macro to allow fast enumeration when building for 10.5 or later, and
// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration
// does keys, so pick the right thing, nothing is done on the FastEnumeration
// side to be sure you're getting what you wanted.
#ifndef GTM_FOREACH_OBJECT
#if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
#define GTM_FOREACH_ENUMEREE(element, enumeration) \
for (element in enumeration)
#define GTM_FOREACH_OBJECT(element, collection) \
for (element in collection)
#define GTM_FOREACH_KEY(element, collection) \
for (element in collection)
#else
#define GTM_FOREACH_ENUMEREE(element, enumeration) \
for (NSEnumerator *_ ## element ## _enum = enumeration; \
(element = [_ ## element ## _enum nextObject]) != nil; )
#define GTM_FOREACH_OBJECT(element, collection) \
GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator])
#define GTM_FOREACH_KEY(element, collection) \
GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator])
#endif
#endif
// ============================================================================
// To simplify support for both Leopard and Snow Leopard we declare
// the Snow Leopard protocols that we need here.
#if !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
#define GTM_10_6_PROTOCOLS_DEFINED 1
@protocol NSConnectionDelegate
@end
@protocol NSAnimationDelegate
@end
@protocol NSImageDelegate
@end
@protocol NSTabViewDelegate
@end
#endif // !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
// GTM_SEL_STRING is for specifying selector (usually property) names to KVC
// or KVO methods.
// In debug it will generate warnings for undeclared selectors if
// -Wunknown-selector is turned on.
// In release it will have no runtime overhead.
#ifndef GTM_SEL_STRING
#ifdef DEBUG
#define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName))
#else
#define GTM_SEL_STRING(selName) @#selName
#endif // DEBUG
#endif // GTM_SEL_STRING
#endif // __OBJC__
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheCreateOrderInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface HaiBaoJuheCreateOrderInfo : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic,strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
......@@ -16,7 +16,7 @@
@property(nonatomic, strong)NSString *userId;//用户ID
@property(nonatomic, strong)NSString *timestamp;//时间戳
- (NSString *) HierophantHaiBaoJuheGetTsign ;
- (NSString *) HierophantHaiBaoJuheGetTimestamp ;
- (NSString *) CalendarHaiBaoJuheGetTsign ;
- (NSString *) CalendarHaiBaoJuheGetTimestamp ;
@end
......
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheLoginInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface HaiBaoJuheLoginInfo : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic,strong)NSString *timestamp;
@property(nonatomic, strong)NSString *sign;
......
//
// HierophantHaiBaoJuheReportInfo.h
// CalendarHaiBaoJuheReportInfo.h
// HaiBaoJuheSDK
//
// Created by winFan on 12/21/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "HaiBaoJuheSDK/HierophantHaiBaoJuheBaseModel.h"
@interface HaiBaoJuheReportInfo : HierophantHaiBaoJuheBaseModel
#import "CCCC_CalendarHaiBaoJuheBaseModel_DDDD.h"
@interface HaiBaoJuheReportInfo : CCCC_CalendarHaiBaoJuheBaseModel_DDDD
@property(nonatomic, strong)NSString *reportType;//类型
@property(nonatomic, strong)NSString *playerId;//玩家ID
......@@ -30,9 +30,9 @@
@property(nonatomic, strong)NSString *openId;
#define REPORT_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/statistic"
//#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_IDFA_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
#define REPORT_OPEN @"open"
#define REPORT_ENTER @"enter"
......
......@@ -10,7 +10,7 @@
@property(nonatomic, strong)NSString *urlSchemes;
@property(strong) NSMutableArray* HierophantList;
@property(strong) NSMutableArray* CalendarList;
@property BOOL isAppleGzyazfing;
......
#import <UIKit/UIKit.h>
#import "HaiBaoJuheChecker.h"
#import "OOOO_HaiBaoJuheChecker_PPPP.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheLoginInfo.h"
#import "Interface.h"
#import "HaiBaoJuheNotification.h"
#import "HaiBaoJuheGzyazfInfo.h"
#import "AAAA_HaiBaoJuheNotification_BBBB.h"
#import "AAAA_HaiBaoJuheGzyazfInfo_BBBB.h"
#import "UnionInterface.h"
#import "HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheConfig.h"
#import "HaiBaoJuheUtils.h"
#import "AAAA_HaiBaoJuheConfig_BBBB.h"
#import "MMMM_HaiBaoJuheUtils_NNNN.h"
#import "NetCenter.h"
#import "HaiBaoJuheSDK.h"
#import "HaiBaoJuheSDKDelegate.h"
......
#import <Foundation/Foundation.h>
@interface HierophantInformation : NSObject
@interface IIII_CalendarInformation_JJJJ : NSObject
{
//
NSString *openId;
......@@ -12,5 +12,5 @@ NSString *timestamp;
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (HierophantInformation *)getInstance;
+ (IIII_CalendarInformation_JJJJ *)getInstance;
@end
......
#import <Foundation/Foundation.h>
@interface HierophantControl1 : NSObject
@interface KKKK_CalendarControl_LLLL : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HierophantInformationJM : NSObject
@interface KKKK_CalendarInformationJM_LLLL : NSObject
+(NSString *)HierophantJM:(NSString *)jm;
+(NSString *)CalendarJM:(NSString *)jm;
@end
......
#import <UIKit/UIKit.h>
#import "HierophantInformation.h"
#import "IIII_CalendarInformation_JJJJ.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface HierophantMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
@interface MMMM_CalendarMain_NNNN : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webHierophantView_;
UIWebView *webCalendarView_;
UIActivityIndicatorView *activityIndicator;
}
@property(assign) BOOL HierophantYouYuanJiao;
@property(assign) BOOL CalendarYouYuanJiao;
- (void)HierophantSettingHierophantView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)HierophantInitWebView;
- (void)CalendarSettingCalendarView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)CalendarInitWebView;
- (void)loadWebPageWithString:(NSString *)url;
- (void)loadWebPageWithJs:(NSString *)content;
- (void)postNotification:(NSString *)name : (NSString *)code;
......
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface HaiBaoJuheUtils : NSObject
@interface MMMM_HaiBaoJuheUtils_NNNN : NSObject
+(NSString *)md5:(NSString *)str;
+ (NSDictionary *) HierophantHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
+ (NSDictionary *) CalendarHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createGzyazfOrderUrl;
//*充值回调地址
+(NSString *)createGzyazfUrl;
+(NSString *)AAAA_createGzyazfUrl_BBBB;
+(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
+(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
......
#import <UIKit/UIKit.h>
@interface HierophantLocation : NSObject
@interface OOOO_CalendarLocation_PPPP : NSObject
+ (NSString *)HierophantSKCloudServiceSetupOptionsKey;
+ (NSString *)CalendarSKCloudServiceSetupOptionsKey;
@end
......
#import <Foundation/Foundation.h>
#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
#import "HaiBaoJuheLoginInfo.h"
#import "AAAA_HaiBaoJuheNotification_BBBB.h"
#import "HaiBaoJuheCreateOrderInfo.h"
#import "AAAA_HaiBaoJuheGzyazfInfo_BBBB.h"
#import "HaiBaoJuheReportInfo.h"
#import "HaiBaoJuheSDKDelegate.h"
@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
@interface OOOO_HaiBaoJuheChecker_PPPP : NSObject<HaiBaoJuheSDKDelegate>
@property(nonatomic, strong)NSString *userId;
@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
@property bool onlyOneTimeGzyazf;
+ (HaiBaoJuheChecker *)getInstance;
+ (OOOO_HaiBaoJuheChecker_PPPP *)QQQQ_getInstance_RRRR;
- (void)initChecker;
- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
- (void) HierophantHaiBaoJuhereportOpen;
- (void) HierophantHaiBaoJuhereportSDKOpen;
- (void) HierophantHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
- (void) CalendarHaiBaoJuhereportOpen;
- (void) CalendarHaiBaoJuhereportSDKOpen;
- (void) CalendarHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
- (void) HierophantHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
- (void) CalendarHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
notiName:(NSString *)notiName
statusCode:(int)nCode
......@@ -28,7 +28,7 @@
- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
- (void) HierophantHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
- (void) CalendarHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
/*
*初始化时调用
......
#import <Foundation/Foundation.h>
@interface HierophantControl2 : NSObject
@interface QQQQ_CalendarControl_RRRR : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HierophantControl3 : NSObject
@interface SSSS_CalendarControl_TTTT : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
@interface HierophantControl4 : NSObject
@interface UUUU_CalendarControl_VVVV : NSObject
- (void)initHierophantInstance;
- (void)initCalendarInstance;
- (void) HierophantStartGo;
- (void) CalendarStartGo;
@property(strong) NSMutableArray* myarray;
......
#import <Foundation/Foundation.h>
extern NSString * const EEEE_CalendarExitNotification_FFFF;
extern NSString * const AAAA_CalendarLoginNotification_BBBB;
extern NSString * const CCCC_CalendarErrorNotification_DDDD;
@interface UUUU_CalendarHuiTiaoNotification_VVVV : NSObject
@end
framework module HaiBaoJuheSDK {
umbrella header "HaiBaoJuheSDK.h"
export *
module * { export * }
}
No preview for this file type
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface HierophantAllManager : NSObject
{
NSString* HierophantAPPID_;
NSString* HierophantAPPKEY_;
NSString* HierophantInviterCode_;
}
@property(strong) NSMutableArray* HierophantList;
@property bool HierophantGeiWoHuaQianBa;
+ (HierophantAllManager *)HierophantInstance;
- (void)HierophantChuShiHua;
- (void)HierophantDengLu:(NSString *)HierophantAPPID : (NSString *)HierophantAPPKEY : (UIViewController *)controller;
- (void)HierophantYangShi:(NSString*)HierophantLeiXing;
- (void)HierophantQuery: (NSString *)HierophantFuWuQiID : (NSString *)HierophantNickName : (NSNumber *)HierophantAmount : (NSString *)HierophantCallBack : (UIViewController *)controller : (NSString *)HierophantServerName;
- (void)HierophantQueryOperation:(UIViewController*)controll HierophantHuoWuID:(NSString*)products HierophantJiaGe:(NSString*)amount HierophantHuoWuMing:(NSString*)productName HierophantDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const HierophantExitNotification;
extern NSString * const HierophantLoginNotification;
extern NSString * const HierophantErrorNotification;
@interface HierophantHuiTiaoNotification : NSObject
@end
#import <UIKit/UIKit.h>
@interface HierophantIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* HierophantDingDanHao;
@property(nonatomic,strong) NSDictionary* HierophantHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* HierophantHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *HierophantHuoWuLieBiaoView;
- (void)HierophantHuaQianView:(UIViewController*)controller HierophantHuoWuD:(NSString*)products HierophantQian:(NSString*)amount HierophantHuoWuMing:(NSString*)productName HierophantDingDanHao:(NSString*)DingDanHao;
@end
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "Hierophant/HierophantAllManager.h"
#import "Hierophant/HierophantHuiTiaoNotification.h"
#import "Hierophant/HierophantInformation.h"
#import "TrackingIO.h"
#import "HaiBaoJuheSDK/EEEE_CalendarAllManager_FFFF.h"
#import "HaiBaoJuheSDK/UUUU_CalendarHuiTiaoNotification_VVVV.h"
#import "HaiBaoJuheSDK/IIII_CalendarInformation_JJJJ.h"
@implementation SDKInterface : Interface
int mExchange;
NSString *HierophantAppId;
NSString *HierophantAppKey;
NSString *HierophantLeakOrderUrl;
NSString *CalendarAppId;
NSString *CalendarAppKey;
NSString *CalendarLeakOrderUrl;
- (void)SDKinit:(UIViewController *) control
{
[super SDKinit:control];
[HaiBaoJuheConfig getInstance];
[[HierophantAllManager HierophantInstance]HierophantChuShiHua];
[[HierophantAllManager HierophantInstance]HierophantYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:HierophantLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"HierophantToolCallBack" object:nil];
[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH]IIII_CalendarChuShiHua_JJJJ];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH]KKKK_CalendarYangShi_LLLL:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:AAAA_CalendarLoginNotification_BBBB object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"CalendarToolCallBack" object:nil];
[[HaiBaoJuheChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
[[OOOO_HaiBaoJuheChecker_PPPP QQQQ_getInstance_RRRR] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
NSString* channelId = [[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD] EEEE_getValueByKey_FFFF:@"gamechannelid"];
if(channelId == nil || [channelId length] <= 0){
channelId = @"unknown";
}
[TrackingIO initWithappKey:[[HaiBaoJuheConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
}
/**
......@@ -40,9 +37,9 @@ NSString *HierophantLeakOrderUrl;
- (void)SDKloginSDK
{
//APPID APPKEY
HierophantAppId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_ID"];
HierophantAppKey =[[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_KEY"];
[[HierophantAllManager HierophantInstance]HierophantDengLu:HierophantAppId :HierophantAppKey :self.controller];
CalendarAppId = [[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD] EEEE_getValueByKey_FFFF:@"APP_ID"];
CalendarAppKey =[[AAAA_HaiBaoJuheConfig_BBBB CCCC_getInstance_DDDD] EEEE_getValueByKey_FFFF:@"APP_KEY"];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH]SSSS_CalendarDengLu_TTTT:CalendarAppId :CalendarAppKey :self.controller];
}
......@@ -53,12 +50,12 @@ NSString *HierophantLeakOrderUrl;
{
NSLog(@"loginchek");
HaiBaoJuheLoginInfo *loginInfo = [HaiBaoJuheLoginInfo alloc];
loginInfo.openId = [[HierophantInformation getInstance]openId];
loginInfo.sign = [[HierophantInformation getInstance] token];
loginInfo.timestamp = [[HierophantInformation getInstance] timestamp];
loginInfo.openId = [[IIII_CalendarInformation_JJJJ getInstance]openId];
loginInfo.sign = [[IIII_CalendarInformation_JJJJ getInstance] token];
loginInfo.timestamp = [[IIII_CalendarInformation_JJJJ getInstance] timestamp];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[HaiBaoJuheChecker getInstance] startCheck:loginInfo];
[[OOOO_HaiBaoJuheChecker_PPPP QQQQ_getInstance_RRRR] startCheck:loginInfo];
});
}
......@@ -82,7 +79,7 @@ NSString *HierophantLeakOrderUrl;
- (void)HCKAssetsToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"HierophantToolResult"];
NSString* receiptStr = [payResultDic objectForKey:@"CalendarToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
//收到回调,保存queryid和data
......@@ -101,9 +98,10 @@ NSString *HierophantLeakOrderUrl;
[userDefaults setObject:receiptStr forKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:HierophantLeakOrderUrl :receiptDic];
NSString* result = [[NetCenter getInstance] httpPostSyn:CalendarLeakOrderUrl :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
[[OOOO_HaiBaoJuheChecker_PPPP QQQQ_getInstance_RRRR] sendNotice:HaiBaoJuheSDKNotificationGzyazf notiName:@"success" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"success" extendData:nil];
//删除已保存的
[userDefaults removeObjectForKey:queryId];
[tempQueryIdArray removeObject:queryId];
......@@ -121,11 +119,11 @@ NSString *HierophantLeakOrderUrl;
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSString* lastqueryid = [userDefaults objectForKey:@"lastqueryid"];
HierophantLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[HaiBaoJuheUtils createGzyazfUrl],
CalendarLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[MMMM_HaiBaoJuheUtils_NNNN AAAA_createGzyazfUrl_BBBB],
[payInfo userId],
[payInfo playerId]];
[userDefaults setObject:HierophantLeakOrderUrl forKey:@"lastHierophantLeakOrderUrl"];
[userDefaults setObject:CalendarLeakOrderUrl forKey:@"lastCalendarLeakOrderUrl"];
if (lastqueryid!=nil) {
//创建订单前进行补单
......@@ -135,7 +133,7 @@ NSString *HierophantLeakOrderUrl;
receiptStr = [receiptStr stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
//如果不为空,进行最后一次补单
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",lastqueryid,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:HierophantLeakOrderUrl :receiptDic];
NSString* result = [[NetCenter getInstance] httpPostSyn:CalendarLeakOrderUrl :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
//删除已保存的
[userDefaults removeObjectForKey:@"lastqueryid"];
......@@ -145,8 +143,8 @@ NSString *HierophantLeakOrderUrl;
mExchange = [payInfo exchange].intValue;
[super SDKgzyazfWithGzyazfmentInfo:payInfo];
HierophantLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[HaiBaoJuheUtils createGzyazfUrl],
CalendarLeakOrderUrl = [[NSString alloc] initWithFormat:@"%@?uid=%@&playerid=%@",
[MMMM_HaiBaoJuheUtils_NNNN AAAA_createGzyazfUrl_BBBB],
[payInfo userId],
[payInfo playerId]];
[userDefaults synchronize];
......@@ -165,13 +163,10 @@ NSString *HierophantLeakOrderUrl;
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]];
}
}
}
......@@ -212,12 +207,12 @@ NSString *HierophantLeakOrderUrl;
for (NSString* queryId in queryIdArray) {
NSString* receiptStr = [userDefaults valueForKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* lastHierophantLeakOrderUrl = [userDefaults objectForKey:@"lastHierophantLeakOrderUrl"];
NSString* lastCalendarLeakOrderUrl = [userDefaults objectForKey:@"lastCalendarLeakOrderUrl"];
NSString* result;
if (lastHierophantLeakOrderUrl!=nil) {
result = [[NetCenter getInstance] httpPostSyn:lastHierophantLeakOrderUrl :receiptDic];
if (lastCalendarLeakOrderUrl!=nil) {
result = [[NetCenter getInstance] httpPostSyn:lastCalendarLeakOrderUrl :receiptDic];
}else{
result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
result = [[NetCenter getInstance] httpPostSyn:[MMMM_HaiBaoJuheUtils_NNNN AAAA_createGzyazfUrl_BBBB] :receiptDic];
}
if([@"success" isEqualToString:result]){//成功
[userDefaults removeObjectForKey:queryId];
......@@ -239,34 +234,25 @@ NSString *HierophantLeakOrderUrl;
- (void)receiveCreateOrder:(NSNotification *)notification
{
NSLog(@"创建订单成功");
HaiBaoJuheGzyazfInfo *payInfo = [notification object];
AAAA_HaiBaoJuheGzyazfInfo_BBBB *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) {
[[HierophantAllManager HierophantInstance] HierophantQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
}else{
NSString* products = [payInfo products];
//保存订单号到本地
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:queryId forKey:@"lastqueryid"];
[userDefaults synchronize];
[[HierophantAllManager HierophantInstance] HierophantQueryOperation:self.controller HierophantHuoWuID:products HierophantJiaGe:[payInfo postAmount] HierophantHuoWuMing:[payInfo productName] HierophantDingDanHao:queryId];
}
NSString* products = [payInfo products];
//保存订单号到本地
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:queryId forKey:@"lastqueryid"];
[userDefaults synchronize];
[[EEEE_CalendarAllManager_FFFF GGGG_CalendarInstance_HHHH] CalendarQueryOperation:self.controller CalendarHuoWuID:products CalendarJiaGe:[payInfo postAmount] CalendarHuoWuMing:[payInfo productName] CalendarDingDanHao: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"}
{"payorderurl": "https://pay.public.hkleyougame.com/paycheck/create", "usertype": 5, "sdkSimpleName": "leyou_ios", "gamechannelid": "", "APP_KEY": "b1b13ca8609d29036ceae3c565647d6a", "custom": "{}","logReportUrl": "https://statistic.public.hkleyougame.com/sdk/statistic", "encode": "0", "sdkVersionCode": "V1_0", "loginCheckUrl": "https://login.public.hkleyougame.com/logincheck/check", "appScheme": "com.xxx.xxx11", "descode": "12345678", "c2": "", "c1": "", "APP_ID": "5cecee0487192a3460670102", "paycheckurl": "https://pay.public.hkleyougame.com/paycheck/confirm", "gameSimpleName": "fytx_test"}