Enable exact correct03 dialogue dance and add standalone camera diagnostics
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Exact user-authorized correct03 debug import/build; no Pi spoof or network dance admission.
|
||||
"""Exact user-authorized correct03 debug import/build; optional explicit network dance.
|
||||
Keep the separate Pi-reviewed white publication workflow unchanged. Owner media is read-only.
|
||||
"""
|
||||
import argparse, importlib.util, json, re, shutil, subprocess, urllib.request, zipfile
|
||||
@@ -15,11 +15,11 @@ OLD=ROOT/'artifacts/lan-voice-v0711-camera-matrix-code29-arm64-debug.apk'
|
||||
OLD_SHA='34905e98534d3b93b769717dd895183e2b06a87e70b564c0ac50c856f8ffa8de'
|
||||
require=pack.require
|
||||
|
||||
def authorization(pin,pi_pin=None,registry=None):
|
||||
def authorization(pin,pi_pin=None,registry=None,network_actions=False):
|
||||
require(pin==PIN,'exact user authorization required')
|
||||
require(pi_pin is None and registry is None,'user debug path cannot label Pi approval or install a dance registry')
|
||||
return {'authorization':'user_exact_revision_debug_integration','manifest_sha256':PIN,
|
||||
'independent_pi_pin':False,'network_dance_available':False,'music_listening':'not_run','device':'not_run'}
|
||||
'independent_pi_pin':False,'network_dance_available':network_actions,'music_listening':'not_run','device':'not_run'}
|
||||
|
||||
def verify_apk(apk,report):
|
||||
require(pack.file_sha(OLD)==OLD_SHA,'code29 rollback drift')
|
||||
@@ -40,26 +40,30 @@ def verify_apk(apk,report):
|
||||
if n.endswith('.mp4'):require(new.getinfo(n).compress_type==zipfile.ZIP_STORED,'compressed video')
|
||||
return {'runtime_referenced_files':len(actual),'retained_legacy_avatar_files':len(retained),'bootstrap_files':2,'all_avatar_files':len(paths(new)),'review_files_packaged':0}
|
||||
|
||||
def publish(report,output,version):
|
||||
def publish(report,output,version,network_actions=False):
|
||||
checks=pack.read_json(ROOT/'logs/black-tulle-correct03/checks.json')
|
||||
require(checks['status']=='passed' and checks['jvm_entry_points']==11 and checks['gateway_passed']>=110 and checks['gateway_skipped']==1 and checks['packaging_passed']>=48 and checks['gles_cases']>=200,'actual completed regression evidence required')
|
||||
for name,digest in checks['hashes'].items():require(pack.file_sha(ROOT/name)==digest,'untested source: '+name)
|
||||
require(version>=30 and version>=pack.next_version((ROOT/'artifacts').glob('*.apk')),'version occupied')
|
||||
flags=['-PavatarUserAssetCandidate=true','-PavatarActionCandidate=true','-PavatarNatural=true','-PavatarMouthCandidate=true',
|
||||
require(version>=(32 if network_actions else 30) and version>=pack.next_version((ROOT/'artifacts').glob('*.apk')),'version occupied')
|
||||
if network_actions:
|
||||
index=pack.read_json(ROOT/'app/src/main/assets'/startup.ASSET_ROOT/'manifest.json')
|
||||
pack.reviewed_actions(index,PIN,ROOT/'gateway/reviewed_action_packs.json')
|
||||
flags=['-PavatarUserNetworkActions='+str(network_actions).lower(),'-PavatarUserAssetCandidate=true','-PavatarActionCandidate=true','-PavatarNatural=true','-PavatarMouthCandidate=true',
|
||||
'-PnaturalManifestSha='+pack.LEGACY_PIN,'-PemotionManifestSha='+PIN,'-PactionVersionCode='+str(version)]
|
||||
flags += ['-P'+name+'=true' for name in ('avatarFullActionCandidate','avatarPlaybackClockFix','avatarStartupFix','presenceCandidate','faceDiagnosticsFix','cameraCompatibilityFix','cameraDirectYuv','cameraPreviewStream','cameraProbeDiagnostic')]
|
||||
subprocess.run([str(ROOT/'scripts/build.sh'),'assembleDebug','compileDebugAndroidTestKotlin',*flags],check=True,cwd=ROOT)
|
||||
built=ROOT/'app/build/outputs/apk/debug/app-debug.apk';badge=pack.badging(built)
|
||||
for value in ("name='com.gorios.lanvoice'",f"versionCode='{version}'","versionName='0.7.12'","sdkVersion:'26'","targetSdkVersion:'34'"):
|
||||
version_name='0.7.13' if network_actions else '0.7.12'
|
||||
for value in ("name='com.gorios.lanvoice'",f"versionCode='{version}'",f"versionName='{version_name}'","sdkVersion:'26'","targetSdkVersion:'34'"):
|
||||
require(value in badge,'APK metadata: '+value)
|
||||
require(re.search(r'^native-code: (.+)$',badge,re.M)[1].strip()=="'arm64-v8a'",'APK ABI')
|
||||
cert=subprocess.check_output([str(pack.TOOLS/'apksigner'),'verify','--verbose','--print-certs',str(built)],text=True)
|
||||
require(re.search(r'Signer #1 certificate SHA-256 digest: (\w+)',cert)[1]==pack.CERT,'same debug certificate required')
|
||||
inventory=verify_apk(built,report)
|
||||
config=(ROOT/'app/build/generated/source/buildConfig/debug/com/gorios/lanvoice/BuildConfig.java').read_text()
|
||||
for value in ('AVATAR_USER_ASSET_CANDIDATE = true','AVATAR_STARTUP_FIX = true','EMOTION_MANIFEST_SHA = "'+PIN+'"','EMOTION_ASSET_ROOT = "'+startup.ASSET_ROOT+'"','STARTUP_MANIFEST_SHA = "'+pack.file_sha(ROOT/'manifests/startup-black-tulle-correct03.json')+'"'):
|
||||
for value in ('AVATAR_NETWORK_ACTIONS_ALLOWED = '+str(network_actions).lower(),'AVATAR_USER_ASSET_CANDIDATE = true','AVATAR_STARTUP_FIX = true','EMOTION_MANIFEST_SHA = "'+PIN+'"','EMOTION_ASSET_ROOT = "'+startup.ASSET_ROOT+'"','STARTUP_MANIFEST_SHA = "'+pack.file_sha(ROOT/'manifests/startup-black-tulle-correct03.json')+'"'):
|
||||
require(value in config,'BuildConfig mismatch: '+value)
|
||||
artifact=ROOT/f'artifacts/lan-voice-v0712-black-tulle-correct03-code{version}-arm64-debug.apk'
|
||||
artifact=ROOT/f'artifacts/lan-voice-v{version_name.replace(".","")}-black-tulle-correct03-code{version}-arm64-debug.apk'
|
||||
with artifact.open('xb') as f,built.open('rb') as source:shutil.copyfileobj(source,f)
|
||||
digest=pack.file_sha(artifact);checksum=f'{digest} {artifact.name}\n'.encode()
|
||||
with artifact.with_suffix('.apk.sha256').open('xb') as f:f.write(checksum)
|
||||
@@ -67,8 +71,8 @@ def publish(report,output,version):
|
||||
opener=urllib.request.build_opener(urllib.request.ProxyHandler({}))
|
||||
with opener.open(url,timeout=30) as r:require(r.status==200 and pack.sha(r.read())==digest,'HTTP bytes mismatch')
|
||||
with opener.open(url+'.sha256',timeout=15) as r:require(r.status==200 and r.read()==checksum,'HTTP checksum mismatch')
|
||||
delivery={'status':'user_authorized_debug_asset_candidate','version_name':'0.7.12','version_code':version,'url':url,'sha256':digest,
|
||||
'certificate_sha256':pack.CERT,**authorization(PIN),**inventory,'combined_rgba_bytes':report['combined_rgba_bytes'],
|
||||
delivery={'status':'user_authorized_debug_asset_candidate','version_name':version_name,'version_code':version,'url':url,'sha256':digest,
|
||||
'certificate_sha256':pack.CERT,**authorization(PIN,network_actions=network_actions),**inventory,'combined_rgba_bytes':report['combined_rgba_bytes'],
|
||||
'http_bytes_verified':True,'gateway_deployed':False,'paid_calls':0,'naturalness':'not_certified'}
|
||||
(output/'delivery.json').write_text(json.dumps(delivery,indent=2)+'\n');return delivery
|
||||
|
||||
@@ -76,8 +80,9 @@ def main():
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--manifest',type=Path,required=True);parser.add_argument('--user-authorized-sha',required=True)
|
||||
parser.add_argument('--output',type=Path,required=True);parser.add_argument('--import-only',action='store_true');parser.add_argument('--build',action='store_true')
|
||||
parser.add_argument('--enable-network-actions',action='store_true',help='Explicit user authorization to test normal dialogue dance with the exact registered pin; not music/device certification')
|
||||
parser.add_argument('--version-code',type=int,default=30);args=parser.parse_args()
|
||||
auth=authorization(args.user_authorized_sha);manifest=args.manifest.resolve(strict=True);out=args.output.resolve()
|
||||
auth=authorization(args.user_authorized_sha,network_actions=args.enable_network_actions);manifest=args.manifest.resolve(strict=True);out=args.output.resolve()
|
||||
require(not out.exists() and not out.is_relative_to(manifest.parent),'fresh evidence outside owner storage required')
|
||||
out.mkdir(parents=True)
|
||||
report=pack.check_bundle(manifest,PIN,out,user_authorized_debug=True)
|
||||
@@ -85,7 +90,7 @@ def main():
|
||||
pack.import_files(manifest.parent,report['files'],ROOT/'app/src/main/assets'/startup.ASSET_ROOT)
|
||||
basic=startup.prepare(manifest.parent)
|
||||
(out/'import.json').write_text(json.dumps({**auth,'files':len(report['files']),'asset_root':startup.ASSET_ROOT,'bootstrap':basic},indent=2)+'\n')
|
||||
result=publish(report,out,args.version_code) if args.build else report
|
||||
result=publish(report,out,args.version_code,args.enable_network_actions) if args.build else report
|
||||
print(json.dumps({k:v for k,v in result.items() if k not in ('files','runtime_packages')},indent=2))
|
||||
if __name__=='__main__':
|
||||
try:main()
|
||||
|
||||
Reference in New Issue
Block a user