Skip to content

Implement phone-watch handshake and CI/CD workflows#1

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/get-handshake-working
Draft

Implement phone-watch handshake and CI/CD workflows#1
Copilot wants to merge 5 commits intomainfrom
copilot/get-handshake-working

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 15, 2026

Completes the Signal Protocol device linking handshake between phone and watch. Adds GitHub Actions CI/CD automation.

Handshake Implementation

Network Permissions

  • Added INTERNET and ACCESS_NETWORK_STATE to AndroidManifest.xml

Key Derivation Fix

  • Replaced XOR simulation with proper HKDF implementation in SignalClient.kt:
// Before: insecure XOR-based derivation
for (i in 0 until 64) {
    derivedSecrets[i] = ((sharedSecret[i % sharedSecret.size].toInt() xor i).toByte())
}

// After: Signal Protocol v3 HKDF
val hkdf = HKDF.createFor(3)
val info = "WhisperProvisioning".toByteArray(Charsets.UTF_8)
val derivedSecrets = hkdf.deriveSecrets(sharedSecret, salt, info, 64)

WebSocket Connection

  • Enabled WebSocket connection in QrCodeScreen.kt (previously commented out)
  • Extracts UUID from link URI: tsdevice:/?uuid=<UUID>&pub_key=<KEY>
  • Connects to provisioning endpoint with extracted UUID

Provisioning Callback

  • Added onProvisioningComplete callback to SignalClient constructor
  • Triggers UI navigation when decryption succeeds

Build Configuration

  • Updated Gradle 8.9, AGP 8.3.2, Kotlin 1.9.23 for compatibility

CI/CD Workflows

Created 7 GitHub Actions workflows:

  • ci.yml - Build + lint + test with dependency caching
  • android-build.yml - Debug APK builds
  • android-lint.yml - Static analysis
  • android-test.yml - Unit tests
  • pr-validation.yml - PR checks
  • release.yml - Release builds on tags
  • code-quality.yml - Scheduled quality analysis

Documentation

  • README.md - Project overview and handshake flow
  • HANDSHAKE_DETAILS.md - Cryptographic protocol deep-dive
  • BUILD_TROUBLESHOOTING.md - Build issue solutions
  • .github/workflows/README.md - CI/CD documentation

Security

Implements Signal Protocol v3 standard:

  • Curve25519 ECDH key agreement
  • HKDF-SHA256 key derivation
  • AES-256-GCM authenticated encryption
  • Ephemeral keys for forward secrecy

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/gradle-daemon-main-8.9.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/agents/gradle-instrumentation-agent-8.9.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.9 (dns block)
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • maven.google.com (HTTP Only)
    • Triggering command: REDACTED, pid is -1 (packet block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

try to get the handshake between phone and watch working. and add ci/cd github actions


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits January 15, 2026 01:14
Co-authored-by: j-cray <150755225+j-cray@users.noreply.github.com>
Co-authored-by: j-cray <150755225+j-cray@users.noreply.github.com>
Co-authored-by: j-cray <150755225+j-cray@users.noreply.github.com>
Co-authored-by: j-cray <150755225+j-cray@users.noreply.github.com>
Copilot AI changed the title [WIP] Get handshake between phone and watch working Implement phone-watch handshake and CI/CD workflows Jan 15, 2026
Copilot AI requested a review from j-cray January 15, 2026 01:23
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.

2 participants