Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ Apps removed (not on Play Store, APK-only distribution): Honeygain, PacketStream

## APK Installation via adb

- `adb install -r <apk>` installs over existing app **only if signatures match**
- Debug and release APKs have different signing keys — installing debug over release (or vice versa) fails with `INSTALL_FAILED_UPDATE_INCOMPATIBLE`
- To switch signing type: `adb uninstall com.cashpilot.android` first (loses app data)
- CI release APK matches the keystore used for GitHub Releases and F-Droid — always prefer `app-release` artifact
- **ALWAYS install the release-signed APK (`app-release`). NEVER use the debug APK.** Switching signatures requires a full uninstall, which wipes all app data (server URL, API key, permissions).
- Download from CI: `gh run download <run-id> --name app-release --dir /tmp/cashpilot-apk`
- Install: `adb install -r /tmp/cashpilot-apk/app-release.apk`
- If signature mismatch: `adb uninstall com.cashpilot.android` first, then install (user must re-configure)

## What NOT to Build Yet

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/cashpilot/android/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ class MainActivity : ComponentActivity() {
val settings by viewModel.settings.collectAsState()
val hasNotif by viewModel.hasNotificationAccess.collectAsState()
val hasUsage by viewModel.hasUsageAccess.collectAsState()
val hasBattery by viewModel.hasBatteryOptOut.collectAsState()
var showSettings by rememberSaveable { mutableStateOf(false) }
var setupDismissed by rememberSaveable { mutableStateOf(false) }

val needsSetup = !setupDismissed &&
(settings.serverUrl.isBlank() || settings.apiKey.isBlank() || !hasNotif || !hasUsage || !hasBattery)
(settings.serverUrl.isBlank() || settings.apiKey.isBlank() || !hasNotif || !hasUsage)

// Handle system Back from Settings → return to Dashboard
BackHandler(enabled = showSettings && !needsSetup) {
Expand Down
21 changes: 16 additions & 5 deletions app/src/main/java/com/cashpilot/android/ui/screen/SetupScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fun SetupScreen(viewModel: MainViewModel, onComplete: () -> Unit) {
onComplete()
},
modifier = Modifier.fillMaxWidth(),
enabled = serverDone && hasNotif && hasUsage && hasBattery,
enabled = serverDone && hasNotif && hasUsage,
) {
Text(stringResource(R.string.setup_continue))
}
Expand Down Expand Up @@ -284,8 +284,19 @@ private fun openUsageAccessSettings(context: Context) {
}

private fun openBatteryOptimizationSettings(context: Context) {
context.startActivity(
Intent(AndroidSettings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
)
try {
// Direct prompt for this app specifically
context.startActivity(
Intent(
AndroidSettings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS,
android.net.Uri.parse("package:${context.packageName}"),
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
)
} catch (_: Exception) {
// Fallback to global list
context.startActivity(
Intent(AndroidSettings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
)
}
}
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading