Skip to content

Dev#11

Closed
SANDRO00O wants to merge 27 commits into
masterfrom
dev
Closed

Dev#11
SANDRO00O wants to merge 27 commits into
masterfrom
dev

Conversation

@SANDRO00O

Copy link
Copy Markdown
Owner

No description provided.

@SANDRO00O SANDRO00O closed this Jun 14, 2026
Comment on lines +14 to +37
- name: Generate Release Keystore
run: |
keytool -genkeypair -alias consoleflow -keyalg RSA -keysize 2048 -validity 10000 -keystore release.keystore -storepass consoleflow123 -keypass consoleflow123 -dname "CN=consoleflow, OU=App, O=consoleflow, L=Unknown, ST=Unknown, C=US"

echo ""
echo "================================================"
echo " COPY THESE VALUES TO GITHUB SECRETS"
echo "================================================"
echo ""
echo "Secret name: KEYSTORE_B64"
echo "Secret value (copy everything between the lines):"
echo "----"
base64 -w 0 release.keystore
echo ""
echo "----"
echo ""
echo "Secret name: KEY_ALIAS"
echo "Secret value: consoleflow"
echo ""
echo "Secret name: KEYSTORE_PASSWORD"
echo "Secret value: consoleflow123"
echo ""
echo "Secret name: KEY_PASSWORD"
echo "Secret value: consoleflow123"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Keystore leaked in logs 🐞 Bug ⛨ Security

The new generate-keystore workflow prints the base64-encoded release keystore and its hardcoded
passwords to the GitHub Actions logs, exposing the signing private key to anyone with log access.
This can enable malicious actors to sign and distribute counterfeit “official” releases.
Agent Prompt
## Issue description
The workflow `.github/workflows/generate-keystore.yml` prints the release keystore (`base64 -w 0 release.keystore`) and hardcoded passwords to stdout, which ends up in CI logs and leaks signing material.

## Issue Context
Release signing keys must never be printed or stored in logs. Even for a manually triggered workflow, logs are typically accessible to many users/roles and may be retained.

## Fix Focus Areas
- Remove or heavily restrict this workflow; do not output keystore/passwords to logs.
- If you must generate in CI, upload the keystore as a short-lived artifact and protect the environment with required reviewers; do not echo secrets.
- Use randomly generated passwords (or inputs) rather than hardcoded values.

## Fix Focus Areas (code references)
- .github/workflows/generate-keystore.yml[14-37]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +34 to +47
private val executor = Executors.newFixedThreadPool(3)
private val activeCount = AtomicInteger(0)
private val notifIdGen = AtomicInteger(NOTIF_BASE)

private val notifManager: NotificationManager by lazy {
getSystemService(NotificationManager::class.java)!!
}

private val okClient = OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(0, TimeUnit.SECONDS)
.followRedirects(true)
.followSslRedirects(true)
.build()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

4. Download cancellation not robust 🐞 Bug ☼ Reliability

DownloadService configures OkHttp with an infinite read timeout and cancellation only updates
tracker state, so a stalled socket read may block indefinitely and cannot be cancelled promptly. The
service also stops without shutting down its thread pool, which can leave idle threads alive after
stopSelf().
Agent Prompt
## Issue description
The download loop can become effectively non-cancellable when network reads stall because:
- OkHttp is configured with `readTimeout(0, ...)` (infinite).
- Cancel requests only update `DownloadTracker` state; there is no `Call.cancel()` path.
Also, the service uses a fixed thread pool that is never shut down on service stop.

## Issue Context
If `input.read()` blocks waiting for network data, your loop cannot check the cancelled state until the read returns. Proper cancellation typically requires tracking `Call` objects and cancelling them.

## Fix Focus Areas
- Set finite `readTimeout` and/or `callTimeout` for downloads.
- Store active `Call` per download id (e.g., `ConcurrentHashMap<Int, Call>`) and call `cancel()` in `handleCancel`.
- Override `onDestroy()` and/or update `stopWhenIdle()` to `executor.shutdownNow()` and cancel any active calls.
- Consider `START_NOT_STICKY` if you do not support restart-resume.

## Fix Focus Areas (code references)
- app/src/main/java/space/karrarnazim/ConsoleFlow/download/DownloadService.kt[34-47]
- app/src/main/java/space/karrarnazim/ConsoleFlow/download/DownloadService.kt[418-424]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Repository owner deleted a comment from qodo-code-review Bot Jun 16, 2026
Repository owner deleted a comment from qodo-code-review Bot Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant