Skip to content

Commit 34e15f1

Browse files
authored
Merge pull request #1 from Gosheto1234/feature/rewrite-readme-from-code
I am going to rewrite the README from scratch based on my analysis of…
2 parents d4a8a2c + 1ba9fc4 commit 34e15f1

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 The Cager Authors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,65 @@
1+
# Cager
12

3+
Cager is a powerful and flexible lockdown tool for Android, designed to help you minimize distractions and take control of your device. Whether you're a developer, a privacy enthusiast, or just someone who needs a "kill switch" for their phone, Cager provides a simple and effective way to "cage" your device's radios, notifications, and other system services.
4+
5+
## Key Features
6+
7+
* **Root and Non-Root Modes:** Cager is designed to work on both rooted and non-rooted devices, providing a different set of features for each.
8+
* **Radio Control:**
9+
* **Non-Root:** Programmatically disable Wi-Fi and Bluetooth. For other radios like NFC and Airplane Mode, Cager will open the relevant settings panels for you to toggle them manually.
10+
* **Root:** Cager can directly control a wide range of system services, including networking, radios, USB debugging, and more, by executing shell commands.
11+
* **Notification Management:**
12+
* **Three Styles:** Choose from three notification styles: "full" (all notifications are shown), "icon" (only the notification icon is shown), and "silent" (all notifications are suppressed).
13+
* **Whitelisting:** You can whitelist specific apps to allow their notifications to come through even when the cage is enabled.
14+
* **Do Not Disturb Integration:** When the notification style is set to "silent," Cager will automatically enable "Do Not Disturb" mode.
15+
* **Battery Guard:** To prevent your device from becoming unresponsive, Cager can be configured to avoid performing certain actions when the battery is low.
16+
* **Housekeeping Reminders:** Cager uses `WorkManager` to schedule periodic reminders to reboot your device or clear your caches.
17+
* **Customizable Settings:** Cager provides a settings screen where you can configure its behavior, including which subsystems to control, the notification style, and more.
18+
* **Emergency Kill-Switch:** A broadcast receiver is available to disable the cage in case of an emergency, which can be triggered via `adb`.
19+
20+
## How it Works
21+
22+
Cager's functionality is centered around the `MainActivity`, which serves as the main entry point for the app. The app's behavior changes depending on whether the device is rooted or not.
23+
24+
### Non-Root Mode
25+
26+
In non-root mode, Cager uses a combination of Android's standard APIs and accessibility services to control the device.
27+
28+
* **Wi-Fi and Bluetooth:** Cager can directly enable or disable Wi-Fi and Bluetooth using the `WifiManager` and `BluetoothAdapter` APIs.
29+
* **NFC and Airplane Mode:** For NFC and Airplane Mode, Cager opens the corresponding settings screens for the user to manually toggle them. The `CagerAccessibilityService` can then be used to automate this process.
30+
* **Notification Handling:** The `NotificationHandlerService` is a `NotificationListenerService` that intercepts incoming notifications and suppresses them based on the user's selected notification style.
31+
32+
### Root Mode
33+
34+
In root mode, Cager can execute shell commands with `su` to directly control a wide range of system settings. This allows for a much more powerful and flexible "cage." The commands to be executed are stored in a JSON file in the app's assets.
35+
36+
## Installation and Setup
37+
38+
1. **Build the App:** Clone this repository and build the app using Android Studio or by running `./gradlew assembleDebug` in the project's root directory.
39+
2. **Install the APK:** Install the generated APK file (`app/build/outputs/apk/debug/app-debug.apk`) on your Android device.
40+
3. **Grant Permissions:** For Cager to function correctly, you will need to grant it several permissions:
41+
* **Notification Listener:** This allows Cager to manage and suppress notifications. You can grant this permission from the app's settings menu.
42+
* **Accessibility Service:** In non-root mode, Cager requires the Accessibility Service permission to automate the toggling of system settings. You will be prompted to enable this service when you first launch the app.
43+
* **Bluetooth and Wi-Fi Control (optional):** For non-root mode, you may be prompted to grant permissions to control Bluetooth and Wi-Fi.
44+
45+
## Usage
46+
47+
* **Main Screen:** The main screen of the app features a single button to "Enable Cage" or "Disable Cage."
48+
* **Advanced Settings:** The overflow menu in the toolbar provides access to advanced settings.
49+
* **Emergency Kill-Switch:** To disable the cage in an emergency, use the following `adb` command:
50+
51+
```
52+
adb shell am broadcast -a com.example.cager.EMERGENCY_CAGE
53+
```
54+
55+
## Contributing
56+
57+
Contributions are welcome! If you have an idea for a new feature or have found a bug, please open an issue or submit a pull request.
58+
59+
## License
60+
61+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
62+
63+
## Disclaimer
64+
65+
This application can modify system-level settings, especially when used with root access. Use this application at your own risk. The developers are not responsible for any damage to your device or loss of data that may result from its use.

0 commit comments

Comments
 (0)