Skip to content

Commit 70d9632

Browse files
committed
v2.0.0 - Complete Rewrite: Dashboard-First Architecture with Modern MVVM
## MAJOR RELEASE - AppControlX v2.0.0 This is a COMPLETE REWRITE of AppControlX from the ground up with modern architecture, new features, and improved user experience. ### NEW FEATURES **Dashboard (DevCheck-style)** - Real-time CPU usage and temperature monitoring - Battery status with charging indicator and temperature - RAM and Storage usage with visual indicators - Network status (WiFi/Mobile/Ethernet) - Display info (resolution, refresh rate) - GPU info (requires root) - Device info with uptime and deep sleep time - Feature quick access cards for easy navigation **Setup Wizard** - Guided first-time setup experience - Mode selection (Root/Shizuku/View-Only) - Permission verification - Clean onboarding flow **Mode Loss Detection** - Automatic detection when Root/Shizuku access is lost - Dialog with options: Retry, Switch Mode, Continue View-Only - Seamless recovery experience **Display Refresh Rate Control** - Set minimum and maximum refresh rate - Reset to default option - Requires Root or Shizuku mode **Batch Progress UI** - Visual progress during batch operations - Per-app status indicators - Success/failure counts - Cancel operation support ### ARCHITECTURE CHANGES **New Package Structure:** - domain/executor/ - Command execution (Root, Shizuku) - domain/manager/ - Business logic managers - domain/scanner/ - App scanning with dumpsys - domain/monitor/ - System monitoring - domain/validator/ - Safety validation - data/model/ - Clean data classes - ui/ - Organized UI components **Key Components:** - CommandExecutor interface with RootExecutor & ShizukuExecutor - AppControlManager for freeze/unfreeze/force-stop/uninstall/clear - BatteryManager for background restriction - ActionLogger for history and rollback - DisplayManager for refresh rate control - ModeWatcher for mode loss detection - SystemMonitor for real-time system info - AppScanner with accurate dumpsys-based detection - SafetyValidator with comprehensive package protection ### SECURITY - Command whitelist enforcement in RootExecutor - Dangerous pattern blocking (rm -rf, reboot, format, etc.) - Package name validation against injection attempts - Critical system app protection (~200 packages) - Force-stop-only packages for security apps ### UI/UX IMPROVEMENTS - Material 3 with Dynamic Colors support - Bottom navigation (Dashboard, Apps, Settings) - Modern card-based layouts - Status badges (Running, Stopped, Frozen, Restricted) - Dark mode support - Accessibility improvements ### CLEANUP - Removed old code structure - Deleted .old folder - Removed unused .gitkeep files - Updated ProGuard rules for new package structure - Updated CHANGELOG.md ### TECHNICAL - Version: 2.0.0 (versionCode 4) - Min SDK: 29 (Android 10) - Target SDK: 34 (Android 14) - Kotlin 1.9 - Hilt DI - Coroutines + Flow - libsu 5.2.2 - Shizuku-API 13.1.5 - Navigation Component - ViewBinding ### FILES CHANGED - 90+ files modified/added/deleted - Complete package restructure - New layouts for Dashboard and cards - Updated navigation graph - New string resources --- Built with using Kiro AI Assistant Ready for GitHub Actions build!
1 parent 56b4c59 commit 70d9632

104 files changed

Lines changed: 11541 additions & 3590 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 84 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,47 @@
22

33
All notable changes to AppControlX.
44

5-
## [1.1.0] - 2024-12
5+
## [2.0.0] - 2026-01 (v2 Rewrite)
6+
7+
### 🎉 Complete Rewrite
8+
This is a complete rewrite of AppControlX with modern architecture and new features.
9+
10+
### Added
11+
- **Dashboard** - System monitoring with real-time updates
12+
- CPU usage and temperature
13+
- Battery status and temperature
14+
- RAM and Storage usage
15+
- Network status
16+
- Display info (resolution, refresh rate)
17+
- GPU info (requires root)
18+
- Device info with uptime and deep sleep time
19+
- **Setup Wizard** - Guided first-time setup with mode selection
20+
- **Mode Loss Detection** - Automatic detection when Root/Shizuku access is lost
21+
- **Display Refresh Rate Control** - Set min/max refresh rate (Root/Shizuku)
22+
- **Feature Quick Access Cards** - Navigate to features from Dashboard
23+
- **Batch Progress UI** - Visual progress during batch operations
24+
25+
### Changed
26+
- **Architecture** - Complete rewrite with clean MVVM + Hilt DI
27+
- **Package Structure** - New organized structure:
28+
- `domain/executor/` - Command executors
29+
- `domain/manager/` - Business logic managers
30+
- `domain/scanner/` - App scanning
31+
- `domain/monitor/` - System monitoring
32+
- `domain/validator/` - Safety validation
33+
- `data/model/` - Data classes
34+
- `ui/` - UI components
35+
- **App Detection** - More accurate using dumpsys + PackageManager
36+
- **Material 3** - Updated to latest Material Design 3
37+
- **Navigation** - Bottom navigation with Dashboard, Apps, Settings
38+
39+
### Removed
40+
- Old code moved to `.old` folder (now deleted)
41+
- Legacy architecture patterns
42+
43+
---
44+
45+
## [1.1.0] - 2025-12
646

