initial project

This commit is contained in:
Meghdad committed 2026-10-15 14:32:18 +03:30
1 parent 26b198e26e
commit 6ce4f924b7
90 files changed
+2154 -349

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
# Architecture and operating boundaries
## Protocol v1
Google Play services enforces matching app ID and certificate. The watch advertises `pakkit_watch_v1`. A reachable node is queried using `/pakkit/probe` with a random nonce. The watch publishes `/pakkit/cap/{node}` with that nonce, API, ABIs, available bytes and installation controls. The phone accepts only the selected node's fresh response. Capabilities expire for send purposes after two minutes.
A selected document is copied from its content URI into app-private storage. The temporary filename is a generated UUID; URI-supplied paths and display names never determine a filesystem path. SHA-256 is computed while enforcing the size cap. The original document is not modified. Persisted URI permission and broad storage access are unnecessary.
`SendWorker` publishes `/pakkit/offer/{UUID}`, containing target node, creation time, APK metadata, digest and an Asset. This publication means queued for sync, not delivered. Google Play services owns transport and retransmission; it can route through Google infrastructure. There is no percentage or speed estimate. There is no automatic installation.
`LinkService` schedules unique `ReceiveWorker` work. The worker checks target, identifier and age; rejects a busy watch; bounds the received bytes; verifies digest and parsed package information; and renames the complete private file. Readiness is sent only after verification. The watch keeps a small recent-ID replay guard. Terminal and ready states are idempotent for a given active transfer. Assets are deleted after verification or a permanent failure, rather than retained as storage.
The watch publishes `/pakkit/status/{UUID}` with target phone and an explicit state. The phone only accepts the current transfer ID from its selected destination node and monotonically increasing status revisions. A status publication worker retries temporary API errors. Phone and watch hold one current job each, plus phone-local history capped at 20 entries. SharedPreferences commits are used for the small durable records; files are not placed in preferences or WorkManager input. WorkManager persists bounded jobs and handles process restart.
## Installation boundary
Only a foreground button in the watch app creates a PackageInstaller session. The file's age, digest, metadata and hardware compatibility are checked again. The session requests `USER_ACTION_REQUIRED`. The status receiver is not exported. Its explicit mutable PendingIntent is scoped to the session and transfer ID; mutable extras are required for Android's installer result.
Pending approval is presented inside Pakkit, with an optional notification containing the system confirmation Intent. No background activity launch is attempted by the receiver. Notification permission is optional and requested only from an explanatory watch button. If approval state is interrupted and cannot be recovered in memory or from its notification, the user can explicitly retry, abandoning the previous session first. A transfer can only be reported as installed after `STATUS_SUCCESS`.
The system owns final package validation, update signatures, policy checks, verification and approval UI. No install result is inferred from a file transfer, countdown or launch attempt. Installation failures are mapped to understandable messages without logging APK contents or private paths.
## Storage and battery
- 50 MiB maximum package, 64 KiB buffers, no entire APK byte arrays, no ZIP extraction.
- Approximate watch space budget: three APK sizes plus 20 MiB. This is a preflight, not a reservation; the system may still report insufficient storage.
- TTL: 24 hours from file selection. Workers remove retained offers/files when scheduled; background scheduling can be deferred by the OS. Stale files are additionally cleaned on app startup and after receive.
- One outstanding offer per phone, one reviewable file per watch; no parallel sync queue. Keep the watch app open for the most predictable receiving experience.
- No always-on service, app-managed wake lock, polling scan loop, custom networking, analytics or account system.
- The parcel artwork uses a short finite entrance, respects system animation and battery saver settings, and stops when its window is hidden or detached. Decorative watch artwork remains static. See the semantic palettes and components in Design.kt and the brand guide in design/README.md.
## Known engineering limits before production
Native Android views keep the runtime and dependencies small. Touch controls and text remain semantic views; the parcel art is decorative. The first locale is English; RTL mirroring uses platform layouts but localized copy and real RTL QA remain release work. Ordinary refreshes preserve scroll position. The watch returns to the heading when its transfer stage changes so the next decision is visible.
Single-file inspection does not fully classify all unusual/vendor split manifests, malicious parser edge cases or expanded installed size. Android remains the security authority. Asset transfer latency, cloud behavior, retry timing, UI interruption and consent recovery require paired-device testing. The initial implementation intentionally excludes automatic recovery that might open an installer without another user action. Cross-device cancellation of an already queued offer is deferred; current jobs can be dismissed on the watch after receipt or expire.
+37
View File
@@ -0,0 +1,37 @@
# Feasibility decision
Research date: October 15, 2026. Reference hardware: Samsung Galaxy Watch 7; no physical hardware has been verified in this workspace.
## Decision
Build a **capability-gated companion**, rather than promise a universal installer. Official APIs support file transfer and user-initiated package installation. Their presence in Android does not prove that a particular Wear OS firmware provides usable unknown-source settings and installation confirmation. Pakkit never changes security settings itself.
The desired no-debugging path is conditional: paired Android phone and watch → install Pakkit through Play on both → approve Pakkit as an install source on supported watch firmware → choose a complete compatible APK → send → review on watch → explicitly request installation → approve the system screen. Source approval is an unavoidable extra setup step where Android requires it.
## Confirmed platform capabilities
1. The [Wearable Data Layer overview](https://developer.android.com/training/wearables/data/overview) documents app-private phone/watch communication and requires matching package names and signing certificates. The transport can use Bluetooth or encrypted cloud routing. Pakkit uses it without its own network backend, direct sockets, Bluetooth discovery permissions or accounts. [Asset synchronization](https://developer.android.com/training/wearables/data/sync) allows queued transfer when disconnected; it is not an application database. Pakkit keeps its own state and private files. Asset APIs do not provide Pakkit with an accurate network byte-progress signal.
2. [PackageInstaller](https://developer.android.com/reference/android/content/pm/PackageInstaller) supports sessions and reports success, failure or pending user action. Pakkit explicitly requires user action and handles the returned confirmation intent. This general Android capability is not proof of a usable Wear installation UI on every OEM firmware.
3. [PackageManager.canRequestPackageInstalls](https://developer.android.com/reference/android/content/pm/PackageManager#canRequestPackageInstalls()) reports whether the caller is trusted as an installation source. Pakkit checks this on the watch. If allowed-source settings are unavailable and source approval is absent, Pakkit blocks sending. Resolver availability is a conservative preflight, not a compatibility certification.
## Google Play eligibility is conditional
[Play's sensitive permissions policy](https://support.google.com/googleplay/android-developer/answer/16558241?hl=en) includes phone-to-wearable companion synchronization among permitted REQUEST_INSTALL_PACKAGES purposes. This makes the proposed purpose potentially eligible; it does **not** guarantee permission approval or listing acceptance. Core functionality must be accurately described, declared and reviewed. Pakkit requests this permission only on the watch, offers no self-update mechanism, bundles no third-party APK and never starts an installation just because a transfer arrived. A reviewer must assess the final implementation and listing.
[Wear app packaging guidance](https://developer.android.com/training/wearables/packaging) requires a separate watch artifact, watch feature declaration and form-factor versioning. Pakkit's watch app declares itself non-standalone because selecting and sending requires the phone. Both artifacts must use the same production signing identity for the Data Layer.
[Current target API policy](https://support.google.com/googleplay/android-developer/answer/11926878) requires API 36 for new phone apps and API 35 for Wear OS as of August 31, 2026. Both modules target 36. Recheck Play Console requirements at submission time.
## Developer verification changes the promise
[Android's developer-verification guidance](https://developer.android.com/developer-verification/guides) describes regional enforcement beginning September 30, 2026. Its [FAQ](https://developer.android.com/developer-verification/guides/faq) explains an advanced flow for unverified developers that includes developer mode and a protective delay. Pakkit does not implement or recommend this flow: it conflicts with the requested no-developer-options experience. Applicability to a particular Wear firmware must be tested; do not infer a verified exemption or rollout from the generic Android guidance. Respect any system block and direct users to a supported distribution of the app.
## Limits and assumptions
- **Unverified:** Galaxy Watch 7 firmware versions, region-specific security settings, actual approval activity behavior and developer-verifier enforcement. Run the physical-device matrix before advertising support.
- **Supported intentionally:** complete single APKs up to 50 MiB. No APKM/XAPK/APKS/AAB or split installation support.
- **Preflight only:** SDK minimum, native-library ABI, approximate space, readable signing information and integrity. These do not prove safety, runtime usability, feature availability, signature validity under all platform rules, successful update or a wearable layout. The OS makes the final install decision.
- **No bypass:** if watch installation is unavailable, Google Play on that watch is the fallback. Pakkit does not silently enable debugging, root, hidden services or elevated privileges.
- **Release gate:** if physical tests show the reference device cannot complete the public consent path, do not publish the installer listing as broadly compatible. Narrow support to tested firmware or reconsider the product's scope.
+13
View File
@@ -0,0 +1,13 @@
# Pakkit privacy text — draft for developer review
Pakkit helps you transfer an APK you select on your Android phone to your paired Wear OS watch and request its installation. You decide which file to send and approve installation on the watch.
Pakkit stores the selected APK, package details, file-integrity digest and transfer state in its private app storage. The phone keeps the latest state of up to 20 transfers. You can clear this activity within Pakkit. Temporary package files are removed after completion or expiry (24 hours from selection); cleanup may be delayed by Android background scheduling. Removing Pakkit removes its local app data.
Transfers use the Wearable Data Layer provided by Google Play services. Depending on device connectivity, data may travel over Bluetooth or encrypted cloud transport through Google infrastructure. Pakkit does not operate its own APK server, require an account, contain advertising or include analytics SDKs.
The watch requests permission to ask Android to install a package. It does not silently install applications. Optional watch notifications help you return to a pending system approval screen. You can decline notifications and continue in the app.
Only send software from a source you trust. Pakkit's file checks are not a malware scan or a guarantee of safety or watch compatibility. Android and the watch's security policy control whether installation can proceed.
Before publication, the developer must add its legal identity, effective date, support contact and any required jurisdiction-specific terms to a publicly accessible policy. This repository draft is not itself a published policy or completed Play Data safety declaration.
+32
View File
@@ -0,0 +1,32 @@
# Google Play release preparation
This is a release checklist, not an assertion that the app is already approved or ready for a public production rollout.
## Technical artifacts
- Phone and watch use application ID `meghdad.pakkit`; namespaces differ by module.
- Phone version code: 100001; watch: 100002. Increment monotonically and keep codes unique across form factors.
- Compile SDK 36.1; min SDK 31; target SDK 36. Confirm supported-device filtering in Play Console.
- Separate watch artifact declares required `android.hardware.type.watch` and `standalone=false`.
- Release minification and resource-safe platform UI. Worker constructors are kept for background reconstruction.
- Use the **same app-signing certificate** across phone and watch. Different debug/release certificates cannot communicate through the Data Layer. Play App Signing key upgrades must be evaluated on both devices.
- Optional release signing environment: `PAKKIT_KEYSTORE`, `PAKKIT_KEYSTORE_PASSWORD`, `PAKKIT_KEY_ALIAS`, `PAKKIT_KEY_PASSWORD`. Keep the keystore outside the repository. No secret defaults or debug signing for release. Without a complete set of variables, output is unsigned and must be signed through the release pipeline.
- Build with `./gradlew :app:bundleRelease :wear:bundleRelease`, inspect merged manifests and upload each artifact to the proper form factor/test track. Check version code handling in Play Console before promoting.
## Permission declaration
`REQUEST_INSTALL_PACKAGES` exists only in the watch app. Justification for review: the core function transfers a user-selected APK from the paired phone to the user's watch and requests installation after the user explicitly reviews it on that watch. Submit the permissions declaration and an accurate screencast showing selection, transfer, source approval, app review, system approval, cancellation and unsupported-device handling.
Explain in the listing that firmware and package restrictions apply. Do not advertise one-tap installation, compatibility with all Wear OS devices, malware certification, silent installation or guaranteed approval. No packaged third-party APK, in-app self-update, package catalog or download service is included.
`POST_NOTIFICATIONS` is optional and watch-only, used for pending installer consent. Declining it leaves in-app consent usable. WorkManager contributes its standard boot-rescheduling/network-state/wake permissions through manifest merging; its unused foreground service and permission are explicitly removed. Review the final manifest rather than just source manifests. No broad storage, package visibility, location or Bluetooth runtime permissions are requested.
## Listing and disclosures
1. Finalize legal developer identity, support email and public privacy-policy URL. No invented identity or placeholder contact should be published.
2. Publish privacy text based on [PRIVACY.md](PRIVACY.md); confirm SDK behavior and the final Data safety answers. Google Play services may route encrypted APK data through Google's infrastructure. “No Pakkit server” does not mean all transport is local.
3. Upload genuine phone and round-watch screenshots, adaptive launcher assets and required store artwork. The same premium identity should appear in both listings.
4. State Wear OS support and the companion requirement clearly. Reference-device claims require recorded results for the specific model and firmware.
5. Complete content rating, target audience, ads declaration (none), Data safety, external-package permission declaration and Wear OS quality review.
6. Run internal/closed testing, pre-launch reports and physical-device compatibility matrix. Check current target API and developer-verification requirements again.
7. Promote only after every blocker in VALIDATION.md is resolved and the permission declaration is accepted. Google Play approval cannot be guaranteed.
+65
View File
@@ -0,0 +1,65 @@
# Validation record
Date: October 15, 2026. This record separates what ran from what still needs paired physical devices and Play review.
## Brand integration update — October 15, 2026
The official Pakkit identity is now implemented in both consumer apps. See [the brand guide](../design/README.md) and [current previews](screenshots/brand/). Earlier screenshots outside that subfolder document the previous visual direction. Brand test results are saved in [validation/brand](validation/brand/).
- Custom open-parcel mark, adaptive/monochrome launcher assets, unified midnight splash and branded approval notification.
- Lavender light and midnight dark phone themes with a native custom appearance dialog, persisted selection and actual chooser/recreation testing.
- New phone navigation, connection illustration, file review, truthful transfer stages, history, empty states and guide.
- Midnight watch home, review, receiving, consent, success and error components, with proportional round-screen margins, a bezel scroll indicator and native clock.
- 9 shared JVM tests pass, including 3 new contrast checks; 5 phone instrumentation tests and 1 strengthened watch review/target-size test pass. The watch test also passed at an emulated 192-DP round size with 1.3× text, checking that install/dismiss actions remain fully reachable and at least 48 DP tall. This is an additional tested configuration, not physical-device certification.
- Both debug builds and optimized unsigned release bundles build; Android lint reports zero errors. Existing informational dependency/SDK/style warnings remain.
- A local signed QA fixture was updated through the redesigned watch review, genuine system confirmation and success screen.
- Android’s real document picker was used to select the signed local QA APK and verify the phone review screen.
- Package transfer, source approval, explicit install/session consent and policy boundaries are preserved. No capability or fake progress state was added from the creative reference.
## Completed
| Check | Result |
| --- | --- |
| Phone debug APK | Built successfully |
| Wear OS debug APK | Built successfully |
| Optimized phone release bundle | Built successfully; unsigned without production signing variables |
| Optimized watch release bundle | Built successfully; unsigned without production signing variables |
| Android lint, phone | 0 errors; informational SDK/dependency/style warnings remain |
| Android lint, watch | 0 errors; informational SDK/style warnings remain |
| Bounded copy, known SHA-256, empty/oversize rejection, identifier safety, expiry, ABI matching | 6 JVM tests passed |
| Phone device tests: navigation and recreation, signed complete APK inspection, self-update rejection, invalid archive/path rejection | 4 passed on Pixel 10 Pro emulator, API 37 |
| Watch review test: signed fixture can be reviewed without creating any install session | 1 passed on round Wear OS 7 emulator, API 37, 454×454 |
| Visual inspection | Phone home and round watch review/controls inspected; explicit illustration height corrected |
| System source approval | Opened via public settings intent; normal system warning and approval completed on watch emulator |
| Watch PackageInstaller path | Explicit Install → pending-user-action callback → Continue → genuine system confirmation → system Install → STATUS_SUCCESS and Pakkit “Installed on your watch” → Open app launched the fixture |
| Installed-file cleanup | Confirmed the successful transfer’s private APK was deleted after installation |
| Merged release manifests | Installation and notification permissions watch-only; no broad storage/visibility/Bluetooth/location permission; unused foreground service and its permission removed |
| Release contents | QA APK absent from consumer bundles; no production signature created in this workspace |
| Git whitespace check | Passed |
The manual install used `qaFixture`, a small signed local test application. Instrumentation staged it into the watch's private review state to isolate the installation boundary. **This was not a test of Data Layer delivery.** The fixture is packaged only into Android test assets, never consumer APKs or bundles. The UI uses the exact same file revalidation, PackageInstaller session and result receiver as the consumer install flow. Developer tooling deployed Pakkit's debug builds; the fixture itself was installed through ordinary watch UI and system consent, without an ADB package install, app-op grant, root or hidden API.
Raw device test summaries: [phone](validation/phone-tests.txt), [watch](validation/watch-tests.txt). Screenshots are in [screenshots](screenshots/): phone home, watch launch/home/controls, real system approval and successful installation. Test fixture screens are labelled accordingly and are not store marketing screenshots.
## Not yet verified — release blockers
1. **Paired Data Layer integration:** the available phone/watch emulators were not configured as a paired Wear network, and discovery on the phone returned an availability/connection failure. Capability nonce exchange, real asset delivery, background receive, acknowledgement routing, delayed retries and cloud routing are implemented but remain unverified end-to-end.
2. **Galaxy Watch 7:** test exact One UI Watch / Wear OS / Android build and region. Confirm source settings, resolver behavior, consent UI, blocked cases, normal launch and developer-verification enforcement. No compatibility claim should be made before this.
3. **Interruptions and limits:** Bluetooth off/on, phone process killed, watch process killed, reboot during sync, missed status acknowledgement, system approval dismissed, user denied source/notification permission, second phone or second watch, no space, low battery and 50 MiB boundary. Test expiry while a job or install session is active. Background workers are OS-scheduled and may run later than their target time.
4. **Package coverage:** real compatible standalone APK, wrong ABI, newer minimum SDK, wrong update signature, downgrade, invalid certificate, isolated/config split, base requiring splits, corrupt resource table and restricted packages. Preflight is intentionally not a full certification or malware scan.
5. **Accessibility and layout:** TalkBack, large fonts, touch exploration, reduced animation, rotary input on hardware, 192/208/227 dp round displays and an actual tablet/phone rotation. Semantic controls and scrolling are implemented; full accessibility certification has not been performed.
6. **Performance:** battery and transfer latency on real Bluetooth/cloud links, background job timing and memory on low-RAM watches. The 50 MiB cap, bounded buffers and lack of continuous watch animation are implementation constraints, not measured performance claims.
7. **Release identity and policy:** production signing identity shared across form factors, verified dependency provenance, public privacy URL/support contact, listing assets, completed permission/Data safety declarations, internal/closed testing and Wear OS review. Google Play approval is not guaranteed.
## Intentional v1 boundaries
Single complete APK, 50 MiB maximum, one in-flight job per phone and one reviewable APK per watch, expiry 24 hours from selection, no percentage estimate, no direct third-party downloads or catalog. Waiting transfers do not currently offer a cross-device cancel action; dismiss on the watch when delivered, or let the job expire. English is the first locale. Background transfers and approval recovery require device validation before public rollout.
## Reproduce
```sh
./gradlew :app:assembleDebug :wear:assembleDebug :shared:testDebugUnitTest :app:lintDebug :wear:lintDebug :app:bundleRelease :wear:bundleRelease
./gradlew :app:assembleDebugAndroidTest :wear:assembleDebugAndroidTest
```
In environments where Google Maven returns HTTP 404, append `-PpakkitGoogleMavenMirror=https://maven.aliyun.com/repository/google` after reviewing the mirror's suitability. Run each instrumentation APK against its matching phone/watch app, rather than deploying both variants to the same device: they intentionally share an application ID. Standard Android Studio device-test tooling can run the tests. The watch test leaves its fixture ready for manual consent checks.
Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+8
View File
@@ -0,0 +1,8 @@
meghdad.pakkit.ProductInstrumentedTest:.....
Time: 3.951
OK (5 tests)
@@ -0,0 +1,8 @@
meghdad.pakkit.wear.WatchReviewTest:.
Time: 0.854
OK (1 test)
+8
View File
@@ -0,0 +1,8 @@
meghdad.pakkit.wear.WatchReviewTest:.
Time: 0.772
OK (1 test)
+8
View File
@@ -0,0 +1,8 @@
meghdad.pakkit.ProductInstrumentedTest:....
Time: 1.434
OK (4 tests)
+8
View File
@@ -0,0 +1,8 @@
meghdad.pakkit.wear.WatchReviewTest:.
Time: 1.014
OK (1 test)