From 39cac2878de059992cb09a1ccf09b6bcece99fae Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 15:09:58 +0200 Subject: feat(android): no text messages backup, and one build again READ_SMS sits behind restricted settings outside a store and Play keeps it for the default SMS application: not worth a second build. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_android_shell.py | 25 ++++-------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'packages/meshbay-hub/tests/test_android_shell.py') diff --git a/packages/meshbay-hub/tests/test_android_shell.py b/packages/meshbay-hub/tests/test_android_shell.py index c68234d..520fa7e 100644 --- a/packages/meshbay-hub/tests/test_android_shell.py +++ b/packages/meshbay-hub/tests/test_android_shell.py @@ -139,7 +139,7 @@ def test_the_shim_offers_desktop_channels_and_native_answers_each(): SRC / "cast" / "CastChannels.kt", SRC / "notify" / "PushChannels.kt", SRC / "photos" / "PhotoChannels.kt", SRC / "phonesync" / "Destination.kt"): native |= set(re.findall(r'^\s*"([\w:-]+)" ->', _read(path), flags=re.M)) - # Contacts and messages share one class, its channels named by a prefix. + # Contacts and the calendar share one class, its channels named by a prefix. docs = set(re.findall(r'^\s*"([\w-]+)" ->', _read(SRC / "phonesync" / "DocChannels.kt"), flags=re.M)) for prefix in re.findall(r'DocChannels\("(\w+)"', _read(SRC / "MainActivity.kt")): native |= {f"{prefix}:{name}" for name in docs} @@ -153,7 +153,7 @@ def test_the_shim_offers_desktop_channels_and_native_answers_each(): # address book to back up, and a desktop has none of them; those families are the ones the desktop lacks # rather than the ones it shares. phone_only = {c for c in shim if c.startswith(("push:", "photosync:", "phonesync:", "contactsync:", - "calendarsync:", "messagesync:", "drivesync:", + "calendarsync:", "drivesync:", "wasync:"))} assert any(c.startswith("push:") for c in phone_only), "the push channels are gone" assert any(c.startswith("photosync:") for c in phone_only), "the backup channels are gone" @@ -277,30 +277,13 @@ def test_only_the_personal_profile_is_backed_up(): "whatsappSync:"): assert name in gated, name for path in [*(SRC / "phonesync").rglob("*.kt"), *(SRC / "photos").rglob("*.kt"), - *(SRC / "drive").rglob("*.kt"), - *(APP / "src" / "full").rglob("*.kt")]: + *(SRC / "drive").rglob("*.kt")]: assert not re.search(r"\.ENTERPRISE_\w+", _read(path)), path.name -def test_the_play_build_cannot_read_text_messages(): - """Play's policy keeps READ_SMS for the default SMS application: the Play - build has neither the permission nor the code that reads messages.""" - main = _read(APP / "src" / "main" / "AndroidManifest.xml") - assert "READ_SMS" not in main - assert "READ_SMS" in _read(APP / "src" / "full" / "AndroidManifest.xml") - assert not (APP / "src" / "play" / "AndroidManifest.xml").exists() or \ - "READ_SMS" not in _read(APP / "src" / "play" / "AndroidManifest.xml") - play = list((APP / "src" / "play").rglob("*.kt")) - assert play and all("Telephony" not in _read(f) and "SmsSource" not in _read(f) for f in play) - assert not list((APP / "src" / "main").rglob("SmsSource.kt")) - - @pytest.mark.skipif(not os.environ.get("ANDROID_HOME") or shutil.which("java") is None, reason="no Android SDK in the environment") def test_the_jvm_unit_tests_pass(): - # The tests are shared; the Play build is compiled too, so a flavor file - # missing from it fails here rather than at release time. - result = subprocess.run(["./gradlew", "--no-daemon", "-q", "testFullDebugUnitTest", - "compilePlayDebugKotlin"], + result = subprocess.run(["./gradlew", "--no-daemon", "-q", "testDebugUnitTest"], cwd=ANDROID, capture_output=True, text=True, timeout=900) assert result.returncode == 0, result.stdout[-3000:] + result.stderr[-3000:] -- cgit v1.2.3