747
### Added
848
- Showcase website (index.html) with responsive design, 3 themes, image gallery with lightbox
@@ -23,7 +63,7 @@ All notable changes to AppControlX.
2363

2464
---
2565

26-
## [1.0.0] - 2024-12
66+
## [1.0.0] - 2025-12
2767

2868
### Added
2969

@@ -131,18 +171,46 @@ All notable changes to AppControlX.
131171

132172
---
133173

134-
## Architecture
174+
## Architecture (v2)
135175

136176
```
137177
com.appcontrolx/
138-
├── data/local/ # Room Database (DAO, Entity)
139-
├── di/ # Hilt modules
140-
├── executor/ # RootExecutor, ShizukuExecutor
141-
├── model/ # AppInfo, ExecutionMode
142-
├── rollback/ # RollbackManager, ActionLog
143-
├── service/ # AppFetcher, BatteryPolicyManager, PermissionBridge
144-
├── ui/ # Activities, Fragments, Adapters, BottomSheets
145-
└── utils/ # Constants, SafetyValidator
178+
├── App.kt # Application class with @HiltAndroidApp
179+
├── di/ # Hilt DI modules
180+
│ ├── AppModule.kt
181+
│ └── ExecutorModule.kt
182+
├── domain/
183+
│ ├── executor/ # Command execution
184+
│ │ ├── CommandExecutor.kt
185+
│ │ ├── RootExecutor.kt
186+
│ │ ├── ShizukuExecutor.kt
187+
│ │ └── PermissionBridge.kt
188+
│ ├── manager/ # Business logic
189+
│ │ ├── AppControlManager.kt
190+
│ │ ├── BatteryManager.kt
191+
│ │ ├── ActionLogger.kt
192+
│ │ ├── DisplayManager.kt
193+
│ │ └── ModeWatcher.kt
194+
│ ├── scanner/ # App scanning
195+
│ │ └── AppScanner.kt
196+
│ ├── monitor/ # System monitoring
197+
│ │ └── SystemMonitor.kt
198+
│ └── validator/ # Safety validation
199+
│ └── SafetyValidator.kt
200+
├── data/
201+
│ └── model/ # Data classes
202+
│ ├── AppInfo.kt
203+
│ ├── ExecutionMode.kt
204+
│ ├── SystemInfo.kt
205+
│ └── ActionLog.kt
206+
└── ui/
207+
├── MainActivity.kt
208+
├── setup/ # Setup wizard
209+
├── dashboard/ # Dashboard with system info
210+
├── applist/ # App list and detail
211+
├── settings/ # Settings
212+
├── history/ # Action history
213+
└── components/ # Reusable UI components
146214
```
147215

148216
## Tech Stack
@@ -151,7 +219,9 @@ com.appcontrolx/
151219
- Min SDK 29 (Android 10)
152220
- Target SDK 34 (Android 14)
153221
- MVVM + Hilt DI
154-
- Material 3
222+
- Material 3 with Dynamic Colors
155223
- Coroutines + Flow
156-
- libsu (Root)
157-
- Shizuku-API
224+
- libsu 5.2.2 (Root)
225+
- Shizuku-API 13.1.5
226+
- Navigation Component
227+
- ViewBinding

app/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId = "com.appcontrolx"
1414
minSdk = 29
1515
targetSdk = 34
16-
versionCode = 3
17-
versionName = "1.1.0"
16+
versionCode = 4
17+
versionName = "2.0.0"
1818
}
1919

