{"id":25615106,"url":"https://github.com/binuka97/cordova-plugin-rootguard","last_synced_at":"2025-04-13T21:13:00.493Z","repository":{"id":277520884,"uuid":"932679031","full_name":"Binuka97/cordova-plugin-rootguard","owner":"Binuka97","description":"cordova-plugin-rootguard is a security plugin for Cordova that detects: ✅Root Access (Magisk, SuperSU, su binaries, system modifications) \u0026 ✅Frida Runtime Instrumentation (open ports, injected libraries, running processes)","archived":false,"fork":false,"pushed_at":"2025-04-09T06:57:47.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T21:12:51.540Z","etag":null,"topics":["cordova","cordova-android","cordova-android-plugin","cordova-plugin","frida-detection","root-detection"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Binuka97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-14T10:17:00.000Z","updated_at":"2025-04-09T08:05:02.000Z","dependencies_parsed_at":"2025-02-21T07:47:40.215Z","dependency_job_id":null,"html_url":"https://github.com/Binuka97/cordova-plugin-rootguard","commit_stats":null,"previous_names":["binuka97/cordova-plugin-rootguard-2","binuka97/cordova-plugin-rootguard"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Binuka97%2Fcordova-plugin-rootguard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Binuka97%2Fcordova-plugin-rootguard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Binuka97%2Fcordova-plugin-rootguard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Binuka97%2Fcordova-plugin-rootguard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Binuka97","download_url":"https://codeload.github.com/Binuka97/cordova-plugin-rootguard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782259,"owners_count":21160717,"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":["cordova","cordova-android","cordova-android-plugin","cordova-plugin","frida-detection","root-detection"],"created_at":"2025-02-22T03:18:00.467Z","updated_at":"2025-04-13T21:13:00.450Z","avatar_url":"https://github.com/Binuka97.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cordova Plugin - RootGuard : cordova-plugin-rootguard\n\n![RootGuard](https://img.shields.io/badge/Cordova%20Plugin-RootGuard-blue.svg)\n\n**`cordova-plugin-rootguard`** is a security plugin for Cordova that detects:\n✅ **Root Access** (Magisk, SuperSU, `su` binaries, system modifications)  \n✅ **Frida Runtime Instrumentation** (open ports, injected libraries, running processes)\n\n## 📌 Features\n- ✅ Detects root access (e.g., presence of `su`, known root apps, and system modifications)\n- ✅ Detects Frida-based debugging and instrumentation\n- ✅ Efficient and lightweight detection\n- ✅ Easy integration with Cordova applications\n- ✅ Compatible with Cordova Android projects.\n---\n\n## 🚀 Installation\n\n### **Option 1: Install from GitHub**\n```sh\ncordova plugin add https://github.com/binuka97/cordova-plugin-rootguard.git\n```\n\n### **Option 2: Install Locally**\n1. Download and place the `cordova-plugin-rootguard/` folder inside your project.\n2. Run:\n   ```sh\n   cordova plugin add ./cordova-plugin-rootguard\n   ```\n\n---\n\n## 📖 Usage\n### JavaScript API\nThe plugin provides a single function `checkSecurity` that checks for both root access and Frida detection.\n\n## 🔍 Usage\n```js\nRootGuard.checkSecurity(function(result) {\n    if (result === 1) {\n        console.log(\"Security status: \" + (result ? \"Compromised\" : \"Safe\"));\n        console.log(\"Security Risk Detected: Root or Frida is present.\");\n    } else {\n        console.log(\"Device is secure.\");\n    }\n}, function(error) {\n    console.error(\"Error detecting Root/Frida:\", error);\n});\n```\n\n---\n\n## 🔧 How It Works\n### Root Detection\n- **File Check**: Scans for common root-related files (e.g., `su`, `Superuser.apk`, `.magisk`).\n- **Command Execution**: Attempts to execute `su` to check for root access.\n- **Mount Check**: Verifies if `/system` is mounted as read-write instead of read-only.\n\n### Frida Detection\n- **Port Scan**: Checks for Frida's default listening ports (`27042`, `27043`).\n- **Memory Scan**: Reads `/proc/self/maps` to detect Frida-related libraries (`frida`, `gum-js`, `gadget`).\n- **Process Check**: Looks for a running `frida-server` process.\n- **Property Check**: Scans system properties for any Frida-related entries.\n\n---\n\n## 🛠️ Testing\n### **Testing Root Detection**\n1. Install **Magisk** or **SuperSU** on your Android device.\n2. Run your Cordova app. It should detect root and exit.\n\n### **Testing Frida Detection**\n1. Start Frida-server on the device:\n   ```sh\n   adb push frida-server /data/local/tmp/\n   adb shell chmod 755 /data/local/tmp/frida-server\n   adb shell /data/local/tmp/frida-server \u0026\n   ```\n2. Run your Cordova app. It should detect Frida and exit.\n\n---\n\n## Supported Platforms\n✅ **Android** (Minimum SDK: API 21+)\n❌ iOS (Not supported yet)\n\n---\n\n## Troubleshooting\n### Common Issues \u0026 Fixes\n**1. Plugin Not Found After Installation**  \nRun `cordova platform remove android \u0026\u0026 cordova platform add android` to refresh plugins.\n\n**2. App Crashes on Certain Devices**  \nEnsure the plugin has the required permissions and that your app has `minSdkVersion` set to **21 or higher** in `config.xml`.\n\n**3. False Positives or False Negatives**  \nRoot detection can vary across devices. Consider adding additional root detection methods if needed.\n\n---\n\n## 📜 License\nThis project is licensed under the MIT License.\n\n## 👨‍💻 Contributing\nWe welcome contributions! Feel free to submit a pull request or report issues on the repository.\n\n## 🛠 Support\nFor any issues, please open a GitHub issue in the repository.\n\n---\n\n## Author\n📌 **Binuka Kamesh**  \n📧 Contact: [binukakamesh97@gmail.com](mailto:binukakamesh97@gmail.com)  \n🌍 GitHub: [binuka97](https://github.com/binuka97)\n\n---\n\n**Maintained by Binuka Kamesh**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinuka97%2Fcordova-plugin-rootguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinuka97%2Fcordova-plugin-rootguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinuka97%2Fcordova-plugin-rootguard/lists"}