diff --git a/fix_ux.py b/fix_ux.py deleted file mode 100644 index aa516aea..00000000 --- a/fix_ux.py +++ /dev/null @@ -1,34 +0,0 @@ -import re - -with open('service/src/main/java/cleveres/tricky/cleverestech/WebServer.kt', 'r') as f: - content = f.read() - -# Replace ''' - -content = content.replace('

System-Wide Spoofing (Global Hardware)

Modem
-
-
+
+
-
-
+
+
Network
-
-
+
+
Operator
-
-
+
+
@@ -1424,19 +1424,19 @@ class WebServer(
Simulates GPS coordinates for target apps. Qualcomm and MediaTek devices supported.
-
-
+
+
-
-
+
+
Random Location Mode
Periodically changes location within a radius of the center coordinates above. Optimized for low CPU/RAM usage.
-
-
+
+
@@ -1477,9 +1477,9 @@ class WebServer( const t = this.value; const af = document.getElementById('authFields'); if (t === 'NONE') af.innerHTML = ''; - else if (t === 'BEARER') af.innerHTML = ''; - else if (t === 'BASIC') af.innerHTML = ''; - else if (t === 'API_KEY') af.innerHTML = ''; + else if (t === 'BEARER') af.innerHTML = ''; + else if (t === 'BASIC') af.innerHTML = ''; + else if (t === 'API_KEY') af.innerHTML = ''; "> @@ -1489,7 +1489,7 @@ class WebServer(
- +
@@ -1887,6 +1887,9 @@ class WebServer( const servers = await res.json(); const list = document.getElementById('serverList'); list.innerHTML = ''; + if (servers.length === 0) { + list.innerHTML = '
No servers configured. Add one below to fetch keyboxes automatically.
'; + } servers.forEach(s => { const div = document.createElement('div'); div.className = 'server-item'; @@ -1914,7 +1917,7 @@ class WebServer( const formData = new FormData(); formData.append('data', JSON.stringify(data)); const res = await fetchAuth('/api/server/add', { method: 'POST', body: formData }); - if (res.ok) { notify('Server Added'); document.getElementById('addServerForm').style.display='none'; loadServers(); } + if (res.ok) { notify('Server Added'); document.getElementById('addServerForm').style.display='none'; document.getElementById('srvName').value=''; document.getElementById('srvUrl').value=''; document.getElementById('srvAuthType').value='NONE'; document.getElementById('authFields').innerHTML=''; loadServers(); } else notify('Failed', 'error'); } catch(e) { notify('Error', 'error'); throw e; } } diff --git a/test_compilation.sh b/test_compilation.sh deleted file mode 100644 index 144c74c6..00000000 --- a/test_compilation.sh +++ /dev/null @@ -1 +0,0 @@ -./gradlew :service:testDebugUnitTest diff --git a/verification.png b/verification.png deleted file mode 100644 index 7c9cc4b3..00000000 Binary files a/verification.png and /dev/null differ diff --git a/verify_ux.py b/verify_ux.py deleted file mode 100644 index 677757cc..00000000 --- a/verify_ux.py +++ /dev/null @@ -1,48 +0,0 @@ -from playwright.sync_api import sync_playwright - -def verify_feature(page): - page.goto("http://localhost:8000/test_ui.html") - page.wait_for_timeout(500) - - # Use evaluate to make the panel visible, as click might not work well on this mock html - page.evaluate("document.getElementById('keys').classList.add('active');") - page.evaluate("document.getElementById('dashboard').classList.remove('active');") - page.evaluate("document.getElementById('keys').style.display='block';") - page.wait_for_timeout(500) - - # Click Add Server - page.evaluate("document.getElementById('addServerForm').style.display='block';") - page.wait_for_timeout(500) - - # Select Auth Type - page.select_option("#srvAuthType", "BEARER") - # Trigger onchange manually just in case - page.evaluate("document.getElementById('srvAuthType').dispatchEvent(new Event('change'))") - page.wait_for_timeout(500) - page.screenshot(path="/home/jules/verification/verification_bearer.png") - - page.select_option("#srvAuthType", "BASIC") - page.evaluate("document.getElementById('srvAuthType').dispatchEvent(new Event('change'))") - page.wait_for_timeout(500) - page.screenshot(path="/home/jules/verification/verification_basic.png") - - page.select_option("#srvAuthType", "API_KEY") - page.evaluate("document.getElementById('srvAuthType').dispatchEvent(new Event('change'))") - page.wait_for_timeout(500) - page.screenshot(path="/home/jules/verification/verification_apikey.png") - - page.select_option("#srvAuthType", "NONE") - page.evaluate("document.getElementById('srvAuthType').dispatchEvent(new Event('change'))") - page.wait_for_timeout(500) - page.screenshot(path="/home/jules/verification/verification_none.png") - -if __name__ == "__main__": - with sync_playwright() as p: - browser = p.chromium.launch(headless=True) - context = browser.new_context(record_video_dir="/home/jules/verification/video") - page = context.new_page() - try: - verify_feature(page) - finally: - context.close() - browser.close() diff --git a/webserver_fix17.py b/webserver_fix17.py deleted file mode 100644 index 0ac00007..00000000 --- a/webserver_fix17.py +++ /dev/null @@ -1,89 +0,0 @@ -import re - -with open('service/src/main/java/cleveres/tricky/cleverestech/WebServer.kt', 'r') as f: - content = f.read() - -html_start = content.find('') -html_end = content.find('') + 7 - -html = content[html_start:html_end] - -# Clean up Kotlin string interpolation -html = html.replace('${getAppName()}', 'CleveresTricky') -html = re.sub(r'\$\{BuildConfig\.DEBUG\}', 'true', html) -html = html.replace('${s.name}', 'Server Name') -html = html.replace('${s.url}', 'http://localhost') -html = html.replace('${s.lastStatus.startsWith(\'OK\')?\'OK\':\'ERROR\'}', 'OK') -html = html.replace('${s.lastStatus}', 'OK') -html = html.replace('${s.id}', 'server_id') -html = html.replace('${k}', 'keybox_name') -html = html.replace('${f}', 'file_name') -html = html.replace('${idx}', '0') -html = html.replace('${rule.package}', 'com.example.app') -html = html.replace('${rule.template === \'null\' ? \'Default\' : rule.template}', 'Default') -html = html.replace('${rule.keybox && rule.keybox !== \'null\' ? rule.keybox : \'\'}', 'keybox') -html = html.replace('${permStr}', 'PERMISSIONS') - -# The javascript interpolation needs escaping -# We're just trying to test the UI, so we can mock the fetch calls -script_mock = """ - const urlParams = new URLSearchParams(window.location.search); - const token = urlParams.get('token') || 'mock_token'; - - // Mock fetchAuth - async function fetchAuth(url, options = {}) { - console.log('Mock fetch:', url, options); - if (url.includes('/api/config')) { - return { ok: true, json: async () => ({ - global_mode: false, tee_broken_mode: false, rkp_bypass: true, - auto_beta_fetch: false, auto_keybox_check: true, random_on_boot: false, - drm_fix: false, random_drm_on_boot: false, auto_patch_update: false, - hide_sensitive_props: true, spoof_region_cn: false, remove_magisk_32: false, - spoof_location: false, imei_global: false, network_global: false, - keybox_count: 5 - })}; - } - if (url.includes('/api/stats')) { - return { ok: true, json: async () => ({ members: "10,000", banned: "500" }) }; - } - if (url.includes('/api/templates')) { - return { ok: true, json: async () => ([ - {id: "pixel8pro", model: "Pixel 8 Pro", manufacturer: "Google", fingerprint: "google/husky...", securityPatch: "2024-05-05"} - ]) }; - } - if (url.includes('/api/packages')) { - return { ok: true, json: async () => (["com.google.android.gms", "com.netflix.mediaclient"]) }; - } - if (url.includes('/api/keyboxes')) { - return { ok: true, json: async () => (["keybox1.xml", "keybox2.xml"]) }; - } - if (url.includes('/api/cbox_status')) { - return { ok: true, json: async () => ({ locked: [], unlocked: ["keybox1.xml"], server_status: [] }) }; - } - if (url.includes('/api/servers')) { - return { ok: true, json: async () => ([]) }; - } - if (url.includes('/api/resource_usage')) { - return { ok: true, json: async () => ({ real_ram_kb: 500000, real_cpu: 2.5, environment: "Magisk", keybox_count: 5, app_config_size: 1024, global_mode: false, rkp_bypass: true, tee_broken_mode: false }) }; - } - if (url.includes('/api/language')) { - return { ok: true, json: async () => ({}) }; - } - if (url.includes('/api/file')) { - return { ok: true, text: async () => ("# Mock file content") }; - } - if (url.includes('/api/app_config_structured')) { - return { ok: true, json: async () => ([]) }; - } - return { ok: true, text: async () => ('OK'), json: async () => ({}) }; - } - function getAuthUrl(path) { return path; } -""" - -html = html.replace("const token = urlParams.get('token');", script_mock) - -# Replace ${} in JS string templates -html = re.sub(r'\$\{([^}]+)\}', r'${\1}', html) - -with open('test_ui.html', 'w') as f: - f.write(html)