summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_android_shell.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-15 15:09:58 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-15 15:09:58 +0200
commit39cac2878de059992cb09a1ccf09b6bcece99fae (patch)
treec4686f00fdf40e90b4b74144c1e8fd8fb8b8ed0b /packages/meshbay-hub/tests/test_android_shell.py
parent7fc2fa04d7d88a1cdf0d290ddd2de3815a7d52a5 (diff)
downloadmeshbay-39cac2878de059992cb09a1ccf09b6bcece99fae.tar.gz
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/test_android_shell.py')
-rw-r--r--packages/meshbay-hub/tests/test_android_shell.py25
1 files changed, 4 insertions, 21 deletions
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:]