Layout DT


SUBMITTED BY: terrorxdroid

DATE: March 27, 2024, 5:31 p.m.

UPDATED: Oct. 2, 2024, 8:18 p.m.

FORMAT: Text only

SIZE: 35.1 kB

HITS: 718

  1. [
  2. {
  3. "label": "Nome do app",
  4. "name": "APP_NAME",
  5. "value": "DTunnel Mod",
  6. "type": "STRING"
  7. },
  8. {
  9. "label": "Logo do app",
  10. "name": "APP_LOGO",
  11. "value": null,
  12. "type": "IMAGE"
  13. },
  14. {
  15. "label": "Imagem de fundo",
  16. "name": "APP_BACKGROUND_IMAGE",
  17. "value": null,
  18. "type": "IMAGE"
  19. },
  20. {
  21. "label": "Tipo do fundo do app",
  22. "name": "APP_BACKGROUND_TYPE",
  23. "value": {
  24. "options": [
  25. {
  26. "label": "Imagem",
  27. "value": "IMAGE"
  28. },
  29. {
  30. "label": "Cor",
  31. "value": "COLOR"
  32. }
  33. ],
  34. "selected": "COLOR"
  35. },
  36. "type": "SELECT"
  37. },
  38. {
  39. "label": "Cor de fundo",
  40. "name": "APP_BACKGROUND_COLOR",
  41. "value": "#080e16c7",
  42. "type": "COLOR"
  43. },
  44. {
  45. "label": "Cor do card inicial",
  46. "name": "APP_CARD_COLOR",
  47. "value": "#1d242e73",
  48. "type": "COLOR"
  49. },
  50. {
  51. "label": "Raio do card inicial",
  52. "name": "APP_CARD_RADIUS",
  53. "value": 20,
  54. "type": "INTEGER"
  55. },
  56. {
  57. "label": "Cor do card de status",
  58. "name": "APP_CARD_STATUS_COLOR",
  59. "value": "#1d242e73",
  60. "type": "COLOR"
  61. },
  62. {
  63. "label": "Raio do card de status",
  64. "name": "APP_CARD_STATUS_RADIUS",
  65. "value": 25,
  66. "type": "INTEGER"
  67. },
  68. {
  69. "label": "Cor do card de configurações",
  70. "name": "APP_CARD_CONFIG_COLOR",
  71. "value": "#0E171EC9",
  72. "type": "COLOR"
  73. },
  74. {
  75. "label": "Cor do fundo dos dialogs",
  76. "name": "APP_DIALOG_BACKGROUND_COLOR",
  77. "value": "#050C5AE4",
  78. "type": "COLOR"
  79. },
  80. {
  81. "label": "Cor do fundo do dialog de log",
  82. "name": "APP_DIALOG_LOGGER_COLOR",
  83. "value": "#080e16c7",
  84. "type": "COLOR"
  85. },
  86. {
  87. "label": "Cor das bordas",
  88. "name": "APP_BORDER_COLOR",
  89. "value": "#1d242e73",
  90. "type": "COLOR"
  91. },
  92. {
  93. "label": "Cor dos inputs",
  94. "name": "APP_INPUT_COLOR",
  95. "value": "#1d242e73",
  96. "type": "COLOR"
  97. },
  98. {
  99. "label": "Raio dos inputs",
  100. "name": "APP_INPUT_RADIUS",
  101. "value": 25,
  102. "type": "INTEGER"
  103. },
  104. {
  105. "label": "Cor dos textos",
  106. "name": "APP_TEXT_COLOR",
  107. "value": "#FFFFFFFF",
  108. "type": "COLOR"
  109. },
  110. {
  111. "label": "Cor dos botões",
  112. "name": "APP_BUTTON_COLOR",
  113. "value": "#1d242e73",
  114. "type": "COLOR"
  115. },
  116. {
  117. "label": "Raio dos botões",
  118. "name": "APP_BUTTON_RADIUS",
  119. "value": 25,
  120. "type": "INTEGER"
  121. },
  122. {
  123. "label": "Cor dos icones",
  124. "name": "APP_ICON_COLOR",
  125. "value": "#FFFFFFFF",
  126. "type": "COLOR"
  127. },
  128. {
  129. "label": "Exibir modo de conexão",
  130. "name": "APP_SHOW_CONNECTION_MODE",
  131. "value": true,
  132. "type": "BOOLEAN"
  133. },
  134. {
  135. "label": "Atualizar automaticamente as configurações ao lançar uma atualização.",
  136. "name": "APP_CONFIG_AUTO_UPDATE",
  137. "value": false,
  138. "type": "BOOLEAN"
  139. },
  140. {
  141. "label": "Iniciar o app automaticamente ao reiniciar o dispositivo",
  142. "name": "APP_AUTO_START",
  143. "value": false,
  144. "type": "BOOLEAN"
  145. },
  146. {
  147. "label": "Usar limiter de conexão",
  148. "name": "APP_CONNECTION_LIMITER",
  149. "value": false,
  150. "type": "BOOLEAN"
  151. },
  152. {
  153. "label": "Usar botão de atualizações",
  154. "name": "APP_BTN_UPDATE_ENABLED",
  155. "value": false,
  156. "type": "BOOLEAN"
  157. },
  158. {
  159. "label": "Usar botão de registros",
  160. "name": "APP_BTN_LOGGER_ENABLED",
  161. "value": true,
  162. "type": "BOOLEAN"
  163. },
  164. {
  165. "label": "Usar botão de pagina webview",
  166. "name": "APP_BTN_PAGE_ENABLED",
  167. "value": false,
  168. "type": "BOOLEAN"
  169. },
  170. {
  171. "label": "Ativar dialog de erros",
  172. "name": "APP_DIALOG_ERROR_ENABLED",
  173. "value": true,
  174. "type": "BOOLEAN"
  175. },
  176. {
  177. "label": "Ativar dialog de checkuser",
  178. "name": "APP_CHECKUSER_DIALOG_ENABLED",
  179. "value": false,
  180. "type": "BOOLEAN"
  181. },
  182. {
  183. "label": "Ativar toast de sucesso",
  184. "name": "APP_SUCCESS_TOAST_ENABLED",
  185. "value": true,
  186. "type": "BOOLEAN"
  187. },
  188. {
  189. "label": "Ativar toast de erro",
  190. "name": "APP_ERROR_TOAST_ENABLED",
  191. "value": true,
  192. "type": "BOOLEAN"
  193. },
  194. {
  195. "label": "Usar layout webview",
  196. "name": "APP_LAYOUT_WEBVIEW_ENABLED",
  197. "value": true,
  198. "type": "BOOLEAN"
  199. },
  200. {
  201. "label": "Mensagem",
  202. "name": "APP_MESSAGE",
  203. "value": null,
  204. "type": "TEXT"
  205. },
  206. {
  207. "label": "Tipo de mensagem",
  208. "name": "APP_MESSAGE_TYPE",
  209. "value": {
  210. "options": [
  211. {
  212. "label": "Alerta",
  213. "value": "ALERT"
  214. },
  215. {
  216. "label": "Informação",
  217. "value": "INFO"
  218. },
  219. {
  220. "label": "Boas vindas",
  221. "value": "WELCOME"
  222. },
  223. {
  224. "label": "Sem mensagem",
  225. "value": "NONE"
  226. }
  227. ],
  228. "selected": "NONE"
  229. },
  230. "type": "SELECT"
  231. },
  232. {
  233. "label": "URL de atualização do aplicativo",
  234. "name": "APP_UPDATE_URL",
  235. "value": null,
  236. "type": "URL"
  237. },
  238. {
  239. "label": "LAYOUT WEBVIEW (POR SUA CONTA E RISCO)",
  240. "name": "APP_LAYOUT_WEBVIEW",
  241. "value": "<!DOCTYPE html>\n\n<html lang=\"en\">\n\n<head>\n\n <meta charset=\"UTF-8\">\n\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\n <title>GUARDIAN</title>\n\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css\">\n\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css\">\n\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\" integrity=\"sha512-Fo3rlrZj/k7ujTnHg4CGR2D7kSs0v4LLanw2qksYuRlEzO+tcaEPQogQ0KaoGN26/zrn20ImR1DfuLWnOo7aBA==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />\n\n <script src=\"https://cdn.tailwindcss.com\"></script>\n\n <style>\n\n@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Outfit:wght@100;200;300;400;500;600;700&display=swap');\n\n:root {\n\n /*Editar o modal*/\n\n --btn-modal: #000000;\n\n --btn-border: 5px solid #000000;\n\n --btn-modal-border: 50px;\n\n --modal-shadow: #ffffff;\n\n --modal-bg: #000000;\n\n --modal-icon: #fff;\n\n --config-color: #000000;\n\n --category-color: #000000;\n\n --text-color: #ffffff; \n\n /*Editar Layout*/\n\n --fundo: #000000;\n\n --topo: #000000;\n\n --icon: #fff; \n\n --icon-bg: #000000;\n\n --config: #F7F7FC;\n\n --box-border: 1px solid #fff;\n\n --box-bg: transparent;\n\n --box-icon: white;\n\n --info1: #fff;\n\n --info2: #fff;\n\n }\n\nbody {\n\n font-family: 'Be Vietnam Pro', sans-serif;\n\n background: var(--fundo);\n\n height: 100vh;\n\n width: 100vw;\n\n justify-content: center;\n\n align-items: center;\n\n}\n\n.container {\n\n display: flex;\n\n flex-direction: row;\n\n justify-content: space-between;\n\n background: var(--topo);\n\n width: 100vw;\n\n padding: 0 auto;\n\n}\n\nbutton.power-icon {\n\n font-size: 2.5em;\n\n box-shadow: 0 20px 25px 0px #000000, 0 2px 0px 0px #000000;\n\n}\n\n.app-bg-gray-1 {\n\n background: var(--config);\n\n}\n\n.app-bg-gray-2 {\n\n background: var(--icon-bg);\n\n}\n\n.app-bg-gray-3 {\n\n background: #fff;\n\n }\n\n \n\n .app-bg-4 {\n\n \tbackground: linear-gradient(#000000, #000000, #fff, #fff);\n\n background-size: 400% 400%;\n\n animation: gradient 3s ease infinite;\n\n }\n\n@keyframes gradient {\n\n 0% {\n\n background-position: 0% 50%;\n\n }\n\n 50% {\n\n background-position: 100% 50%;\n\n }\n\n 100% {\n\n background-position: 0% 50%;\n\n }\n\n}\n\n.app-bg-blue {\n\n background: #000000;\n\n}\n\n.app-color-blue {\n\n color: #4071FF;\n\n}\n\n.app-color-gray-1 {\n\n color: #C0C6DE;\n\n}\n\n.app-rounded {\n\n border-bottom-left-radius: 50px;\n\n border-bottom-right-radius: 50px;\n\n}\n\n\t.status {\n\n font-size: 1em;\n\n }\n\n \n\n .put {\n\n \tborder-radius: 80px;\n\n }\n\n \n\n .icon {\n\n \tfont-size: 0.8em;\n\n color: var(--box-icon);\n\n }\n\n input {\n\n width: 100%;\n\n background: transparent;\n\n border-radius: 60px;\n\n outline: none;\n\n color: var(--box-typing);\n\n line-height: 1;\n\n font-weight: 600;\n\n font-size: 1.1rem;\n\n }\n\n \n\n .box {\n\nborder-radius: 20px;\n\nbackground: var(--box-bg);\n\n}\n\n.tool {\n\n align-items: center;\n\n justify-content: center;\n\n text-align: center;\n\n}\n\n.tool-bt {\n\n background: var(--btn-modal);\n\n height: 50px;\n\n width: 150px;\n\n border: var(--btn-border);\n\n}\n\n.info {\n\ncolor: var(--info2);\n\n}\n\n.info1 {\n\ncolor: var(--info1);\n\n}\n\n .info2 {\n\ncolor: var(--modal-icon);\n\n}\n\n .info3 {\n\nfont-size: 1.2em;\n\n color: var(--icon);\n\n}\n\n.modal {\n\n backdrop-filter: blur(5px);\n\n -webkit-backdrop-filter: blur(5px);\n\n }\n\n .modal-content {\n\n border: none;\n\n background: var(--modal-bg);\n\n box-shadow: 0 5px 10px var(--modal-shadow);\n\n color: var(--text-color);\n\n }\n\n .modal-dialog {\n\n padding: 0 0.5rem;\n\n }\n\n .bg-category {\n\n background: var(--category-color);\n\n }\n\n .bg-config {\n\n background: var(--config-color);\n\n }\n\n \n\n .btn{\n\n width: 150px;\n\n background-color: #ffff;\n\n outline: none;\n\n height: 49px;\n\n border-radius: var(--btn-modal-border);\n\n text-transform: uppercase;\n\n font-weight: 600;\n\n margin: 10px 0;\n\n cursor: pointer;\n\n transition: 0.3s;\n\n border: var(--btn-border);\n\n}\n\n</style>\n\n</head>\n\n<body class=\"h-screen\">\n\n <div class=\"container px-6 pt-10 pb-44 app-rounded\">\n\n <button class=\"app-bg-blue h-12 rounded-2xl py-2 px-5 text-white\" onclick=\"ToolsModal.show()\"><i class=\"bi bi-list-nested mr-2\"></i>Mais</button>\n\n <button class=\"put w-12 h-12 app-bg-gray-2 rounded-2xl place-items-center p-2\" onclick=\"DtStartAppUpdate.execute()\"><i class=\"info3 bi bi-arrow-repeat\"></i></button>\n\n <button class=\"put w-12 h-12 app-bg-gray-2 rounded-2xl place-items-center p-2\" onclick=\"loggerModal.show()\"><i class=\"info3 bi bi-file-earmark-text\"></i></button>\n\n </div>\n\n <div class=\"flex flex-row items-center justify-center -top-32 relative\">\n\n <div class=\"w-56 h-56 app-bg-gray-3 rounded-full items-center justify-center flex\">\n\n <div class=\"w-44 h-44 app-bg-4 rounded-full flex justify-center items-center\">\n\n <button class=\"fa-solid fa-power-off bg-white app-color-blue rounded-full p-10 power-icon\" onclick=\"startStopVpn()\"></button>\n\n </div>\n\n </div>\n\n </div>\n\n <div class=\"flex flex-col -top-36 relative\">\n\n <div class=\"py-3 flex flex-row justify-center items-center\">\n\n <span class=\"app-color-gray-1 mr-2\">INSIRA SEU LOGIN</span>\n\n <i class=\"fa-solid fa-check app-color-gray-1\"></i>\n\n </div>\n\n \n\n \n\n \n\n <div class=\"box d-flex gap-2 justify-content-center mb-1 mt-1 flex flex-row items-center px-6 py-2.5 mx-6 rounded-xl app-bg-gray-1 border-2\">\n\n <i class=\"icon fa fa-cogs\"></i>\n\n <input type=\"text\" placeholder=\"CONFIG.\" disabled id=\"config\">\n\n <i class=\"icon fa fa-angle-double-down\"></i>\n\n </div> \n\n <div class=\"box d-flex gap-2 justify-content-center mb-2 mt-1 items-center px-6 py-2 mx-6 rounded-xl border-slate-150 border-2\">\n\n <i class=\"icon fa fa-user\"></i>\n\n <input type=\"text\" placeholder=\"Nome de usuario\" id=\"username\">\n\n </div> \n\n <div class=\"box d-flex gap-2 justify-content-center items-center px-6 py-2 mx-6 rounded-xl border-slate-150 border-2\">\n\n <i class=\"icon fa fa-lock\"></i>\n\n <input type=\"text\" placeholder=\"Senha\" id=\"password\">\n\n <i class=\"icon fa fa-eye\" onclick=\"password.type==`text`?password.type = `password`:password.type = `text`\"></i>\n\n </div>\n\n \n\n <div class=\"d-flex gap-2 justify-content-center mb-2 mt-1 flex flex-row items-center px-6 py-2 mx-6 rounded-xl border-slate-150 border-2\">\n\n <i class=\"icon fa fa-lock\"></i>\n\n <input type=\"text\" placeholder=\"V2ray UUID\" id=\"uuid\">\n\n <i class=\"icon fa fa-eye\" onclick=\"uuid.type==`text`?uuid.type = `password`:uuid.type = `text`\"></i> \n\n </div>\n\n <div class=\"flex flex-row items-center justify-center mt-4\"> \n\n <span class=\"status app-color-blue font-semibold\" id=\"state\">DESCONECTADO</span>\n\n </div>\n\n \n\n <div class=\"flex flex-row items-center justify-center mt-2\">\n\n <i class=\"info1 fa-solid fa-rss app-color-gray-1 mr-2\"></i>\n\n <span class=\"info1 font-semibold text-xs mr-2\" id=\"name\">REDE</span>\n\n <span class=\"info font-semibold text-xs\" id=\"ip\">127.0.0.1</span>\n\n </div>\n\n <div class=\"flex flex-row items-center justify-center mt-1\">\n\n \t<i class=\"info1 fa-solid fa-user app-color-gray-1 mr-2\"></i>\n\n \t<span class=\"info font-semibold text-xs\" id=\"total\">00</span>\n\n </div> \n\n </div>\n\n </div>\n\n <div class=\"modal fade\" id=\"configModal\">\n\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n\n <div class=\"modal-content rounded-3 shadow\">\n\n <div class=\"modal-header border-bottom-0 pb-0\">\n\n <h1 class=\"modal-title fs-5\" style=\"color: var(--text-color);\">CONFIGURAÇÕES</h1>\n\n <button class=\"btn-close btn-close-white\" data-bs-dismiss=\"modal\"></button>\n\n </div>\n\n <div class=\"modal-body p-1 text-center\">\n\n <ul class=\"list-group bg-transparent overflow-y-auto config-body\" style=\"max-height: 600px;\"></ul>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n <div class=\"modal fade\" id=\"loggerModal\">\n\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n\n <div class=\"modal-content rounded-3 shadow\">\n\n <div class=\"modal-body p-1 text-center\">\n\n <ul class=\"list-group bg-transparent overflow-y-auto logger-content\" style=\"max-height: 600px;\">\n\n </ul>\n\n </div>\n\n <div class=\"modal-footer flex-nowrap p-0\">\n\n <button class=\"btn btn-primary w-100 clear-logger\" style=\"background-color:var(--btn-modal);\">LIMPAR</button>\n\n <button type=\"button\" class=\"btn btn-primary w-100\" data-bs-dismiss=\"modal\" style=\"background-color: var(--btn-modal);\">FECHAR</button>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n <div class=\"tool webm modal fade\" index=\"-1\" id=\"ToolsModal\">\n\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n\n \n\n \n\n <div class=\"modal-content\">\n\n <div class=\"tool modal-header\">\n\n <h5 class=\"modal-title\" style=\"color:#ffffff;\">FERRAMENTAS</h5>\n\n </div>\n\n <div class=\"modal-body\">\n\n <button class=\"tool-bt rounded-2xl text-white\" onclick=\"DtStartCheckUser.execute()\"><i class=\"info2 bi bi-calendar-check mr-2\"></i>VALIDADE</button>\n\n </div>\n\n <div class=\"modal-body\">\n\n <button class=\"tool-bt rounded-2xl text-white\" data-bs-target=\"#speedTestModal\" data-bs-toggle=\"modal\"><i class=\"info2 bi bi-speedometer mr-2\"></i>SPEEDTEST</button>\n\n <button class=\"tool-bt rounded-2xl text-white\" onclick=\"DtStartWebViewActivity.execute('https://pluto.tv')\"><i class=\"info2 bi bi-globe mr-2\"></i>TV & FILMES</button>\n\n </div>\n\n <div class=\"modal-body\">\n\n <button class=\"tool-bt rounded-2xl text-white\" onclick=\"DtStartApnActivity.execute()\"><i class=\"info2 bi bi-wifi mr-2\"></i>APN</button>\n\n <button class=\"tool-bt rounded-2xl text-white\" onclick=\"DtIgnoreBatteryOptimizations.execute()\"><i class=\"info2 bi bi-battery-full mr-2\"></i>BATERIA</button>\n\n </div>\n\n <div class=\"modal-body\">\n\n <button class=\"tool-bt rounded-2xl text-white\" onclick=\"DtCleanApp.execute()\"><i class=\"info2 bi bi-trash3 mr-2\"></i>LIMPAR</button>\n\n </div>\n\n <div class=\"tool modal-footer\">\n\n <button type=\"button\" class=\"btn btn-primary\" data-bs-dismiss=\"modal\" style=\"background-color: var(--btn-modal);\">FECHAR</button>\n\n \n\n </div>\n\n </div>\n\n </div>\n\n</div>\n\n<div class=\"modal fade\" id=\"checkUserModal\" index=\"1\">\n\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n\n <div class=\"modal-content rounded-3 shadow\">\n\n <div class=\"modal-header border-bottom-0 pb-0\">\n\n <h1 class=\"modal-title fs-5 chk-title text-light\"></h1>\n\n <button class=\"btn-close btn-close-white\" data-bs-dismiss=\"modal\"></button>\n\n </div>\n\n <div class=\"modal-body text-center\">\n\n <p class=\"fs-5 mb-0 chk-message text-light\"></p>\n\n </div>\n\n </div>\n\n </div>\n\n</div>\n\n<div class=\"md modal fade\" id=\"speedTestModal\">\n\n <div class=\"md modal-dialog modal-dialog-centered\" role=\"document\">\n\n <div class=\"md modal-content rounded-3 shadow\">\n\n <div class=\"md modal-header border-bottom-0 py-3\">\n\n <button class=\"btn-close btn-close-white\" data-bs-dismiss=\"modal\"\n\n aria-label=\"Close\"></button>\n\n \n\n </div>\n\n <div class=\"modal-body ratio rounded-bottom-3\" style=\"height: 600px;\">\n\n <div class=\"spinner d-flex w-100 h-100 align-items-center justify-content-center\">\n\n <div class=\"spinner-border text-light p-5\" role=\"status\">\n\n <span class=\"visually-hidden\">Loading...</span>\n\n </div>\n\n </div>\n\n <iframe class=\"rounded-bottom-3\" id=\"speedFrame\"></iframe>\n\n </div>\n\n </div>\n\n </div>\n\n</div>\n\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.min.js\"></script>\n\n <script>\n\n Object.defineProperty(String.prototype, 't', {\n\n value: function t() {\n\n return window?.DtTranslateText?.execute('' + this) ?? '' + this\n\n },\n\n writable: true,\n\n configurable: true,\n\n })\n\n const config = document.querySelector('#config')\n\n config.parentElement.onclick = () => showConfigsModal();\n\n const username = document.querySelector('#username')\n\n username.oninput = e => DtUsername.set(e.target.value)\n\n const password = document.querySelector('#password')\n\n password.oninput = e => DtPassword.set(e.target.value)\n\n const uuid = document.querySelector('#uuid')\n\n uuid.oninput = e => DtUuid.set(e.target.value)\n\n const clearLogger = document.querySelector('.clear-logger')\n\n const checkUserModal = new bootstrap.Modal(document.querySelector('#checkUserModal'))\n\n const configModal = new bootstrap.Modal(document.querySelector('#configModal'))\n\n const loggerModal = new bootstrap.Modal(document.querySelector('#loggerModal'))\n\n const ToolsModal = new bootstrap.Modal(document.querySelector('#ToolsModal'))\n\n const speedTestModal = new bootstrap.Modal(document.querySelector('#speedTestModal'))\n\n \n\n const dtConfigClickListener = () => {\n\n const data = JSON.parse(window?.DtGetDefaultConfig?.execute() || `{ \"auth\": {\"username\": \"\"} }`)\n\n const isV2ray = data?.mode?.toLowerCase()?.startsWith('v2ray');\n\n config.placeholder = data.name ?? 'Escolha um servidor';\n\n username.parentElement.style.setProperty('display', !data?.auth?.username && !isV2ray ? 'flex' : 'none', 'important')\n\n password.parentElement.style.setProperty('display', !data?.auth?.password && !isV2ray ? 'flex' : 'none', 'important')\n\n uuid.parentElement.style.setProperty('display', !data?.auth?.v2ray_uuid && isV2ray ? 'flex' : 'none', 'important')\n\n }\n\n const startStopVpn = e => {\n\n if (DtGetVpnState.execute() != 'DISCONNECTED') {\n\n DtExecuteVpnStop.execute()\n\n } else {\n\n DtExecuteVpnStart.execute()\n\n }\n\n }\n\n clearLogger.addEventListener('click', () => DtClearLogs.execute())\n\n speedTestModal._element.addEventListener('shown.bs.modal', () => {\n\n const iframe = document.querySelector('#speedFrame');\n\n if (!iframe.src) {\n\n iframe.src = 'http://speedtest.sercomtel.com.br/'\n\n iframe.addEventListener('load', () => {\n\n mp3Modal._element.querySelector('.spinner').classList.add('d-none')\n\n })\n\n }\n\n })\n\n speedTestModal._element.addEventListener('hide.bs.modal', () => {\n\n const iframe = document.querySelector('#speedFrame');\n\n iframe.src = '';\n\n })\n\n const dtVpnStateListener = state => {\n\n const isRunning = state != 'DISCONNECTED';\n\n const status = document.querySelector('#state')\n\n status.innerHTML = ('LBL_STATE_' + state).t()\n\n if (isRunning) {\n\n username.setAttribute('readonly', 'true')\n\n password.setAttribute('readonly', 'true')\n\n status.style.color = '#00ff15'\n\n } else {\n\n username.removeAttribute('readonly')\n\n password.removeAttribute('readonly')\n\n status.style.color = 'RED'\n\n }\n\n }\n\n const dtCheckUserStartedListener = () => {\n\n const data = JSON.parse(window?.DtGetDefaultConfig?.execute() || `{}`)\n\n const isV2ray = data?.mode?.toLowerCase()?.startsWith('v2ray');\n\n if (isV2ray || !data.urlCheckUser) return;\n\n const html = `\n\n <div class=\"d-flex justify-content-center\">\n\n <div class=\"spinner-border p-4\" role=\"status\">\n\n <span class=\"visually-hidden\">Loading...</span>\n\n </div>\n\n </div>\n\n `\n\n checkUserModal._element.querySelector('.chk-title').textContent = 'CHECK USER'\n\n checkUserModal._element.querySelector('.chk-message').innerHTML = html;\n\n checkUserModal.show()\n\n }\n\n const dtCheckUserModelListener = model => {\n\n const data = JSON.parse(model ?? `{\"username\": \"test\"}`)\n\n const html = `\n\n <div class=\"d-flex flex-column text-white\">\n\n <span>👤Nome de usuario: ${data.username}</span>\n\n <span>📆Expira em: ${data.expiration_date}</span>\n\n <span>📆Dias restantes: ${data.expiration_days}</span>\n\n <span>🚫Conexoes: ${data.count_connections}|${data.limit_connections}</span>\n\n </div>\n\n `\n\n checkUserModal._element.querySelector('.chk-title').textContent = ''\n\n checkUserModal._element.querySelector('.chk-message').innerHTML = html;\n\n checkUserModal.show()\n\n }\n\n const showConfigsModal = () => {\n\n const mock = '[{\"sorter\":6,\"color\":\"#6D08041C\",\"name\":\"CONFIG\",\"id\":1393,\"items\":[{\"mode\":\"V2RAY - VLESS\",\"sorter\":4,\"tlsVersion\":\"TLSv1.2\",\"name\":\"CONFIG 01\",\"icon\":\"https://cdn-icons-png.flaticon.com/512/8187/8187143.png\",\"id\":11803,\"status\":\"ACTIVE\"},{\"mode\":\"SSH_DIRECT\",\"sorter\":2,\"tlsVersion\":\"TLSv1.2\",\"name\":\"CONFIG 02\",\"icon\":\"https://cdn-icons-png.flaticon.com/512/8187/8187143.png\",\"id\":28627,\"status\":\"ACTIVE\"},{\"mode\":\"OVPN_PROXY\",\"sorter\":23,\"tlsVersion\":\"TLSv1.2\",\"name\":\"CONFIG 03\",\"icon\":\"https://cdn-icons-png.flaticon.com/512/8187/8187143.png\",\"id\":30001,\"status\":\"ACTIVE\"}]},{\"sorter\":2,\"color\":\"#6D08041C\",\"name\":\"CONFIG 2\",\"id\":1846,\"items\":[{\"mode\":\"SSH_PROXY\",\"sorter\":1,\"tlsVersion\":\"TLSv1.2\",\"name\":\"CONFIG 01\",\"icon\":\"https://cdn-icons-png.flaticon.com/512/8187/8187143.png\",\"id\":26295,\"status\":\"ACTIVE\"}]},{\"sorter\":4,\"color\":\"#80000000\",\"name\":\"CONFIG 3\",\"id\":3310,\"items\":[{\"mode\":\"SSH_PROXY\",\"sorter\":1,\"tlsVersion\":\"TLSv1.2\",\"name\":\"CONFIG. TEST\",\"icon\":\"https://cdn-icons-png.flaticon.com/512/8187/8187143.png\",\"id\":29997,\"status\":\"ACTIVE\"},{\"mode\":\"OVPN_PROXY\",\"sorter\":1,\"tlsVersion\":\"TLSv1.2\",\"name\":\"CONFIG. TEST 2\",\"icon\":\"https://cdn-icons-png.flaticon.com/512/8187/8187143.png\",\"id\":29998,\"status\":\"ACTIVE\"}]}]'\n\n const data = JSON.parse(window?.DtGetConfigs?.execute() || mock)\n\n data.sort((a, b) => a.sorter - b.sorter)\n\n data.forEach(item => item.items.sort((a, b) => a.sorter - b.sorter))\n\n const body = configModal._element.querySelector('.config-body')\n\n body.innerHTML = ''\n\n data.forEach(category => {\n\n const categoryElement = document.createElement('li')\n\n categoryElement.className = 'list-group-item bg-transparent border-0 mb-1 rounded-1 px-1'\n\n categoryElement.style.color = 'var(--text-color)'\n\n categoryElement.innerHTML = `<span class=\"fw-bold w-100 d-block p-1 rounded-1 mb-1 bg-category\">${category.name}</span>`\n\n const configUlElement = document.createElement('ul')\n\n configUlElement.className = 'list-group overflow-y-auto'\n\n category.items.forEach(item => {\n\n const configElement = document.createElement('li')\n\n configElement.className = 'list-group-item d-flex border-0 bg-config rounded-2 px-1 py-2 mb-1'\n\n configElement.style.color = 'var(--text-color)'\n\n configElement.innerHTML = `\n\n <img src=\"${item.icon}\" width=\"40\" height=\"40\">\n\n <div class=\"text-start d-flex flex-column ms-2 w-100 text-truncate\">\n\n <span class=\"fw-bold text-uppercase\" style=\"font-size: 0.8rem;\">${item.name}</span>\n\n <span class=\"fst-italic fw-bold text-uppercase\" style=\"font-size: 0.7rem;\">${item.description || ''}</span>\n\n </div>\n\n <div class=\"d-flex flex-column ms-2\">\n\n <span class=\"fst-italic fw-bold text-end text-uppercase text-nowrap\" style=\"font-size: 0.8rem;\">${item.mode}</span>\n\n </div>\n\n </li>\n\n `\n\n configElement.addEventListener('click', e => {\n\n window?.DtSetConfig?.execute(item.id)\n\n configModal.hide()\n\n })\n\n configUlElement.appendChild(configElement)\n\n })\n\n categoryElement.appendChild(configUlElement)\n\n body.appendChild(categoryElement)\n\n })\n\n configModal.show()\n\n }\n\n const dtOnNewLogListener = () => {\n\n const mock = [];\n\n for (let i = 0; i < 30; i++) {\n\n mock.push({ 'TIME': 'MESSAGE ' + i })\n\n }\n\n const log = window?.DtGetLogs?.execute() || JSON.stringify(mock)\n\n const data = JSON.parse(log)\n\n let content = '';\n\n data.forEach(item => {\n\n content += '<li class=\"list-group-item bg-transparent p-0 border-0 text-start ms-2 text-wrap\" style=\"font-size: 12px; color: var(--text-color);\">';\n\n content += Object.keys(item)[0] + \" \" + item[Object.keys(item)]\n\n content += '</li>';\n\n })\n\n loggerModal._element.querySelector('.logger-content').innerHTML = content;\n\n const listGroup = loggerModal._element.querySelector('.list-group')\n\n listGroup.scrollTo(0, listGroup.scrollHeight)\n\n }\n\n username.value = window?.DtUsername?.get() ?? ''\n\n password.value = window?.DtPassword?.get() ?? ''\n\n uuid.value = window?.DtUuid?.get() ?? ''\n\n dtOnNewLogListener()\n\n dtConfigClickListener()\n\n dtVpnStateListener(window?.DtGetVpnState?.execute() ?? 'DISCONNECTED')\n\n \n\n </script>\n\n \n\n <script>\n\n const config = JSON.parse(DtGetAppConfig.execute());\n\n const urlCheckUser = new URL(config.urlCheckUser);\n\n urlCheckUser.protocol = 'http:';\n\n const createConnection = () => new WebSocket(urlCheckUser);\n\n const startActions = socket => {\n\n socket.send(JSON.stringify({\n\n action: 'all',\n\n data: {}\n\n }));\n\n }\n\n const parseResponseData = data => {\n\n data = JSON.parse(data);\n\n console.log(data)\n\n if (data.total != undefined) {\n\n const total = data.total;\n\n document.getElementById('total').innerHTML = String(total).padStart(2, '0');\n\n }\n\n }\n\n const startSocket = () => {\n\n const socket = createConnection();\n\n socket.onopen = e => startActions(socket);\n\n socket.onmessage = e => parseResponseData(e.data);\n\n }\n\n const setVpnState = state => {\n\n if (state == 'CONNECTED') startSocket();\n\n }\n\n startSocket();\n\n </script>\n\n <script>\n\n class AndroidMock {\n\n static getLocalIP() {\n\n return '192.168.0.1';\n\n }\n\n \n\n static getConfig() {\n\n return JSON.stringify({\n\n urlCheckUser: 'URLAQUI'\n\n });\n\n }\n\n \n\n static getNetworkName() {\n\n return 'REDE';\n\n }\n\n \n\n static openRadioInfo() {\n\n console.log('openRadioInfo');\n\n }\n\n }\n\n </script>\n\n \n\n <script>\n\n function showLocalIP(android) {\n\n console.log(android.getNetworkName());\n\n document.getElementById('name').innerHTML = ' ' + android.getNetworkName() + ':';\n\n document.getElementById('ip').innerHTML = android.getLocalIP();\n\n \n\n setInterval(() => {\n\n document.getElementById('name').innerHTML =\n\n ' ' + android.getNetworkName() + ':';\n\n document.getElementById('ip').innerHTML = android.getLocalIP();\n\n }, 2000)\n\n }\n\n \n\n function showCheckUser(android) {\n\n const config = JSON.parse(window?.DtGetDefaultConfig?.execute() ?? android.getConfig());\n\n \n\n const urlCheckUser = new URL(config.urlCheckUser);\n\n urlCheckUser.protocol = 'ws:';\n\n const socket = new WebSocket(urlCheckUser);\n\n socket.onopen = function (e) {\n\n socket.send(JSON.stringify({\n\n action: 'all',\n\n data: {}\n\n }));\n\n };\n\n \n\n socket.onmessage = function (event) {\n\n const data = JSON.parse(event.data);\n\n if (data.total === undefined)\n\n return;\n\n \n\n const total = data.total;\n\n document.getElementById('total').innerHTML = ' ' + String(total).padStart(2, '0');\n\n socket.close();\n\n };\n\n }\n\n \n\n \n\n \n\n window.onload = function () {\n\n const android = window.Android || AndroidMock;\n\n showLocalIP(android);\n\n showCheckUser(android);\n\n }\n\n \n\n </script>\n\n</body>\n\n</html>",
  242. "type": "HTML"
  243. },
  244. {
  245. "label": "ANDROID WEBVIEW (POR SUA CONTA E RISCO)",
  246. "name": "APP_SUPPORT_BUTTON",
  247. "value": null,
  248. "type": "HTML"
  249. },
  250. {
  251. "label": "PAGINA WEBVIEW (POR SUA CONTA E RISCO)",
  252. "name": "APP_WEB_VIEW",
  253. "value": null,
  254. "type": "HTML"
  255. }
  256. ]

comments powered by Disqus