fix(camera): negotiate preview surfaces and gate diagnostic recovery

This commit is contained in:
zenord
2026-10-14 12:28:19 +08:00
parent 5339949534
commit 14f1194a95
15 changed files with 523 additions and 76 deletions
+8 -6
View File
@@ -32,8 +32,8 @@ def digest(path):
def verify(apk):
badge = subprocess.check_output([str(TOOLS/'aapt'), 'dump', 'badging', str(apk)], text=True)
for value in ("name='com.gorios.lanvoice.cameraprobe'", "versionCode='3'",
"versionName='camera-probe-0.1.2'", "sdkVersion:'26'", "targetSdkVersion:'34'"):
for value in ("name='com.gorios.lanvoice.cameraprobe'", "versionCode='4'",
"versionName='camera-probe-0.1.3'", "sdkVersion:'26'", "targetSdkVersion:'34'"):
require(value in badge, 'APK metadata: '+value)
permissions = set(re.findall(r"^uses-permission: name='([^']+)'", badge, re.M))
require(permissions == {'android.permission.CAMERA', 'android.permission.INTERNET',
@@ -68,6 +68,7 @@ def verify(apk):
'Lcom/gorios/lanvoice/IsolatedCameraDiagnosticsActivity;',
'Lcom/gorios/lanvoice/CameraProbeWorkerService;',
'Lcom/gorios/lanvoice/IsolatedProbeSuite;',
'Lcom/gorios/lanvoice/ProbeAvailabilityMonitor;',
'Lcom/gorios/lanvoice/expression/CameraProbeController;',
'Lcom/gorios/lanvoice/diag/DiagnosticReportUpload;'):
require(klass.encode() in dex, 'missing production diagnostic component: '+klass)
@@ -81,12 +82,13 @@ def verify(apk):
trust = ROOT/'camera-probe/build/generated/cameraTrust/res/raw/gateway_cert.pem'
require(trust.read_bytes() == (ROOT/'app/src/main/res/raw/gateway_cert.pem').read_bytes(), 'gateway trust drift')
camera_sources = {str(p.relative_to(ROOT)): digest(p) for p in sorted((ROOT/'camera-probe/src').rglob('*')) if p.is_file()}
return {'package': 'com.gorios.lanvoice.cameraprobe', 'version_name': 'camera-probe-0.1.2',
'version_code': 3, 'min_sdk': 26, 'target_sdk': 34, 'certificate_sha256': CERT,
return {'package': 'com.gorios.lanvoice.cameraprobe', 'version_name': 'camera-probe-0.1.3',
'version_code': 4, 'min_sdk': 26, 'target_sdk': 34, 'certificate_sha256': CERT,
'abi': 'arm64-v8a', 'assets': 0, 'microphone_permission': False,
'shared_production_sources': sources, 'camera_application_sources': camera_sources,
'camera_tests': 7, 'process_isolated': True,
'run_limit_ms': 5000, 'close_limit_ms': 2000, 'process_exit_limit_ms': 4000, 'device': 'not_run'}
'run_limit_ms': 5000, 'close_limit_ms': 2000, 'process_exit_limit_ms': 4000, 'availability_limit_ms': 5000, 'surface_resize_handshake': True,
'availability_is_streaming_proof': False, 'default_preview_last': True, 'device': 'not_run'}
def main():
parser = argparse.ArgumentParser(description=__doc__)
@@ -99,7 +101,7 @@ def main():
subprocess.run([str(ROOT/'scripts/build.sh'), ':camera-probe:assembleDebug'], cwd=ROOT, check=True)
built = ROOT/'camera-probe/build/outputs/apk/debug/camera-probe-debug.apk'
report = verify(built)
artifact = ROOT/'artifacts/lan-voice-camera-probe-v012-code3-debug.apk'
artifact = ROOT/'artifacts/lan-voice-camera-probe-v013-code4-debug.apk'
require(not artifact.exists() and not artifact.with_suffix('.apk.sha256').exists(), 'published camera version occupied')
with artifact.open('xb') as target, built.open('rb') as source:
shutil.copyfileobj(source, target)