feat: redesign Pakkit’s watch and browser experience
- Unify branding around “Pack it. Send it. Wear it.” - Refine layouts, typography, motion, and accessibility - Rewrite product copy, notifications, and error messages - Simplify receiving and contextual installation permissions - Expand browser and Wear OS emulator validation
This commit is contained in:
28 files changed
+1045
-458
No files matched your search
@@ -1,16 +1,16 @@
|
|||||||
# Pakkit
|
# Pakkit
|
||||||
|
|
||||||
**Pocket to Wrist.** A standalone Wear OS application for sending an APK from any browser on your Wi-Fi to your watch, then approving installation on your wrist.
|
**Pack it. Send it. Wear it.** Give your next app a place on your wrist.
|
||||||
|
|
||||||
Pack it. Send it. Wear it.
|
Send an APK from your browser to your Wear OS watch, then approve installation on your watch.
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
1. Open Pakkit on a supported watch and allow it to request installations through the system settings screen.
|
1. Open Pakkit on a supported watch.
|
||||||
2. Connect the watch and browser device to the same trusted Wi-Fi.
|
2. Connect the watch and browser device to the same trusted Wi-Fi.
|
||||||
3. Tap **Start receiving** and scan the QR code or type the complete private link. Opening only the address lets you enter the session key separately.
|
3. Tap **Start receiving** and scan the QR code. For manual entry, tap **View link** on the watch and open the complete link in your browser.
|
||||||
4. Select one complete `.apk` up to **50 MiB**. Watch transfer progress in the browser and on the watch.
|
4. Select one complete `.apk` up to **50 MiB**. Watch transfer progress in the browser and on the watch.
|
||||||
5. Review the package on the watch, tap **Install**, and complete Android’s system approval.
|
5. Review the app on your watch. If prompted, tap **Allow installs** to grant source permission, then tap **Install** and approve it.
|
||||||
6. End the receiving session when finished. Sessions automatically end after ten minutes or on Wi-Fi loss.
|
6. End the receiving session when finished. Sessions automatically end after ten minutes or on Wi-Fi loss.
|
||||||
|
|
||||||
The local connection uses **unencrypted HTTP**. Use trusted Wi-Fi and keep the private link secret. Package inspection checks format and compatibility; it does not certify app safety. Source approval, firmware security policy and Android’s installer determine whether installation is available. Split packages and app bundles are unsupported. See [platform constraints](docs/PLATFORM.md).
|
The local connection uses **unencrypted HTTP**. Use trusted Wi-Fi and keep the private link secret. Package inspection checks format and compatibility; it does not certify app safety. Source approval, firmware security policy and Android’s installer determine whether installation is available. Split packages and app bundles are unsupported. See [platform constraints](docs/PLATFORM.md).
|
||||||
@@ -49,8 +49,8 @@ Routine development uses emulators. No physical watch is required.
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
./gradlew :app:assembleDebug :app:assembleDebugAndroidTest :app:testDebugUnitTest
|
./gradlew :app:assembleDebug :app:assembleDebugAndroidTest :app:testDebugUnitTest
|
||||||
python 3 scripts/test-emulators.py --watch emulator-5554 --skip-build
|
python3 scripts/test-emulators.py --watch emulator-5554 --skip-build
|
||||||
python 3 scripts/test-emulators.py --watch emulator-5554 --small --skip-build
|
python3 scripts/test-emulators.py --watch emulator-5554 --small --skip-build
|
||||||
```
|
```
|
||||||
|
|
||||||
For browser tests and real Android-Emulator-to-Wear-Emulator uploads, see [development and testing](docs/DEVELOPMENT.md). Results and screenshots are generated under `app/build/reports/validation`, not checked into source control.
|
For browser tests and real Android-Emulator-to-Wear-Emulator uploads, see [development and testing](docs/DEVELOPMENT.md). Results and screenshots are generated under `app/build/reports/validation`, not checked into source control.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class LocalReceiveTest : WatchTest() {
|
|||||||
head.toString() + bytes.toString(Charsets.UTF_8)
|
head.toString() + bytes.toString(Charsets.UTF_8)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertTrue(request("GET", "/").contains("Pocket"))
|
assertTrue(request("GET", "/").contains("Pack it."))
|
||||||
assertTrue(request("GET", "/api/status", token = null).startsWith("HTTP/1.1 403"))
|
assertTrue(request("GET", "/api/status", token = null).startsWith("HTTP/1.1 403"))
|
||||||
assertTrue(request("GET", "/api/status", token = "wrong").startsWith("HTTP/1.1 403"))
|
assertTrue(request("GET", "/api/status", token = "wrong").startsWith("HTTP/1.1 403"))
|
||||||
assertTrue(
|
assertTrue(
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class ServerExpiryTest : WatchTest() {
|
|||||||
socket.getInputStream().bufferedReader().readText()
|
socket.getInputStream().bufferedReader().readText()
|
||||||
}
|
}
|
||||||
assertTrue(response.startsWith("HTTP/1.1 400"))
|
assertTrue(response.startsWith("HTTP/1.1 400"))
|
||||||
assertTrue(response.contains("session ended"))
|
assertTrue(response.contains("didn’t arrive"))
|
||||||
assertNull(store.pending())
|
assertNull(store.pending())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
package meghdad.pakkit
|
||||||
|
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.Rect
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.Button
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
|
import java.io.File
|
||||||
|
import meghdad.pakkit.apk.InstallState
|
||||||
|
import meghdad.pakkit.transfer.Receiving
|
||||||
|
import meghdad.pakkit.ui.RoundScrollView
|
||||||
|
import meghdad.pakkit.ui.WatchActivity
|
||||||
|
import meghdad.pakkit.ui.WatchDesign
|
||||||
|
import org.junit.Assert.*
|
||||||
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(AndroidJUnit4::class)
|
||||||
|
class WatchExperienceTest : WatchTest() {
|
||||||
|
private fun views(view: View): List<View> =
|
||||||
|
listOf(view) +
|
||||||
|
if (view is ViewGroup) (0 until view.childCount).flatMap { views(view.getChildAt(it)) }
|
||||||
|
else emptyList()
|
||||||
|
|
||||||
|
private fun screen() = views(requireNotNull(activity).window.decorView)
|
||||||
|
|
||||||
|
private fun capture(name: String) {
|
||||||
|
instrumentation.waitForIdleSync()
|
||||||
|
Thread.sleep(220) // Finite screen entrance; screenshots capture the settled UI.
|
||||||
|
val bitmap = requireNotNull(instrumentation.uiAutomation.takeScreenshot())
|
||||||
|
val folder = File(context.getExternalFilesDir(null), "product-review").apply { mkdirs() }
|
||||||
|
File(folder, "$name.png").outputStream().use {
|
||||||
|
bitmap.compress(Bitmap.CompressFormat.PNG, 100, it)
|
||||||
|
}
|
||||||
|
bitmap.recycle()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun assertActionsReachable() {
|
||||||
|
instrumentation.runOnMainSync {
|
||||||
|
val all = screen()
|
||||||
|
val scroll = all.filterIsInstance<RoundScrollView>().single()
|
||||||
|
for (button in all.filterIsInstance<Button>()) {
|
||||||
|
assertTrue(button.height >= WatchDesign.dp(context, 48))
|
||||||
|
scroll.scrollTo(
|
||||||
|
0,
|
||||||
|
(button.top + button.height / 2 - scroll.height / 2).coerceAtLeast(0),
|
||||||
|
)
|
||||||
|
val rect = Rect()
|
||||||
|
assertTrue(button.getGlobalVisibleRect(rect))
|
||||||
|
assertEquals(button.height, rect.height())
|
||||||
|
assertEquals(button.width, rect.width())
|
||||||
|
}
|
||||||
|
scroll.scrollTo(0, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun homeLeadsWithBrandAndReceiving() {
|
||||||
|
openWatch()
|
||||||
|
instrumentation.runOnMainSync {
|
||||||
|
val labels = screen().filterIsInstance<TextView>().map { it.text.toString() }
|
||||||
|
assertTrue(labels.contains("Pack it. Send it. Wear it."))
|
||||||
|
assertTrue(labels.contains("Start receiving"))
|
||||||
|
assertFalse(labels.contains("Allow installs"))
|
||||||
|
val start = screen().filterIsInstance<Button>().single { it.text == "Start receiving" }
|
||||||
|
val visible = Rect()
|
||||||
|
assertTrue(start.getGlobalVisibleRect(visible))
|
||||||
|
assertEquals("Receiving is visible without scrolling", start.height, visible.height())
|
||||||
|
}
|
||||||
|
assertActionsReachable()
|
||||||
|
capture("home")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun reviewApprovalFailureAndSuccessHaveReachableActions() {
|
||||||
|
val apk = fixture()
|
||||||
|
store.stage(apk)
|
||||||
|
openWatch()
|
||||||
|
val sessions = context.packageManager.packageInstaller.mySessions.map { it.sessionId }
|
||||||
|
for ((state, detail) in
|
||||||
|
listOf(
|
||||||
|
InstallState.READY to "Ready when you are.",
|
||||||
|
InstallState.INSTALLING to "Getting ready to install…",
|
||||||
|
InstallState.CONFIRM to "Ready for your approval.",
|
||||||
|
InstallState.FAILED to "Free some space on your watch, then try again.",
|
||||||
|
InstallState.INSTALLED to "Installed on your watch.",
|
||||||
|
)) {
|
||||||
|
store.update(apk.id, state, detail)
|
||||||
|
instrumentation.runOnMainSync { (activity as WatchActivity).refresh() }
|
||||||
|
instrumentation.waitForIdleSync()
|
||||||
|
assertActionsReachable()
|
||||||
|
capture(state.wireValue)
|
||||||
|
}
|
||||||
|
assertEquals(
|
||||||
|
sessions,
|
||||||
|
context.packageManager.packageInstaller.mySessions.map { it.sessionId },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun linkAndProgressRemainAccessibleWithoutExtraDialogs() {
|
||||||
|
val owner = Any()
|
||||||
|
try {
|
||||||
|
Receiving.begin(owner)
|
||||||
|
Receiving.update(owner) { it.copy(url = "http://10.0.2.16:8080/#test-display-link") }
|
||||||
|
openWatch()
|
||||||
|
capture("scan")
|
||||||
|
instrumentation.runOnMainSync {
|
||||||
|
screen().filterIsInstance<Button>().single { it.text == "View link" }.performClick()
|
||||||
|
}
|
||||||
|
instrumentation.waitForIdleSync()
|
||||||
|
assertActionsReachable()
|
||||||
|
capture("link")
|
||||||
|
instrumentation.runOnMainSync {
|
||||||
|
screen()
|
||||||
|
.filterIsInstance<Button>()
|
||||||
|
.single { it.text == "Back to code" }
|
||||||
|
.performClick()
|
||||||
|
}
|
||||||
|
Receiving.update(owner) { it.copy(total = 1000, received = 420) }
|
||||||
|
instrumentation.waitForIdleSync()
|
||||||
|
capture("sending")
|
||||||
|
Receiving.update(owner) { it.copy(received = 1000) }
|
||||||
|
instrumentation.waitForIdleSync()
|
||||||
|
capture("checking")
|
||||||
|
} finally {
|
||||||
|
Receiving.end(owner, "Session ended")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,10 +13,20 @@ $('theme').onclick = () => {
|
|||||||
};
|
};
|
||||||
// Keep the secret out of subsequent navigation, referrers and visible browser history.
|
// Keep the secret out of subsequent navigation, referrers and visible browser history.
|
||||||
if (token) history.replaceState(null, '', location.pathname);
|
if (token) history.replaceState(null, '', location.pathname);
|
||||||
|
function setText(id, value) {
|
||||||
|
if ($(id).textContent !== value) $(id).textContent = value;
|
||||||
|
}
|
||||||
function message(text = '') {
|
function message(text = '') {
|
||||||
$('message').textContent = text;
|
setText('message', text);
|
||||||
}
|
}
|
||||||
function panel(id) {
|
function panel(id) {
|
||||||
|
const step = id === 'progress-panel' ? 1 : id === 'result' ? 2 : 0;
|
||||||
|
document.querySelectorAll('.steps li').forEach((item, index) => {
|
||||||
|
if (index === step) item.setAttribute('aria-current', 'step');
|
||||||
|
else item.removeAttribute('aria-current');
|
||||||
|
item.classList.toggle('complete', index < step);
|
||||||
|
});
|
||||||
|
$('progress-panel').setAttribute('aria-busy', String(id === 'progress-panel'));
|
||||||
['dropzone', 'selection', 'progress-panel', 'result'].forEach(
|
['dropzone', 'selection', 'progress-panel', 'result'].forEach(
|
||||||
(key) => ($(key).hidden = key !== id),
|
(key) => ($(key).hidden = key !== id),
|
||||||
);
|
);
|
||||||
@@ -30,16 +40,14 @@ function selected(next) {
|
|||||||
next.size === 0 ||
|
next.size === 0 ||
|
||||||
next.size > 50 * 1024 * 1024
|
next.size > 50 * 1024 * 1024
|
||||||
) {
|
) {
|
||||||
message(
|
message('Choose a single APK up to 50 MB. Bundles and split APKs won’t work here.');
|
||||||
'Choose a complete .apk file up to 50 MiB. App bundles and split packages aren’t supported.',
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file = next;
|
file = next;
|
||||||
$('filename').textContent = file.name;
|
$('filename').textContent = file.name;
|
||||||
$('filesize').textContent =
|
$('filesize').textContent = (file.size / 1048576).toFixed(1) + ' MB · ready to send';
|
||||||
(file.size / 1048576).toFixed(2) + ' MiB · ready for its next adventure';
|
|
||||||
panel('selection');
|
panel('selection');
|
||||||
|
$('send').focus({ preventScroll: true });
|
||||||
}
|
}
|
||||||
$('choose').onclick = () => $('file').click();
|
$('choose').onclick = () => $('file').click();
|
||||||
$('file').onchange = () => {
|
$('file').onchange = () => {
|
||||||
@@ -50,6 +58,7 @@ $('remove').onclick = () => {
|
|||||||
file = null;
|
file = null;
|
||||||
panel('dropzone');
|
panel('dropzone');
|
||||||
message();
|
message();
|
||||||
|
$('choose').focus({ preventScroll: true });
|
||||||
};
|
};
|
||||||
const zone = $('dropzone');
|
const zone = $('dropzone');
|
||||||
['dragenter', 'dragover'].forEach((name) =>
|
['dragenter', 'dragover'].forEach((name) =>
|
||||||
@@ -72,9 +81,10 @@ window.addEventListener('dragover', (e) => e.preventDefault());
|
|||||||
window.addEventListener('drop', (e) => e.preventDefault());
|
window.addEventListener('drop', (e) => e.preventDefault());
|
||||||
function result(title, detail, success = false) {
|
function result(title, detail, success = false) {
|
||||||
panel('result');
|
panel('result');
|
||||||
$('result-title').textContent = title;
|
setText('result-title', title);
|
||||||
$('result-detail').textContent = detail;
|
setText('result-detail', detail);
|
||||||
$('result-icon').textContent = success ? '✓' : '↗';
|
$('result-icon').textContent = success ? '✓' : '↗';
|
||||||
|
$('result').dataset.state = success ? 'success' : 'waiting';
|
||||||
$('again').hidden = true;
|
$('again').hidden = true;
|
||||||
}
|
}
|
||||||
$('send').onclick = () => {
|
$('send').onclick = () => {
|
||||||
@@ -83,8 +93,10 @@ $('send').onclick = () => {
|
|||||||
panel('progress-panel');
|
panel('progress-panel');
|
||||||
$('progress').value = 0;
|
$('progress').value = 0;
|
||||||
$('percentage').textContent = '0%';
|
$('percentage').textContent = '0%';
|
||||||
$('progress-title').textContent = 'On its way.';
|
$('progress-title').textContent = 'On its way';
|
||||||
|
$('progress-detail').textContent = 'Keep this page open. Your app is on its way.';
|
||||||
$('cancel').hidden = false;
|
$('cancel').hidden = false;
|
||||||
|
$('cancel').focus({ preventScroll: true });
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
upload = xhr;
|
upload = xhr;
|
||||||
xhr.open('POST', '/api/upload');
|
xhr.open('POST', '/api/upload');
|
||||||
@@ -97,15 +109,15 @@ $('send').onclick = () => {
|
|||||||
$('progress').value = percent;
|
$('progress').value = percent;
|
||||||
$('percentage').textContent = percent + '%';
|
$('percentage').textContent = percent + '%';
|
||||||
if (percent === 100) {
|
if (percent === 100) {
|
||||||
$('progress-title').textContent = 'A final check.';
|
$('progress-title').textContent = 'Just checking…';
|
||||||
$('progress-detail').textContent =
|
$('progress-detail').textContent = 'Your watch is getting your app ready.';
|
||||||
'Your watch is checking the package. Installation still needs your approval.';
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const failed = (text) => {
|
const failed = (text) => {
|
||||||
upload = null;
|
upload = null;
|
||||||
panel('selection');
|
panel('selection');
|
||||||
message(text);
|
message(text);
|
||||||
|
$('send').focus({ preventScroll: true });
|
||||||
};
|
};
|
||||||
xhr.onload = () => {
|
xhr.onload = () => {
|
||||||
upload = null;
|
upload = null;
|
||||||
@@ -113,25 +125,23 @@ $('send').onclick = () => {
|
|||||||
try {
|
try {
|
||||||
data = JSON.parse(xhr.responseText);
|
data = JSON.parse(xhr.responseText);
|
||||||
} catch {
|
} catch {
|
||||||
failed('The watch returned an unexpected response. Try a new session.');
|
failed('We couldn’t finish the transfer. Open a fresh link from your watch.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (xhr.status !== 200) {
|
if (xhr.status !== 200) {
|
||||||
failed(data.error || 'The file could not be transferred. Try again.');
|
failed(data.error || 'Your app didn’t arrive. Try sending it again.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pending = true;
|
pending = true;
|
||||||
file = null;
|
file = null;
|
||||||
result(
|
result('Made it to your watch', 'Review ' + data.label + ' on your watch.');
|
||||||
'Over to your wrist.',
|
|
||||||
'Review ' + data.label + ' and approve installation on your watch.',
|
|
||||||
);
|
|
||||||
poll();
|
poll();
|
||||||
};
|
};
|
||||||
xhr.onerror = () =>
|
xhr.onerror = () =>
|
||||||
failed('The connection was interrupted. Keep both devices on the same Wi-Fi and try again.');
|
failed('Connection lost. Check that both devices are on the same Wi-Fi, then try again.');
|
||||||
xhr.ontimeout = () => failed('The transfer timed out. Start a new watch session and try again.');
|
xhr.ontimeout = () =>
|
||||||
xhr.onabort = () => failed('Transfer cancelled. Check your watch before trying again.');
|
failed('That took too long. Open a fresh link from your watch and try again.');
|
||||||
|
xhr.onabort = () => failed('Transfer cancelled. Your app may have arrived—check your watch.');
|
||||||
xhr.send(file);
|
xhr.send(file);
|
||||||
};
|
};
|
||||||
$('cancel').onclick = () => upload?.abort();
|
$('cancel').onclick = () => upload?.abort();
|
||||||
@@ -160,10 +170,11 @@ async function poll() {
|
|||||||
});
|
});
|
||||||
if (response.status === 403) {
|
if (response.status === 403) {
|
||||||
online = false;
|
online = false;
|
||||||
|
document.querySelector('.connection').dataset.online = 'false';
|
||||||
$('access-form').hidden = false;
|
$('access-form').hidden = false;
|
||||||
$('choose').disabled = true;
|
$('choose').disabled = true;
|
||||||
$('connection').textContent = 'Private link needed';
|
$('connection').textContent = 'Let’s connect';
|
||||||
message('Use the current QR code or private session key shown on your watch.');
|
message('Scan the code on your watch to reconnect.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!response.ok) throw new Error('disconnected');
|
if (!response.ok) throw new Error('disconnected');
|
||||||
@@ -172,30 +183,30 @@ async function poll() {
|
|||||||
online = true;
|
online = true;
|
||||||
$('send').disabled = false;
|
$('send').disabled = false;
|
||||||
$('access-form').hidden = true;
|
$('access-form').hidden = true;
|
||||||
$('connection').textContent = 'Connected to your watch';
|
setText('connection', 'Connected to your watch');
|
||||||
|
document.querySelector('.connection').dataset.online = 'true';
|
||||||
$('expiry').textContent =
|
$('expiry').textContent =
|
||||||
'· ' +
|
'· ' +
|
||||||
Math.floor(data.expiresIn / 60) +
|
Math.floor(data.expiresIn / 60) +
|
||||||
':' +
|
':' +
|
||||||
String(data.expiresIn % 60).padStart(2, '0') +
|
String(data.expiresIn % 60).padStart(2, '0') +
|
||||||
' left';
|
' remaining';
|
||||||
$('choose').disabled = false;
|
$('choose').disabled = false;
|
||||||
if (upload) return;
|
if (upload) return;
|
||||||
const waiting = data.state === 'waiting';
|
const waiting = data.state === 'waiting';
|
||||||
if (!waiting) {
|
if (!waiting) {
|
||||||
pending = true;
|
pending = true;
|
||||||
const states = {
|
const states = {
|
||||||
ready: ['Over to your wrist.', 'Review ' + data.label + ' and tap Install on your watch.'],
|
ready: ['Made it to your watch', 'Review ' + data.label + ' on your watch.'],
|
||||||
confirm: [
|
confirm: ['One tap closer', 'Approve installation on your watch.'],
|
||||||
'Your watch. Your call.',
|
installing: ['Getting ready', 'Your watch will ask you to approve installation.'],
|
||||||
'Continue to the system approval screen on your watch.',
|
installed: ['Looks good on you.', data.label + ' is ready. Enjoy it on your watch.'],
|
||||||
],
|
failed: ['Let’s try that again', data.detail],
|
||||||
installing: ['One last step.', 'Follow the system installer on your watch.'],
|
|
||||||
installed: ['Looks good on you.', data.label + ' is installed. Open it on your watch.'],
|
|
||||||
failed: ['A small detour.', data.detail],
|
|
||||||
};
|
};
|
||||||
const content = states[data.state] || ['Check your watch.', data.detail];
|
const content = states[data.state] || ['Check your watch.', data.detail];
|
||||||
result(content[0], content[1], data.state === 'installed');
|
result(content[0], content[1], data.state === 'installed');
|
||||||
|
$('result').dataset.state = data.state;
|
||||||
|
if (data.state === 'failed') $('result-icon').textContent = '!';
|
||||||
} else if (pending) {
|
} else if (pending) {
|
||||||
pending = false;
|
pending = false;
|
||||||
result('Ready for another?', 'Your watch is ready to receive a new app.', true);
|
result('Ready for another?', 'Your watch is ready to receive a new app.', true);
|
||||||
@@ -203,12 +214,13 @@ async function poll() {
|
|||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
online = false;
|
online = false;
|
||||||
|
document.querySelector('.connection').dataset.online = 'false';
|
||||||
$('send').disabled = true;
|
$('send').disabled = true;
|
||||||
$('connection').textContent = 'Watch connection paused';
|
setText('connection', 'Watch out of reach');
|
||||||
$('choose').disabled = true;
|
$('choose').disabled = true;
|
||||||
if (!upload)
|
if (!upload)
|
||||||
message(
|
message(
|
||||||
'Keep your watch on Wi-Fi. If the session ended, start a new one and open its new link.',
|
'Check your watch’s Wi-Fi. If receiving has stopped, start again and scan the new code.',
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
polling = false;
|
polling = false;
|
||||||
@@ -217,7 +229,7 @@ async function poll() {
|
|||||||
if (!token) {
|
if (!token) {
|
||||||
$('access-form').hidden = false;
|
$('access-form').hidden = false;
|
||||||
$('choose').disabled = true;
|
$('choose').disabled = true;
|
||||||
$('connection').textContent = 'Private link needed';
|
$('connection').textContent = 'Let’s connect';
|
||||||
}
|
}
|
||||||
poll();
|
poll();
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="color-scheme" content="dark light" />
|
<meta name="color-scheme" content="dark light" />
|
||||||
<meta name="referrer" content="no-referrer" />
|
<meta name="referrer" content="no-referrer" />
|
||||||
<title>Pakkit — Pocket to Wrist.</title>
|
<title>Pakkit — Pack it. Send it. Wear it.</title>
|
||||||
<link rel="stylesheet" href="/style.css" />
|
<link rel="stylesheet" href="/style.css" />
|
||||||
<script src="/app.js" defer></script>
|
<script src="/app.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -13,8 +13,8 @@
|
|||||||
<div class="ambient" aria-hidden="true"></div>
|
<div class="ambient" aria-hidden="true"></div>
|
||||||
<div class="shell">
|
<div class="shell">
|
||||||
<header>
|
<header>
|
||||||
<a class="wordmark" href="/" aria-label="Pakkit home"
|
<div class="wordmark" aria-label="Pakkit">
|
||||||
><span class="brand-icon" aria-hidden="true"
|
<span class="brand-icon" aria-hidden="true"
|
||||||
><svg viewBox="0 0 40 40" fill="none">
|
><svg viewBox="0 0 40 40" fill="none">
|
||||||
<path d="M9 20L20 25L31 20V31L20 36L9 31Z" fill="#C9B8FF" />
|
<path d="M9 20L20 25L31 20V31L20 36L9 31Z" fill="#C9B8FF" />
|
||||||
<path d="M20 25V36M9 20L20 15L31 20" stroke="white" stroke-width="1.3" />
|
<path d="M20 25V36M9 20L20 15L31 20" stroke="white" stroke-width="1.3" />
|
||||||
@@ -31,20 +31,18 @@
|
|||||||
transform="rotate(20 22 8)"
|
transform="rotate(20 22 8)"
|
||||||
fill="white"
|
fill="white"
|
||||||
/></svg></span
|
/></svg></span
|
||||||
>Pakkit<span class="brand-dot">.</span></a
|
>Pakkit<span class="brand-dot">.</span>
|
||||||
>
|
</div>
|
||||||
<div class="connection">
|
<div class="connection" data-online="false" role="status" aria-live="polite">
|
||||||
<span></span><span id="connection">Connecting to your watch</span>
|
<span></span><span id="connection">Connecting to your watch</span>
|
||||||
</div>
|
</div>
|
||||||
<button id="theme" class="icon-button" aria-label="Change color theme">◐</button>
|
<button id="theme" class="icon-button" aria-label="Change color theme">◐</button>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<section class="intro">
|
<section class="intro">
|
||||||
<p class="eyebrow">A LITTLE MAGIC. RIGHT ON YOUR WRIST.</p>
|
<p class="eyebrow">A LITTLE POSSIBILITY. ON YOUR WRIST.</p>
|
||||||
<h1>Pocket<br />to <em>Wrist.</em></h1>
|
<h1>Pack it.<br />Send it.<br /><em>Wear it.</em></h1>
|
||||||
<p class="lede">
|
<p class="lede">Give your next app a place on your wrist.</p>
|
||||||
Your favorite apps, with a shorter journey.<br />One watch. Any browser. All yours.
|
|
||||||
</p>
|
|
||||||
<div class="parcel-stage" aria-hidden="true">
|
<div class="parcel-stage" aria-hidden="true">
|
||||||
<div class="orbit orbit-one"></div>
|
<div class="orbit orbit-one"></div>
|
||||||
<div class="orbit orbit-two"></div>
|
<div class="orbit orbit-two"></div>
|
||||||
@@ -136,39 +134,46 @@
|
|||||||
</g>
|
</g>
|
||||||
<path d="M69 86L72 78L75 86L83 89L75 92L72 100L69 92L61 89Z" fill="#87F6E3" />
|
<path d="M69 86L72 78L75 86L83 89L75 92L72 100L69 92L61 89Z" fill="#87F6E3" />
|
||||||
<path d="M284 69L287 61L290 69L298 72L290 75L287 83L284 75L276 72Z" fill="#BA9BFF" />
|
<path d="M284 69L287 61L290 69L298 72L290 75L287 83L284 75L276 72Z" fill="#BA9BFF" />
|
||||||
<circle cx="278" cy="246" r="3" fill="#77EFD8" /></svg
|
<circle cx="278" cy="246" r="3" fill="#77EFD8" />
|
||||||
><span class="stage-caption">PACK IT. SEND IT. WEAR IT.</span>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="transfer-card" aria-labelledby="card-title">
|
<section class="transfer-card" aria-labelledby="card-title">
|
||||||
<div class="card-top">
|
<div class="card-top">
|
||||||
<span class="pill">DIRECT TO YOUR WATCH</span
|
<span class="pill">YOUR NEXT APP</span
|
||||||
><span class="private-label">↗ On your Wi-Fi</span>
|
><span class="private-label">↗ On your Wi-Fi</span>
|
||||||
</div>
|
</div>
|
||||||
<h2 id="card-title">A new home<br />for your next app.</h2>
|
<h2 id="card-title">Good things<br />come in Pakkits.</h2>
|
||||||
<p class="card-description">Choose a compatible APK. We’ll take it from here.</p>
|
<p class="card-description">Choose an app for your watch. We’ll deliver it.</p>
|
||||||
<form id="access-form" hidden>
|
<form id="access-form" hidden>
|
||||||
<label for="access">Private session key</label>
|
<label for="access">Connect your watch</label>
|
||||||
<p>Scan the QR code or enter the key after # in your watch’s link.</p>
|
<p>Scan the code on your watch, or paste its full link here.</p>
|
||||||
<input id="access" autocomplete="off" spellcheck="false" required /><button
|
<input
|
||||||
class="primary"
|
id="access"
|
||||||
type="submit"
|
type="password"
|
||||||
>
|
aria-label="Watch link"
|
||||||
Connect to watch
|
autocomplete="off"
|
||||||
</button>
|
spellcheck="false"
|
||||||
|
required
|
||||||
|
/><button class="primary" type="submit">Connect to watch</button>
|
||||||
</form>
|
</form>
|
||||||
|
<ol class="steps" aria-label="Transfer steps">
|
||||||
|
<li aria-current="step">Choose</li>
|
||||||
|
<li>Send</li>
|
||||||
|
<li>Wear</li>
|
||||||
|
</ol>
|
||||||
<div id="dropzone" class="dropzone">
|
<div id="dropzone" class="dropzone">
|
||||||
<div class="upload-symbol" aria-hidden="true">↑</div>
|
<div class="upload-symbol" aria-hidden="true">↑</div>
|
||||||
<strong>Drop a little possibility.</strong
|
<strong>A little app. A new possibility.</strong
|
||||||
><span>Drag your APK here, or choose a file below.</span
|
><span>Drop an APK here to get started.</span
|
||||||
><button id="choose" class="primary" type="button">
|
><button id="choose" class="primary" type="button" disabled>
|
||||||
Choose an APK <span aria-hidden="true">↗</span></button
|
Choose app <span aria-hidden="true">↗</span></button
|
||||||
><input
|
><input
|
||||||
id="file"
|
id="file"
|
||||||
type="file"
|
type="file"
|
||||||
accept=".apk,application/vnd.android.package-archive"
|
accept=".apk,application/vnd.android.package-archive"
|
||||||
hidden
|
hidden
|
||||||
/><small>Single .apk file · up to 50 MiB</small>
|
/><small>APK files · up to 50 MB</small>
|
||||||
</div>
|
</div>
|
||||||
<div id="selection" hidden>
|
<div id="selection" hidden>
|
||||||
<div class="file-row">
|
<div class="file-row">
|
||||||
@@ -177,51 +182,44 @@
|
|||||||
<button id="remove" class="icon-button" aria-label="Remove selected file">×</button>
|
<button id="remove" class="icon-button" aria-label="Remove selected file">×</button>
|
||||||
</div>
|
</div>
|
||||||
<button id="send" class="primary" type="button">
|
<button id="send" class="primary" type="button">
|
||||||
Send to my watch <span aria-hidden="true">→</span>
|
Send to watch <span aria-hidden="true">→</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="progress-panel" hidden>
|
<div id="progress-panel" hidden>
|
||||||
<div class="progress-heading">
|
<div class="progress-heading">
|
||||||
<strong id="progress-title">On its way.</strong><span id="percentage">0%</span>
|
<strong id="progress-title">On its way</strong><span id="percentage">0%</span>
|
||||||
</div>
|
</div>
|
||||||
<progress id="progress" max="100" value="0" aria-label="APK upload progress"></progress>
|
<progress id="progress" max="100" value="0" aria-label="APK upload progress"></progress>
|
||||||
<p id="progress-detail">Keep this page open while your app travels.</p>
|
<p id="progress-detail">Keep this page open. Your app is on its way.</p>
|
||||||
<button id="cancel" class="secondary" type="button">Cancel transfer</button>
|
<button id="cancel" class="secondary" type="button">Cancel transfer</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="result" hidden>
|
<div id="result" role="status" aria-live="polite" aria-atomic="true" hidden>
|
||||||
<div id="result-icon" aria-hidden="true">✓</div>
|
<div id="result-icon" aria-hidden="true">✓</div>
|
||||||
<h3 id="result-title">Over to your wrist.</h3>
|
<h3 id="result-title">Made it to your watch</h3>
|
||||||
<p id="result-detail">Review the app and confirm installation on your watch.</p>
|
<p id="result-detail">Tap Install on your watch when you’re ready.</p>
|
||||||
<button id="again" class="secondary" type="button" hidden>Choose another APK</button>
|
<button id="again" class="secondary" type="button" hidden>Send another app</button>
|
||||||
</div>
|
</div>
|
||||||
<p id="message" role="status" aria-live="polite"></p>
|
<p id="message" role="status" aria-live="polite"></p>
|
||||||
<div class="consent-note">
|
<div class="consent-note">
|
||||||
<span aria-hidden="true">✧</span>
|
<span aria-hidden="true">✧</span>
|
||||||
<p>
|
<p>
|
||||||
Your watch. Your call.<br /><span
|
Your watch. Your call.<br /><span>You approve every installation on your watch.</span>
|
||||||
>Nothing installs until you approve it on your watch.</span
|
|
||||||
>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<section class="journey" aria-label="How it works">
|
|
||||||
<div>
|
|
||||||
<span>01</span>
|
|
||||||
<p><strong>Pick your app.</strong><br />A complete APK you trust.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span>02</span>
|
|
||||||
<p><strong>Send it over.</strong><br />Straight across your Wi-Fi.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span>03</span>
|
|
||||||
<p><strong>Make it yours.</strong><br />Approve it on your wrist.</p>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<footer>
|
<footer>
|
||||||
<span>Pakkit <span class="muted">/ A lighter way to wear your apps.</span></span
|
<span>Pakkit <span class="muted">/ Pack it. Send it. Wear it.</span></span
|
||||||
><span>Local HTTP session · trusted Wi-Fi only <span id="expiry"></span></span>
|
><span
|
||||||
|
><details class="connection-help">
|
||||||
|
<summary>About this connection</summary>
|
||||||
|
<p>
|
||||||
|
Use Wi-Fi you trust. Files travel across your network without encryption. Keep your
|
||||||
|
watch’s link private.
|
||||||
|
</p>
|
||||||
|
</details>
|
||||||
|
<span id="expiry"></span
|
||||||
|
></span>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+307
-104
@@ -19,31 +19,38 @@
|
|||||||
'Segoe UI',
|
'Segoe UI',
|
||||||
sans-serif;
|
sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button,
|
button,
|
||||||
input {
|
input {
|
||||||
font: inherit;
|
font: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
button,
|
button,
|
||||||
a,
|
a,
|
||||||
input {
|
input {
|
||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:disabled {
|
button:disabled {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:focus-visible,
|
button:focus-visible,
|
||||||
a:focus-visible,
|
a:focus-visible,
|
||||||
input:focus-visible,
|
input:focus-visible,
|
||||||
@@ -51,9 +58,11 @@ input:focus-visible,
|
|||||||
outline: 3px solid var(--mint);
|
outline: 3px solid var(--mint);
|
||||||
outline-offset: 5px;
|
outline-offset: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
[hidden] {
|
[hidden] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ambient {
|
.ambient {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -65,17 +74,20 @@ input:focus-visible,
|
|||||||
radial-gradient(ellipse at 10% 40%, #7145ec19, transparent 50%),
|
radial-gradient(ellipse at 10% 40%, #7145ec19, transparent 50%),
|
||||||
radial-gradient(ellipse at 95% 10%, #28e0d60b, transparent 45%);
|
radial-gradient(ellipse at 95% 10%, #28e0d60b, transparent 45%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.shell {
|
.shell {
|
||||||
max-width: 1260px;
|
max-width: 1260px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
padding: 34px 52px 24px;
|
padding: 34px 52px 24px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wordmark {
|
.wordmark {
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
font-weight: 780;
|
font-weight: 780;
|
||||||
@@ -86,6 +98,7 @@ header {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 9px;
|
gap: 9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-icon {
|
.brand-icon {
|
||||||
background: linear-gradient(140deg, #bda8ff, #7049ed);
|
background: linear-gradient(140deg, #bda8ff, #7049ed);
|
||||||
border-radius: 11px;
|
border-radius: 11px;
|
||||||
@@ -97,10 +110,12 @@ header {
|
|||||||
font-size: 31px;
|
font-size: 31px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-dot {
|
.brand-dot {
|
||||||
color: var(--mint);
|
color: var(--mint);
|
||||||
margin-left: -9px;
|
margin-left: -9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.connection {
|
.connection {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -109,6 +124,7 @@ header {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
.connection > span:first-child {
|
.connection > span:first-child {
|
||||||
width: 6px;
|
width: 6px;
|
||||||
height: 6px;
|
height: 6px;
|
||||||
@@ -116,23 +132,28 @@ header {
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow: 0 0 12px #80efd855;
|
box-shadow: 0 0 12px #80efd855;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button {
|
.icon-button {
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: var(--soft);
|
background: var(--soft);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
width: 40px;
|
width: 44px;
|
||||||
height: 40px;
|
height: 44px;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
min-width: 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 70px;
|
gap: 88px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 76px 0 54px;
|
padding: 76px 0 54px;
|
||||||
|
padding-top: 56px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.eyebrow {
|
.eyebrow {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
letter-spacing: 2.6px;
|
letter-spacing: 2.6px;
|
||||||
@@ -140,34 +161,41 @@ main {
|
|||||||
font-weight: 750;
|
font-weight: 750;
|
||||||
margin: 0 0 24px;
|
margin: 0 0 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: clamp(66px, 7.6vw, 104px);
|
font-size: clamp(64px, 6.4vw, 88px);
|
||||||
line-height: 0.99;
|
line-height: 1.06;
|
||||||
letter-spacing: -6px;
|
letter-spacing: -4.8px;
|
||||||
font-weight: 740;
|
font-weight: 740;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 em {
|
h1 em {
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
background: linear-gradient(110deg, #bd9fff, #91befc 60%, #79e7d6);
|
background: linear-gradient(110deg, #bd9fff, #91befc 60%, #79e7d6);
|
||||||
background-clip: text;
|
background-clip: text;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lede {
|
.lede {
|
||||||
font-size: 16px;
|
font-size: 17px;
|
||||||
line-height: 1.8;
|
line-height: 1.65;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
margin: 24px 0 0;
|
margin: 24px 0 0;
|
||||||
|
max-width: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parcel-stage {
|
.parcel-stage {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 250px;
|
height: 215px;
|
||||||
max-width: 390px;
|
max-width: 390px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parcel-stage:before {
|
.parcel-stage:before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -175,13 +203,15 @@ h1 em {
|
|||||||
background: radial-gradient(ellipse, #8752ff29, transparent 65%);
|
background: radial-gradient(ellipse, #8752ff29, transparent 65%);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parcel {
|
.parcel {
|
||||||
width: 285px;
|
width: 260px;
|
||||||
height: 270px;
|
height: 245px;
|
||||||
position: relative;
|
position: relative;
|
||||||
filter: drop-shadow(0 16px 26px #8560e522);
|
filter: drop-shadow(0 16px 26px #8560e522);
|
||||||
animation: arrive 0.8s ease-out both;
|
animation: arrive 0.8s ease-out both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orbit {
|
.orbit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
@@ -191,27 +221,23 @@ h1 em {
|
|||||||
transform: rotate(-13deg);
|
transform: rotate(-13deg);
|
||||||
bottom: 36px;
|
bottom: 36px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orbit-two {
|
.orbit-two {
|
||||||
width: 340px;
|
width: 340px;
|
||||||
bottom: 26px;
|
bottom: 26px;
|
||||||
border-color: #8df2de0c;
|
border-color: #8df2de0c;
|
||||||
}
|
}
|
||||||
.stage-caption {
|
|
||||||
position: absolute;
|
|
||||||
bottom: -5px;
|
|
||||||
font-size: 9px;
|
|
||||||
letter-spacing: 3px;
|
|
||||||
color: var(--muted);
|
|
||||||
}
|
|
||||||
.transfer-card {
|
.transfer-card {
|
||||||
background: linear-gradient(145deg, var(--surface), var(--bg));
|
background: linear-gradient(145deg, var(--surface), var(--bg));
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 30px;
|
border-radius: 32px;
|
||||||
padding: 30px;
|
padding: 32px;
|
||||||
box-shadow: 0 24px 80px var(--shadow);
|
box-shadow: 0 24px 80px var(--shadow);
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.transfer-card:before {
|
.transfer-card:before {
|
||||||
content: '';
|
content: '';
|
||||||
height: 2px;
|
height: 2px;
|
||||||
@@ -221,12 +247,14 @@ h1 em {
|
|||||||
top: 0;
|
top: 0;
|
||||||
background: linear-gradient(90deg, transparent, #a088ff77, transparent);
|
background: linear-gradient(90deg, transparent, #a088ff77, transparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-top {
|
.card-top {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pill {
|
.pill {
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
font-weight: 750;
|
font-weight: 750;
|
||||||
@@ -237,10 +265,12 @@ h1 em {
|
|||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.private-label {
|
.private-label {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 34px;
|
font-size: 34px;
|
||||||
line-height: 1.13;
|
line-height: 1.13;
|
||||||
@@ -248,12 +278,14 @@ h2 {
|
|||||||
margin: 28px 0 12px;
|
margin: 28px 0 12px;
|
||||||
font-weight: 650;
|
font-weight: 650;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-description {
|
.card-description {
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
margin: 0 0 24px;
|
margin: 0 0 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone {
|
.dropzone {
|
||||||
border: 1px dashed #a596d047;
|
border: 1px dashed #a596d047;
|
||||||
background: var(--soft);
|
background: var(--soft);
|
||||||
@@ -267,11 +299,13 @@ h2 {
|
|||||||
border-color 0.2s,
|
border-color 0.2s,
|
||||||
transform 0.2s;
|
transform 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone.dragging {
|
.dropzone.dragging {
|
||||||
border-color: var(--mint);
|
border-color: var(--mint);
|
||||||
background: #7aefd513;
|
background: #7aefd513;
|
||||||
transform: scale(1.01);
|
transform: scale(1.01);
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-symbol {
|
.upload-symbol {
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
@@ -284,17 +318,20 @@ h2 {
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone strong {
|
.dropzone strong {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
letter-spacing: -0.3px;
|
letter-spacing: -0.3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone > span {
|
.dropzone > span {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
margin: 8px 0 20px;
|
margin: 8px 0 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.primary {
|
.primary {
|
||||||
border: 1px solid #c3abff40;
|
border: 1px solid #c3abff40;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
@@ -314,25 +351,31 @@ h2 {
|
|||||||
gap: 25px;
|
gap: 25px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone .primary {
|
.dropzone .primary {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 255px;
|
max-width: 255px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.primary:hover:enabled {
|
.primary:hover:enabled {
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
box-shadow: 0 9px 28px #6840db40;
|
box-shadow: 0 9px 28px #6840db40;
|
||||||
}
|
}
|
||||||
|
|
||||||
.primary:active:enabled {
|
.primary:active:enabled {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
small {
|
small {
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone small {
|
.dropzone small {
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.consent-note {
|
.consent-note {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
@@ -341,63 +384,34 @@ small {
|
|||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.consent-note > span {
|
.consent-note > span {
|
||||||
color: var(--mint);
|
color: var(--mint);
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.consent-note p {
|
.consent-note p {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.consent-note p span {
|
.consent-note p span {
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#message {
|
#message {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.65;
|
line-height: 1.65;
|
||||||
color: var(--error);
|
color: var(--error);
|
||||||
margin: 12px 0 0;
|
margin: 12px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#message:empty {
|
#message:empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.journey {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
gap: 30px;
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
padding: 29px 0;
|
|
||||||
}
|
|
||||||
.journey > div {
|
|
||||||
display: flex;
|
|
||||||
gap: 17px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.journey > div > span {
|
|
||||||
color: var(--violet);
|
|
||||||
font-size: 11px;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 50%;
|
|
||||||
width: 34px;
|
|
||||||
height: 34px;
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.journey p {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--muted);
|
|
||||||
line-height: 1.9;
|
|
||||||
}
|
|
||||||
.journey strong {
|
|
||||||
color: var(--text);
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
footer {
|
footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -405,12 +419,16 @@ footer {
|
|||||||
border-top: 1px solid var(--border);
|
border-top: 1px solid var(--border);
|
||||||
padding-top: 22px;
|
padding-top: 22px;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
font-size: 9px;
|
font-size: 11px;
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
|
align-items: baseline;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.muted {
|
.muted {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-row {
|
.file-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -421,21 +439,26 @@ footer {
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-row > div:nth-child(2) {
|
.file-row > div:nth-child(2) {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-row strong {
|
.file-row strong {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-row small {
|
.file-row small {
|
||||||
margin-top: 7px;
|
margin-top: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-icon {
|
.file-icon {
|
||||||
color: var(--mint);
|
color: var(--mint);
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary {
|
.secondary {
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
@@ -446,42 +469,51 @@ footer {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-heading {
|
.progress-heading {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress {
|
progress {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 8px;
|
height: 10px;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
accent-color: var(--mint);
|
accent-color: var(--mint);
|
||||||
margin: 20px 0 6px;
|
margin: 20px 0 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress::-webkit-progress-bar {
|
progress::-webkit-progress-bar {
|
||||||
background: #a09abd22;
|
background: #a09abd22;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress::-webkit-progress-value {
|
progress::-webkit-progress-value {
|
||||||
background: linear-gradient(90deg, #8560ed, #7be6da);
|
background: linear-gradient(90deg, #8560ed, #7be6da);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress::-moz-progress-bar {
|
progress::-moz-progress-bar {
|
||||||
background: #80efd8;
|
background: #80efd8;
|
||||||
}
|
}
|
||||||
|
|
||||||
#progress-detail,
|
#progress-detail,
|
||||||
#result-detail {
|
#result-detail {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
#result {
|
#result {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 18px 4px;
|
padding: 18px 4px;
|
||||||
|
min-height: 230px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#result-icon {
|
#result-icon {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 55px;
|
width: 55px;
|
||||||
@@ -493,22 +525,27 @@ progress::-moz-progress-bar {
|
|||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
letter-spacing: -0.8px;
|
letter-spacing: -0.8px;
|
||||||
margin: 12px 0;
|
margin: 12px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#access-form {
|
#access-form {
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#access-form label {
|
#access-form label {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#access-form p {
|
#access-form p {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
input:not([type='file']) {
|
input:not([type='file']) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
@@ -518,6 +555,7 @@ input:not([type='file']) {
|
|||||||
padding: 12px;
|
padding: 12px;
|
||||||
margin: 4px 0 12px;
|
margin: 4px 0 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-theme='light'] {
|
[data-theme='light'] {
|
||||||
color-scheme: light;
|
color-scheme: light;
|
||||||
--bg: #f6f5fc;
|
--bg: #f6f5fc;
|
||||||
@@ -531,13 +569,126 @@ input:not([type='file']) {
|
|||||||
--shadow: #4420800c;
|
--shadow: #4420800c;
|
||||||
--error: #a52445;
|
--error: #a52445;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-theme='light'] h1 em {
|
[data-theme='light'] h1 em {
|
||||||
background: linear-gradient(110deg, #7144d7, #3669ba 65%, #16866f);
|
background: linear-gradient(110deg, #7144d7, #3669ba 65%, #16866f);
|
||||||
background-clip: text;
|
background-clip: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-theme='light'] .parcel-stage:before {
|
[data-theme='light'] .parcel-stage:before {
|
||||||
background: radial-gradient(ellipse, #8158e51c, transparent 70%);
|
background: radial-gradient(ellipse, #8158e51c, transparent 70%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.brand-icon svg {
|
||||||
|
width: 29px;
|
||||||
|
height: 29px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.steps {
|
||||||
|
display: flex;
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 0 24px;
|
||||||
|
gap: 8px;
|
||||||
|
counter-reset: step;
|
||||||
|
}
|
||||||
|
|
||||||
|
.steps li {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 7px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--muted);
|
||||||
|
counter-increment: step;
|
||||||
|
}
|
||||||
|
|
||||||
|
.steps li::before {
|
||||||
|
content: counter(step);
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--soft);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.steps [aria-current] {
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.steps [aria-current]::before {
|
||||||
|
background: #7854ee;
|
||||||
|
color: white;
|
||||||
|
border-color: #bca6ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.steps .complete::before {
|
||||||
|
content: '✓';
|
||||||
|
color: var(--mint);
|
||||||
|
}
|
||||||
|
|
||||||
|
.connection[data-online='false'] > span:first-child {
|
||||||
|
background: var(--muted);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#result[data-state='failed'] #result-icon {
|
||||||
|
color: var(--error);
|
||||||
|
background: #e3677d16;
|
||||||
|
}
|
||||||
|
|
||||||
|
#result[data-state='installed'] #result-icon {
|
||||||
|
animation: settle 420ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
#result:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#result-title {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.connection-help {
|
||||||
|
max-width: 290px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.connection-help summary {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 11px;
|
||||||
|
min-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.connection-help p {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
#expiry {
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropzone > span,
|
||||||
|
small {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.consent-note p,
|
||||||
|
.consent-note p span {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary,
|
||||||
|
.secondary {
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 16px;
|
||||||
|
min-height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes arrive {
|
@keyframes arrive {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -548,6 +699,18 @@ input:not([type='file']) {
|
|||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes settle {
|
||||||
|
from {
|
||||||
|
transform: scale(0.85);
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: scale(1);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
*,
|
*,
|
||||||
*:before,
|
*:before,
|
||||||
@@ -557,129 +720,169 @@ input:not([type='file']) {
|
|||||||
scroll-behavior: auto !important;
|
scroll-behavior: auto !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
.shell {
|
.shell {
|
||||||
padding: 26px 30px;
|
padding: 26px 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
gap: 30px;
|
gap: 30px;
|
||||||
padding-top: 55px;
|
padding-top: 55px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 78px;
|
font-size: 78px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.transfer-card {
|
.transfer-card {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.private-label {
|
.private-label {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 680px) {
|
@media (max-width: 680px) {
|
||||||
.shell {
|
.shell {
|
||||||
padding: 22px;
|
padding: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wordmark {
|
.wordmark {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.connection {
|
.connection {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
max-width: 145px;
|
max-width: 145px;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 32px;
|
gap: 28px;
|
||||||
padding: 48px 0 32px;
|
padding: 48px 0 32px;
|
||||||
|
padding-top: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.intro {
|
.intro {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.eyebrow {
|
.eyebrow {
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
|
letter-spacing: 1.6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 76px;
|
font-size: clamp(52px, 13vw, 76px);
|
||||||
letter-spacing: -4px;
|
letter-spacing: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lede {
|
.lede {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parcel-stage {
|
.parcel-stage {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 12px;
|
right: -10px;
|
||||||
top: 170px;
|
top: 42px;
|
||||||
width: 160px;
|
width: 140px;
|
||||||
height: 180px;
|
height: 170px;
|
||||||
opacity: 0.65;
|
opacity: 0.85;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parcel {
|
.parcel {
|
||||||
width: 170px;
|
width: 170px;
|
||||||
|
height: 180px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orbit {
|
.orbit {
|
||||||
width: 145px;
|
width: 130px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orbit-two {
|
.orbit-two {
|
||||||
width: 160px;
|
width: 145px;
|
||||||
}
|
|
||||||
.stage-caption {
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.intro .lede {
|
.intro .lede {
|
||||||
position: relative;
|
position: relative;
|
||||||
max-width: 75%;
|
max-width: 75%;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.transfer-card {
|
.transfer-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 24px;
|
border-radius: 28px;
|
||||||
}
|
padding: 24px;
|
||||||
.journey {
|
|
||||||
gap: 18px;
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
.journey > div {
|
|
||||||
gap: 14px;
|
|
||||||
}
|
|
||||||
.journey p br {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.journey p strong {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 8px;
|
gap: 12px;
|
||||||
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-top .private-label {
|
.card-top .private-label {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 32px;
|
font-size: 30px;
|
||||||
}
|
margin-top: 22px;
|
||||||
}
|
|
||||||
@media (max-width: 370px) {
|
|
||||||
.parcel-stage {
|
|
||||||
opacity: 0.25;
|
|
||||||
}
|
|
||||||
.connection {
|
|
||||||
max-width: 100px;
|
|
||||||
}
|
|
||||||
.shell {
|
|
||||||
padding: 17px;
|
|
||||||
}
|
|
||||||
.card-top .private-label {
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-icon svg {
|
@media (max-width: 370px) {
|
||||||
width: 29px;
|
.parcel-stage {
|
||||||
height: 29px;
|
opacity: 0.5;
|
||||||
|
right: -12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.connection {
|
||||||
|
max-width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shell {
|
||||||
|
padding: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-top .private-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transfer-card {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1000px) and (min-width: 681px) {
|
||||||
|
main {
|
||||||
|
gap: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transfer-card {
|
||||||
|
padding: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 65px;
|
||||||
|
letter-spacing: -3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.steps li {
|
||||||
|
gap: 4px;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -29,11 +29,11 @@ object ApkRules {
|
|||||||
if (count < 0) break
|
if (count < 0) break
|
||||||
if (count == 0) continue
|
if (count == 0) continue
|
||||||
total += count
|
total += count
|
||||||
require(total <= max) { "Choose an APK up to 50 MiB." }
|
requireUser(total <= max) { "Choose an APK up to 50 MB." }
|
||||||
hash.update(buffer, 0, count)
|
hash.update(buffer, 0, count)
|
||||||
output?.write(buffer, 0, count)
|
output?.write(buffer, 0, count)
|
||||||
}
|
}
|
||||||
require(total > 0) { "This file is empty." }
|
requireUser(total > 0) { "This file is empty. Choose another APK." }
|
||||||
return total to hash.digest().joinToString("") { "%02x".format(it) }
|
return total to hash.digest().joinToString("") { "%02x".format(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,24 +9,28 @@ import java.util.zip.ZipFile
|
|||||||
object PackageInspector {
|
object PackageInspector {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
fun inspect(context: Context, file: File, hash: String): Apk {
|
fun inspect(context: Context, file: File, hash: String): Apk {
|
||||||
require(file.length() in 1..ApkRules.MAX_BYTES) { "Choose an APK up to 50 MiB." }
|
requireUser(file.length() in 1..ApkRules.MAX_BYTES) { "Choose an APK up to 50 MB." }
|
||||||
val abis = mutableSetOf<String>()
|
val abis = mutableSetOf<String>()
|
||||||
ZipFile(file).use { zip ->
|
ZipFile(file).use { zip ->
|
||||||
require(zip.getEntry("AndroidManifest.xml") != null) {
|
requireUser(zip.getEntry("AndroidManifest.xml") != null) {
|
||||||
"This file is not an Android APK."
|
"This file is not an Android APK."
|
||||||
}
|
}
|
||||||
require(zip.size() < 100_000) { "This archive contains too many entries." }
|
requireUser(zip.size() < 100_000) {
|
||||||
|
"This file is too complex to open. Try another APK."
|
||||||
|
}
|
||||||
var expanded = 0L
|
var expanded = 0L
|
||||||
zip.entries().asSequence().forEach { entry ->
|
zip.entries().asSequence().forEach { entry ->
|
||||||
require(entry.size >= 0 && entry.size <= 128L * 1024 * 1024) {
|
requireUser(entry.size >= 0 && entry.size <= 128L * 1024 * 1024) {
|
||||||
"This APK contains an unusually large archive entry."
|
"This app is too large to unpack. Try a smaller APK."
|
||||||
}
|
}
|
||||||
expanded += entry.size
|
expanded += entry.size
|
||||||
require(expanded <= 200L * 1024 * 1024) {
|
requireUser(expanded <= 200L * 1024 * 1024) {
|
||||||
"This APK expands beyond Pakkit’s package limit."
|
"This app is too large to unpack. Try a smaller APK."
|
||||||
}
|
}
|
||||||
if (entry.name == "AndroidManifest.xml")
|
if (entry.name == "AndroidManifest.xml")
|
||||||
require(entry.size <= 2 * 1024 * 1024) { "This APK manifest is too large." }
|
requireUser(entry.size <= 2 * 1024 * 1024) {
|
||||||
|
"This file can’t be opened. Try another APK."
|
||||||
|
}
|
||||||
val parts = entry.name.split('/')
|
val parts = entry.name.split('/')
|
||||||
if (parts.size >= 3 && parts[0] == "lib" && entry.name.endsWith(".so"))
|
if (parts.size >= 3 && parts[0] == "lib" && entry.name.endsWith(".so"))
|
||||||
abis += parts[1]
|
abis += parts[1]
|
||||||
@@ -36,17 +40,16 @@ object PackageInspector {
|
|||||||
context.packageManager.getPackageArchiveInfo(
|
context.packageManager.getPackageArchiveInfo(
|
||||||
file.path,
|
file.path,
|
||||||
PackageManager.GET_SIGNING_CERTIFICATES or PackageManager.GET_CONFIGURATIONS,
|
PackageManager.GET_SIGNING_CERTIFICATES or PackageManager.GET_CONFIGURATIONS,
|
||||||
)
|
) ?: throw UserMessage("This file can’t be opened. Choose a complete APK.")
|
||||||
?: error(
|
requireUser(info.splitNames.isNullOrEmpty()) {
|
||||||
"Android could not read this APK. Split packages and bundles are not supported.",
|
"This is only part of an app. Choose a complete APK."
|
||||||
)
|
|
||||||
require(info.splitNames.isNullOrEmpty()) {
|
|
||||||
"Choose a complete, single APK rather than a split package."
|
|
||||||
}
|
}
|
||||||
require(info.signingInfo?.apkContentsSigners?.isNotEmpty() == true) {
|
requireUser(info.signingInfo?.apkContentsSigners?.isNotEmpty() == true) {
|
||||||
"This APK has no readable signing certificate."
|
"This app’s signature can’t be verified. Get a fresh copy from its source."
|
||||||
|
}
|
||||||
|
requireUser(info.packageName != context.packageName) {
|
||||||
|
"Update Pakkit through Google Play."
|
||||||
}
|
}
|
||||||
require(info.packageName != context.packageName) { "Update Pakkit through Google Play." }
|
|
||||||
val app = requireNotNull(info.applicationInfo)
|
val app = requireNotNull(info.applicationInfo)
|
||||||
app.sourceDir = file.path
|
app.sourceDir = file.path
|
||||||
app.publicSourceDir = file.path
|
app.publicSourceDir = file.path
|
||||||
@@ -57,22 +60,22 @@ object PackageInspector {
|
|||||||
.use { xml ->
|
.use { xml ->
|
||||||
while (xml.next() != org.xmlpull.v1.XmlPullParser.END_DOCUMENT) {
|
while (xml.next() != org.xmlpull.v1.XmlPullParser.END_DOCUMENT) {
|
||||||
if (xml.eventType != org.xmlpull.v1.XmlPullParser.START_TAG) continue
|
if (xml.eventType != org.xmlpull.v1.XmlPullParser.START_TAG) continue
|
||||||
require(xml.name != "uses-split") {
|
requireUser(xml.name != "uses-split") {
|
||||||
"Choose a complete APK; this file requires other splits."
|
"This is only part of an app. Choose a complete APK."
|
||||||
}
|
}
|
||||||
if (xml.name == "manifest")
|
if (xml.name == "manifest")
|
||||||
require(xml.getAttributeValue(null, "split").isNullOrEmpty()) {
|
requireUser(xml.getAttributeValue(null, "split").isNullOrEmpty()) {
|
||||||
"This is a split APK. Choose a complete APK."
|
"This is only part of an app. Choose a complete APK."
|
||||||
}
|
}
|
||||||
if (xml.name == "application")
|
if (xml.name == "application")
|
||||||
require(
|
requireUser(
|
||||||
!xml.getAttributeBooleanValue(
|
!xml.getAttributeBooleanValue(
|
||||||
"http://schemas.android.com/apk/res/android",
|
"http://schemas.android.com/apk/res/android",
|
||||||
"isSplitRequired",
|
"isSplitRequired",
|
||||||
false,
|
false,
|
||||||
),
|
)
|
||||||
) {
|
) {
|
||||||
"This APK requires additional splits."
|
"This is only part of an app. Choose a complete APK."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,17 +92,17 @@ object PackageInspector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun checkForWatch(apk: Apk, sdk: Int, abis: Set<String>, free: Long) {
|
fun checkForWatch(apk: Apk, sdk: Int, abis: Set<String>, free: Long) {
|
||||||
require(apk.minSdk <= sdk) {
|
requireUser(apk.minSdk <= sdk) {
|
||||||
"This APK needs Android API ${apk.minSdk}; your watch runs API $sdk."
|
"This app needs a newer version of Android. Check your watch for updates."
|
||||||
}
|
}
|
||||||
require(ApkRules.compatibleAbis(apk.abis, abis)) {
|
requireUser(ApkRules.compatibleAbis(apk.abis, abis)) {
|
||||||
"This APK was built for a different processor."
|
"This version doesn’t work on your watch. Try a version made for it."
|
||||||
}
|
}
|
||||||
requireSpace(apk.bytes, free)
|
requireSpace(apk.bytes, free)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun requireSpace(bytes: Long, free: Long) {
|
fun requireSpace(bytes: Long, free: Long) {
|
||||||
require(free > bytes * 3 + 20 * 1024 * 1024) {
|
requireUser(free > bytes * 3 + 20 * 1024 * 1024) {
|
||||||
"Free more storage on your watch, then try again."
|
"Free more storage on your watch, then try again."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ data class PendingApk(
|
|||||||
val created: Long,
|
val created: Long,
|
||||||
val apk: Apk,
|
val apk: Apk,
|
||||||
val state: InstallState = InstallState.READY,
|
val state: InstallState = InstallState.READY,
|
||||||
val detail: String = "Review this app and approve installation on your watch.",
|
val detail: String = "Ready when you are.",
|
||||||
val sessionId: Int? = null,
|
val sessionId: Int? = null,
|
||||||
) {
|
) {
|
||||||
init {
|
init {
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package meghdad.pakkit.apk
|
||||||
|
|
||||||
|
/** Only deliberately written product copy may cross an exception boundary into the UI. */
|
||||||
|
class UserMessage(message: String) : IllegalArgumentException(message)
|
||||||
|
|
||||||
|
inline fun requireUser(value: Boolean, message: () -> String) {
|
||||||
|
if (!value) throw UserMessage(message())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Throwable.userMessage(fallback: String): String =
|
||||||
|
if (this is UserMessage) message ?: fallback else fallback
|
||||||
@@ -12,6 +12,8 @@ import meghdad.pakkit.apk.ApkRules
|
|||||||
import meghdad.pakkit.apk.InstallState
|
import meghdad.pakkit.apk.InstallState
|
||||||
import meghdad.pakkit.apk.PackageInspector
|
import meghdad.pakkit.apk.PackageInspector
|
||||||
import meghdad.pakkit.apk.PendingApk
|
import meghdad.pakkit.apk.PendingApk
|
||||||
|
import meghdad.pakkit.apk.requireUser
|
||||||
|
import meghdad.pakkit.apk.userMessage
|
||||||
import meghdad.pakkit.data.PackageStore
|
import meghdad.pakkit.data.PackageStore
|
||||||
|
|
||||||
/** Called only after the watch's explicit Install action, on a worker thread. */
|
/** Called only after the watch's explicit Install action, on a worker thread. */
|
||||||
@@ -26,15 +28,17 @@ class ApkInstaller(private val context: Context) {
|
|||||||
context
|
context
|
||||||
.getSystemService(NotificationManager::class.java)
|
.getSystemService(NotificationManager::class.java)
|
||||||
.cancel(InstallReceiver.NOTIFICATION)
|
.cancel(InstallReceiver.NOTIFICATION)
|
||||||
check(context.packageManager.canRequestPackageInstalls()) {
|
requireUser(context.packageManager.canRequestPackageInstalls()) {
|
||||||
"Allow Pakkit to request installs first."
|
"Allow Pakkit to install apps, then try again."
|
||||||
}
|
}
|
||||||
require(ApkRules.fresh(apk.created, System.currentTimeMillis())) {
|
requireUser(ApkRules.fresh(apk.created, System.currentTimeMillis())) {
|
||||||
"This APK expired. Upload it again."
|
"This file has expired. Send it again to install."
|
||||||
}
|
}
|
||||||
val file = store.file(apk.id)
|
val file = store.file(apk.id)
|
||||||
val digest = file.inputStream().use { ApkRules.copyBounded(it).second }
|
val digest = file.inputStream().use { ApkRules.copyBounded(it).second }
|
||||||
require(digest == apk.apk.sha256) { "This APK changed. Upload it again." }
|
requireUser(digest == apk.apk.sha256) {
|
||||||
|
"This file has changed. Send a fresh copy to install."
|
||||||
|
}
|
||||||
val inspected = PackageInspector.inspect(context, file, digest)
|
val inspected = PackageInspector.inspect(context, file, digest)
|
||||||
PackageInspector.checkForWatch(
|
PackageInspector.checkForWatch(
|
||||||
inspected,
|
inspected,
|
||||||
@@ -57,9 +61,9 @@ class ApkInstaller(private val context: Context) {
|
|||||||
store.update(
|
store.update(
|
||||||
apk.id,
|
apk.id,
|
||||||
InstallState.INSTALLING,
|
InstallState.INSTALLING,
|
||||||
"Waiting for the watch’s system installer.",
|
"Getting ready to install…",
|
||||||
sessionId,
|
sessionId,
|
||||||
),
|
)
|
||||||
) {
|
) {
|
||||||
"This package review is no longer available."
|
"This package review is no longer available."
|
||||||
}
|
}
|
||||||
@@ -79,11 +83,12 @@ class ApkInstaller(private val context: Context) {
|
|||||||
session.commit(pending.intentSender)
|
session.commit(pending.intentSender)
|
||||||
}
|
}
|
||||||
} catch (error: Exception) {
|
} catch (error: Exception) {
|
||||||
|
android.util.Log.w("PakkitInstall", "Installation preparation failed", error)
|
||||||
sessionId?.let { runCatching { installer.abandonSession(it) } }
|
sessionId?.let { runCatching { installer.abandonSession(it) } }
|
||||||
store.update(
|
store.update(
|
||||||
apk.id,
|
apk.id,
|
||||||
InstallState.FAILED,
|
InstallState.FAILED,
|
||||||
error.message ?: "Could not open the system installer. Use Google Play.",
|
error.userMessage("Couldn’t start installation. Try again."),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class InstallReceiver : BroadcastReceiver() {
|
|||||||
store.update(
|
store.update(
|
||||||
apk.id,
|
apk.id,
|
||||||
InstallState.FAILED,
|
InstallState.FAILED,
|
||||||
"The system did not provide an approval screen.",
|
"Couldn’t open approval. Try again.",
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -50,43 +50,9 @@ class InstallReceiver : BroadcastReceiver() {
|
|||||||
store.update(
|
store.update(
|
||||||
apk.id,
|
apk.id,
|
||||||
InstallState.CONFIRM,
|
InstallState.CONFIRM,
|
||||||
"Continue the system approval on your watch.",
|
"Ready for your approval.",
|
||||||
)
|
)
|
||||||
manager.createNotificationChannel(
|
notifyApproval(context)
|
||||||
NotificationChannel(
|
|
||||||
"installation",
|
|
||||||
"Installation approval",
|
|
||||||
NotificationManager.IMPORTANCE_DEFAULT,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
if (
|
|
||||||
Build.VERSION.SDK_INT < 33 ||
|
|
||||||
context.checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) ==
|
|
||||||
PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
|
||||||
val open =
|
|
||||||
Intent(context, WatchActivity::class.java)
|
|
||||||
.putExtra("approval", confirmation)
|
|
||||||
.putExtra("job", apk.id)
|
|
||||||
val pending =
|
|
||||||
PendingIntent.getActivity(
|
|
||||||
context,
|
|
||||||
apk.sessionId,
|
|
||||||
open,
|
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
|
||||||
)
|
|
||||||
manager.notify(
|
|
||||||
NOTIFICATION,
|
|
||||||
Notification.Builder(context, "installation")
|
|
||||||
.setSmallIcon(R.drawable.pakkit_mark)
|
|
||||||
.setColor(WatchDesign.PURPLE)
|
|
||||||
.setContentTitle("Approve installation")
|
|
||||||
.setContentText("Open Pakkit to continue on your watch.")
|
|
||||||
.setContentIntent(pending)
|
|
||||||
.setAutoCancel(true)
|
|
||||||
.build(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
PackageInstaller.STATUS_SUCCESS -> {
|
PackageInstaller.STATUS_SUCCESS -> {
|
||||||
PendingApproval.clear()
|
PendingApproval.clear()
|
||||||
@@ -101,17 +67,17 @@ class InstallReceiver : BroadcastReceiver() {
|
|||||||
PackageInstaller.STATUS_FAILURE_ABORTED ->
|
PackageInstaller.STATUS_FAILURE_ABORTED ->
|
||||||
"Installation was cancelled. You can try again."
|
"Installation was cancelled. You can try again."
|
||||||
PackageInstaller.STATUS_FAILURE_BLOCKED ->
|
PackageInstaller.STATUS_FAILURE_BLOCKED ->
|
||||||
"The watch’s security policy blocked this installation. Use Google Play or contact the app developer."
|
"Your watch blocked this app. Look for it on Google Play."
|
||||||
PackageInstaller.STATUS_FAILURE_CONFLICT ->
|
PackageInstaller.STATUS_FAILURE_CONFLICT ->
|
||||||
"This APK conflicts with an installed app or its signature. Ask the developer for a compatible version."
|
"A different version is already installed. Get a matching update from the app’s source."
|
||||||
PackageInstaller.STATUS_FAILURE_INCOMPATIBLE ->
|
PackageInstaller.STATUS_FAILURE_INCOMPATIBLE ->
|
||||||
"This APK is not compatible with your watch."
|
"This app doesn’t work on your watch. Try a version made for it."
|
||||||
PackageInstaller.STATUS_FAILURE_INVALID ->
|
PackageInstaller.STATUS_FAILURE_INVALID ->
|
||||||
"The system rejected this APK’s format or signature."
|
"Your watch couldn’t verify this app. Get a fresh copy from its source."
|
||||||
PackageInstaller.STATUS_FAILURE_STORAGE ->
|
PackageInstaller.STATUS_FAILURE_STORAGE ->
|
||||||
"Your watch needs more free storage."
|
"Free some space on your watch, then try again."
|
||||||
else ->
|
else ->
|
||||||
"The system could not finish installing. Try again or use Google Play."
|
"Couldn’t finish installing. Try again or find the app on Google Play."
|
||||||
}
|
}
|
||||||
store.update(apk.id, InstallState.FAILED, detail)
|
store.update(apk.id, InstallState.FAILED, detail)
|
||||||
manager.cancel(NOTIFICATION)
|
manager.cancel(NOTIFICATION)
|
||||||
@@ -121,5 +87,48 @@ class InstallReceiver : BroadcastReceiver() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NOTIFICATION = 42
|
const val NOTIFICATION = 42
|
||||||
|
|
||||||
|
fun notifyApproval(context: Context) {
|
||||||
|
val apk = PackageStore(context).pending() ?: return
|
||||||
|
if (apk.state != InstallState.CONFIRM || PendingApproval.id != apk.id) return
|
||||||
|
val sessionId = apk.sessionId ?: return
|
||||||
|
val confirmation = PendingApproval.intent ?: return
|
||||||
|
val manager = context.getSystemService(NotificationManager::class.java)
|
||||||
|
manager.createNotificationChannel(
|
||||||
|
NotificationChannel(
|
||||||
|
"installation",
|
||||||
|
"App installation",
|
||||||
|
NotificationManager.IMPORTANCE_DEFAULT,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if (
|
||||||
|
Build.VERSION.SDK_INT < 33 ||
|
||||||
|
context.checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) ==
|
||||||
|
PackageManager.PERMISSION_GRANTED
|
||||||
|
) {
|
||||||
|
val open =
|
||||||
|
Intent(context, WatchActivity::class.java)
|
||||||
|
.putExtra("approval", confirmation)
|
||||||
|
.putExtra("job", apk.id)
|
||||||
|
val pending =
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
context,
|
||||||
|
sessionId,
|
||||||
|
open,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
||||||
|
)
|
||||||
|
manager.notify(
|
||||||
|
NOTIFICATION,
|
||||||
|
Notification.Builder(context, "installation")
|
||||||
|
.setSmallIcon(R.drawable.pakkit_mark)
|
||||||
|
.setColor(WatchDesign.PURPLE)
|
||||||
|
.setContentTitle("Your app is ready to install")
|
||||||
|
.setContentText("Open Pakkit to give it the go-ahead.")
|
||||||
|
.setContentIntent(pending)
|
||||||
|
.setAutoCancel(true)
|
||||||
|
.build(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicBoolean
|
|||||||
import meghdad.pakkit.apk.ApkRules
|
import meghdad.pakkit.apk.ApkRules
|
||||||
import meghdad.pakkit.apk.PackageInspector
|
import meghdad.pakkit.apk.PackageInspector
|
||||||
import meghdad.pakkit.apk.PendingApk
|
import meghdad.pakkit.apk.PendingApk
|
||||||
|
import meghdad.pakkit.apk.userMessage
|
||||||
import meghdad.pakkit.data.PackageStore
|
import meghdad.pakkit.data.PackageStore
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ class LocalHttpServer(
|
|||||||
val input = BufferedInputStream(socket.getInputStream(), 8192)
|
val input = BufferedInputStream(socket.getInputStream(), 8192)
|
||||||
val request = HttpProtocol.read(input)
|
val request = HttpProtocol.read(input)
|
||||||
check(!closed.get() && SystemClock.elapsedRealtime() < deadline) {
|
check(!closed.get() && SystemClock.elapsedRealtime() < deadline) {
|
||||||
"The receiving session ended. Start a new one."
|
"Receiving has ended. Open a fresh link from your watch."
|
||||||
}
|
}
|
||||||
if (request.headers["host"] != authority) {
|
if (request.headers["host"] != authority) {
|
||||||
response.error(403, "Open the address shown on your watch.")
|
response.error(403, "Open the address shown on your watch.")
|
||||||
@@ -118,7 +119,7 @@ class LocalHttpServer(
|
|||||||
response.json(200, status())
|
response.json(200, status())
|
||||||
request.method == "POST" && request.path == "/api/upload" -> {
|
request.method == "POST" && request.path == "/api/upload" -> {
|
||||||
if (request.headers["origin"] != "http://$authority")
|
if (request.headers["origin"] != "http://$authority")
|
||||||
response.error(403, "Use Pakkit’s local page.")
|
response.error(403, "Open the link shown on your watch to send an app.")
|
||||||
else upload(request, input, response)
|
else upload(request, input, response)
|
||||||
}
|
}
|
||||||
else -> response.error(404, "Not found")
|
else -> response.error(404, "Not found")
|
||||||
@@ -128,7 +129,7 @@ class LocalHttpServer(
|
|||||||
runCatching {
|
runCatching {
|
||||||
response.error(
|
response.error(
|
||||||
400,
|
400,
|
||||||
error.message?.take(180) ?: "Transfer interrupted. Try again.",
|
error.userMessage("Your app didn’t arrive. Choose the file and try again."),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,7 +156,7 @@ class LocalHttpServer(
|
|||||||
var partial: File? = null
|
var partial: File? = null
|
||||||
try {
|
try {
|
||||||
if (store.pending() != null) {
|
if (store.pending() != null) {
|
||||||
response.error(409, "Finish or dismiss the current app on your watch first.")
|
response.error(409, "Finish with the app on your watch before sending another.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
PackageInspector.requireSpace(length, PackageInspector.free(context))
|
PackageInspector.requireSpace(length, PackageInspector.free(context))
|
||||||
@@ -163,7 +164,7 @@ class LocalHttpServer(
|
|||||||
val file = store.file(id)
|
val file = store.file(id)
|
||||||
partial = file
|
partial = file
|
||||||
Receiving.update(owner) {
|
Receiving.update(owner) {
|
||||||
it.copy(detail = "Receiving APK…", total = length, received = 0)
|
it.copy(detail = "Your app is on its way…", total = length, received = 0)
|
||||||
}
|
}
|
||||||
val body =
|
val body =
|
||||||
UploadBody(
|
UploadBody(
|
||||||
@@ -174,7 +175,7 @@ class LocalHttpServer(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
val digest = file.outputStream().use { ApkRules.copyBounded(body, it).second }
|
val digest = file.outputStream().use { ApkRules.copyBounded(body, it).second }
|
||||||
Receiving.update(owner) { it.copy(detail = "Checking APK…") }
|
Receiving.update(owner) { it.copy(detail = "Getting your app ready…") }
|
||||||
val apk = PackageInspector.inspect(context, file, digest)
|
val apk = PackageInspector.inspect(context, file, digest)
|
||||||
PackageInspector.checkForWatch(
|
PackageInspector.checkForWatch(
|
||||||
apk,
|
apk,
|
||||||
@@ -183,7 +184,7 @@ class LocalHttpServer(
|
|||||||
PackageInspector.free(context),
|
PackageInspector.free(context),
|
||||||
)
|
)
|
||||||
check(!closed.get() && SystemClock.elapsedRealtime() < deadline) {
|
check(!closed.get() && SystemClock.elapsedRealtime() < deadline) {
|
||||||
"The receiving session ended. Try again."
|
"Receiving has ended. Open a fresh link from your watch."
|
||||||
}
|
}
|
||||||
store.stage(PendingApk(id, System.currentTimeMillis(), apk))
|
store.stage(PendingApk(id, System.currentTimeMillis(), apk))
|
||||||
partial = null
|
partial = null
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class ReceiveService : Service() {
|
|||||||
this@ReceiveService.network == network &&
|
this@ReceiveService.network == network &&
|
||||||
properties.linkAddresses.none { it.address == address }
|
properties.linkAddresses.none { it.address == address }
|
||||||
) {
|
) {
|
||||||
finish("Wi-Fi address changed. Start a new session.")
|
finish("Wi-Fi changed. Ready to reconnect?")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ class ReceiveService : Service() {
|
|||||||
override fun onLost(network: Network) {
|
override fun onLost(network: Network) {
|
||||||
main.post {
|
main.post {
|
||||||
if (network == this@ReceiveService.network)
|
if (network == this@ReceiveService.network)
|
||||||
finish("Wi-Fi disconnected. Start a new session.")
|
finish("Wi-Fi disconnected. Ready to reconnect?")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class ReceiveService : Service() {
|
|||||||
manager.createNotificationChannel(
|
manager.createNotificationChannel(
|
||||||
NotificationChannel(
|
NotificationChannel(
|
||||||
"receive",
|
"receive",
|
||||||
"Receiving sessions",
|
"App transfers",
|
||||||
NotificationManager.IMPORTANCE_LOW,
|
NotificationManager.IMPORTANCE_LOW,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -92,8 +92,8 @@ class ReceiveService : Service() {
|
|||||||
val notification =
|
val notification =
|
||||||
Notification.Builder(this, "receive")
|
Notification.Builder(this, "receive")
|
||||||
.setSmallIcon(R.drawable.pakkit_mark)
|
.setSmallIcon(R.drawable.pakkit_mark)
|
||||||
.setContentTitle("Pakkit is ready to receive")
|
.setContentTitle("Ready for your next app")
|
||||||
.setContentText("Private Wi-Fi session · ends in 10 minutes")
|
.setContentText("Open Pakkit to connect your browser.")
|
||||||
.setContentIntent(open)
|
.setContentIntent(open)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.addAction(Notification.Action.Builder(null, "End session", stop).build())
|
.addAction(Notification.Action.Builder(null, "End session", stop).build())
|
||||||
@@ -105,7 +105,7 @@ class ReceiveService : Service() {
|
|||||||
)
|
)
|
||||||
Receiving.begin(this)
|
Receiving.begin(this)
|
||||||
deadline = SystemClock.elapsedRealtime() + DURATION_MS
|
deadline = SystemClock.elapsedRealtime() + DURATION_MS
|
||||||
main.postDelayed({ finish("Session expired. Start a new session.") }, DURATION_MS)
|
main.postDelayed({ finish("Time’s up. Ready for another app?") }, DURATION_MS)
|
||||||
try {
|
try {
|
||||||
registered = true
|
registered = true
|
||||||
connectivity.requestNetwork(
|
connectivity.requestNetwork(
|
||||||
@@ -117,7 +117,7 @@ class ReceiveService : Service() {
|
|||||||
25_000,
|
25_000,
|
||||||
)
|
)
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
finish("Wi-Fi is unavailable. Check watch settings.")
|
finish("Can’t reach Wi-Fi. Check your watch’s connection.")
|
||||||
}
|
}
|
||||||
return START_NOT_STICKY
|
return START_NOT_STICKY
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ class ReceiveService : Service() {
|
|||||||
Receiving.update(this) { it.copy(url = listener.url, detail = "Ready to receive") }
|
Receiving.update(this) { it.copy(url = listener.url, detail = "Ready to receive") }
|
||||||
} catch (error: Exception) {
|
} catch (error: Exception) {
|
||||||
android.util.Log.w("PakkitReceive", "Cannot open receiving session", error)
|
android.util.Log.w("PakkitReceive", "Cannot open receiving session", error)
|
||||||
finish("Could not open local Wi-Fi. Check the network and try again.")
|
finish("Couldn’t connect. Check Wi-Fi and try again.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package meghdad.pakkit.transfer
|
package meghdad.pakkit.transfer
|
||||||
|
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
import meghdad.pakkit.apk.requireUser
|
||||||
|
|
||||||
/** Exact-length stream: truncation is an error, and extra bytes cannot become another request. */
|
/** Exact-length stream: truncation is an error, and extra bytes cannot become another request. */
|
||||||
internal class UploadBody(
|
internal class UploadBody(
|
||||||
@@ -22,7 +23,7 @@ internal class UploadBody(
|
|||||||
if (count == 0) return 0
|
if (count == 0) return 0
|
||||||
if (received == length) return -1
|
if (received == length) return -1
|
||||||
val read = input.read(bytes, offset, minOf(count.toLong(), length - received).toInt())
|
val read = input.read(bytes, offset, minOf(count.toLong(), length - received).toInt())
|
||||||
require(read > 0) { "Transfer interrupted. Choose the file again." }
|
requireUser(read > 0) { "The transfer stopped early. Choose the file and try again." }
|
||||||
received += read
|
received += read
|
||||||
val now = clock()
|
val now = clock()
|
||||||
if (now - lastUpdate >= 250_000_000 || received == length) {
|
if (now - lastUpdate >= 250_000_000 || received == length) {
|
||||||
|
|||||||
@@ -38,6 +38,15 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
private var busy = false
|
private var busy = false
|
||||||
private var error: String? = null
|
private var error: String? = null
|
||||||
private var renderedState = ""
|
private var renderedState = ""
|
||||||
|
private var showingLink = false
|
||||||
|
private var backRegistered = false
|
||||||
|
private val linkBack =
|
||||||
|
if (Build.VERSION.SDK_INT >= 33)
|
||||||
|
android.window.OnBackInvokedCallback {
|
||||||
|
showingLink = false
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
else null
|
||||||
private var qrUrl = ""
|
private var qrUrl = ""
|
||||||
private var qrBitmap: android.graphics.Bitmap? = null
|
private var qrBitmap: android.graphics.Bitmap? = null
|
||||||
|
|
||||||
@@ -46,12 +55,14 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
store = PackageStore(this)
|
store = PackageStore(this)
|
||||||
store.clean()
|
store.clean()
|
||||||
acceptIntent(intent)
|
acceptIntent(intent)
|
||||||
|
showingLink = savedInstanceState?.getBoolean("showingLink") ?: false
|
||||||
refresh()
|
refresh()
|
||||||
savedInstanceState?.getInt("scroll")?.let { y -> scroll.post { scroll.scrollTo(0, y) } }
|
savedInstanceState?.getInt("scroll")?.let { y -> scroll.post { scroll.scrollTo(0, y) } }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
outState.putInt("scroll", scroll.scrollY)
|
outState.putInt("scroll", scroll.scrollY)
|
||||||
|
outState.putBoolean("showingLink", showingLink)
|
||||||
super.onSaveInstanceState(outState)
|
super.onSaveInstanceState(outState)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +101,9 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
if (Build.VERSION.SDK_INT >= 33 && backRegistered) {
|
||||||
|
onBackInvokedDispatcher.unregisterOnBackInvokedCallback(requireNotNull(linkBack))
|
||||||
|
}
|
||||||
io.shutdown()
|
io.shutdown()
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}
|
||||||
@@ -108,6 +122,7 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
) =
|
) =
|
||||||
WatchDesign.text(this, value, size, color, bold).apply {
|
WatchDesign.text(this, value, size, color, bold).apply {
|
||||||
gravity = Gravity.CENTER
|
gravity = Gravity.CENTER
|
||||||
|
isAccessibilityHeading = bold && size >= 18f
|
||||||
breakStrategy = android.graphics.text.LineBreaker.BREAK_STRATEGY_BALANCED
|
breakStrategy = android.graphics.text.LineBreaker.BREAK_STRATEGY_BALANCED
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +165,7 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
addView(
|
addView(
|
||||||
ImageView(this@WatchActivity).apply {
|
ImageView(this@WatchActivity).apply {
|
||||||
setImageDrawable(
|
setImageDrawable(
|
||||||
GlyphDrawable(glyph, if (success) colors.mint else colors.error),
|
GlyphDrawable(glyph, if (success) colors.mint else colors.error)
|
||||||
)
|
)
|
||||||
setPadding(dp(12), dp(12), dp(12), dp(12))
|
setPadding(dp(12), dp(12), dp(12), dp(12))
|
||||||
background =
|
background =
|
||||||
@@ -183,14 +198,29 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
if (isDestroyed || isFinishing) return
|
if (isDestroyed || isFinishing) return
|
||||||
val job = store.pending()
|
val job = store.pending()
|
||||||
val live = Receiving.state
|
val live = Receiving.state
|
||||||
|
if (live.url == null || job != null || live.total > 0) showingLink = false
|
||||||
val stateKey =
|
val stateKey =
|
||||||
job?.let { "${it.id}:${it.state}" }
|
job?.let { "${it.id}:${it.state}" }
|
||||||
?: when {
|
?: when {
|
||||||
|
showingLink && live.url != null -> "link"
|
||||||
live.total > 0 -> "uploading"
|
live.total > 0 -> "uploading"
|
||||||
live.url != null -> "receiving"
|
live.url != null -> "receiving"
|
||||||
live.active -> "connecting"
|
live.active -> "connecting"
|
||||||
else -> "home"
|
else -> "home"
|
||||||
}
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= 33) {
|
||||||
|
val handleBack = showingLink && job == null && live.url != null && live.total == 0L
|
||||||
|
if (handleBack && !backRegistered) {
|
||||||
|
onBackInvokedDispatcher.registerOnBackInvokedCallback(
|
||||||
|
android.window.OnBackInvokedDispatcher.PRIORITY_DEFAULT,
|
||||||
|
requireNotNull(linkBack),
|
||||||
|
)
|
||||||
|
} else if (!handleBack && backRegistered) {
|
||||||
|
onBackInvokedDispatcher.unregisterOnBackInvokedCallback(requireNotNull(linkBack))
|
||||||
|
}
|
||||||
|
backRegistered = handleBack
|
||||||
|
}
|
||||||
|
val previousState = renderedState
|
||||||
val y = if (::scroll.isInitialized && stateKey == renderedState) scroll.scrollY else 0
|
val y = if (::scroll.isInitialized && stateKey == renderedState) scroll.scrollY else 0
|
||||||
renderedState = stateKey
|
renderedState = stateKey
|
||||||
scroll = RoundScrollView(this).apply { setBackgroundColor(colors.canvas) }
|
scroll = RoundScrollView(this).apply { setBackgroundColor(colors.canvas) }
|
||||||
@@ -215,13 +245,13 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
textSize = 12f
|
textSize = 12f
|
||||||
setTextColor(colors.secondary)
|
setTextColor(colors.secondary)
|
||||||
importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
|
importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
if (job == null) home()
|
if (job == null) home()
|
||||||
else {
|
else {
|
||||||
incoming(job)
|
incoming(job)
|
||||||
if (Receiving.state.url != null)
|
if (Receiving.state.url != null)
|
||||||
button("End Wi-Fi session", false) {
|
button(getString(R.string.watch_end_session), false) {
|
||||||
stopService(Intent(this, ReceiveService::class.java))
|
stopService(Intent(this, ReceiveService::class.java))
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
@@ -231,37 +261,56 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
scroll.isFocusableInTouchMode = true
|
scroll.isFocusableInTouchMode = true
|
||||||
setContentView(scroll)
|
setContentView(scroll)
|
||||||
scroll.requestFocus()
|
scroll.requestFocus()
|
||||||
|
if (
|
||||||
|
y == 0 &&
|
||||||
|
stateKey != previousState &&
|
||||||
|
android.animation.ValueAnimator.areAnimatorsEnabled()
|
||||||
|
) {
|
||||||
|
column.alpha = 0f
|
||||||
|
column.animate().alpha(1f).setDuration(180).start()
|
||||||
|
}
|
||||||
scroll.post { scroll.scrollTo(0, y) }
|
scroll.post { scroll.scrollTo(0, y) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun home() {
|
private fun home() {
|
||||||
val url = Receiving.state.url
|
val live = Receiving.state
|
||||||
if (url == null) {
|
val url = live.url
|
||||||
parcel(54)
|
|
||||||
add(line("Pakkit", 25f, bold = true), 4)
|
|
||||||
add(line(getString(R.string.brand_tagline), 12f, colors.secondary), 5)
|
|
||||||
}
|
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
val received = Receiving.state.received
|
if (showingLink && live.total == 0L) {
|
||||||
val total = Receiving.state.total
|
showLink(url)
|
||||||
if (total > 0) {
|
return
|
||||||
|
}
|
||||||
|
if (live.total > 0) {
|
||||||
|
parcel(48)
|
||||||
|
val percent = (live.received * 100 / live.total).coerceAtMost(100)
|
||||||
add(
|
add(
|
||||||
line(
|
line(
|
||||||
"${(received * 100 / total).coerceAtMost(100)}% received",
|
if (percent == 100L) getString(R.string.watch_just_checking)
|
||||||
21f,
|
else getString(R.string.watch_on_its_way),
|
||||||
|
22f,
|
||||||
bold = true,
|
bold = true,
|
||||||
),
|
),
|
||||||
12,
|
10,
|
||||||
)
|
)
|
||||||
|
add(line("$percent%", 30f, colors.mint, true), 10)
|
||||||
add(
|
add(
|
||||||
ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal).apply {
|
ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal).apply {
|
||||||
max = 100
|
max = 100
|
||||||
progress = (received * 100 / total).toInt()
|
progress = percent.toInt()
|
||||||
progressTintList = android.content.res.ColorStateList.valueOf(colors.mint)
|
progressTintList = android.content.res.ColorStateList.valueOf(colors.mint)
|
||||||
|
contentDescription = getString(R.string.watch_percent_received, percent)
|
||||||
},
|
},
|
||||||
12,
|
12,
|
||||||
)
|
)
|
||||||
add(line("Keep your browser open.", 12f, colors.secondary), 8)
|
add(
|
||||||
|
line(
|
||||||
|
if (percent == 100L) getString(R.string.watch_getting_your_app_ready)
|
||||||
|
else getString(R.string.watch_keep_your_browser_open),
|
||||||
|
13f,
|
||||||
|
colors.secondary,
|
||||||
|
),
|
||||||
|
10,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
if (qrUrl != url || qrBitmap == null) {
|
if (qrUrl != url || qrBitmap == null) {
|
||||||
val matrix =
|
val matrix =
|
||||||
@@ -298,109 +347,100 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
dp(
|
dp(
|
||||||
(resources.configuration.screenWidthDp * .6f)
|
(resources.configuration.screenWidthDp * .6f)
|
||||||
.roundToInt()
|
.roundToInt()
|
||||||
.coerceAtMost(138),
|
.coerceAtMost(138)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
contentDescription =
|
contentDescription = getString(R.string.scan_code_description)
|
||||||
"QR code for your private receiving link. The full link is below."
|
|
||||||
},
|
},
|
||||||
14,
|
14,
|
||||||
)
|
)
|
||||||
add(line("Scan to send", 18f, bold = true), 12)
|
add(line(getString(R.string.watch_scan_to_send), 20f, bold = true), 12)
|
||||||
badge("Private Wi-Fi session", positive = true)
|
add(line(getString(R.string.watch_scan_description), 13f, colors.secondary), 8)
|
||||||
add(
|
add(line(getString(R.string.watch_ready_for_10_minutes), 12f, colors.mint), 10)
|
||||||
line(
|
button(getString(R.string.watch_view_link), false) {
|
||||||
"Use the same Wi-Fi. Session ends automatically in 10 minutes.",
|
showingLink = true
|
||||||
12f,
|
refresh()
|
||||||
colors.secondary,
|
|
||||||
),
|
|
||||||
8,
|
|
||||||
)
|
|
||||||
add(
|
|
||||||
line(url, 11f, colors.mint).apply {
|
|
||||||
textDirection = View.TEXT_DIRECTION_LTR
|
|
||||||
setTextIsSelectable(true)
|
|
||||||
},
|
|
||||||
14,
|
|
||||||
)
|
|
||||||
add(
|
|
||||||
line(
|
|
||||||
"Local HTTP · use a trusted network. Anyone with this link can send a file; only you can approve installation.",
|
|
||||||
11f,
|
|
||||||
colors.secondary,
|
|
||||||
),
|
|
||||||
12,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
button("End session", false) {
|
}
|
||||||
|
button(getString(R.string.watch_end_session), false) {
|
||||||
stopService(Intent(this, ReceiveService::class.java))
|
stopService(Intent(this, ReceiveService::class.java))
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!packageManager.canRequestPackageInstalls()) {
|
|
||||||
badge("Allow installation")
|
|
||||||
add(
|
add(
|
||||||
line(
|
LinearLayout(this).apply {
|
||||||
"Pakkit needs your permission to request installs. You approve every app on your watch.",
|
gravity = Gravity.CENTER
|
||||||
13f,
|
addView(
|
||||||
colors.secondary,
|
ImageView(this@WatchActivity).apply {
|
||||||
),
|
setImageResource(R.drawable.pakkit_icon)
|
||||||
|
importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
|
||||||
|
},
|
||||||
|
LinearLayout.LayoutParams(dp(30), dp(30)),
|
||||||
|
)
|
||||||
|
addView(
|
||||||
|
line(getString(R.string.pakkit_name), 22f, bold = true),
|
||||||
|
LinearLayout.LayoutParams(-2, -2).apply { leftMargin = dp(6) },
|
||||||
|
)
|
||||||
|
},
|
||||||
12,
|
12,
|
||||||
)
|
)
|
||||||
button("Allow installs") { settings() }
|
if (live.active) {
|
||||||
add(
|
badge(getString(R.string.watch_finding_wi_fi))
|
||||||
line(
|
add(line(getString(R.string.watch_connecting_description), 13f, colors.secondary), 12)
|
||||||
"If your watch does not offer this permission, use Google Play. Pakkit cannot bypass its security settings.",
|
button(getString(R.string.watch_cancel), false) {
|
||||||
12f,
|
stopService(Intent(this, ReceiveService::class.java))
|
||||||
colors.secondary,
|
}
|
||||||
),
|
|
||||||
12,
|
|
||||||
)
|
|
||||||
button("Open Google Play", false) { play() }
|
|
||||||
} else {
|
} else {
|
||||||
badge("Any device. Any browser.", positive = true)
|
button(getString(R.string.watch_start_receiving)) {
|
||||||
add(
|
|
||||||
line(
|
|
||||||
"Choose an APK in your browser. Review it here before installing.",
|
|
||||||
14f,
|
|
||||||
colors.secondary,
|
|
||||||
),
|
|
||||||
12,
|
|
||||||
)
|
|
||||||
if (!Receiving.state.active)
|
|
||||||
button("Start receiving") {
|
|
||||||
error = null
|
error = null
|
||||||
runCatching { startForegroundService(Intent(this, ReceiveService::class.java)) }
|
runCatching { startForegroundService(Intent(this, ReceiveService::class.java)) }
|
||||||
.onFailure {
|
.onFailure {
|
||||||
error = "Could not start receiving. Check Wi-Fi and try again."
|
error = getString(R.string.watch_connection_error)
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add(line(Receiving.state.detail, 12f, colors.secondary), 12)
|
add(line(getString(R.string.brand_tagline), 12f, colors.accent), 14)
|
||||||
if (Receiving.state.active)
|
if (live.detail != Receiving.State().detail)
|
||||||
button("Cancel session", false) {
|
add(line(live.detail, 13f, colors.secondary), 12)
|
||||||
stopService(Intent(this, ReceiveService::class.java))
|
button(getString(R.string.watch_wi_fi), false) {
|
||||||
}
|
|
||||||
button("Wi-Fi settings", false) {
|
|
||||||
runCatching {
|
runCatching {
|
||||||
startActivity(Intent(android.provider.Settings.ACTION_WIFI_SETTINGS))
|
startActivity(Intent(android.provider.Settings.ACTION_WIFI_SETTINGS))
|
||||||
}
|
}
|
||||||
.onFailure {
|
.onFailure {
|
||||||
error = "Open Wi-Fi from your watch’s Settings app."
|
error = getString(R.string.watch_wifi_unavailable)
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
}
|
||||||
Build.VERSION.SDK_INT >= 33 &&
|
|
||||||
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) !=
|
private fun showLink(url: String) {
|
||||||
PackageManager.PERMISSION_GRANTED
|
add(line(getString(R.string.watch_your_watch_link), 20f, bold = true), 14)
|
||||||
) {
|
add(line(getString(R.string.watch_link_description), 13f, colors.secondary), 12)
|
||||||
button("Enable session alerts", false) {
|
add(
|
||||||
requestPermissions(arrayOf(Manifest.permission.POST_NOTIFICATIONS), 52)
|
line(url, 12f, colors.mint).apply {
|
||||||
|
textDirection = View.TEXT_DIRECTION_LTR
|
||||||
|
setTextIsSelectable(true)
|
||||||
|
},
|
||||||
|
14,
|
||||||
|
)
|
||||||
|
add(line(getString(R.string.watch_connection_privacy), 12f, colors.secondary), 14)
|
||||||
|
button(getString(R.string.watch_back_to_code), false) {
|
||||||
|
showingLink = false
|
||||||
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Android 12 uses this callback; Android 13+ registers the platform callback above.
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
@android.annotation.SuppressLint("GestureBackNavigation")
|
||||||
|
@Deprecated("Legacy callback for Android 12")
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (showingLink) {
|
||||||
|
showingLink = false
|
||||||
|
refresh()
|
||||||
|
} else super.onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun incoming(job: PendingApk) {
|
private fun incoming(job: PendingApk) {
|
||||||
@@ -409,100 +449,124 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
when (state) {
|
when (state) {
|
||||||
InstallState.INSTALLED -> statusIcon(Glyph.CHECK, success = true)
|
InstallState.INSTALLED -> statusIcon(Glyph.CHECK, success = true)
|
||||||
InstallState.FAILED -> statusIcon(Glyph.ALERT, success = false)
|
InstallState.FAILED -> statusIcon(Glyph.ALERT, success = false)
|
||||||
else -> parcel(42)
|
else -> parcel(32)
|
||||||
}
|
}
|
||||||
when (state) {
|
when (state) {
|
||||||
InstallState.INSTALLED -> {
|
InstallState.INSTALLED -> {
|
||||||
add(line("All yours.", 25f, bold = true), 5)
|
add(line(getString(R.string.watch_all_yours), 22f, bold = true), 5)
|
||||||
add(line(apk.label, 17f, bold = true), 10)
|
add(line(apk.label, 16f, bold = true), 10)
|
||||||
}
|
}
|
||||||
InstallState.FAILED -> {
|
InstallState.FAILED -> {
|
||||||
add(line("A small detour.", 22f, bold = true), 5)
|
add(line(getString(R.string.watch_couldn_t_install), 22f, bold = true), 5)
|
||||||
add(line(apk.label, 16f), 10)
|
add(line(apk.label, 16f), 10)
|
||||||
}
|
}
|
||||||
else -> add(line(apk.label, 21f, bold = true), 5)
|
else -> add(line(apk.label, 20f, bold = true), 5)
|
||||||
}
|
}
|
||||||
add(
|
add(
|
||||||
line(
|
line(
|
||||||
"${apk.version} · ${"%.1f".format(apk.bytes / 1048576.0)} MiB",
|
getString(
|
||||||
|
R.string.watch_app_summary,
|
||||||
|
apk.version,
|
||||||
|
"%.1f".format(apk.bytes / 1048576.0),
|
||||||
|
),
|
||||||
12f,
|
12f,
|
||||||
colors.secondary,
|
colors.secondary,
|
||||||
),
|
),
|
||||||
7,
|
7,
|
||||||
)
|
)
|
||||||
if (busy) add(line("Preparing installer…", 13f, colors.secondary), 12)
|
if (busy) add(line(getString(R.string.watch_getting_ready), 13f, colors.secondary), 12)
|
||||||
else if (state == InstallState.READY) badge("Ready to install", positive = true)
|
else if (state == InstallState.READY)
|
||||||
else add(line(job.detail, 13f, colors.secondary), 12)
|
badge(getString(R.string.watch_ready_to_install), positive = true)
|
||||||
|
else if (state != InstallState.INSTALLED) add(line(job.detail, 13f, colors.secondary), 12)
|
||||||
when (state) {
|
when (state) {
|
||||||
InstallState.READY,
|
InstallState.READY,
|
||||||
InstallState.FAILED -> {
|
InstallState.FAILED -> {
|
||||||
if (!ApkRules.fresh(job.created, System.currentTimeMillis())) {
|
if (!ApkRules.fresh(job.created, System.currentTimeMillis())) {
|
||||||
add(
|
add(
|
||||||
line(
|
line(
|
||||||
"This APK expired. Upload it again from your browser.",
|
getString(R.string.watch_file_expired),
|
||||||
13f,
|
13f,
|
||||||
colors.error,
|
colors.error,
|
||||||
),
|
),
|
||||||
12,
|
12,
|
||||||
)
|
)
|
||||||
} else if (store.file(job.id).exists()) {
|
} else if (store.file(job.id).exists()) {
|
||||||
add(line(apk.packageName, 12f, colors.secondary), 12)
|
|
||||||
if (!apk.wear)
|
if (!apk.wear)
|
||||||
add(
|
add(
|
||||||
line(
|
line(
|
||||||
"Watch support is unverified. The layout may not fit.",
|
getString(R.string.watch_fit_notice),
|
||||||
12f,
|
12f,
|
||||||
colors.error,
|
colors.error,
|
||||||
),
|
),
|
||||||
10,
|
10,
|
||||||
)
|
)
|
||||||
add(line("Only install apps you trust.", 13f, colors.secondary), 10)
|
|
||||||
if (packageManager.canRequestPackageInstalls())
|
if (packageManager.canRequestPackageInstalls())
|
||||||
button(
|
button(
|
||||||
if (state == InstallState.FAILED) "Try installation" else "Install",
|
if (state == InstallState.FAILED) getString(R.string.watch_try_again)
|
||||||
|
else getString(R.string.watch_install)
|
||||||
) {
|
) {
|
||||||
install(job)
|
install(job)
|
||||||
}
|
}
|
||||||
else button("Allow installs") { settings() }
|
else {
|
||||||
|
add(
|
||||||
|
line(
|
||||||
|
getString(R.string.watch_permission_description),
|
||||||
|
13f,
|
||||||
|
colors.secondary,
|
||||||
|
),
|
||||||
|
10,
|
||||||
|
)
|
||||||
|
button(getString(R.string.watch_allow_installs)) { settings() }
|
||||||
|
button(getString(R.string.watch_google_play), false) { play() }
|
||||||
}
|
}
|
||||||
button("Dismiss", false) { dismiss(job) }
|
}
|
||||||
|
add(line(getString(R.string.watch_trust_notice), 12f, colors.secondary), 10)
|
||||||
|
button(getString(R.string.watch_remove_file), false) { dismiss(job) }
|
||||||
}
|
}
|
||||||
InstallState.CONFIRM -> {
|
InstallState.CONFIRM -> {
|
||||||
if (PendingApproval.intent != null && PendingApproval.id == job.id)
|
if (PendingApproval.intent != null && PendingApproval.id == job.id)
|
||||||
button("Continue") {
|
button(getString(R.string.watch_continue)) {
|
||||||
val confirm = PendingApproval.intent ?: return@button
|
val confirm = PendingApproval.intent ?: return@button
|
||||||
runCatching { startActivity(confirm) }
|
runCatching { startActivity(confirm) }
|
||||||
.onFailure {
|
.onFailure {
|
||||||
error =
|
error = getString(R.string.watch_approval_error)
|
||||||
"The system approval screen could not open. Try the installation again."
|
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
add(
|
add(
|
||||||
line(
|
line(
|
||||||
"Open the approval notification, or retry if interrupted.",
|
getString(R.string.watch_approval_recovery),
|
||||||
12f,
|
12f,
|
||||||
colors.secondary,
|
colors.secondary,
|
||||||
),
|
),
|
||||||
10,
|
10,
|
||||||
)
|
)
|
||||||
button("Retry approval", false) { install(job) }
|
button(getString(R.string.watch_try_again), false) { install(job) }
|
||||||
|
if (
|
||||||
|
Build.VERSION.SDK_INT >= 33 &&
|
||||||
|
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) !=
|
||||||
|
PackageManager.PERMISSION_GRANTED
|
||||||
|
) {
|
||||||
|
button(getString(R.string.watch_enable_alerts), false) {
|
||||||
|
requestPermissions(arrayOf(Manifest.permission.POST_NOTIFICATIONS), 52)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
InstallState.INSTALLING -> {
|
InstallState.INSTALLING -> {
|
||||||
add(
|
add(
|
||||||
line(
|
line(
|
||||||
"Follow the system approval. If interrupted, you can retry.",
|
getString(R.string.watch_installing_description),
|
||||||
12f,
|
12f,
|
||||||
colors.secondary,
|
colors.secondary,
|
||||||
),
|
),
|
||||||
10,
|
10,
|
||||||
)
|
)
|
||||||
button("Retry installation", false) { install(job) }
|
button(getString(R.string.watch_try_again), false) { install(job) }
|
||||||
}
|
}
|
||||||
InstallState.INSTALLED -> {
|
InstallState.INSTALLED -> {
|
||||||
button("Open app") { launch(apk.packageName) }
|
button(getString(R.string.watch_open_app)) { launch(apk.packageName) }
|
||||||
button("Done", false) {
|
button(getString(R.string.watch_done), false) {
|
||||||
store.dismiss(job.id)
|
store.dismiss(job.id)
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
@@ -510,11 +574,22 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onRequestPermissionsResult(
|
||||||
|
requestCode: Int,
|
||||||
|
permissions: Array<out String>,
|
||||||
|
grantResults: IntArray,
|
||||||
|
) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||||
|
if (requestCode == 52) {
|
||||||
|
meghdad.pakkit.install.InstallReceiver.notifyApproval(this)
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun settings() {
|
private fun settings() {
|
||||||
runCatching { startActivity(ApkInstaller.settings(this)) }
|
runCatching { startActivity(ApkInstaller.settings(this)) }
|
||||||
.onFailure {
|
.onFailure {
|
||||||
error =
|
error = getString(R.string.watch_permission_unavailable)
|
||||||
"This watch does not offer that setting. Install compatible apps through Google Play."
|
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -551,11 +626,11 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
.sendIntent(this, 0, null, null, null)
|
.sendIntent(this, 0, null, null, null)
|
||||||
else
|
else
|
||||||
startActivity(
|
startActivity(
|
||||||
packageManager.getLaunchIntentForPackage(packageName) ?: error("No launcher"),
|
packageManager.getLaunchIntentForPackage(packageName) ?: error("No launcher")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.onFailure {
|
.onFailure {
|
||||||
error = "This app has no available watch launcher. Look in your watch’s app list."
|
error = getString(R.string.watch_launch_unavailable)
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -563,11 +638,11 @@ class WatchActivity : Activity(), SharedPreferences.OnSharedPreferenceChangeList
|
|||||||
private fun play() {
|
private fun play() {
|
||||||
runCatching {
|
runCatching {
|
||||||
startActivity(
|
startActivity(
|
||||||
Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=wear%20os&c=apps")),
|
Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=wear%20os&c=apps"))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.onFailure {
|
.onFailure {
|
||||||
error = "Open Google Play from your watch’s app list."
|
error = getString(R.string.watch_play_unavailable)
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,20 +74,20 @@ object WatchDesign {
|
|||||||
ColorStateList(
|
ColorStateList(
|
||||||
arrayOf(intArrayOf(-android.R.attr.state_enabled), intArrayOf()),
|
arrayOf(intArrayOf(-android.R.attr.state_enabled), intArrayOf()),
|
||||||
intArrayOf(p.secondary, if (primary) Color.WHITE else p.text),
|
intArrayOf(p.secondary, if (primary) Color.WHITE else p.text),
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
val fill =
|
val fill =
|
||||||
if (primary)
|
if (primary)
|
||||||
gradient(
|
gradient(
|
||||||
intArrayOf(0xFF7854EE.toInt(), 0xFF6038D6.toInt()),
|
intArrayOf(0xFF7854EE.toInt(), 0xFF6038D6.toInt()),
|
||||||
dp(c, 20).toFloat(),
|
dp(c, 24).toFloat(),
|
||||||
)
|
)
|
||||||
else shape(p.raised, dp(c, 20).toFloat(), p.border)
|
else shape(p.raised, dp(c, 24).toFloat(), p.border)
|
||||||
val states =
|
val states =
|
||||||
android.graphics.drawable.StateListDrawable().apply {
|
android.graphics.drawable.StateListDrawable().apply {
|
||||||
addState(
|
addState(
|
||||||
intArrayOf(-android.R.attr.state_enabled),
|
intArrayOf(-android.R.attr.state_enabled),
|
||||||
shape(p.raised, dp(c, 20).toFloat(), p.border),
|
shape(p.raised, dp(c, 24).toFloat(), p.border),
|
||||||
)
|
)
|
||||||
addState(intArrayOf(), fill)
|
addState(intArrayOf(), fill)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="pakkit_name">Pakkit</string>
|
<string name="pakkit_name">Pakkit</string>
|
||||||
<string name="brand_tagline">Pocket to Wrist.</string>
|
<string name="brand_tagline">Pack it. Send it. Wear it.</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="watch_end_session">End session</string>
|
||||||
|
<string name="watch_just_checking">Just checking…</string>
|
||||||
|
<string name="watch_on_its_way">On its way</string>
|
||||||
|
<string name="watch_getting_your_app_ready">Getting your app ready.</string>
|
||||||
|
<string name="watch_keep_your_browser_open">Keep your browser open.</string>
|
||||||
|
<string name="watch_scan_to_send">Scan to send</string>
|
||||||
|
<string name="watch_scan_description">Both devices on the same Wi-Fi.</string>
|
||||||
|
<string name="watch_ready_for_10_minutes">Ready for 10 minutes</string>
|
||||||
|
<string name="watch_view_link">View link</string>
|
||||||
|
<string name="watch_finding_wi_fi">Finding Wi-Fi</string>
|
||||||
|
<string name="watch_connecting_description">Getting ready for your next app.</string>
|
||||||
|
<string name="watch_cancel">Cancel</string>
|
||||||
|
<string name="watch_start_receiving">Start receiving</string>
|
||||||
|
<string name="watch_connection_error">Couldn’t connect. Check Wi-Fi and try again.</string>
|
||||||
|
<string name="watch_wi_fi">Wi-Fi</string>
|
||||||
|
<string name="watch_wifi_unavailable">Open Wi-Fi in your watch’s Settings.</string>
|
||||||
|
<string name="watch_your_watch_link">Your watch link</string>
|
||||||
|
<string name="watch_link_description">Open this link on a device using the same Wi-Fi.</string>
|
||||||
|
<string name="watch_connection_privacy">Use Wi-Fi you trust. Transfers aren’t encrypted. Keep this link private.</string>
|
||||||
|
<string name="watch_back_to_code">Back to code</string>
|
||||||
|
<string name="watch_all_yours">All yours.</string>
|
||||||
|
<string name="watch_couldn_t_install">Couldn’t install</string>
|
||||||
|
<string name="watch_getting_ready">Getting ready…</string>
|
||||||
|
<string name="watch_ready_to_install">Ready to install</string>
|
||||||
|
<string name="watch_file_expired">This file has expired. Send it again to install.</string>
|
||||||
|
<string name="watch_fit_notice">Made for a phone? It may not fit your watch.</string>
|
||||||
|
<string name="watch_trust_notice">Only install apps you trust.</string>
|
||||||
|
<string name="watch_try_again">Try again</string>
|
||||||
|
<string name="watch_install">Install</string>
|
||||||
|
<string name="watch_permission_description">Allow Pakkit to install apps. You’ll approve each one.</string>
|
||||||
|
<string name="watch_allow_installs">Allow installs</string>
|
||||||
|
<string name="watch_google_play">Google Play</string>
|
||||||
|
<string name="watch_remove_file">Remove file</string>
|
||||||
|
<string name="watch_enable_alerts">Enable alerts</string>
|
||||||
|
<string name="watch_continue">Continue</string>
|
||||||
|
<string name="watch_approval_error">Couldn’t open approval. Try again.</string>
|
||||||
|
<string name="watch_approval_recovery">Approval was interrupted. Try again to continue.</string>
|
||||||
|
<string name="watch_installing_description">Your watch will ask you to approve installation.</string>
|
||||||
|
<string name="watch_open_app">Open app</string>
|
||||||
|
<string name="watch_done">Done</string>
|
||||||
|
<string name="watch_permission_unavailable">Your watch doesn’t offer this setting. Find apps on Google Play instead.</string>
|
||||||
|
<string name="watch_launch_unavailable">This app can’t be opened here. Check your watch’s app list.</string>
|
||||||
|
<string name="watch_play_unavailable">Find Google Play in your watch’s app list.</string>
|
||||||
|
<string name="scan_code_description">QR code to connect your browser. Use View link for the full address.</string>
|
||||||
|
<string name="watch_percent_received">%1$d%% received</string>
|
||||||
|
<string name="watch_app_summary">%1$s · %2$s MB</string>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package meghdad.pakkit.apk
|
||||||
|
|
||||||
|
import org.junit.Assert.*
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class UserMessageTest {
|
||||||
|
@Test
|
||||||
|
fun hidesUnexpectedPlatformAndFileErrors() {
|
||||||
|
for (error in
|
||||||
|
listOf(
|
||||||
|
java.io.IOException("/data/private/file.apk"),
|
||||||
|
IllegalArgumentException("Invalid request headers"),
|
||||||
|
SecurityException("Permission denial"),
|
||||||
|
)) {
|
||||||
|
assertEquals("Try again.", error.userMessage("Try again."))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun retainsDeliberateRecoveryCopy() {
|
||||||
|
val error = runCatching { requireUser(false) { "Choose another APK." } }.exceptionOrNull()!!
|
||||||
|
assertEquals("Choose another APK.", error.userMessage("Try again."))
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
-4
@@ -1,6 +1,6 @@
|
|||||||
# Pakkit design
|
# 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.
|
**Pakkit — Pack it. Send it. Wear it.** This is the official brand tagline. 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
|
## Implemented assets
|
||||||
|
|
||||||
@@ -13,14 +13,31 @@
|
|||||||
|
|
||||||
## Themes and layout
|
## 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 native watch UI uses midnight `#090B17` 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 connection disclosure are available through **View link**, with native back navigation. The home screen pairs a compact parcel/wordmark with a visible receiving action. Source permission is requested at the app review, where its purpose is clear.
|
||||||
|
|
||||||
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.
|
The browser leads with the official tagline, original parcel artwork and a compact Choose / Send / Wear indicator. Mobile layouts omit the redundant journey explainer. It 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
|
## 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.
|
The watch has static decorative artwork and a finite 180 ms screen entrance when system animation is enabled. Progress updates do not restart it. 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.
|
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.
|
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.
|
||||||
|
|
||||||
|
## Product voice
|
||||||
|
|
||||||
|
Write for the person wearing the watch: short, warm, specific and calm. Let the parcel, color and interactions carry the playfulness. Use APK when a file type matters; use app in actions and outcomes. Never introduce architectural history, development setup or platform API names into the product interface. Keep necessary connection privacy information accessible in context rather than repeating warnings throughout the journey.
|
||||||
|
|
||||||
|
| Moment | Watch | Browser |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Start | Pakkit + official tagline; Start receiving | Official tagline; Choose app |
|
||||||
|
| Connect | Scan to send; View link | Connected to your watch |
|
||||||
|
| Transfer | On its way + actual percentage | On its way + actual percentage |
|
||||||
|
| Check | Just checking… | Just checking… |
|
||||||
|
| Review | Ready to install; Install or contextual Allow installs | Made it to your watch |
|
||||||
|
| Approval | Continue, with recovery action | One tap closer |
|
||||||
|
| Success | All yours.; Open app | Looks good on you. |
|
||||||
|
| Failure | Couldn’t install + specific recovery | Let’s try that again + specific recovery |
|
||||||
|
|
||||||
|
Watch screen copy lives in Android string resources. Deliberately written package-validation messages are marked with `UserMessage`; unknown file/platform exceptions are replaced with recovery copy at the UI boundary, while installer diagnostics stay in logs. Notification copy follows the same voice. The app name and official tagline are shared branding resources. Browser result changes are announced with a live region, and color is never the only state indicator.
|
||||||
+1
-1
@@ -20,7 +20,7 @@ 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.
|
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.
|
For install tests, first send an APK to Pakkit on the emulator and use **Allow installs** on its review screen, or open Android Settings → Apps → Special app access → Install unknown apps → Pakkit. 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.
|
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.
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -21,18 +21,18 @@ Browser UI fixtures exercise interactions independently; the separate Android Em
|
|||||||
|
|
||||||
## Latest completed run
|
## Latest completed run
|
||||||
|
|
||||||
Refactoring validation date: October 15, 2026. No physical device was accessed.
|
Product experience validation date: October 15, 2026. No physical device was accessed.
|
||||||
|
|
||||||
- **19 JVM tests passed**, with zero failures/errors.
|
- **21 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.
|
- **17 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.
|
- **Five round UI tests passed again** at 192 dp / 1.3x text: the initial receiving action stays visible, review/approval/error/success controls are reachable, connection details and transfer feedback work, and a decodable QR 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.
|
- **16 browser UI checks passed** on Chromium 140.0.7339.16 across four viewport widths and both themes, including connection recovery, keyboard focus, reduced motion and 200% zoom at an effective 320 px layout width, 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.
|
- **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.
|
- **Debug, test and release 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.
|
- 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.
|
- 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.
|
||||||
|
|
||||||
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.
|
Ten watch product-state screenshots at each tested size, browser screenshots, detailed XML, text logs 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.
|
||||||
|
|
||||||
## Hardware-specific release matrix
|
## Hardware-specific release matrix
|
||||||
|
|
||||||
|
|||||||
@@ -61,11 +61,13 @@ def tap_text(serial, label, attempts=6):
|
|||||||
|
|
||||||
|
|
||||||
def session_url(serial):
|
def session_url(serial):
|
||||||
|
tap_text(serial, "View link")
|
||||||
for _ in range(6):
|
for _ in range(6):
|
||||||
tree = ui(serial)
|
tree = ui(serial)
|
||||||
for node in tree.iter("node"):
|
for node in tree.iter("node"):
|
||||||
value = node.get("text", "")
|
value = node.get("text", "")
|
||||||
if value.startswith("http://") and "#" in value:
|
if value.startswith("http://") and "#" in value:
|
||||||
|
tap_text(serial, "Back to code")
|
||||||
return value
|
return value
|
||||||
bounds = next(tree.iter("node")).get("bounds")
|
bounds = next(tree.iter("node")).get("bounds")
|
||||||
_, _, width, height = map(int, re.findall(r"\d+", bounds))
|
_, _, width, height = map(int, re.findall(r"\d+", bounds))
|
||||||
|
|||||||
@@ -44,11 +44,17 @@ try:
|
|||||||
adb(args.watch, "shell", "wm", "size", "384x384")
|
adb(args.watch, "shell", "wm", "size", "384x384")
|
||||||
adb(args.watch, "shell", "wm", "density", "320")
|
adb(args.watch, "shell", "wm", "density", "320")
|
||||||
adb(args.watch, "shell", "settings", "put", "system", "font_scale", "1.3")
|
adb(args.watch, "shell", "settings", "put", "system", "font_scale", "1.3")
|
||||||
test_args = ["-e", "class", "meghdad.pakkit.WatchReviewTest,meghdad.pakkit.WatchSessionTest"]
|
test_args = ["-e", "class", "meghdad.pakkit.WatchReviewTest,meghdad.pakkit.WatchSessionTest,meghdad.pakkit.WatchExperienceTest"]
|
||||||
output = adb(args.watch, "shell", "am", "instrument", "-w", "-r", *test_args,
|
output = adb(args.watch, "shell", "am", "instrument", "-w", "-r", *test_args,
|
||||||
"meghdad.pakkit.test/androidx.test.runner.AndroidJUnitRunner").decode()
|
"meghdad.pakkit.test/androidx.test.runner.AndroidJUnitRunner").decode()
|
||||||
(report_dir / ("watch-small.txt" if args.small else "watch.txt")).write_text(output)
|
(report_dir / ("watch-small.txt" if args.small else "watch.txt")).write_text(output)
|
||||||
print(output, flush=True)
|
print(output, flush=True)
|
||||||
|
screenshots = report_dir / ("watch-product-small" if args.small else "watch-product")
|
||||||
|
screenshots.mkdir(exist_ok=True)
|
||||||
|
for name in ["home", "scan", "link", "sending", "checking", "ready", "installing", "confirm", "failed", "installed"]:
|
||||||
|
image = adb(args.watch, "exec-out", "cat", f"/sdcard/Android/data/meghdad.pakkit/files/product-review/{name}.png")
|
||||||
|
(screenshots / f"{name}.png").write_bytes(image)
|
||||||
|
|
||||||
if re.search(r"INSTRUMENTATION_STATUS_CODE: -[34]", output):
|
if re.search(r"INSTRUMENTATION_STATUS_CODE: -[34]", output):
|
||||||
raise RuntimeError("Tests skipped: allow Pakkit as an install source through the emulator’s system UI, then rerun.")
|
raise RuntimeError("Tests skipped: allow Pakkit as an install source through the emulator’s system UI, then rerun.")
|
||||||
if not re.search(r"OK \(\d+ tests?\)", output) or "FAILURES" in output:
|
if not re.search(r"OK \(\d+ tests?\)", output) or "FAILURES" in output:
|
||||||
@@ -74,7 +80,7 @@ if args.browser:
|
|||||||
env = dict(os.environ, PAKKIT_SESSION_URL=url, PAKKIT_CDP_URL=f"http://127.0.0.1:{endpoint}")
|
env = dict(os.environ, PAKKIT_SESSION_URL=url, PAKKIT_CDP_URL=f"http://127.0.0.1:{endpoint}")
|
||||||
subprocess.run(["node", str(ROOT / "web-tests/emulator.test.cjs")], cwd=ROOT, env=env, check=True)
|
subprocess.run(["node", str(ROOT / "web-tests/emulator.test.cjs")], cwd=ROOT, env=env, check=True)
|
||||||
adb(args.watch, "shell", "am", "start", "-W", "-n", "meghdad.pakkit/.ui.WatchActivity")
|
adb(args.watch, "shell", "am", "start", "-W", "-n", "meghdad.pakkit/.ui.WatchActivity")
|
||||||
tap_text(args.watch, "Dismiss")
|
tap_text(args.watch, "Remove file")
|
||||||
tap_text(args.watch, "End session")
|
tap_text(args.watch, "End session")
|
||||||
finally:
|
finally:
|
||||||
adb(args.browser, "forward", "--remove", f"tcp:{endpoint}")
|
adb(args.browser, "forward", "--remove", f"tcp:{endpoint}")
|
||||||
|
|||||||
+53
-14
@@ -10,7 +10,8 @@ const reports = path.resolve(__dirname, '../app/build/reports/validation');
|
|||||||
let state = 'waiting',
|
let state = 'waiting',
|
||||||
failure = false,
|
failure = false,
|
||||||
hold = false,
|
hold = false,
|
||||||
bytesReceived = 0;
|
bytesReceived = 0,
|
||||||
|
disconnected = false;
|
||||||
const server = http.createServer(async (request, response) => {
|
const server = http.createServer(async (request, response) => {
|
||||||
response.setHeader('Cache-Control', 'no-store');
|
response.setHeader('Cache-Control', 'no-store');
|
||||||
const routes = {
|
const routes = {
|
||||||
@@ -28,6 +29,10 @@ const server = http.createServer(async (request, response) => {
|
|||||||
if (request.headers.authorization !== 'Bearer test-key') {
|
if (request.headers.authorization !== 'Bearer test-key') {
|
||||||
response.writeHead(403).end('{}');
|
response.writeHead(403).end('{}');
|
||||||
} else if (request.url === '/api/status') {
|
} else if (request.url === '/api/status') {
|
||||||
|
if (disconnected) {
|
||||||
|
response.writeHead(503).end('{}');
|
||||||
|
return;
|
||||||
|
}
|
||||||
response.end(
|
response.end(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
state,
|
state,
|
||||||
@@ -37,7 +42,7 @@ const server = http.createServer(async (request, response) => {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} else if (request.url === '/api/upload') {
|
} else if (request.url === '/api/upload') {
|
||||||
bytesReceived = 0;
|
((bytesReceived = 0), (disconnected = false));
|
||||||
for await (const chunk of request) bytesReceived += chunk.length;
|
for await (const chunk of request) bytesReceived += chunk.length;
|
||||||
if (hold) return; // Cancellation while awaiting a response.
|
if (hold) return; // Cancellation while awaiting a response.
|
||||||
if (failure)
|
if (failure)
|
||||||
@@ -102,10 +107,7 @@ const server = http.createServer(async (request, response) => {
|
|||||||
mimeType: 'text/plain',
|
mimeType: 'text/plain',
|
||||||
buffer: Buffer.from('test'),
|
buffer: Buffer.from('test'),
|
||||||
});
|
});
|
||||||
await page
|
await page.locator('#message').getByText('Choose a single APK', { exact: false }).waitFor();
|
||||||
.getByRole('status')
|
|
||||||
.getByText('Choose a complete .apk file', { exact: false })
|
|
||||||
.waitFor();
|
|
||||||
checks++;
|
checks++;
|
||||||
const file = {
|
const file = {
|
||||||
name: 'test.apk',
|
name: 'test.apk',
|
||||||
@@ -114,30 +116,67 @@ const server = http.createServer(async (request, response) => {
|
|||||||
};
|
};
|
||||||
await page.locator('#file').setInputFiles(file);
|
await page.locator('#file').setInputFiles(file);
|
||||||
failure = true;
|
failure = true;
|
||||||
await page.getByRole('button', { name: 'Send to my watch' }).click();
|
await page.getByRole('button', { name: 'Send to watch' }).click();
|
||||||
await page
|
await page
|
||||||
.getByRole('status')
|
.locator('#message')
|
||||||
.getByText('This APK is not compatible with your watch.')
|
.getByText('This APK is not compatible with your watch.')
|
||||||
.waitFor();
|
.waitFor();
|
||||||
checks++;
|
checks++;
|
||||||
failure = false;
|
failure = false;
|
||||||
await page.getByRole('button', { name: 'Send to my watch' }).click();
|
await page.getByRole('button', { name: 'Send to watch' }).click();
|
||||||
await page.getByRole('heading', { name: 'Over to your wrist.' }).waitFor();
|
await page.getByRole('heading', { name: 'Made it to your watch' }).waitFor();
|
||||||
assert.equal(bytesReceived, file.buffer.length);
|
assert.equal(bytesReceived, file.buffer.length);
|
||||||
state = 'confirm';
|
state = 'confirm';
|
||||||
await page.getByRole('heading', { name: 'Your watch. Your call.' }).waitFor();
|
await page.getByRole('heading', { name: 'One tap closer' }).waitFor();
|
||||||
|
state = 'installing';
|
||||||
|
await page.getByRole('heading', { name: 'Getting ready', exact: true }).waitFor();
|
||||||
|
state = 'failed';
|
||||||
|
await page.getByRole('heading', { name: 'Let’s try that again' }).waitFor();
|
||||||
|
assert.equal(await page.locator('#result').getAttribute('data-state'), 'failed');
|
||||||
|
checks++;
|
||||||
state = 'installed';
|
state = 'installed';
|
||||||
await page.getByRole('heading', { name: 'Looks good on you.' }).waitFor();
|
await page.getByRole('heading', { name: 'Looks good on you.' }).waitFor();
|
||||||
state = 'waiting';
|
state = 'waiting';
|
||||||
await page.getByRole('button', { name: 'Choose another APK' }).click();
|
await page.getByRole('button', { name: 'Send another app' }).click();
|
||||||
checks++;
|
checks++;
|
||||||
await page.locator('#file').setInputFiles(file);
|
await page.locator('#file').setInputFiles(file);
|
||||||
hold = true;
|
hold = true;
|
||||||
await page.getByRole('button', { name: 'Send to my watch' }).click();
|
await page.getByRole('button', { name: 'Send to watch' }).click();
|
||||||
await page.getByRole('button', { name: 'Cancel transfer' }).click();
|
await page.getByRole('button', { name: 'Cancel transfer' }).click();
|
||||||
await page.getByRole('status').getByText('Transfer cancelled.', { exact: false }).waitFor();
|
await page.locator('#message').getByText('Transfer cancelled.', { exact: false }).waitFor();
|
||||||
|
checks++;
|
||||||
|
disconnected = true;
|
||||||
|
await page.getByText('Watch out of reach', { exact: true }).waitFor();
|
||||||
|
assert.equal(await page.locator('#send').isDisabled(), true);
|
||||||
|
disconnected = false;
|
||||||
|
await page.getByText('Connected to your watch', { exact: true }).waitFor();
|
||||||
checks++;
|
checks++;
|
||||||
await page.getByRole('button', { name: 'Change color theme' }).click();
|
await page.getByRole('button', { name: 'Change color theme' }).click();
|
||||||
|
await page.setViewportSize({ width: 640, height: 1136 });
|
||||||
|
await page.evaluate(() => {
|
||||||
|
document.body.style.zoom = '2';
|
||||||
|
});
|
||||||
|
assert.equal(
|
||||||
|
await page.evaluate(() => document.documentElement.scrollWidth > innerWidth),
|
||||||
|
false,
|
||||||
|
'200% zoom reflows',
|
||||||
|
);
|
||||||
|
await page.evaluate(() => {
|
||||||
|
document.body.style.zoom = '';
|
||||||
|
});
|
||||||
|
await page.getByRole('button', { name: 'Remove selected file' }).click();
|
||||||
|
await page.locator('#choose').focus();
|
||||||
|
assert.equal(
|
||||||
|
await page.locator('#choose').evaluate((el) => el === document.activeElement),
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
await page.emulateMedia({ reducedMotion: 'reduce' });
|
||||||
|
assert.equal(
|
||||||
|
await page.locator('.parcel').evaluate((el) => getComputedStyle(el).animationName),
|
||||||
|
'none',
|
||||||
|
);
|
||||||
|
checks++;
|
||||||
|
|
||||||
assert.deepEqual(errors, []);
|
assert.deepEqual(errors, []);
|
||||||
const result = {
|
const result = {
|
||||||
browser: await browser.version(),
|
browser: await browser.version(),
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ const path = require('node:path');
|
|||||||
path.resolve(__dirname, '../qa/fixture/build/outputs/apk/debug/qaFixture-debug.apk'),
|
path.resolve(__dirname, '../qa/fixture/build/outputs/apk/debug/qaFixture-debug.apk'),
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
await page.getByRole('button', { name: 'Send to my watch' }).click();
|
await page.getByRole('button', { name: 'Send to watch' }).click();
|
||||||
await page.getByRole('heading', { name: 'Over to your wrist.' }).waitFor({ timeout: 30000 });
|
await page.getByRole('heading', { name: 'Made it to your watch' }).waitFor({ timeout: 30000 });
|
||||||
await page.screenshot({
|
await page.screenshot({
|
||||||
path: path.join(reports, 'android-browser-review.png'),
|
path: path.join(reports, 'android-browser-review.png'),
|
||||||
fullPage: true,
|
fullPage: true,
|
||||||
|
|||||||
Reference in new issue
Block a user