Skip to content

Commit 5f6e51a

Browse files
committed
fix: resolve compilation errors + update README for v2.0.0
Build Fixes: - App.kt: Merge duplicate companion objects, move PREFS_* constants to single companion - PermissionBridge.kt: Merge duplicate companion objects, add SHIZUKU_PERMISSION_REQUEST_CODE - AppListViewModel.kt: Wrap detectMode() call in viewModelScope.launch (suspend function) README Updates: - Add 'What's New in v2.0.0' section highlighting major changes - Add Dashboard features with system monitoring cards - Add Display Settings section for refresh rate control - Update architecture diagram with new package structure - Add comprehensive Key Components table - Update Tech Stack with version table - Simplify Platform Support to single line - Add Kiro credit in acknowledgments
1 parent 70d9632 commit 5f6e51a

4 files changed

Lines changed: 130 additions & 82 deletions

File tree

README.md

Lines changed: 112 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,56 @@
11
# AppControlX
22

3-
A powerful Android application for controlling app behavior, battery optimization, and system management — using Root or Shizuku.
3+
A powerful Android application for controlling app behavior, system monitoring, and device management — using Root or Shizuku.
4+
5+
## What's New in v2.0.0 🎉
6+
7+
Complete rewrite with modern architecture and new features:
8+
- **Dashboard** - Real-time system monitoring (CPU, RAM, Battery, Storage, Network, GPU)
9+
- **Setup Wizard** - Guided first-time setup with mode selection
10+
- **Mode Loss Detection** - Automatic detection when Root/Shizuku access is lost
11+
- **Display Refresh Rate Control** - Set min/max refresh rate
12+
- **Clean Architecture** - MVVM + Hilt DI with organized package structure
413

514
## Features
615

7-
### App Control
16+
### 🏠 Dashboard
17+
Real-time system monitoring with DevCheck-style cards:
18+
- **CPU** - Usage percentage, temperature, core count
19+
- **Battery** - Level, charging status, temperature, health
20+
- **RAM** - Used, free, total memory
21+
- **Storage** - Internal storage usage
22+
- **Network** - Connection type, status, WiFi SSID
23+
- **Display** - Resolution, refresh rate
24+
- **GPU** - Model and vendor (requires root)
25+
- **Device** - Brand, model, Android version, uptime
26+
27+
### 📱 App Control
828
- **Freeze/Unfreeze** - Disable apps without uninstalling (keeps data intact)
929
- **Uninstall** - Remove apps for current user while preserving data
1030
- **Force Stop** - Immediately terminate running applications
1131
- **Clear Cache/Data** - Clean app storage with size preview
1232
- **Batch Operations** - Apply actions to multiple apps with progress tracking
1333

14-
### Battery Optimization
34+
### 🔋 Battery Optimization
1535
- **Restrict Background** - Block apps from running in background
1636
- **Allow Background** - Permit background execution
1737
- **Real-time Status** - View current background restriction status per app
38+
- **Multiple AppOps** - RUN_IN_BACKGROUND, RUN_ANY_IN_BACKGROUND, WAKE_LOCK, BOOT_COMPLETED
1839

19-
### Tools
20-
- **Activity Launcher** - Launch hidden activities from any app (hold to copy path)
21-
- **QColor / Display Color** - Qualcomm QColor, MediaTek MiraVision, AOSP, Samsung
22-
- **Extra Dim** - Reduce screen brightness below minimum (Android 12+)
23-
- **Notification Log/History** - Access notification records
24-
- **Battery Optimization** - View app battery consumption
25-
- **Power Mode** - Quick access to power settings
26-
- **Device Info & Diagnostic** - System information
27-
- **Unknown Sources** - Control app install permissions
28-
- **Manage Apps (AOSP)** - Pure AOSP app manager
29-
30-
### Action Logs & Rollback
40+
### 🖥️ Display Settings
41+
- **Refresh Rate Control** - Set minimum and maximum refresh rate
42+
- **Reset to Default** - Restore system default settings
43+
- *Requires Root or Shizuku*
44+
45+
### 📜 Action Logs & Rollback
3146
- **Action History** - Track all operations with timestamps
3247
- **Rollback** - Reverse battery actions (Freeze/Unfreeze, Restrict/Allow)
3348
- **State Snapshots** - Automatic backup before actions
3449

35-
### UI/UX
36-
- **Material 3 Design** - Modern, clean interface with icons
50+
### 🎨 UI/UX
51+
- **Material 3 Design** - Modern interface with dynamic colors (Android 12+)
3752
- **Dark Mode** - Full dark theme support
38-
- **Multi-language** - English & Indonesian
53+
- **Bottom Navigation** - Dashboard, Apps, Settings
3954
- **Search & Filter** - Quick app discovery by name, package, or status
4055

4156
## Screenshots
@@ -50,14 +65,7 @@ A powerful Android application for controlling app behavior, battery optimizatio
5065

5166
## Platform Support
5267

