Showing
14 changed files
with
30 additions
and
113 deletions
No preview for this file type
No preview for this file type
... | @@ -8,6 +8,8 @@ | ... | @@ -8,6 +8,8 @@ |
8 | 8 | ||
9 | 9 | ||
10 | #import <Foundation/Foundation.h> | 10 | #import <Foundation/Foundation.h> |
11 | +#import <UIKit/UIKit.h> | ||
12 | + | ||
11 | @interface PoolUtils : NSObject | 13 | @interface PoolUtils : NSObject |
12 | 14 | ||
13 | +(NSString *)md5:(NSString *)str; | 15 | +(NSString *)md5:(NSString *)str; |
... | @@ -15,4 +17,8 @@ | ... | @@ -15,4 +17,8 @@ |
15 | +(NSString *)createPayOrderUrl; | 17 | +(NSString *)createPayOrderUrl; |
16 | //*充值回调地址 | 18 | //*充值回调地址 |
17 | +(NSString *)createPayUrl; | 19 | +(NSString *)createPayUrl; |
20 | + | ||
21 | ++(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView; | ||
22 | ++(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView; | ||
23 | + | ||
18 | @end | 24 | @end |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
No preview for this file type
No preview for this file type
PoolSdk_Demo/bingxue.py
deleted
100755 → 0
1 | -import shutil | ||
2 | -import os | ||
3 | -import plistlib | ||
4 | - | ||
5 | -import config | ||
6 | -import json | ||
7 | -import packageProj | ||
8 | - | ||
9 | -from mod_pbxproj import XcodeProject | ||
10 | - | ||
11 | - | ||
12 | -gameProjName = config.gameProjName | ||
13 | -channelName = "bingxue" | ||
14 | -#copy dir xcodeproj | ||
15 | -copyNewDirName = gameProjName + '_' + channelName + '.xcodeproj' | ||
16 | -currentPath = os.path.abspath('.') | ||
17 | -currentPath += '/' + copyNewDirName | ||
18 | - | ||
19 | - | ||
20 | -if os.path.exists(currentPath): | ||
21 | - shutil.rmtree(currentPath) | ||
22 | - | ||
23 | -shutil.copytree(gameProjName + '.xcodeproj',currentPath) | ||
24 | - | ||
25 | -project = XcodeProject.Load(copyNewDirName + '/project.pbxproj') | ||
26 | - | ||
27 | -project.add_other_ldflags('-ObjC') | ||
28 | -#frameworks = project.add_folder('poolsdk_file/poolsdk_itools') | ||
29 | -#print(frameworks); | ||
30 | -#add search path | ||
31 | - | ||
32 | -channelRootPath = config.channelRootPath#'poolsdk_file' | ||
33 | - | ||
34 | -frameworksPath = '$(PROJECT_DIR)/' + channelRootPath + '/poolsdk_' + channelName + '/SDK' | ||
35 | -print(frameworksPath); | ||
36 | -#add header search path | ||
37 | -project.add_header_search_paths(frameworksPath, recursive=False) | ||
38 | -#add framework search path | ||
39 | -project.add_framework_search_paths(frameworksPath, recursive=False) | ||
40 | -#add library search path | ||
41 | -project.add_library_search_paths(frameworksPath, recursive=False) | ||
42 | - | ||
43 | -#add poolsdk_xy dir all file into project | ||
44 | -project.remove_group_by_name('poolsdk') | ||
45 | -frameworkRelativePath = project.add_folder(channelRootPath + '/poolsdk_' + channelName + '/SDK') | ||
46 | -#add sdk lib framework | ||
47 | -#project.add_file_if_doesnt_exist('XYPlatform.framework',parent=frameworkRelativePath, weak=True) | ||
48 | -#project.add_file_if_doesnt_exist('XYPlatformResources.bundle',parent=frameworkRelativePath, weak=True) | ||
49 | - | ||
50 | -#remove demo file and replace sdk file | ||
51 | -#project.remove_file_by_path('poolsdk_file/Demo') | ||
52 | -#project.remove_group_by_name('poolsdk_file') | ||
53 | -#project.add_file_if_doesnt_exist('PoolSdk.h',parent=frameworkRelativePath, weak=True) | ||
54 | -#project.add_file_if_doesnt_exist('PoolSdk.m',parent=frameworkRelativePath, weak=True) | ||
55 | -#project.add_file_if_doesnt_exist('SDKInterface.h',parent=frameworkRelativePath, weak=True) | ||
56 | -#project.add_file_if_doesnt_exist('SDKInterface.m',parent=frameworkRelativePath, weak=True) | ||
57 | -#ignore_unknown_type | ||
58 | -project.add_file_if_doesnt_exist('pool_setting',parent=frameworkRelativePath, weak=True,ignore_unknown_type=True) | ||
59 | - | ||
60 | - | ||
61 | -systemFrameworks = project.get_or_create_group('Frameworks') | ||
62 | -#add system framework | ||
63 | -project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreTelephony.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
64 | -project.add_file_if_doesnt_exist('System/Library/Frameworks/SystemConfiguration.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
65 | - | ||
66 | - | ||
67 | -#add system dylib | ||
68 | -systemLibs = project.get_or_create_group('Libraries') | ||
69 | -project.add_file_if_doesnt_exist('/usr/lib/libsqlite3.dylib',parent=systemLibs, weak=True, tree='<absolute>')#absolute path | ||
70 | - | ||
71 | -#modify info.plist reference path | ||
72 | -project.add_single_valued_flag('INFOPLIST_FILE',channelRootPath + '/poolsdk_' + channelName + '/Info.plist') | ||
73 | - | ||
74 | -project.add_single_valued_flag('ENABLE_BITCODE', 'NO') | ||
75 | - | ||
76 | -readInfoPlistFilePath = channelRootPath + '/poolsdk/Info.plist' | ||
77 | -writeInfoFilePath = channelRootPath + '/poolsdk_' + channelName + '/Info.plist' | ||
78 | -infoContent = plistlib.readPlist(readInfoPlistFilePath) | ||
79 | - | ||
80 | -xyInfoPath = channelRootPath + '/poolsdk_' + channelName + '/Info_' + channelName + '.plist' | ||
81 | -xyInfoContent = plistlib.readPlist(xyInfoPath) | ||
82 | - | ||
83 | -#read pool_setting file | ||
84 | -settingFile = open(channelRootPath + '/poolsdk_' + channelName + '/SDK/pool_setting','rw') | ||
85 | -try: | ||
86 | - settingFileContent = settingFile.read( ) | ||
87 | -finally: | ||
88 | - settingFile.close( ) | ||
89 | -#json op | ||
90 | -jsonStr = json.loads(settingFileContent) | ||
91 | - | ||
92 | -#modify bundle id | ||
93 | -project.add_single_valued_flag('PRODUCT_BUNDLE_IDENTIFIER',jsonStr["appScheme"]) | ||
94 | - | ||
95 | -#update and add info.plist content | ||
96 | -infoContent.update(xyInfoContent) | ||
97 | -#write | ||
98 | -plistlib.writePlist(infoContent,writeInfoFilePath) | ||
99 | - | ||
100 | -project.save() | ||
101 | - | ||
102 | - | ||
103 | -packageProj.buildProjName = gameProjName + '_' + channelName | ||
104 | -packageProj.targetName = gameProjName | ||
105 | -packageProj.buildProj() |
PoolSdk_Demo/config.pyc
deleted
100644 → 0
No preview for this file type
PoolSdk_Demo/mod_pbxproj.pyc
deleted
100644 → 0
No preview for this file type
PoolSdk_Demo/packageProj.pyc
deleted
100644 → 0
No preview for this file type
doc/公共SDK服务端接入文档.md
100755 → 100644
... | @@ -7,13 +7,15 @@ | ... | @@ -7,13 +7,15 @@ |
7 | userType | int | 用户类型 ID(渠道类型,兼容以 前帐号体系) | 7 | userType | int | 用户类型 ID(渠道类型,兼容以 前帐号体系) |
8 | openId | string | 平台渠道方返回用户ID | 8 | openId | string | 平台渠道方返回用户ID |
9 | timestamp | string | 时间戳,公共SDK发送到客户端的参数timestamp, 服务端可以判断 timestamp 是否 在有效的登录时间内 | 9 | timestamp | string | 时间戳,公共SDK发送到客户端的参数timestamp, 服务端可以判断 timestamp 是否 在有效的登录时间内 |
10 | -serverSign | string | 验证密钥,公共 SDK 发送到 客户端的参数 serverSign,加密串:gameAppkey=%s&userType=% s&openId=%s×tamp=%s注意:(游戏测试验证时 gameAppkey 默认值为 fytx_onlie#@12&34 进行验证, 出正式母包时改为游戏本身的gameAppkey值) | 10 | +serverSign | string | 验证密钥,公共 SDK 发送到 客户端的参数 serverSign,加密串:gameAppkey=%s&userType=% s&openId=%s×tamp=%s注意:(改为游戏本身的gameAppkey值) |
11 | 11 | ||
12 | 验证方式: | 12 | 验证方式: |
13 | serverSign=MD5(gameAppkey=%s&userType=%s&openId=%s×tamp=%s) 如: | 13 | serverSign=MD5(gameAppkey=%s&userType=%s&openId=%s×tamp=%s) 如: |
14 | md5("gameAppkey=xxxx&userType=1&openId=123×tamp=111111111111") | 14 | md5("gameAppkey=xxxx&userType=1&openId=123×tamp=111111111111") |
15 | gameAppkey : 在公共SDK后台的 Md5加密的KEY | 15 | gameAppkey : 在公共SDK后台的 Md5加密的KEY |
16 | 16 | ||
17 | +`注意!CP必须要以userType+openId保证帐号唯一性` | ||
18 | + | ||
17 | ### 2. 充值验证(通知游戏方发货) | 19 | ### 2. 充值验证(通知游戏方发货) |
18 | 公共SDK服务器接收到渠道服务器充值回调,对回调进行 MD5 验证,如果验证通过, 则采用Post方式马上回调给游戏充值服务器,否则不会回调充值服务器,然后再返回 信息给渠道服务器。回调参数如下: | 20 | 公共SDK服务器接收到渠道服务器充值回调,对回调进行 MD5 验证,如果验证通过, 则采用Post方式马上回调给游戏充值服务器,否则不会回调充值服务器,然后再返回 信息给渠道服务器。回调参数如下: |
19 | 参数 | 类型 | 描述 | 21 | 参数 | 类型 | 描述 |
... | @@ -24,16 +26,21 @@ orderId | string | 渠道方订单 ID | ... | @@ -24,16 +26,21 @@ orderId | string | 渠道方订单 ID |
24 | payAmount | double | 充值金额(如有商品 ID,此值为商 品的金额) | 26 | payAmount | double | 充值金额(如有商品 ID,此值为商 品的金额) |
25 | currency | string | 充值货币(CNY:人民币) | 27 | currency | string | 充值货币(CNY:人民币) |
26 | goodsId | string | 商品ID,参数对一些有商品列表 的充值有效 | 28 | goodsId | string | 商品ID,参数对一些有商品列表 的充值有效 |
27 | -goodsName | string | 客户端充值 IP | 29 | +goodsName | string | 商品名称 |
30 | +remoteIp | string | 客户端充值 IP | ||
28 | custom | string | 透传参数 ,长度 512 | 31 | custom | string | 透传参数 ,长度 512 |
29 | -serverSign | string | 发给充值服务器验证的注意:(游戏测试验证时 gameAppkey 默认值为fytx_onlie#@12&34 进行验证, 出正式母包时改为游戏本身的 gameAppkey 值) | 32 | +serverSign | string | 发给充值服务器验证的注意:(改为游戏本身的 gameAppkey 值) |
30 | uId | string | 平台渠道帐号 ID | 33 | uId | string | 平台渠道帐号 ID |
31 | -gameSimpleName | string | 公告SDK后台游戏名 | 34 | +gameSimpleName | string | 平台SDK后台游戏代号名 |
32 | -sdkSimpleName | string | 平台渠道代号 | 35 | +sdkSimpleName | string | 平台SDK代号 |
33 | -queryId | string | 公共SDK订单号 | 36 | +queryId | string | 平台SDK订单号 |
34 | postTime | string | 订单创建时间戳 | 37 | postTime | string | 订单创建时间戳 |
35 | 38 | ||
36 | 验证方式: | 39 | 验证方式: |
37 | -serverSign=MD5(serverId=%s&playerId=%s&orderId=%s&gameAppKe y=%s)%s:为相应的值 | 40 | +旧:serverSign=MD5(serverId=%s&playerId=%s&orderId=%s&gameAppKey=%s) |
41 | +升级:sign=Md5('serverId=%s&playerId=%s&orderId=%s&payAmount=%s&goodsId=%s&sdkSimpleName=%s&gameAppKey=%s') | ||
42 | +%s:为相应的值 | ||
38 | gameAppkey : 在公共SDK后台的Md5加密的KEY | 43 | gameAppkey : 在公共SDK后台的Md5加密的KEY |
39 | -验证通过后,返回公共 SDK 服务器数据,数据格式:{"code":0,"message":"无订 单"}。code:0 表示失败,1 表示成功,message:描述原因。 | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
44 | +验证通过后,返回公共 SDK 服务器数据,数据格式:{"code":0,"message":"无订 单"}。code:0 表示失败,1 表示成功,message:描述原因。 | ||
45 | + | ||
46 | +`注意!CP必须要以orderId+sdkSimpleName保证订单唯一性,建议使用sign验证` | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -8,6 +8,8 @@ | ... | @@ -8,6 +8,8 @@ |
8 | 8 | ||
9 | 9 | ||
10 | #import <Foundation/Foundation.h> | 10 | #import <Foundation/Foundation.h> |
11 | +#import <UIKit/UIKit.h> | ||
12 | + | ||
11 | @interface PoolUtils : NSObject | 13 | @interface PoolUtils : NSObject |
12 | 14 | ||
13 | +(NSString *)md5:(NSString *)str; | 15 | +(NSString *)md5:(NSString *)str; |
... | @@ -15,4 +17,8 @@ | ... | @@ -15,4 +17,8 @@ |
15 | +(NSString *)createPayOrderUrl; | 17 | +(NSString *)createPayOrderUrl; |
16 | //*充值回调地址 | 18 | //*充值回调地址 |
17 | +(NSString *)createPayUrl; | 19 | +(NSString *)createPayUrl; |
20 | + | ||
21 | ++(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView; | ||
22 | ++(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView; | ||
23 | + | ||
18 | @end | 24 | @end |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
No preview for this file type
No preview for this file type
-
Please register or login to post a comment