AppleParamConfusion.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <?php
  2. /**
  3. * AppleParamConfusion-php UTF-8
  4. * 苹果ios切换版本混淆表
  5. *
  6. * @date : 2018/6/11 22:24
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : liuhongliang <lhl@huosdk-com>
  10. * @version : HUOOA 1-0
  11. */
  12. namespace huolib\constant;
  13. class AppleParamConfusion {
  14. /***
  15. * 客户端服务端配对 第一版
  16. * 客服端key => 服务端 key
  17. */
  18. public $confusion
  19. = [
  20. 'ts' => 'ts',
  21. 'apple_id' => 'apple_id',
  22. 'sign' => 'sign',
  23. 'token' => 'token',
  24. 'game' => 'game',
  25. 'game-pkg_name' => 'game-pkg_name',
  26. 'game-app_ver' => 'game-app_ver',
  27. 'game-h_ver' => 'game-h_ver',
  28. 'game-sdk_ver' => 'game-sdk_ver',
  29. 'game-build_id' => 'game-build_id',
  30. 'agent' => 'agent',
  31. 'agent-ch' => 'agent-ch',
  32. 'agent-sub_ch' => 'agent-sub_ch',
  33. 'device' => 'device',
  34. 'device-device_id' => 'device-device_id',
  35. 'device-mac' => 'device-mac',
  36. 'device-ip' => 'device-ip',
  37. 'device-brand' => 'device-brand',
  38. 'device-model' => 'device-model',
  39. 'device-os' => 'device-os',
  40. 'device-os_version' => 'device-os_version',
  41. 'device-screen' => 'device-screen',
  42. 'device-net' => 'device-net',
  43. 'device-imsi' => 'device-imsi',
  44. 'device-longitude' => 'device-longitude',
  45. 'device-latitude' => 'device-latitude',
  46. 'device-userua' => 'device-userua',
  47. 'open_cnt' => 'open_cnt',
  48. 'mem-username' => 'mem-username',
  49. 'mem-password' => 'mem-password',
  50. 'mem_id' => 'mem_id',
  51. 'cp_user_token' => 'cp_user_token',
  52. 'agentgame' => 'agentgame',
  53. 'user_token' => 'user_token',
  54. 'float_status' => 'float_status',
  55. 'float_image' => 'float_image',
  56. 'is_bind' => 'is_bind',
  57. 'sms-type' => 'sms-type',
  58. 'sms-mobile' => 'sms-mobile',
  59. 'sms-code' => 'sms-code',
  60. 'role' => 'role',
  61. 'role-event' => 'role-event',
  62. 'role-server_id' => 'role-server_id',
  63. 'role-server_name' => 'role-server_name',
  64. 'role-role_id' => 'role-role_id',
  65. 'role-role_name' => 'role-role_name',
  66. 'role-role_level' => 'role-role_level',
  67. 'role-role_vip' => 'role-role_vip',
  68. 'role-onlineTime' => 'role-onlineTime',
  69. 'role-scene' => 'role-scene',
  70. 'role-axis' => 'role-axis',
  71. 'order' => 'order',
  72. 'order-currency' => 'order-currency',
  73. 'order-cp_order_id' => 'order-cp_order_id',
  74. 'order-product_price' => 'order-product_price',
  75. 'order-product_id' => 'order-product_id',
  76. 'order-product_name' => 'order-product_name',
  77. 'order-product_desc' => 'order-product_desc',
  78. 'order-order_id' => 'order-order_id',
  79. 'order-ext' => 'order-ext',
  80. 'order-receipt_data' => 'order-receipt_data',
  81. 'order-trans_id' => 'order-trans_id',
  82. 'order-sandbox' => 'order-sandbox',
  83. 'order_id' => 'order_id',
  84. 'check' => 'check',
  85. 'pay_token' => 'pay_token',
  86. 'pay_url' => 'pay_url',
  87. 'product_name' => 'product_name',
  88. 'product_price' => 'product_price',
  89. 'real_amount' => 'real_amount',
  90. 'ptb_cnt' => 'ptb_cnt',
  91. 'ptb_rate' => 'ptb_rate',
  92. 'gm_cnt' => 'gm_cnt',
  93. 'gm_rate' => 'gm_rate',
  94. 'benefit_type' => 'benefit_type',
  95. 'pay_type' => 'pay_type',
  96. 'pay_type-name' => 'pay_type-name',
  97. 'pay_type-mem_rate' => 'pay_type-mem_rate',
  98. 'pay_type-rebate_cnt' => 'pay_type-rebate_cnt',
  99. 'pay_type-icon' => 'pay_type-icon',
  100. 'pay_type-payway' => 'pay_type-payway',
  101. 'pay_type-url' => 'pay_type-url',
  102. 'status' => 'status',
  103. 'cp_status' => 'cp_status',
  104. 'is_native' => 'is_native',
  105. 'product_id' => 'product_id',
  106. 'trans_id' => 'trans_id',
  107. 'receipt_data' => 'receipt_data',
  108. 'sandbox' => 'sandbox',
  109. 'username' => 'username',
  110. 'nickname' => 'nickname',
  111. 'last_login_time' => 'last_login_time',
  112. 'last_login_game' => 'last_login_game',
  113. 'mobile' => 'mobile',
  114. 'email' => 'email',
  115. 'from' => 'from',
  116. 'device-info' => 'device-info',
  117. 'device-idfv' => 'device-idfv',
  118. 'device-idfa' => 'device-idfa',
  119. 'event-event' => 'event-event',
  120. 'event-status' => 'event-status',
  121. 'event-context' => 'event-context',
  122. 'crash-active' => 'crash-active',
  123. 'crash-msg' => 'crash-msg',
  124. 'device-disk_space' => 'device-disk_space',
  125. 'device-open_time' => 'device-open_time',
  126. 'device-is_charge' => 'device-is_charge',
  127. 'device-screen_luminance' => 'device-screen_luminance',
  128. 'device-has_sim' => 'device-has_sim',
  129. 'device-is_break' => 'device-is_break',
  130. ];
  131. /***
  132. * 客户端服务端配对 第二版
  133. * 客服端key => 服务端 key
  134. */
  135. private $new_confusion
  136. = [
  137. 'ts' => 'ts',
  138. 'apple_id' => 'apple_id',
  139. 'sign' => 'sign',
  140. 'tk' => 'token',
  141. 'gm' => 'game',
  142. 'gm-pkg' => 'game-pkg_name',
  143. 'gm-aver' => 'game-app_ver',
  144. 'gm-hver' => 'game-h_ver',
  145. 'gm-sver' => 'game-sdk_ver',
  146. 'gm-bid' => 'game-build_id',
  147. 'ag' => 'agent',
  148. 'ag-ch' => 'agent-ch',
  149. 'ag-sub_ch' => 'agent-sub_ch',
  150. 'dv' => 'device',
  151. 'dv-ida' => 'device-device_id',
  152. 'dv-mc' => 'device-mac',
  153. 'dv-ip' => 'device-ip',
  154. 'dv-brd' => 'device-brand',
  155. 'dv-md' => 'device-model',
  156. 'dv-os' => 'device-os',
  157. 'dv-osv' => 'device-os_version',
  158. 'dv-scr' => 'device-screen',
  159. 'dv-net' => 'device-net',
  160. 'dv-imsi' => 'device-imsi',
  161. 'dv-lot' => 'device-longitude',
  162. 'dv-lat' => 'device-latitude',
  163. 'dv-ua' => 'device-userua',
  164. 'opct' => 'open_cnt',
  165. 'mem-uname' => 'mem-username',
  166. 'mem-pwd' => 'mem-password',
  167. 'mid' => 'mem_id',
  168. 'cutk' => 'cp_user_token',
  169. 'agm' => 'agentgame',
  170. 'utk' => 'user_token',
  171. 'fs' => 'float_status',
  172. 'fimg' => 'float_image',
  173. 'isb' => 'is_bind',
  174. 'sms-tp' => 'sms-type',
  175. 'sms-mb' => 'sms-mobile',
  176. 'sms-cd' => 'sms-code',
  177. 'rl' => 'role',
  178. 'rl-ev' => 'role-event',
  179. 'rl-sd' => 'role-server_id',
  180. 'rl-sn' => 'role-server_name',
  181. 'rl-rd' => 'role-role_id',
  182. 'rl-rn' => 'role-role_name',
  183. 'rl-rl' => 'role-role_level',
  184. 'rl-rv' => 'role-role_vip',
  185. 'rl-ont' => 'role-onlineTime',
  186. 'rl-sc' => 'role-scene',
  187. 'rl-ax' => 'role-axis',
  188. 'ord' => 'order',
  189. 'ord-cry' => 'order-currency',
  190. 'ord-coi' => 'order-cp_order_id',
  191. 'ord-pp' => 'order-product_price',
  192. 'ord-pi' => 'order-product_id',
  193. 'ord-pn' => 'order-product_name',
  194. 'ord-pd' => 'order-product_desc',
  195. 'ord-oi' => 'order-order_id',
  196. 'ord-ext' => 'order-ext',
  197. 'ord-recedt' => 'order-receipt_data',
  198. 'ord-trid' => 'order-trans_id',
  199. 'ord-sandbox' => 'order-sandbox',
  200. 'oi' => 'order_id',
  201. 'cc' => 'check',
  202. 'pt' => 'pay_token',
  203. 'pul' => 'pay_url',
  204. 'pn' => 'product_name',
  205. 'pp' => 'product_price',
  206. 'ram' => 'real_amount',
  207. 'pcnt' => 'ptb_cnt',
  208. 'prt' => 'ptb_rate',
  209. 'gcnt' => 'gm_cnt',
  210. 'grt' => 'gm_rate',
  211. 'bftp' => 'benefit_type',
  212. 'pyyp' => 'pay_type',
  213. 'pyyp-nm' => 'pay_type-name',
  214. 'pyyp-mrt' => 'pay_type-mem_rate',
  215. 'pyyp-rbcn' => 'pay_type-rebate_cnt',
  216. 'pyyp-ic' => 'pay_type-icon',
  217. 'pyyp-py' => 'pay_type-payway',
  218. 'pyyp-ul' => 'pay_type-url',
  219. 'stt' => 'status',
  220. 'cstt' => 'cp_status',
  221. 'isnt' => 'is_native',
  222. 'pdid' => 'product_id',
  223. 'trid' => 'trans_id',
  224. 'recedt' => 'receipt_data',
  225. 'sandbox' => 'sandbox',
  226. 'urnm' => 'username',
  227. 'nknm' => 'nickname',
  228. 'lalt' => 'last_login_time',
  229. 'lalg' => 'last_login_game',
  230. 'mb' => 'mobile',
  231. 'eml' => 'email',
  232. 'from' => 'from',
  233. 'dv-info' => 'device-info',
  234. 'dv-idfv' => 'device-idfv',
  235. 'dv-idfa' => 'device-idfa',
  236. 'ev-ev' => 'event-event',
  237. 'ev-stt' => 'event-status',
  238. 'ev-ctt' => 'event-context',
  239. 'cr-act' => 'crash-active',
  240. 'cr-msg' => 'crash-msg',
  241. 'dv-disk_space' => 'device-disk_space',
  242. 'dv-open_time' => 'device-open_time',
  243. 'dv-is_charge' => 'device-is_charge',
  244. 'dv-screen_luminance' => 'device-screen_luminance',
  245. 'dv-has_sim' => 'device-has_sim',
  246. 'dv-is_break' => 'device-is_break',
  247. ];
  248. /***
  249. * 客户端需转换新的 配置
  250. * 旧的key=>新的key
  251. */
  252. public $replace_confusion
  253. = [
  254. 'ts' => 'ts',
  255. 'apple_id' => 'apple_id',
  256. 'sign' => 'sign',
  257. 'token' => 'tk',
  258. 'game' => 'gm',
  259. 'game-pkg_name' => 'gm-pkg',
  260. 'game-app_ver' => 'gm-aver',
  261. 'game-h_ver' => 'gm-hver',
  262. 'game-sdk_ver' => 'gm-sver',
  263. 'game-build_id' => 'gm-bid',
  264. 'agent' => 'ag',
  265. 'agent-ch' => 'ag-ch',
  266. 'agent-sub_ch' => 'ag-sub_ch',
  267. 'device' => 'dv',
  268. 'device-device_id' => 'dv-ida',
  269. 'device-mac' => 'dv-mc',
  270. 'device-ip' => 'dv-ip',
  271. 'device-brand' => 'dv-brd',
  272. 'device-model' => 'dv-md',
  273. 'device-os' => 'dv-os',
  274. 'device-os_version' => 'dv-osv',
  275. 'device-screen' => 'dv-scr',
  276. 'device-net' => 'dv-net',
  277. 'device-imsi' => 'dv-imsi',
  278. 'device-longitude' => 'dv-lot',
  279. 'device-latitude' => 'dv-lat',
  280. 'device-userua' => 'dv-ua',
  281. 'open_cnt' => 'opct',
  282. 'mem-username' => 'mem-uname',
  283. 'mem-password' => 'mem-pwd',
  284. 'mem_id' => 'mid',
  285. 'cp_user_token' => 'cutk',
  286. 'agentgame' => 'agm',
  287. 'user_token' => 'utk',
  288. 'float_status' => 'fs',
  289. 'float_image' => 'fimg',
  290. 'is_bind' => 'isb',
  291. 'sms-type' => 'sms-tp',
  292. 'sms-mobile' => 'sms-mb',
  293. 'sms-code' => 'sms-cd',
  294. 'role' => 'rl',
  295. 'role-event' => 'rl-ev',
  296. 'role-server_id' => 'rl-sd',
  297. 'role-server_name' => 'rl-sn',
  298. 'role-role_id' => 'rl-rd',
  299. 'role-role_name' => 'rl-rn',
  300. 'role-role_level' => 'rl-rl',
  301. 'role-role_vip' => 'rl-rv',
  302. 'role-onlineTime' => 'rl-ont',
  303. 'role-scene' => 'rl-sc',
  304. 'role-axis' => 'rl-ax',
  305. 'order' => 'ord',
  306. 'order-currency' => 'ord-cry',
  307. 'order-cp_order_id' => 'ord-coi',
  308. 'order-product_price' => 'ord-pp',
  309. 'order-product_id' => 'ord-pi',
  310. 'order-product_name' => 'ord-pn',
  311. 'order-product_desc' => 'ord-pd',
  312. 'order-order_id' => 'ord-oi',
  313. 'order-ext' => 'ord-ext',
  314. 'order-receipt_data' => 'ord-recedt',
  315. 'order-trans_id' => 'ord-trid',
  316. 'order-sandbox' => 'ord-sandbox',
  317. 'order_id' => 'oi',
  318. 'check' => 'cc',
  319. 'pay_token' => 'pt',
  320. 'pay_url' => 'pul',
  321. 'product_name' => 'pn',
  322. 'product_price' => 'pp',
  323. 'real_amount' => 'ram',
  324. 'ptb_cnt' => 'pcnt',
  325. 'ptb_rate' => 'prt',
  326. 'gm_cnt' => 'gcnt',
  327. 'gm_rate' => 'grt',
  328. 'benefit_type' => 'bftp',
  329. 'pay_type' => 'pyyp',
  330. 'pay_type-name' => 'pyyp-nm',
  331. 'pay_type-mem_rate' => 'pyyp-mrt',
  332. 'pay_type-rebate_cnt' => 'pyyp-rbcnt',
  333. 'pay_type-icon' => 'pyyp-ic',
  334. 'pay_type-payway' => 'pyyp-py',
  335. 'pay_type-url' => 'pyyp-ul',
  336. 'status' => 'stt',
  337. 'cp_status' => 'cstt',
  338. 'is_native' => 'isnt',
  339. 'product_id' => 'pdid',
  340. 'trans_id' => 'trid',
  341. 'receipt_data' => 'recedt',
  342. 'sandbox' => 'sandbox',
  343. 'username' => 'urnm',
  344. 'nickname' => 'nknm',
  345. 'last_login_time' => 'lalt',
  346. 'last_login_game' => 'lalg',
  347. 'mobile' => 'mb',
  348. 'email' => 'eml',
  349. 'from' => 'from',
  350. 'device-info' => 'info',
  351. 'device-idfv' => 'idfv',
  352. 'device-idfa' => 'idfa',
  353. 'event-event' => 'ev-ev',
  354. 'event-status' => 'ev-stt',
  355. 'event-context' => 'ev-ctt',
  356. 'crash-active' => 'cr-act',
  357. 'crash-msg' => 'cr-msg',
  358. 'device-disk_space' => 'dv-disk_space',
  359. 'device-open_time' => 'dv-open_time',
  360. 'device-is_charge' => 'dv-is_charge',
  361. 'device-screen_luminance' => 'dv-screen_luminance',
  362. 'device-has_sim' => 'dv-has_sim',
  363. 'device-is_break' => 'dv-is_break',
  364. ];
  365. /***
  366. * 服务器获取现用key
  367. */
  368. public function getConfusion() {
  369. $_data = [];
  370. $_new_data = [];
  371. // foreach ($this->confusion as $_k => $_v) {
  372. // $_data['v8ios_'.$_k.'_v8ios'] = $_v;
  373. // }
  374. foreach ($this->new_confusion as $_k => $_v) {
  375. $_new_data['sdkios_'.$_k.'_sdkios'] = $_v;
  376. }
  377. //$_data = array_merge($_data, $_new_data);
  378. return $_new_data;
  379. }
  380. /**
  381. * 返回用于客户端替换
  382. */
  383. public function getReConfusion() {
  384. $_data = [];
  385. foreach ($this->replace_confusion as $_k => $_v) {
  386. $_data['v8ios_'.$_k.'_v8ios'] = 'sdkios_'.$_v.'_sdkios';
  387. }
  388. return $_data;
  389. }
  390. }