storebound scan: offline rejection-risk scan of the project itself

Detects the stack (native iOS / Android, React Native, Expo, Capacitor, Cordova,
Flutter, Unity, Godot) and the SDKs from a maintained table with versions,
file:line and each vendor's disclosure page, then reports App Store and Google
Play rejection risks with guideline, evidence, fix, severity and skill: 2.1(a)
demo account and placeholder text, 5.1.1(v) account deletion, 4.8 login
services, 3.1.1 restore and outside payments, 3.1.2 subscription info, 5.1.2(i)
ATT, purpose strings, privacy link, privacy manifest, 2.3.10, 2.3.7, 2.3.8, 4.2
web wrappers, 2.5.1, 2.5.5, ATS, export compliance, 1.3 kids ads, review
prompts, privacy labels vs SDKs; Play target SDK 36, delete-account URL, App
access, foreground services, exact alarms, QUERY_ALL_PACKAGES, SMS / call log,
com.example package name.

Proposes Data safety / App Privacy / ATT / privacy manifest answers (detected
file:line or ask owner) as a diff against the config; --write adds only the
detected ones. scan.ignore records owner-accepted findings. MCP tool scan
(read-only), validate includes open findings, desktop Checks tab shows them.
Fixtures for iOS, Android, Capacitor, Unity, Flutter, clean and teaser.
This commit is contained in:
CRTkafa 2026-10-11 15:20:55 +00:00
parent 02d90de77a
commit 00a38cd305
109 changed files with 3103 additions and 31 deletions

View file

@ -1,9 +1,9 @@
// Checks: the offline config check (every time) and the read-only store readiness report (`validate`, on demand)
// with its ordered blockers and fix hints.
// Checks: the offline rejection-risk scan of the project files (`scan`, every time), the offline config check and
// the read-only store readiness report (`validate`, on demand) with its ordered blockers and fix hints.
import type { Project } from '../../api';
import { t } from '../../i18n';
import { ago } from '../../lib/format';
import type { Finding, ValidateResult } from '../../lib/model';
import type { Finding, ScanResult, ScanSeverity, ValidateResult } from '../../lib/model';
import { useData, useRead } from '../../store';
import { Icon } from '../../ui/icons';
import { Card, Chip, Empty, ErrorNotice, Skeleton } from '../../ui/kit';
@ -12,6 +12,50 @@ import { useExports } from '../../ui/Exports';
const LEVEL: Record<Finding['level'], ['bad' | 'warn' | 'ok', 'alertCircle' | 'alert' | 'check']> = { blocker: ['bad', 'alertCircle'], warn: ['warn', 'alert'], ok: ['ok', 'check'] };
const SEV: Record<ScanSeverity, ['bad' | 'warn' | 'info', 'alertCircle' | 'alert' | 'info']> = { blocker: ['bad', 'alertCircle'], high: ['bad', 'alert'], medium: ['warn', 'alert'], low: ['info', 'info'] };
/** The `storebound scan` card: rejection risks with guideline, evidence file:line, fix and skill. */
function ScanCard({ project }: { project: Project }) {
const s = useRead<ScanResult>(project.id, 'scan', { network: false, title: t('checks.scan') });
const findings = Array.isArray(s.data?.findings) ? s.data!.findings : [];
const sdks = Array.isArray(s.data?.sdks) ? s.data!.sdks : [];
const asks = (Array.isArray(s.data?.declarations?.items) ? s.data!.declarations.items : []).filter(x => x.status === 'ask').length;
return (
<Card title={t('checks.scan')} icon="search" sub={s.data && sdks.length ? t('checks.scanSdks', { list: sdks.map(x => x.name).join(', ') }) : t('checks.scanSub')} pad={false}
actions={<button className="btn btn-sm" onClick={s.refresh} disabled={s.loading}><Icon name="refresh" className={s.loading ? 'spin' : undefined} />{t('checks.scanAgain')}</button>}>
{s.error && <div className="card-body"><ErrorNotice error={s.error} keep={!!s.data} /></div>}
{!s.data ? (s.loading && !s.error ? <div className="card-body"><Skeleton lines={4} /></div> : null)
: !findings.length ? <Empty compact illo="shield" title={t('checks.scanClean')}>{t('checks.scanCleanText')}</Empty> : (
<div className="list">
{findings.map((f, i) => {
const [tone, icon] = f.accepted ? ['ok', 'check'] as const : SEV[f.severity] ?? SEV.low;
const ev = Array.isArray(f.evidence) ? f.evidence : [];
return (
<div className="li" key={`${f.rule}-${i}`}>
<span className={`li-icon tone-bg-${tone}`}><Icon name={icon} /></span>
<div className="li-main">
<span className="li-title">{f.guideline} · {f.title}</span>
{ev.slice(0, 2).map((e, j) => <span className="li-sub selectable" key={j}><code>{e.file}:{e.line}</code>{e.text ? ` ${e.text}` : ''}</span>)}
{f.accepted ? <span className="li-sub">{t('checks.accepted', { reason: f.accepted })}</span>
: <span className="fix"><Icon name="wand" /><span className="selectable">{f.fix} <code>{f.skill}</code></span></span>}
</div>
<Chip tone={f.accepted ? 'ok' : tone}>{t(f.accepted ? 'checks.sev.accepted' : `checks.sev.${f.severity}` as Parameters<typeof t>[0])}</Chip>
<Chip tone="outline">{f.store === 'apple' ? 'App Store' : 'Google Play'}</Chip>
</div>
);
})}
</div>
)}
{s.data && (asks > 0 || s.data.declarations?.changed) && (
<div className="card-body">
{asks > 0 && <div className="li-sub">{t('checks.scanAsk', { count: asks })}</div>}
{s.data.declarations?.changed && <div className="li-sub"><code className="selectable">{t('checks.scanWrite')}</code></div>}
</div>
)}
</Card>
);
}
export function ChecksTab({ project }: { project: Project }) {
const d = useData();
const e = d.statusOf(project);
@ -23,6 +67,7 @@ export function ChecksTab({ project }: { project: Project }) {
const findings = [...(v.data?.findings ?? [])].sort((a, b) => ['blocker', 'warn', 'ok'].indexOf(a.level) - ['blocker', 'warn', 'ok'].indexOf(b.level));
return (
<div className="grid g2" style={{ alignItems: 'start' }}>
<div style={{ gridColumn: '1 / -1' }}><ScanCard project={project} /></div>
<Card title={t('checks.offline')} icon="shield" sub={t('checks.offlineSub')} pad={false}
actions={<button className="btn btn-sm" onClick={() => d.refreshPortfolio(false)} disabled={!!d.portfolioBusy}><Icon name="refresh" className={d.portfolioBusy === 'offline' ? 'spin' : undefined} />{t('checks.again')}</button>}>
{!e ? <div className="card-body"><Skeleton lines={4} /></div> : !problems.length && !warnings.length ? (