#!/usr/bin/env python3
"""Build the free native PureApp store with the shared release certificate."""
import os,sys,subprocess
from pathlib import Path
root=Path(__file__).resolve().parents[1]
env=os.environ.copy();env.setdefault('ANDROID_HOME',str(Path.home()/'.local/share/android-sdk'))
if not env.get('PUREAPP_SDK_PUBLIC_KEY'):sys.exit('请设置可信 PUREAPP_SDK_PUBLIC_KEY')
gradle=env.get('PUREAPP_GRADLE',str(Path.home()/'.local/share/gradle-9.1.0/bin/gradle'))
sys.exit(subprocess.call([gradle,':app:assembleRelease',':app:assembleDebug',':app:lintRelease','--console=plain',*sys.argv[1:]],cwd=root/'apps/store-android',env=env))