2020
signingConfigs {
@@ -92,6 +92,7 @@ dependencies {
9292
implementation("androidx.appcompat:appcompat:1.6.1")
9393
implementation("com.google.android.material:material:1.11.0")
9494
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
95+
implementation("androidx.gridlayout:gridlayout:1.0.0")
9596

9697
// Lifecycle & ViewModel
9798
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")

app/proguard-rules.pro

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,34 @@
2020
-keep class com.appcontrolx.IShellService$* { *; }
2121
-keep class * extends android.os.Binder { *; }
2222

23-
# Keep Shizuku UserService
24-
-keep class com.appcontrolx.executor.ShellService { *; }
25-
-keep class com.appcontrolx.executor.ShizukuExecutor { *; }
26-
-keep class com.appcontrolx.executor.ShizukuExecutor$* { *; }
27-
28-
# Keep all executors
29-
-keep class com.appcontrolx.executor.** { *; }
30-
31-
# Keep MainActivity methods (What's New dialog)
32-
-keepclassmembers class com.appcontrolx.ui.MainActivity {
33-
private void showWhatsNewIfNeeded();
34-
private void showWhatsNewDialog();
35-
}
23+
# Keep Shizuku UserService - NEW PACKAGE STRUCTURE
24+
-keep class com.appcontrolx.domain.executor.ShellService { *; }
25+
-keep class com.appcontrolx.domain.executor.ShizukuExecutor { *; }
26+
-keep class com.appcontrolx.domain.executor.ShizukuExecutor$* { *; }
27+
28+
# Keep all executors - NEW PACKAGE STRUCTURE
29+
-keep class com.appcontrolx.domain.executor.** { *; }
30+
31+
# Keep all managers
32+
-keep class com.appcontrolx.domain.manager.** { *; }
33+
34+
# Keep all validators
35+
-keep class com.appcontrolx.domain.validator.** { *; }
3636

37-
# Keep Models
38-
-keep class com.appcontrolx.model.** { *; }
39-
-keep class com.appcontrolx.data.local.entity.** { *; }
37+
# Keep all scanners
38+
-keep class com.appcontrolx.domain.scanner.** { *; }
4039

41-
# Keep Rollback data classes (for Gson serialization)
42-
-keep class com.appcontrolx.rollback.** { *; }
40+
# Keep all monitors
41+
-keep class com.appcontrolx.domain.monitor.** { *; }
42+
43+
# Keep Data Models - NEW PACKAGE STRUCTURE
44+
-keep class com.appcontrolx.data.model.** { *; }
45+
-keep class com.appcontrolx.data.preferences.** { *; }
46+
-keep class com.appcontrolx.data.repository.** { *; }
47+
48+
# Keep UI State classes
49+
-keep class com.appcontrolx.ui.applist.AppListUiState { *; }
50+
-keep class com.appcontrolx.ui.dashboard.DashboardUiState { *; }
4351

4452
# Keep ViewModels
4553
-keep class * extends androidx.lifecycle.ViewModel {
@@ -70,12 +78,6 @@
7078
-keep class * implements com.google.gson.JsonSerializer
7179
-keep class * implements com.google.gson.JsonDeserializer
7280

73-
# Crashlytics
74-
-keepattributes SourceFile,LineNumberTable
75-
-keep public class * extends java.lang.Exception
76-
-keep class com.google.firebase.crashlytics.** { *; }
77-
-dontwarn com.google.firebase.crashlytics.**
78-
7981
# Coroutines
8082
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
8183
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
@@ -89,8 +91,3 @@
8991
public static *** v(...);
9092
public static *** i(...);
9193
}
92-
-assumenosideeffects class timber.log.Timber {
93-
public static *** d(...);
94-
public static *** v(...);
95-
public static *** i(...);
96-
}

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

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
package com.appcontrolx
22

33
import android.app.Application
4+
import android.os.Build
45
import android.util.Log
56
import androidx.appcompat.app.AppCompatDelegate
67
import androidx.preference.PreferenceManager
7-
import com.appcontrolx.utils.Constants
8+
import com.google.android.material.color.DynamicColors
89
import com.topjohnwu.superuser.Shell
910
import dagger.hilt.android.HiltAndroidApp
1011

12+
/**
13+
* Application class for AppControlX.
14+
*
15+
* Handles:
16+
* - Hilt dependency injection initialization
17+
* - Root shell configuration via libsu
18+
* - Material 3 dynamic colors support (Android 12+)
19+
* - Theme (Light/Dark/System) application
20+
*
21+
* Requirements: 8.7, 8.8 - Material 3 design with dynamic colors and dark mode support
22+
*/
1123
@HiltAndroidApp
1224
class App : Application() {
1325

@@ -43,13 +55,62 @@ class App : Application() {
4355

4456
override fun onCreate() {
4557
super.onCreate()
58+
59+
// Apply Material 3 dynamic colors (Android 12+)
60+
// This extracts colors from the user's wallpaper for a personalized theme
61+
applyDynamicColors()
62+
63+
// Apply user's theme preference (Light/Dark/System)
4664
applyTheme()
47-
Log.d(TAG, "App initialized")
65+
66+
Log.d(TAG, "App initialized with Material 3 theming")
67+
}
68+
69+
/**
70+
* Apply Material 3 dynamic colors if available (Android 12+).
71+
*
72+
* Dynamic colors extract the dominant colors from the user's wallpaper
73+
* and apply them throughout the app for a cohesive, personalized experience.
74+
*
75+
* On devices running Android 11 or below, the app falls back to the
76+
* static Material 3 color scheme defined in colors.xml.
77+
*/
78+
private fun applyDynamicColors() {
79+
val prefs = PreferenceManager.getDefaultSharedPreferences(this)
80+
val useDynamicColors = prefs.getBoolean(PREFS_DYNAMIC_COLORS, true)
81+
82+
if (useDynamicColors && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
83+
// Apply dynamic colors to all activities
84+
DynamicColors.applyToActivitiesIfAvailable(this)
85+
Log.d(TAG, "Dynamic colors applied")
86+
} else {
87+
Log.d(TAG, "Using static Material 3 color scheme")
88+
}
4889
}
4990

91+
/**
92+
* Apply the user's theme preference.
93+
*
94+
* Supports:
95+
* - MODE_NIGHT_FOLLOW_SYSTEM: Follow system dark mode setting (default)
96+
* - MODE_NIGHT_NO: Always use light theme
97+
* - MODE_NIGHT_YES: Always use dark theme
98+
*/
5099
private fun applyTheme() {
51100
val prefs = PreferenceManager.getDefaultSharedPreferences(this)
52-
val theme = prefs.getInt(Constants.PREFS_THEME, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
101+
val theme = prefs.getInt(PREFS_THEME, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
53102
AppCompatDelegate.setDefaultNightMode(theme)
103+
104+
val themeName = when (theme) {
105+
AppCompatDelegate.MODE_NIGHT_NO -> "Light"
106+
AppCompatDelegate.MODE_NIGHT_YES -> "Dark"
107+
else -> "System"
108+
}
109+
Log.d(TAG, "Theme applied: $themeName")
110+
}
111+
112+
private companion object {
113+
const val PREFS_THEME = "theme"
114+
const val PREFS_DYNAMIC_COLORS = "dynamic_colors"
54115
}
55116
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.appcontrolx.data.model
2+
3+
import java.util.UUID
4+
5+
/**
6+
* Types of actions that can be performed on apps.
7+
*/
8+
enum class AppAction {
9+
FREEZE,
10+
UNFREEZE,
11+
FORCE_STOP,
12+
UNINSTALL,
13+
CLEAR_CACHE,
14+
CLEAR_DATA,
15+
RESTRICT_BACKGROUND,
16+
ALLOW_BACKGROUND
17+
}
18+
19+
/**
20+
* Record of an action performed on one or more apps.
21+
*/
22+
data class ActionLog(
23+
val id: String = UUID.randomUUID().toString(),
24+
val action: AppAction,
25+
val packages: List<String>,
26+
val success: Boolean,
27+
val errorMessage: String? = null,
28+
val timestamp: Long = System.currentTimeMillis()
29+
)
30+
31+
/**
32+
* State of a single app for rollback purposes.
33+
*/
34+
data class AppState(
35+
val packageName: String,
36+
val isEnabled: Boolean,
37+
val runInBackground: String,
38+
val wakeLock: String
39+
)
40+
41+
/**
42+
* Snapshot of app states before a batch action.
43+
* Used for rollback functionality.
44+
*/
45+
data class StateSnapshot(
46+
val id: String = UUID.randomUUID().toString(),
47+
val states: List<AppState>,
48+
val createdAt: Long = System.currentTimeMillis()
49+
)

0 commit comments

Comments
 (0)