mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-09 22:13:43 +08:00
f63e715d2d
Connect over LAN or Bluetooth with network discovery, build-matched Galaxy pages, phone GPS and a background uplink. Guide pairing with readiness retries, cancellable progress and bond cleanup. Include app updates, regression tests, the current APK, and a workflow to test, build and sign releases.
29 lines
1.4 KiB
Python
29 lines
1.4 KiB
Python
from pathlib import Path
|
|
import xml.etree.ElementTree as ET
|
|
|
|
|
|
ANDROID = "{http://schemas.android.com/apk/res/android}"
|
|
MANIFEST = Path(__file__).parents[1] / "app/src/main/AndroidManifest.xml"
|
|
|
|
|
|
def test_main_activity_handles_rotation_without_recreating_bluetooth_session():
|
|
root = ET.parse(MANIFEST).getroot()
|
|
activity = next(node for node in root.iter("activity") if node.get(ANDROID + "name") == ".MainActivity")
|
|
changes = set(activity.get(ANDROID + "configChanges", "").split("|"))
|
|
assert {"orientation", "screenSize", "screenLayout", "smallestScreenSize"} <= changes
|
|
|
|
|
|
def test_in_app_updater_has_scoped_install_permission_and_receiver():
|
|
root = ET.parse(MANIFEST).getroot()
|
|
permissions = {node.get(ANDROID + "name") for node in root.findall("uses-permission")}
|
|
assert "android.permission.REQUEST_INSTALL_PACKAGES" in permissions
|
|
receiver = next(node for node in root.iter("receiver") if node.get(ANDROID + "name") == ".AppInstallReceiver")
|
|
assert receiver.get(ANDROID + "exported") == "false"
|
|
|
|
|
|
def test_update_completion_survives_replacement_without_exporting_receiver():
|
|
root = ET.parse(MANIFEST).getroot()
|
|
receiver = next(node for node in root.iter("receiver") if node.get(ANDROID + "name") == ".AppUpdateCompletion")
|
|
assert receiver.get(ANDROID + "exported") == "false"
|
|
assert {node.get(ANDROID + "name") for node in receiver.iter("action")} == {"android.intent.action.MY_PACKAGE_REPLACED"}
|