53-
| Platform | Version | Support |
54-
|----------|---------|---------|
55-
| Android Stock | 10 - 15 | Full |
56-
| MIUI/HyperOS | 12+ | Full |
57-
| Samsung OneUI | 3+ | Full |
58-
| ColorOS/Realme | 11+ | Full |
59-
| OxygenOS | 11+ | Full |
60-
| Custom ROM | Android 10+ | Full |
68+
- Android 10+ (API 29) - Stock, AOSP, Custom ROMs
6169

6270
### Protected System Apps
6371
SafetyValidator blocks critical system packages from being disabled/frozen to prevent bricking. Covers AOSP, Google, Xiaomi, Samsung, OPPO, Vivo, Huawei, OnePlus, Nothing, ASUS, Sony, Motorola, and more.
@@ -66,14 +74,14 @@ SafetyValidator blocks critical system packages from being disabled/frozen to pr
6674

6775
- Android 10+ (API 29)
6876
- One of the following:
69-
- **Root access** (Magisk recommended)
77+
- **Root access** (Magisk/KernelSU recommended)
7078
- **Shizuku** installed and activated (full features, no root needed)
7179

72-
### Features Without Root
73-
These features work without Root or Shizuku:
74-
- **Tools** - All hidden settings shortcuts (Extra Dim, QColor, Notification Log, etc.)
75-
- **Activity Launcher** - Browse and launch any app's activities
76-
- **Autostart Manager** - Quick access to OEM autostart settings
80+
### Features Without Root/Shizuku
81+
These features work in View-Only mode:
82+
- **Dashboard** - System monitoring (limited GPU info)
83+
- **App List** - Browse installed apps
84+
- **Settings** - Theme and preferences
7785

7886
## Installation
7987

