refactor: consolidate Pakkit into a standalone Wear OS app

- Remove obsolete modules, dependencies, assets, and documentation
- Separate UI, receiving sessions, HTTP serving, storage, and installation
- Introduce typed package state and guard against stale callbacks
- Add reproducible emulator and browser tests
- Update build, signing, and release configuration
This commit is contained in:
Meghdad committed 2026-10-15 18:38:52 +03:30
1 parent 4d5d0b4165
commit 7d01d57e6f
136 files changed
+4822 -1773

No files matched your search

+31 -21
View File
@@ -1,35 +1,45 @@
# Standalone architecture and security
# Architecture
## Components and flow
Pakkit is a single Android application for Wear OS. The watch hosts both the native review/install experience and a static HTML/CSS/JavaScript interface delivered to a browser over local Wi-Fi.
WatchActivity → explicit Start receiving → ReceiveService → Wi-Fi network request → private IPv4 listener → private URL/QR → browser HTML/CSS/JS from watch → authenticated raw APK POST → bounded private file → Android archive inspection → ready state → watch Install → PackageInstaller → system consent → result receiver → browser status.
## Ownership
`shared` contains protocol/inspection/storage/design code. `wear` owns the server and installer. The phone module, Play Services Data Layer and WorkManager have been removed. No Google services runtime, backend, account, mDNS or WebView is required. ZXing Core encodes the QR locally.
| Package | Responsibility |
| ---------- | -------------------------------------------------------------------------------------------- |
| `ui` | WatchActivity, round scrolling, status glyphs and watch design tokens |
| `transfer` | Receiving state, Wi-Fi service, local HTTP endpoint, framing and bounded upload body |
| `apk` | APK metadata, package inspection, compatibility/space/integrity rules and typed review state |
| `data` | PackageStore: one staged APK and its durable review/installation state |
| `install` | ApkInstaller, validated system callback and pending system approval intent |
## Session ownership
The native UI composes Android platform views. The web app is served directly from `app/src/main/assets/web`; there is no frontend build step, CDN, WebView, account, backend or internet requirement for transfer. The only explicit runtime library is ZXing Core. A separate Gradle application under `qa/fixture` supplies a signed test APK exclusively to the instrumentation APK.
The user starts a connectedDevice foreground service while WatchActivity is visible. Wi-Fi is requested for up to 25 seconds; absent connectivity yields a recoverable message. A socket binds exclusively to the chosen Wi-Fi private IPv4 address and ephemeral port. The service is never exported, restarted automatically or started at boot. The ten-minute deadline starts at user initiation; a timed CPU wake lock covers the session without keeping the screen on. Losing that network ends the session. Stop closes accepted sockets, shuts down the bounded worker pool, unregisters the network callback, removes the URL and releases power resources.
## Receiving lifecycle
The browser may continue watching installation results while the session remains active. Ending the network session does not cancel an already committed Android installation or delete a pending user review. A completed upload remains eligible for review for 24 hours; expired packages are removed when the app next opens. This is lazy cleanup, not a guaranteed background deletion deadline. Partial and rejected uploads are deleted immediately. Reboot/process death requires a new receiving session. No resume tokens are persisted for transfer recovery.
WatchActivity starts ReceiveService only after an explicit action. The non-exported connectedDevice foreground service owns the notification/stop action, a requested Wi-Fi network, a timed partial CPU wake lock and a ten-minute deadline. It waits for link properties and binds LocalHttpServer to that network’s private IPv4 address and an ephemeral port. Network loss or address change ends the session. START_NOT_STICKY and absence of boot receivers prevent automatic resurrection.
## HTTP boundary
LocalHttpServer owns the listener, two workers, four queued connections, tracked sockets, HTTP routing and one streamed upload. Service teardown closes the listener and accepted sockets, stops workers, unregisters the Wi-Fi callback, removes callbacks and releases the CPU lock. The display is not held awake. The session can continue while the display sleeps, subject to firmware and OS constraints.
- Independent 192-bit SecureRandom URL-safe key per session, in the URL fragment so the initial HTTP request does not include it. JS removes the fragment from visible history after loading, keeps it only in memory and sends an Authorization bearer header for APIs. Reload without the key requires re-entering it or rescanning.
- All content is local. Strict self-only script/style/connect CSP, no framing, no referrer, no cache, no MIME sniffing, no CORS or external fonts/trackers.
- Exact Host check protects against DNS rebinding. Upload requires the watch page’s exact Origin and bearer token. No browser install/cancel-install endpoint exists.
- Parser limits headers to 8 KiB and lines to 4 KiB, rejects duplicate headers, invalid framing, transfer encoding, expectations and unsupported methods. Each socket serves one request then closes. Only fixed public asset routes are served; there is no user-controlled filesystem lookup.
- Raw octet-stream POST with positive Content-Length <=50 MiB. No multipart buffering, user filenames or extraction into filesystem paths. UUID private filename. One upload at a time; another review must be dismissed/completed first. Free-space preflight, streamed SHA-256, 64 KiB buffer, ZIP expansion/entry limits, full-package/split and self-update rejection, SDK/ABI/storage checks.
- Two workers, four queued connections, 15-second read inactivity deadline and hard session lifetime. CPU/memory/storage are bounded. Early rejected large requests may be observed by a browser as a connection error because the server intentionally does not consume an unauthorized body.
- Progress is bytes actually read on the watch and bytes sent by browser XHR. 100% sent changes to verification wording and never implies installation. Installation success appears only after STATUS_SUCCESS.
`Receiving` holds an immutable, volatile snapshot in memory. Updates are tagged with the owning service instance, so a stopped session’s workers cannot change a later session. UI notifications are coalesced onto the main thread and observers are removed on pause. Private links and byte counters are never written to preferences. Process death invalidates the session; the user starts a fresh one.
## Trust model
## Durable package state
Local HTTP is unencrypted. Link secrecy, Host/Origin checks and SHA-256 do not stop an active LAN attacker, protect against passive capture, or authenticate the server with a certificate. Use a trusted private Wi-Fi and keep the private URL secret. Anyone holding the link can submit a package, but only an explicit watch action can request its installation and Android requires consent. The app does not claim malware scanning or universal app compatibility. Source approval and system restrictions remain authoritative.
PackageStore retains one PendingApk: UUID, creation time, inspected metadata, an InstallState, detail and optional installer session ID. It preserves a stable private storage schema across application updates. All writers share a lock; staging refuses replacement of an existing review, and updates require the current package ID. Dismissed reviews cannot be resurrected by late callbacks.
ReceiveService has INTERNET, ACCESS_NETWORK_STATE, CHANGE_NETWORK_STATE, WAKE_LOCK and foreground-service permissions; these support the explicit Wi-Fi session. REQUEST_INSTALL_PACKAGES is limited to the watch. Optional notification permission enables visible receiving/approval alerts; denying it does not authorize hidden background starts or bypass the in-app consent flow. The system may still expose the running foreground service in its task UI.
Files use app-private UUID filenames. Complete APKs remain eligible for review for 24 hours. Launch cleanup removes expired reviews and old unreferenced files. Partial/rejected uploads are deleted in a finally block. Installation success or dismissal deletes the staged APK. Expiry is an eligibility deadline with lazy disk cleanup, not a scheduled background deletion promise.
## Installation state
## HTTP and trust
`LocalInstall.status` writes watch-local ready/installing/confirm/installed/failed state. Store persists the current package/review across activity recreation. Session callbacks validate job and session IDs in a non-exported receiver. The pending system intent is kept in process or carried by the app’s immutable notification PendingIntent; interrupted approval can be retried. Installation re-hashes the private file and rechecks compatibility before writing a PackageInstaller session. Dismiss deletes the staged package. Success deletes it and cancels the consent notification.
Each session generates a 192-bit random key embedded in the private URL fragment. JavaScript removes it from visible history after page load and keeps it in memory for Authorization headers. A reload without the fragment requires the key again. A fixed asset allowlist prevents filesystem traversal. APIs require the key; uploads also require the exact Origin. Exact Host validation resists DNS rebinding. No CORS, framing, external scripts/styles/fonts, cached responses or browser-controlled installation endpoints are enabled.
No appops mutation, permission grant shell command, ADB client, root, hidden installer component, device-owner privilege, automatic installation, browser-driven installation or Pakkit self-update exists in the product.
HttpProtocol accepts a small HTTP/1.1 subset: GET/POST, one request per connection, 8 KiB total headers, 4 KiB lines, unique headers and no chunked/Expect framing. Uploads require decimal Content-Length in 1..50 MiB and application/octet-stream. UploadBody reads exactly that length, treats truncation as failure and reports progress at most four times per second. A 64 KiB buffer writes the private file while computing SHA-256. Storage reserve and bounded ZIP/manifest inspection precede review. SDK, ABI, complete-package and self-update checks are centralized in the APK package.
Local HTTP is unencrypted. Link secrecy and Host/Origin/hash checks do not protect against a LAN observer or active attacker. Use a trusted network. Possession of the link allows file submission, while watch review and the Android installer remain separate consent boundaries.
## Installation
InstallState progresses from READY to INSTALLING, then CONFIRM when Android requires user action, and finally INSTALLED or FAILED. ApkInstaller runs off the main thread only after the watch’s Install action. It rechecks source trust, expiry, private-file digest and compatibility before creating a MODE_FULL_INSTALL session with USER_ACTION_REQUIRED. It never bypasses source approval, verification or system consent.
The explicit mutable PendingIntent targets a non-exported InstallReceiver. The receiver requires the active package ID, a non-null matching session ID and an installation/confirmation state. A pending action exposes only Android’s returned confirmation intent, through the watch UI or an immutable notification PendingIntent. State changes refresh the UI through PackageStore preferences; the receiver does not hold an Activity reference. Interrupted confirmation can be retried.
Optional notification denial leaves the in-app consent flow usable. Firmware that cannot expose usable source approval or installation consent is unsupported for external installs and directs users to Google Play. Read PLATFORM.md and RELEASE.md before making distribution claims.
+26
View File
@@ -0,0 +1,26 @@
# Pakkit design
**Pakkit — Pocket to Wrist.** Secondary tagline: **Pack it. Send it. Wear it.** The identity is friendly, playful and polished: an open parcel with a floating app tile, soft geometry, violet lighting and mint/cyan accents.
## Implemented assets
- `app/src/main/res/drawable/pakkit_icon.xml`: gradient parcel artwork used by the watch header, splash and adaptive launcher.
- `pakkit_mark.xml`: monochrome launcher/notification mark.
- `app/src/main/assets/web/index.html`: original inline vector parcel illustration and compact wordmark icon. These are real SVG elements, not screenshots.
- `ui/WatchDesign.kt`: only the native watch’s actual text, action, badge, color and shape primitives.
- `ui/GlyphDrawable.kt`: check/error glyphs, paired with explanatory text.
- `ui/RoundScrollView.kt`: bezel position indication and native rotary/touch scrolling, redrawn in response to scroll changes.
## Themes and layout
The native watch UI uses midnight `#090 B 17` to limit lit OLED pixels, lavender-white text and semantic mint/error surfaces. Body and secondary copy, badges and action gradient endpoints have automated contrast checks. Actions have a minimum 48 dp height and scalable text. Proportional margins and bottom padding allow controls to move into the usable center of a round display. The QR is sized to screen width and positioned within the circular safe area; the full URL and trust disclosure remain scrollable below it.
The browser follows prefers-color-scheme with an explicit in-session toggle. Dark is midnight with violet/cyan lighting; light uses soft lavender and white surfaces. A two-column desktop layout becomes a single-column layout at smaller widths. The maintained CSS, HTML and JavaScript are readable source files, formatted with the optional web development tools. Native browser controls, semantic headings, focus rings, file labels and a live status region support keyboard and assistive access.
## Motion and product states
The watch has static decorative artwork. Browser motion is a finite parcel entrance and short hover/press feedback; prefers-reduced-motion disables these. There are no continuous particle effects or decorative render loops. Polling pauses in hidden tabs.
Upload progress reflects actual XHR bytes sent and socket bytes read. “100% sent” transitions to package checking, never to an installation-success claim. The browser distinguishes upload, verification, watch review, system approval, failure and success. Android STATUS_SUCCESS is the authority for “installed”. Cancelling an HTTP request does not imply a rollback of a file the watch may already have received.
Keep copy precise: preflight does not certify safety or runtime compatibility. Source approval and system consent are explicit decisions. The trust disclosure describes unencrypted local HTTP without claiming encryption.
+61
View File
@@ -0,0 +1,61 @@
# Development and testing
## Environment
- Android Studio with JDK 21 (set JAVA_HOME for shell builds).
- SDK platform 36.1, current platform-tools and Android Emulator 36.5+ for shared virtual Wi-Fi.
- A round Wear OS Emulator (API 31+); an Android Emulator with Chrome is used as a browser device.
- Python 3 for the test runner. Optional Node 22+ and npm for browser tests/formatting.
`local.properties`, IDE files, Gradle/Kotlin caches, node_modules, generated APKs/reports and signing keys are ignored. Android Studio regenerates its local project model. No generated reports or screenshots are committed.
## Build and native tests
```sh
./gradlew :app:assembleDebug :app:assembleDebugAndroidTest :app:testDebugUnitTest :app:lint :app:bundleRelease
adb devices
python 3 scripts/test-emulators.py --watch emulator-5554 --skip-build
python 3 scripts/test-emulators.py --watch emulator-5554 --small --skip-build
```
Use actual serials from `adb devices`. The runner refuses serials that do not start with `emulator-` and requires the watch feature. It never selects a physical device. It connects the watch to the virtual AndroidWifi access point, installs only the app/test APKs and saves results under `app/build/reports/validation`. The small-screen run temporarily uses 192 dp and 1.3x font scaling, restoring the previous size, density and font setting in a finally block.
For install tests, first open Pakkit on the emulator and use **Allow installs** to approve it through the normal system UI. No shell permission grant is needed. Tests mark missing source approval as an assumption; the runner treats skipped tests as incomplete validation. Native tests clean up staged files, pending system sessions, notifications and activities. The official-installer test stops at required system consent and abandons its test session afterward.
The optional Google Maven mirror property is documented in README.md. If needed, build with that property and pass --skip-build to the runner; its default build uses standard repositories.
## Browser UI tests
```sh
npm ci --prefix web-tests
npm exec --prefix web-tests -- playwright install chromium
npm test --prefix web-tests
npm run format:check --prefix web-tests
```
These tests serve the actual bundled assets with a local API fixture and exercise 320/390/768/1440 px widths, both themes, manual session-key entry, file rejection, upload errors/retry, system-status transitions and cancellation. This isolates browser interactions; it does not stand in for watch networking. An existing Chromium executable can be selected with PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH.
Playwright and Prettier are development dependencies only, locked in web-tests/package-lock.json. There is no Node toolchain in the Android runtime or asset build. `npm run format --prefix web-tests` formats web assets and browser tests; use standard Kotlin formatting for native source.
## Real browser-to-watch emulator transfer
Complete Chrome’s first-run setup in the Android Emulator, leave Chrome open, and run:
```sh
python 3 scripts/test-emulators.py --watch emulator-5554 --browser emulator-5556 --skip-build
```
Both emulators must use the shared virtual Wi-Fi network. Android Emulator 36.5+ [supports direct communication between emulator instances](https://developer.android.com/studio/run/emulator-networking-interconnect). The runner starts Pakkit through its visible receiving action, reads the private link from the actual watch UI, connects Playwright to Chrome on the Android Emulator through a local ADB forward, and submits the signed QA fixture. Chrome sends the real XHR directly to the watch’s private Wi-Fi address. The test asserts watch review, then dismisses the fixture and ends the session. Debug forwarding is test infrastructure; no debug endpoint or test mode ships in Pakkit. The forward is removed afterward and the watch app is stopped even on failure.
An uninitialized Chrome instance or isolated/older emulator network requires environment setup; the runner does not silently substitute mock transport. Keep private session URLs out of committed logs. Generated screenshots and API summaries live under app/build/reports/validation.
## Fixture and release inspection
`qa/fixture` builds a minimal signed test app. StageFixtureApk copies it into debug instrumentation assets only. The consumer APK/AAB must contain no fixture APK or test classes. Inspect release resources, merged permissions and runtime dependencies when changing Gradle configuration:
```sh
./gradlew :app:dependencies --configuration releaseRuntimeClasspath
./gradlew :app:bundleRelease
```
Hardware testing is a final compatibility/power gate, documented in VALIDATION.md, rather than a routine development requirement.
-49
View File
@@ -1,49 +0,0 @@
# Standalone feasibility decision
Research and implementation: October 15, 2026. Pakkit 0.2 replaces the companion architecture.
## Decision and evidence boundary
Use a user-started local HTTP receiving session hosted by the watch, followed by explicit on-watch review and a public PackageInstaller session requiring user action. Receiving a file does not install it. Support is conditional on firmware exposing source approval and a functioning system installer.
Android’s [Wear network guidance](https://developer.android.com/training/wearables/data/network-communication) explicitly supports HTTP/TCP/UDP and independent network access. This supports implementing a server using ordinary Android sockets; the documentation does not certify inbound reachability on every network. A Bluetooth-proxied internet route is not an inbound Wi-Fi listener, so Pakkit requests a Wi-Fi network and binds only its private IPv4 address. Guest-network isolation and firewalls remain outside application control.
The [standalone app definition](https://developer.android.com/training/wearables/apps/standalone-apps) permits QR/browser alternatives without a companion phone app. The manifest now declares standalone=true. “Any device” means a supported modern browser on a reachable local network, not independence from the watch’s original OEM onboarding requirements. A Galaxy Watch 7’s initial setup requirements are separate from Pakkit’s browser support.
## Installation is a separate capability
[PackageInstaller](https://developer.android.com/reference/android/content/pm/PackageInstaller) permits ordinary apps to create sessions with REQUEST_INSTALL_PACKAGES. Pakkit uses MODE_FULL_INSTALL and USER_ACTION_REQUIRED, handles STATUS_PENDING_USER_ACTION and starts only the returned system confirmation intent following a watch action. Android decides the final outcome. Readable signing metadata, hashes, SDK, ABI and space checks are preflight, not malware scanning or proof that an app will work on a round display.
[canRequestPackageInstalls](https://developer.android.com/reference/android/content/pm/PackageManager#canRequestPackageInstalls()) reports source trust. [ACTION_MANAGE_UNKNOWN_APP_SOURCES](https://developer.android.com/reference/android/provider/Settings#ACTION_MANAGE_UNKNOWN_APP_SOURCES) is the public settings route. A resolving activity alone does not prove a usable permission UI. Pakkit checks actual trust and gates session start; if approval is unavailable it explains the limit and offers Google Play. No appops changes, hidden components, privileged APIs or debugging client exist in application code.
### Galaxy Watch 7 evidence
Reference hardware observed: SM-L310, Android 16, fingerprint `samsung/fresh7blue/fresh7bl:16/BP2A.250325.020/L310XXS2BZF4:user/release-keys`.
The user reports that the previous Pakkit build completed installation normally without ADB, including with ADB debugging disabled. The development inspection found REQUEST_INSTALL_PACKAGES already allowed; no shell permission grant or security-setting modification was made. This is useful hardware evidence but does not independently reproduce a fresh Play-installed permission setup. See VALIDATION.md for the separately observed browser/upload/installer results. Do not generalize this result to every Samsung firmware, region or security configuration.
## Lifecycle and power
A [connectedDevice foreground service](https://developer.android.com/develop/background-work/services/fgs/service-types#connected-device) fits an explicit local transfer with an external browser device. CHANGE_NETWORK_STATE is used to request Wi-Fi and meets this service type’s declared prerequisite. The foreground notification has a stop action. A timed partial wake lock keeps the CPU available without holding the display on. Wi-Fi requests and CPU lock are released at session stop, network loss, service destruction or ten-minute expiry. Nothing starts at boot; START_NOT_STICKY prevents automatic session resurrection. Process death invalidates the session and the user starts another.
No continuous decorative watch animation, discovery broadcasts, cloud relay or analytics runs. Browser polling pauses while hidden. Watch byte updates are throttled to four per second. This bounds resource use but is not a battery consumption measurement; screen-off longevity, thermal and energy measurements remain release tests.
[Local network protections](https://developer.android.com/privacy-and-security/local-network-permission) cover incoming TCP too. At the current target SDK 36, INTERNET provides implicit local access. Before targeting 37, implement and test ACCESS_LOCAL_NETWORK runtime permission; official guidance says not to request it on lower targets. Browsers can independently require local-network permission.
## Google Play
The [REQUEST_INSTALL_PACKAGES policy](https://support.google.com/googleplay/android-developer/answer/12085295?hl=en) permits file sharing/transfer/management when package receipt and user-initiated installation are core functionality. Pakkit appears aligned with that category; this is an eligibility assessment, not approval. Accurately declare the final standalone purpose in Play Console and show source approval, transfer, watch review, system consent and denial handling. Do not reuse a companion-sync justification.
Declare the [foreground service use](https://support.google.com/googleplay/android-developer/answer/13392821) and provide the required demonstration. Publish only the watch artifact, with the required watch feature and standalone metadata, following [Wear packaging guidance](https://developer.android.com/training/wearables/packaging).
[Android developer verification](https://developer.android.com/developer-verification/guides) can add system restrictions to external apps. Some unverified-developer flows require developer settings and a delay. Those flows conflict with the product’s setup goal; Pakkit does not bypass them. Describe the supported compatible/verified package path rather than guaranteeing installation of every APK.
## Alternatives and limits
- **Google Play installation:** the compliant fallback when source trust, security policy, verification or firmware blocks external installation. Pakkit cannot silently elevate itself.
- **Trusted HTTPS relay:** could avoid LAN reachability and certificate setup, but requires a backend, retention policy, hosting cost, internet connectivity and additional privacy work. It would not fix a blocked PackageInstaller. Not implemented.
- **Local HTTPS:** a self-signed watch certificate produces browser trust warnings; ordinary public trust cannot be issued to an arbitrary private IP without additional infrastructure. Current local HTTP avoids certificate setup, openly limits use to trusted networks and does not claim encryption.
- **ADB/root/device-owner hacks:** excluded; they defeat the product goal or require privileges consumers do not have.
- **Cloud APK catalog/self-updater:** excluded; no third-party catalog, bundled consumer APK or Pakkit self-update path.
Current scope: private IPv4 Wi-Fi, one complete APK up to 50 MiB, one pending review, no split/APKS/APKM/XAPK/AAB support, no resumable upload. The OS performs final signature/update/verification checks. A failed firmware matrix or rejected permission declaration blocks production publication; a working upload alone does not change that decision.
+31
View File
@@ -0,0 +1,31 @@
# Platform and distribution constraints
## Supported flow
Pakkit requests a local Wi-Fi connection, hosts its browser assets and accepts a complete APK. Watch review initiates the public Android PackageInstaller session with user action required. Receiving a file is not proof that firmware permits installation.
[Wear OS network guidance](https://developer.android.com/training/wearables/data/network-communication) documents independent HTTP/TCP/UDP access. Pakkit uses a requested Wi-Fi network and a listener bound to its private IPv4 address; a proxied/default internet route is insufficient for inbound LAN access. Guest-network isolation, VPNs, firewalls and browser local-network restrictions can prevent access. IPv6-only networks and resumable/split-package uploads are outside the current scope.
[Standalone Wear apps](https://developer.android.com/training/wearables/apps/standalone-apps) support a QR/browser flow. The manifest declares required watch hardware and standalone=true. A watch’s OEM onboarding requirements remain independent of Pakkit’s transfer functionality.
## Source approval and installation
[PackageManager.canRequestPackageInstalls](<https://developer.android.com/reference/android/content/pm/PackageManager#canRequestPackageInstalls()>) reports trust as an installation source. Pakkit opens the public [unknown-app sources setting](https://developer.android.com/reference/android/provider/Settings#ACTION_MANAGE_UNKNOWN_APP_SOURCES) for the user to approve; it never changes that setting itself.
[PackageInstaller](https://developer.android.com/reference/android/content/pm/PackageInstaller) supports sessions, pending system user action and final success/failure results. Pakkit explicitly requires user action and handles Android’s returned consent intent. A source setting or API existing on Android does not establish that every Wear OS firmware exposes usable permission/confirmation UI. Unsupported firmware directs the user to Google Play. No root, privileged installer, hidden component, debugging client or verification bypass is implemented.
APK inspection checks size, bounded archive structure, readable signing metadata, complete-package status, SDK, ABI and storage reserve. It rejects Pakkit self-updates. It does not certify malware safety, final signature validity, runtime behavior, every hardware feature or a suitable circular layout. Android makes the final installation decision. Verification/security policy can block an otherwise well-formed upload.
## Lifecycle and permissions
A user-started [connectedDevice foreground service](https://developer.android.com/develop/background-work/services/fgs/service-types#connected-device) supports a bounded local transfer with an external device. CHANGE_NETWORK_STATE supports the Wi-Fi request and this service type’s prerequisite. The service exposes a stop action and releases its network/CPU resources at termination. This design bounds resource use but does not replace hardware battery/thermal testing.
[Local network protections](https://developer.android.com/privacy-and-security/local-network-permission) apply to incoming TCP too. Target 36 uses INTERNET for implicit local access. Before raising the target to 37, implement/test ACCESS_LOCAL_NETWORK runtime consent. Browser permissions can impose separate constraints. Keep this guidance aligned with the target SDK and supported firmware.
## Google Play
The [REQUEST_INSTALL_PACKAGES policy](https://support.google.com/googleplay/android-developer/answer/12085295?hl=en) permits file transfer/management where package receipt and user-initiated installation are core functionality. This makes Pakkit’s use potentially eligible; it does not guarantee approval. Accurately declare this purpose and submit the source-approval/review/consent flow. Also declare the [foreground-service use](https://support.google.com/googleplay/android-developer/answer/13392821) and meet [Wear packaging/quality guidance](https://developer.android.com/training/wearables/packaging).
[Android developer verification](https://developer.android.com/developer-verification/guides) may add restrictions to externally installed packages. Pakkit respects system blocks and does not promise to install every APK without additional platform requirements.
Local HTTP avoids a self-signed certificate setup flow but is unencrypted and limited to trusted networks. A relay or local HTTPS architecture would require separate certificate/backend/privacy work and would not make a blocked installer available. Google Play is the supported fallback when firmware or security policy prevents external installation.
+7 -7
View File
@@ -1,13 +1,13 @@
# Pakkit privacy disclosure draft
# Privacy disclosure draft
Pakkit transfers an APK that you select in a browser directly to your Wear OS watch over your local Wi-Fi. It does not require an account, companion app, cloud relay, analytics or advertising. The HTML, styles, JavaScript, icons and QR generation are bundled with the watch app; no external font or asset service is contacted.
Pakkit transfers the APK you select in a browser directly to your Wear OS watch over local Wi-Fi. The browser assets and QR generation are bundled with the watch application. No account, backend, analytics, advertising, remote font or cloud relay is used.
A short receiving session exposes a private URL and key. Keep that link private and use trusted Wi-Fi. Local HTTP is not encrypted; people able to observe or alter your network traffic may access it. Your browser/operating system may maintain its own local browsing history. Pakkit does not log uploaded filenames, IP addresses, keys or APK contents to a remote service.
Receiving sessions generate a private URL/key that stays in process memory. Keep the link private and use trusted Wi-Fi. Local HTTP is unencrypted: someone able to observe or alter network traffic may access it. Pakkit removes the key from visible browser history after loading; the browser and operating system still control their own browsing data and behavior.
The APK is stored in the app’s private watch storage. Pakkit reads package metadata and signing information, checks size/compatibility and computes a hash. This does not certify that a package is safe. Nothing installs until you explicitly request it on the watch and complete Android’s system approval. Android may independently verify the app under its own policies.
APKs and package-review metadata are stored in private watch storage. Pakkit reads package/signing metadata and computes a hash to detect corruption or changed staged files. This is not malware certification. Installation requires your watch action and Android’s system consent. Android can independently verify or block packages under its own policies.
Rejected/partial uploads are deleted. Successful installations and dismissed reviews delete the staged APK. Pending packages expire for installation after 24 hours and are cleaned up on the next app launch; they may remain in private storage until then. Local status history holds up to 20 entries of package label, state and timestamp. App backups/device transfer are disabled. Uninstalling Pakkit removes its private data; installed third-party apps are separate.
Partial/rejected uploads are deleted. Successful installation or dismissing the review deletes the staged file. Pending APKs expire for installation after 24 hours and are cleaned on the next app launch; they may remain in private storage until then. Pakkit retains one durable review. Backups and device transfer of private app data are disabled. Uninstalling Pakkit removes its private data; installed apps are separate.
Sessions end automatically within ten minutes, on Wi-Fi loss or when you stop them. Ending a session closes network access; it does not cancel an already committed system installation.
Sessions end within ten minutes, on Wi-Fi loss or when stopped. Ending network access does not cancel an already committed Android installation. Process death requires a new session and key.
Before publication, add the legal developer identity, support contact and hosted privacy policy URL. Reconcile the final binary, Android system behavior and Google Play Data safety answers; this draft is not a completed Play declaration.
Before publication, supply the legal developer identity, support contact and hosted privacy-policy URL. Reconcile the final binary, system behavior and Google Play Data safety declaration. This file is the product disclosure source, not a completed Play submission.
+32 -14
View File
@@ -1,16 +1,34 @@
# Google Play release preparation
# Release preparation
Pakkit is implemented as a standalone Wear OS app. This checklist does not assert Google Play approval.
## Artifact
- Publish only `wear`: application ID `meghdad.pakkit`, version 0.2.0/code100003, standalone=true, required watch feature, min31/target36/compile36.1. The phone module is removed. Increment codes for subsequent uploads.
- Build `./gradlew :wear:bundleRelease`. R8/resource shrinking enabled. Debug fixtures remain only in the test APK.
- Production signing inputs: PAKKIT_KEYSTORE, PAKKIT_KEYSTORE_PASSWORD, PAKKIT_KEY_ALIAS, PAKKIT_KEY_PASSWORD. No secret/default production key is included. Without the full set the release AAB is unsigned and must be signed by the release pipeline.
- Declare REQUEST_INSTALL_PACKAGES accurately as core, user-selected local package transfer with user-initiated installation. Submit the final standalone flow, source approval, transfer, watch review, system approval, cancellation and unsupported-state screencast. Do not claim prior companion permission eligibility automatically applies.
- Declare connectedDevice foreground-service use for a user-started bounded local device transfer, with notification/stop controls and required evidence. Review final merged permissions. No storage, broad package visibility, Bluetooth, location or boot permissions are requested.
- INTERNET/ACCESS_NETWORK_STATE/CHANGE_NETWORK_STATE support the requested Wi-Fi network and socket. WAKE_LOCK supports the bounded session. POST_NOTIFICATIONS is optional for receiving and approval alerts. Foreground service and connected-device foreground permissions are declared explicitly.
- Confirm the [install-package permission policy](https://support.google.com/googleplay/android-developer/answer/12085295) and [foreground service declaration requirements](https://support.google.com/googleplay/android-developer/answer/13392821) with the actual listing. Approval is not guaranteed.
- Add real developer/support identity and hosted privacy policy. Reconcile Data safety with PRIVACY.md and the final binary. No backend/analytics is used, but system installation verification is controlled by Android.
- Use genuine current standalone web and round-watch screenshots. Explain trusted same-Wi-Fi requirement, unencrypted local HTTP, source approval, complete APK limit, device/firmware restrictions and final Android consent. Avoid universal “all APKs” or encrypted/private-network security guarantees.
- Test fresh Play-delivered source approval on Watch7 firmware/regions, screen-off receiving, blocked sources, browser local-network permission, guest/client-isolated networks, user stop, session expiry, interrupted upload, process death, battery and accessibility. Record browser/device versions. Full Safari/iOS/Firefox/Windows/Linux coverage remains required.
- Recheck target SDK, Wear quality and developer verification requirements at submission. Target37 needs runtime ACCESS_LOCAL_NETWORK implementation/testing before adoption; current target36 follows Android’s implicit local network access rules.
- Run internal/closed testing and Play pre-launch/review. Do not promote until VALIDATION.md gates are met and restricted-permission/foreground-service declarations are accepted.
Publish the app module’s Wear OS AAB: application ID `meghdad.pakkit`, version 0.3.0/code 100004, min 31/target 36/compile 36.1. It declares required watch hardware and standalone=true. Increment versionCode for each upload. R 8 and resource shrinking are enabled.
```sh
./gradlew :app:bundleRelease
```
Output: app/build/outputs/bundle/release/app-release.aab. Production signing uses PAKKIT_KEYSTORE, PAKKIT_KEYSTORE_PASSWORD, PAKKIT_KEY_ALIAS and PAKKIT_KEY_PASSWORD. Set all four; incomplete/blank signing configuration fails clearly. With all unset, the bundle is unsigned and must be signed through the release pipeline. Keep keys and passwords outside source control. Application ID and private review schema are stable across updates; source class/package refactoring does not require data migration.
## Runtime permission surface
| Permission | Use |
| -------------------------------------------------------- | ------------------------------------------------------------------------- |
| INTERNET | Local listener and HTTP responses |
| ACCESS_NETWORK_STATE / CHANGE_NETWORK_STATE | Request/watch the Wi-Fi network and handle connectivity lifecycle |
| WAKE_LOCK | Timed partial CPU lock during a receiving session |
| FOREGROUND_SERVICE / FOREGROUND_SERVICE_CONNECTED_DEVICE | Explicit local receiving service with stop action |
| REQUEST_INSTALL_PACKAGES | Watch-initiated system installation after review |
| POST_NOTIFICATIONS | Optional session/approval alerts; in-app consent remains usable if denied |
No package-visibility queries, broad storage, location, Bluetooth, boot receiver or unrestricted installed-app enumeration is required. Inspect merged release permissions and verify fixture/test assets are absent. Release runtime dependencies are ZXing Core and the Kotlin standard library with its annotations dependency; browser development tools are separate.
## Publication gates
1. Complete unit/native/browser checks in DEVELOPMENT.md and the hardware-specific matrix in VALIDATION.md.
2. Submit REQUEST_INSTALL_PACKAGES as core local package receipt plus user-initiated installation, with source approval, transfer, watch review, system consent, denial and cancellation evidence. [Permission policy](https://support.google.com/googleplay/android-developer/answer/12085295).
3. Submit the connectedDevice foreground-service declaration and required demonstration. [Foreground-service requirements](https://support.google.com/googleplay/android-developer/answer/13392821).
4. Provide real developer/support identity, hosted privacy policy, Data safety answers, content rating, audience/ads declarations and current screenshots. Generate screenshots from the product; do not commit development artifacts as source assets.
5. Describe trusted same-Wi-Fi, unencrypted HTTP, complete APK limit, source approval and firmware/package restrictions accurately. Do not promise universal compatibility, malware certification, silent installation or guaranteed permission approval.
6. Recheck target API, Wear app quality and developer-verification requirements against current Play Console guidance. Target 37 requires explicit local-network permission implementation/testing.
7. Run internal/closed testing and Play review before public promotion. Successful development/emulator tests do not constitute Google Play acceptance.
+37 -26
View File
@@ -1,37 +1,48 @@
# Standalone validation — October 15, 2026
# Validation
Version 0.2.0 / 100003. The consumer app is standalone; old companion test results in `validation/brand` and older screenshots are historical evidence only.
Routine validation uses a Wear OS Emulator and an Android Emulator browser. Hardware is reserved for final compatibility and power testing. This document distinguishes completed automated coverage from release requirements.
## Automated coverage
## Reproducible checks
- 13 shared JVM tests: six bounded-stream/expiry/ABI rules, three semantic contrast checks, four HTTP parsing/authentication/size tests. Results: `shared/build/test-results/testDebugUnitTest`.
- Two watch instrumentation tests on the Wear OS API37 round emulator: actual Wi-Fi socket GET/status/raw APK POST; missing-token and cross-origin rejection; invalid APK deletion; duplicate upload refusal; verified fixture metadata; no automatic PackageInstaller session; listener closes and private URL clears at explicit stop. The separate round-review test verifies 48dp actions are reachable and receipt does not create an installation session.
- The emulator needed its virtual Wi-Fi enabled and associated with AndroidWifi. Initial failures while Wi-Fi was disabled were environmental. A repeated run exposed an HTTP test-client bug: reading until EOF could observe a reset after an intentionally early rejected request; the test now reads the response’s exact Content-Length. Final results are saved in `validation/standalone/watch-tests.txt`.
- Debug APK, instrumentation APK, optimized release AAB, shared unit tests and Android lint build successfully. Lint has zero errors; remaining warnings concern SDK/library update suggestions and optional KTX/style changes. Release bundle is unsigned unless production signing inputs are supplied.
See DEVELOPMENT.md for the commands and environment setup. Results are generated under app/build rather than committed. Current architecture: one production Android module (`app`) and the instrumentation-only signed fixture (`qaFixture`).
## Physical Galaxy Watch 7
| Check | Scope |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| JVM tests | Bounded copy/digest, IDs, expiry, SDK/ABI/storage policy, strict HTTP framing/auth/length, exact upload-body reads and progress throttling, native watch contrast |
| Wear instrumentation | Signed archive inspection, self-update/invalid archive rejection, typed storage persistence/expiry, late callback rejection, changed-file rejection, official system consent, real socket upload/auth/Host/Origin/size checks, stop cleanup, stale-worker isolation, circular QR and reachable actions |
| Small round screen | Review controls and QR geometry at 192 dp with 1.3x text, restoring emulator configuration afterward |
| Browser UI | Four widths, dark/light, private-key entry, invalid files, error/retry, watch/system-status transitions and cancellation, using actual assets with an API fixture |
| Android-to-Wear transfer | Chrome on Android Emulator -> actual Wi-Fi HTTP listener on Wear OS Emulator -> verified signed APK waiting for watch review |
| Release | Clean debug/test/release builds, Android lint, dependency and merged-manifest inspection, fixture exclusion from consumer artifacts |
SM-L310, Android16 firmware `L310XXS2BZF4`, full fingerprint in FEASIBILITY.md. Development ADB installed Pakkit and observed/clicked visible UI for QA. No `pm grant`, `appops set`, hidden installer, root or ADB package installation was used to install the QA fixture. Consumer code contains no ADB/debugging path.
The install-consent test calls the same ApkInstaller used by the explicit watch action, waits for Android’s STATUS_PENDING_USER_ACTION and abandons the test session afterward. It does not grant permission or install through a shell command. Tests that require source approval use the emulator’s normal system setting; skipped assumptions are reported as incomplete validation by the test runner.
1. Existing Pakkit source approval was already allowed. User reports normal prior source approval/installation without ADB, including with ADB debugging disabled. The agent did not reproduce a fresh Play-installed permission setup.
2. Started Pakkit’s explicit receiving session on real Wi-Fi. Watch issued a private IPv4 URL and locally generated QR.
3. Headless Chromium opened **the real watch-hosted site**, authenticated and rendered desktop1440x1100 and mobile390x844 layouts in light/dark modes. Zero JavaScript errors; no mobile horizontal overflow. Screenshots are actual product renders in `screenshots/standalone`.
4. Browser selected our signed `qaFixture-debug.apk` (2,473,486 bytes), uploaded it through XHR to the watch’s socket and received ready. Watch persisted package `meghdad.pakkit.fixture`, correct SHA-256 and source `local-browser`. Receiving stopped at review without an installation session.
5. Watch Install and Continue actions reached the pending system-consent flow. Subsequent InstallReceiver history recorded **installed** for that exact upload UUID, and Android’s package list confirmed the fixture. The user was interacting with the watch during this test. A separate screenshot of the system installer was not captured; the image initially taken after consent had already returned to Pakkit is not presented as system UI evidence.
6. Repeated live HTTP checks: public page200; status without token403; wrong token403; authenticated status200; foreign-Origin upload403; invalid APK400. Recorded in `validation/standalone/live-http.json`. These checks also passed with the physical display explicitly asleep. This is a short screen-off accessibility check, not a long-duration power/Doze certification.
7. Final QR layout centers its square in the circular safe area and sizes with screen width. ZXing decoded the actual physical screenshot after masking all pixels outside the display circle (`validation/standalone/qr-check.txt`); the watch remains scrollable for the URL, disclosure and End session action.
Browser UI fixtures exercise interactions independently; the separate Android Emulator test proves that the actual browser/XHR path reaches the actual watch listener. These are not substituted for one another. The receiving protocol continues to have no browser-triggered installation endpoint.
The temporary QA fixture was removed after verification.
## Latest completed run
No release claim is inferred solely from a successful file upload. The observed fixture installation is separate, stronger evidence for this device’s public installation route with trust already granted.
Refactoring validation date: October 15, 2026. No physical device was accessed.
## Remaining release gates
- **19 JVM tests passed**, with zero failures/errors.
- **14 native tests passed** on the round Wear OS API 37 emulator, with no skipped assumptions. This includes the public installer’s required-consent callback and refusal of requests after a session deadline.
- **Two round UI tests passed again** at 192 dp / 1.3x text: reachable review actions and a decodable QR whose full square fits inside the circular bezel. Size, density and font scale were restored.
- **13 browser UI checks passed** on Chromium 140.0.7339.16 across four viewport widths and both themes, with zero JavaScript errors.
- **Real Android Emulator Chrome 145.0.7632.218 uploaded the signed fixture directly to the Wear OS Emulator over virtual Wi-Fi**, receiving READY review state. The test dismissed its package, ended receiving and removed its local debug forward.
- **Clean builds succeeded** for the debug app, instrumentation APK, unit tests, lint and optimized release AAB. Lint has zero errors; three remaining warnings are SDK/Gradle/library update notices, not unused code/resources.
- Release inspection found exactly the three bundled web assets, no fixture APK/test payload, no package-visibility queries, one exported launcher and non-exported service/installer receiver. The release dependency graph contains ZXing Core, Kotlin stdlib and its annotations dependency.
- The unchanged Gradle distribution version is checksum-pinned to its official download. Release output is unsigned when signing inputs are absent; incomplete signing configuration fails clearly.
- Fresh Play-delivered installation and source-approval flow without preexisting Pakkit trust, across supported Samsung firmware/regions and security settings. Record denial/revocation/cancellation and developer-verification behavior.
- Google Play restricted-permission and foreground-service declaration acceptance, listing/quality review, developer identity/signing and hosted privacy policy.
- Safari on real iOS/macOS, Firefox, Edge/Windows, Android browser and Linux coverage. The current browser run was Chromium on macOS, with mobile viewport emulation; it is not proof of all browser/platform combinations.
- Full ten-minute expiry on hardware, repeated sessions, long screen-off/Doze, network/IP change, client isolation, local-network permissions, interrupted large upload, low storage and process death. Explicit-stop cleanup is automated; expiry is implemented but not yet a completed elapsed-time hardware test.
- Full TalkBack/rotary/large-text/contrast review of the new receiving screen and web flow; small round physical displays. The prior review screen was tested at192dp/1.3x text, but this does not certify every new state.
- Measured battery/thermal/memory behavior under maximum50MiB transfers and adversarial bounded connections. Locks, buffers, threads and deadlines are bounded by implementation, not a measured battery guarantee.
Detailed XML, text logs, screenshots and browser summaries are generated under app/build/reports and app/build/test-results. They are not source assets or claims of universal hardware/browser support.
Do not advertise universal firmware/APK compatibility, encrypted transport, unconditional no-setup installation, or Google Play approval.
## Hardware-specific release matrix
- Fresh Google Play delivery, source approval and system confirmation on supported Galaxy Watch 7 and other firmware/regions, without preexisting source trust or developer setup. Include denied/revoked permission and cancellation.
- Real maximum-size transfers, interruption, ten-minute expiry, repeated sessions, IP/network changes, guest/client-isolated networks, VPNs and browser local-network permission prompts.
- Long screen-off/Doze behavior, low battery/battery saver, charging transitions, memory/thermal behavior and measured battery consumption. Timed locks and bounded buffers alone are not measurements.
- Actual low storage and processor/SDK/package/update conflicts; system developer verification and managed-device restrictions. The OS is the final compatibility/security authority.
- TalkBack, rotary interaction, large font and physical small-round displays; camera scanning of QR on real displays under varied lighting.
- Safari on iOS/macOS, Firefox, Edge/Windows, Linux browsers and Android browser variants. Emulator Chrome and desktop Chromium do not certify the whole browser matrix.
- Minimum supported API 31 devices and supported newer OS versions. Native lint checks API usage but cannot replace that runtime matrix.
- Google Play restricted-permission/foreground-service declarations, Wear quality review, signing/identity and hosted privacy policy.
Do not claim universal APK/firmware compatibility, encrypted transport, guaranteed Google Play approval or measured power quality from emulator results.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

-8
View File
@@ -1,8 +0,0 @@
meghdad.pakkit.ProductInstrumentedTest:.....
Time: 3.951
OK (5 tests)
@@ -1,8 +0,0 @@
meghdad.pakkit.wear.WatchReviewTest:.
Time: 0.854
OK (1 test)
-8
View File
@@ -1,8 +0,0 @@
meghdad.pakkit.wear.WatchReviewTest:.
Time: 0.772
OK (1 test)
-8
View File
@@ -1,8 +0,0 @@
meghdad.pakkit.ProductInstrumentedTest:....
Time: 1.434
OK (4 tests)
@@ -1,27 +0,0 @@
{
"unitSuites": [
{
"name": "meghdad.pakkit.core.TransferRulesTest",
"tests": "6",
"failures": "0",
"errors": "0"
},
{
"name": "meghdad.pakkit.core.HttpProtocolTest",
"tests": "4",
"failures": "0",
"errors": "0"
},
{
"name": "meghdad.pakkit.core.BrandPaletteTest",
"tests": "3",
"failures": "0",
"errors": "0"
}
],
"lintErrors": 0,
"lintWarnings": 17,
"version": "0.2.0",
"versionCode": 100003,
"releaseBundleSigned": false
}
@@ -1,8 +0,0 @@
{
"publicPage": 200,
"noToken": 403,
"wrongToken": 403,
"status": 200,
"wrongOrigin": 403,
"invalidApk": 400
}
-1
View File
@@ -1 +0,0 @@
Physical Watch 7 screenshot: QR decodes successfully with circular display mask.
@@ -1,9 +0,0 @@
meghdad.pakkit.wear.LocalReceiveTest:.
meghdad.pakkit.wear.WatchReviewTest:.
Time: 1.492
OK (2 tests)
-8
View File
@@ -1,8 +0,0 @@
meghdad.pakkit.wear.WatchReviewTest:.
Time: 1.014
OK (1 test)