Guest User

Untitled

a guest
Oct 31st, 2025
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.59 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
  6. *
  7. * @ Version : 5.0.1.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.04.2022
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace app\sign\controller;
  15.  
  16. class Index extends \app\common\controller\Frontend
  17. {
  18. protected $noNeedLogin = ['*'];
  19. protected $noNeedRight = ['*'];
  20.  
  21. public function checkudid(\think\Request $request)
  22. {
  23. $udid = $request->param('udid');
  24.  
  25. if ($udid == '') {
  26. return json([
  27. 'code' => 0,
  28. 'msg' => '非法请求',
  29. 'data' => []
  30. ]);
  31. }
  32.  
  33. $row = \think\Db::table('fa_udidlist')->where('udid', $udid)->order('id desc')->select();
  34.  
  35. if ($row[0]['disable'] == 1) {
  36. return json([
  37. 'code' => 0,
  38. 'msg' => '此设备已被禁用!',
  39. 'data' => []
  40. ]);
  41. }
  42.  
  43. if (!$row) {
  44. return json([
  45. 'code' => 0,
  46. 'msg' => '此设备未授权!请联系客服处理',
  47. 'data' => []
  48. ]);
  49. }
  50.  
  51. if ($row[0]['dqtime'] < time()) {
  52. return json([
  53. 'code' => 0,
  54. 'msg' => '此设备已到期!请联系客服续期',
  55. 'data' => []
  56. ]);
  57. }
  58. else {
  59. return json([
  60. 'code' => 1,
  61. 'msg' => '请求成功',
  62. 'data' => []
  63. ]);
  64. }
  65. }
  66.  
  67. public function index(\think\Request $request)
  68. {
  69. $udid = $request->param('UDID');
  70. $kcode = $request->param('code');
  71. $appid = $request->param('appid');
  72. $appbid = $request->param('appbid');
  73. $appname = $request->param('appname');
  74. $zstype = $request->param('zstype');
  75. $logoimg = $request->param('logoimg');
  76. $apppath = $request->param('apppath');
  77. $d = $request->param('d');
  78. $icon_url = \think\Db::table('fa_config')->where('name', 'sourceicon')->value('value');
  79. $icon_url = 'https://' . $_SERVER['HTTP_HOST'] . $icon_url;
  80. $row = \think\Db::table('fa_qmpz')->where('id', 1)->order('id desc')->select();
  81. $zsht = intval($row[0]['zsht']);
  82.  
  83. if ($udid == '') {
  84. return json([
  85. 'code' => 1001,
  86. 'msg' => '请输入UDID值',
  87. 'data' => []
  88. ]);
  89. }
  90.  
  91. $absolute_path = str_replace('application/sign/controller', 'public/zsign/ok/' . $udid . '/', dirname(__FILE__));
  92.  
  93. if ($zstype == 2) {
  94. if (($appid == '8888') && ($apppath != '')) {
  95. $dbpath = $apppath;
  96.  
  97. if ($logoimg == '') {
  98. $appicon = $icon_url;
  99. $xgtb = false;
  100. }
  101. else {
  102. $appicon = $logoimg;
  103. $xgtb = true;
  104. }
  105. }
  106. else {
  107. $res = \think\Db::table('fa_category')->where('id', $appid)->order('id desc')->select();
  108.  
  109. if ($res) {
  110. $dbpath = $res[0]['upipa'];
  111.  
  112. if ($logoimg == '') {
  113. $appicon = $res[0]['image'];
  114. $xgtb = false;
  115. }
  116. else {
  117. $appicon = $logoimg;
  118. $xgtb = true;
  119. }
  120. }
  121. else {
  122. return json([
  123. 'code' => 1001,
  124. 'msg' => '应用安装路径出错',
  125. 'data' => []
  126. ]);
  127. }
  128. }
  129.  
  130. $row = \think\Db::table('fa_udidlist')->where('udid', $udid)->order('id desc')->select();
  131.  
  132. if ($row[0]['freecs'] <= 0) {
  133. return json([
  134. 'code' => 1001,
  135. 'msg' => '免费安装次数已用完!',
  136. 'data' => []
  137. ]);
  138. }
  139.  
  140. return $this->query_install_url($udid, $dbpath, $appid, $appbid, $appname, $appicon, 1, $xgtb);
  141. }
  142.  
  143. if ($kcode == '') {
  144. $chkis = \think\Db::table('fa_udidlist')->where('udid', $udid)->order('id desc')->select();
  145.  
  146. if ($chkis) {
  147. $kdata = $chkis[0];
  148. $kzsid = $kdata['zsid'];
  149. $kzspt = intval($kdata['zspt']);
  150. if (($kdata['dqtime'] == 586998488) || ($kzsid == '')) {
  151. if ($d == 1) {
  152. return json([
  153. 'code' => 1001,
  154. 'msg' => '您尚未购买VIP',
  155. 'data' => []
  156. ]);
  157. }
  158. else {
  159. if ($appid == '') {
  160. return json([
  161. 'code' => 1001,
  162. 'msg' => '未查询到兑换记录',
  163. 'data' => []
  164. ]);
  165. }
  166.  
  167. return json([
  168. 'code' => 1002,
  169. 'msg' => '您尚未购买VIP' . "\r\n" . '无法安装VIP版应用',
  170. 'data' => []
  171. ]);
  172. }
  173. }
  174.  
  175. if ($kdata['dqtime'] < time()) {
  176. return json([
  177. 'code' => 1001,
  178. 'msg' => 'VIP已到期,请续费',
  179. 'data' => []
  180. ]);
  181. }
  182.  
  183. if ($d == 1) {
  184. if ($kdata['ghqx'] == 0) {
  185. return json([
  186. 'code' => 1001,
  187. 'msg' => '您的证书已掉签' . "\r\n" . '请联系客服更换',
  188. 'data' => []
  189. ]);
  190. }
  191.  
  192. $ab = $this->create_udid_cer($udid, '', '', 1, 1, '客户更换证书');
  193. $flag = json_decode($ab->getContent(), true);
  194.  
  195. if ($flag['code'] == 1) {
  196. $zsid = $flag['zsid'];
  197. \think\Db::table('fa_udidlist')->where('id', $kdata['id'])->update(['zspt' => $zsht, 'zsid' => $flag['zsid']]);
  198. return json([
  199. 'code' => 1,
  200. 'msg' => 'ok',
  201. 'data' => []
  202. ]);
  203. }
  204. else {
  205. return json([
  206. 'code' => 1001,
  207. 'msg' => $flag['msg'],
  208. 'data' => []
  209. ]);
  210. }
  211. }
  212. else {
  213. if (($appid == '8888') && ($apppath != '')) {
  214. $dbpath = $apppath;
  215.  
  216. if ($logoimg == '') {
  217. $appicon = $icon_url;
  218. $xgtb = false;
  219. }
  220. else {
  221. $appicon = $logoimg;
  222. $xgtb = true;
  223. }
  224. }
  225. else {
  226. $res = \think\Db::table('fa_category')->where('id', $appid)->order('id desc')->select();
  227.  
  228. if ($res) {
  229. $dbpath = $res[0]['upipa'];
  230.  
  231. if ($logoimg == '') {
  232. $appicon = $res[0]['image'];
  233. $xgtb = false;
  234. }
  235. else {
  236. $appicon = $logoimg;
  237. ................................................
  238. ................................
  239. .................
Advertisement
Add Comment
Please, Sign In to add comment