@@ -88,22 +96,7 @@ git clone https://github.com/risunCode/AppControl-X.git
8896
cd AppControl-X
8997
./gradlew assembleDebug
9098
```
91-
92-
## Architecture
93-
94-
MVVM architecture with Hilt dependency injection.
95-
96-
```
97-
com.appcontrolx/
98-
├── data/local/ # Room Database
99-
├── di/ # Hilt modules
100-
├── executor/ # Command execution (Root/Shizuku)
101-
├── model/ # Data classes
102-
├── rollback/ # Action logs & rollback
103-
├── service/ # Business logic
104-
├── ui/ # Activities, Fragments, Adapters
105-
└── utils/ # Helpers & validators
106-
```
99+
107100

108101
### Key Components
109102

@@ -112,20 +105,69 @@ com.appcontrolx/
112105
| `PermissionBridge` | Detects execution mode (Root/Shizuku/None) |
113106
| `RootExecutor` | Executes commands via libsu with security validation |
114107
| `ShizukuExecutor` | Executes commands via Shizuku UserService |
115-
| `BatteryPolicyManager` | Manages appops and battery settings |
116-
| `RollbackManager` | Action logs and state snapshots |
108+
| `SystemMonitor` | Real-time system info (CPU, RAM, Battery, etc.) |
109+
| `AppScanner` | Accurate app detection using dumpsys + PackageManager |
110+
| `AppControlManager` | App actions (freeze, uninstall, force stop, etc.) |
111+
| `BatteryManager` | Background restriction via appops |
112+
| `ActionLogger` | Action history and rollback |
117113
| `SafetyValidator` | Prevents actions on critical system apps |
114+
| `ModeWatcher` | Detects Root/Shizuku access loss |
118115

119116
## Tech Stack
120117

121-
- **Language**: Kotlin 1.9
122-
- **Min SDK**: 29 (Android 10)
123-
- **Target SDK**: 34 (Android 14)
124-
- **Architecture**: MVVM + Hilt
125-
- **UI**: Material 3, ViewBinding
126-
- **Async**: Coroutines + Flow
127-
- **Root**: [libsu](https://github.com/topjohnwu/libsu)
128-
- **Shizuku**: [Shizuku-API](https://github.com/RikkaApps/Shizuku-API)
118+
| Technology | Version | Purpose |
119+
|------------|---------|---------|
120+
| Kotlin | 1.9 | Primary language |
121+
| Min SDK | 29 (Android 10) | Minimum supported |
122+
| Target SDK | 34 (Android 14) | Target version |
123+
aApps/Shizuku) - Elevated API access
124+
- Built with [Kiro](https://kiro.dev) AI Assistant
125+
rate
126+
settings delete system min_refresh_rate # Reset to default
127+
```
128+
129+
## Changelog
130+
131+
See [CHANGELOG.md](CHANGELOG.md) for full history.
132+
133+
## Contributing
134+
135+
1. Fork the repository
136+
2. Create a feature branch
137+
3. Commit your changes
138+
4. Push and open a Pull Request
139+
140+
## License
141+
142+
GPL-3.0 License - see [LICENSE](LICENSE)
143+
144+
## Credits
145+
146+
Made with ❤️ by [risunCode](https://github.com/risunCode)
147+
148+
### Acknowledgments
149+
150+
- [libsu](https://github.com/topjohnwu/libsu) - Root shell library
151+
- [Shizuku](https://github.com/RikkBOOT_COMPLETED ignore # Disable boot receiver
152+
```
153+
154+
### Display Settings
155+
```bash
156+
settings put system min_refresh_rate <hz> # Set min refresh rate
157+
settings put system peak_refresh_rate <hz> # Set max refreshe <package> # Unfreeze
158+
pm uninstall -k --user 0 <package> # Uninstall
159+
am force-stop <package> # Force stop
160+
pm clear --cache-only <package> # Clear cache
161+
pm clear <package> # Clear data
162+
```lin | 1.9 | Primary language |
163+
| Min SDK | 29 (Android 10) | Minimum supported |
164+
| Target SDK | 34 (Android 14) | Target version |
165+
| Hilt | 2.50 | Dependency Injection |
166+
| libsu | 5.2.2 | Root access |
167+
| Shizuku | 13.1.5 | Non-root privileged access |
168+
| Navigation | 2.7.6 | Fragment navigation |
169+
| Coroutines | 1.7.3 | Async operations |
170+
| Material 3 | 1.11.0 | UI components |
129171
130172
## Commands Reference
131173
@@ -141,9 +183,17 @@ pm clear <package> # Clear data
141183

142184
### Battery Control
143185
```bash
144-
appops set <package> RUN_IN_BACKGROUND ignore # Restrict
145-
appops set <package> RUN_IN_BACKGROUND allow # Allow
146-
appops set <package> WAKE_LOCK ignore # Disable wake lock
186+
appops set <package> RUN_IN_BACKGROUND ignore # Restrict
187+
appops set <package> RUN_ANY_IN_BACKGROUND ignore # Restrict (extended)
188+
appops set <package> WAKE_LOCK ignore # Disable wake lock
189+
appops set <package> BOOT_COMPLETED ignore # Disable boot receiver
190+
```
191+
192+
### Display Settings
193+
```bash
194+
settings put system min_refresh_rate <hz> # Set min refresh rate
195+
settings put system peak_refresh_rate <hz> # Set max refresh rate
196+
settings delete system min_refresh_rate # Reset to default
147197
```
148198

149199
## Changelog
@@ -169,3 +219,4 @@ Made with ❤️ by [risunCode](https://github.com/risunCode)
169219

170220
- [libsu](https://github.com/topjohnwu/libsu) - Root shell library
171221
- [Shizuku](https://github.com/RikkaApps/Shizuku) - Elevated API access
222+
- Built with [Kiro](https://kiro.dev) AI Assistant

app/src/main/java/com/appcontrolx/App.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class App : Application() {
2525

2626
companion object {
2727
private const val TAG = "AppControlX"
28+
private const val PREFS_THEME = "theme"
29+
private const val PREFS_DYNAMIC_COLORS = "dynamic_colors"
2830

2931
init {
3032
// Configure libsu for root shell
@@ -108,9 +110,4 @@ class App : Application() {
108110
}
109111
Log.d(TAG, "Theme applied: $themeName")
110112
}
111-
112-
private companion object {
113-
const val PREFS_THEME = "theme"
114-
const val PREFS_DYNAMIC_COLORS = "dynamic_colors"
115-
}
116113
}

app/src/main/java/com/appcontrolx/domain/executor/PermissionBridge.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class PermissionBridge @Inject constructor(
3636
private const val MODE_ROOT = "root"
3737
private const val MODE_SHIZUKU = "shizuku"
3838
private const val MODE_NONE = "none"
39+
40+
const val SHIZUKU_PERMISSION_REQUEST_CODE = 1001
3941
}
4042

4143
private val prefs: SharedPreferences by lazy {
@@ -295,8 +297,4 @@ class PermissionBridge @Inject constructor(
295297
detectMode(forceDetect = true)
296298
}
297299
}
298-
299-
companion object {
300-
const val SHIZUKU_PERMISSION_REQUEST_CODE = 1001
301-
}
302300
}

app/src/main/java/com/appcontrolx/ui/applist/AppListViewModel.kt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,21 @@ class AppListViewModel @Inject constructor(
6161
}
6262

6363
init {
64-
// Detect execution mode
65-
val mode = permissionBridge.detectMode()
66-
_uiState.update { it.copy(executionMode = mode) }
67-
68-
// Select executor based on mode
69-
executor = when (mode) {
70-
ExecutionMode.Root -> rootExecutor
71-
ExecutionMode.Shizuku -> shizukuExecutor
72-
ExecutionMode.None -> null
64+
// Detect execution mode in coroutine
65+
viewModelScope.launch {
66+
val mode = permissionBridge.detectMode()
67+
_uiState.update { it.copy(executionMode = mode) }
68+
69+
// Select executor based on mode
70+
executor = when (mode) {
71+
ExecutionMode.Root -> rootExecutor
72+
ExecutionMode.Shizuku -> shizukuExecutor
73+
ExecutionMode.None -> null
74+
}
75+
76+
// Setup scanner with executor
77+
appScanner.setExecutor(executor, mode)
7378
}
74-
75-
// Setup scanner with executor
76-
appScanner.setExecutor(executor, mode)
7779
}
7880

7981

0 commit comments

Comments
 (0)