41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
$config = require dirname(__DIR__) . '/config/mini_legal.php';
|
|
$app = $config['businesses']['evus']['apps']['evus_jn_app'] ?? [];
|
|
|
|
if (($app['company_code'] ?? '') !== 'jn') {
|
|
fwrite(STDERR, "evus_jn_app must use the Jinan company.\n");
|
|
exit(1);
|
|
}
|
|
|
|
foreach (['terms', 'privacy'] as $type) {
|
|
$intro = (string)($app['documents'][$type]['intro_template'] ?? '');
|
|
if (strpos($intro, '移动应用') === false) {
|
|
fwrite(STDERR, "$type must identify the Android mobile app.\n");
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
$privacyAppendix = (string)($app['documents']['privacy']['append_content'] ?? '');
|
|
foreach (['支付宝', '微信 OpenSDK', 'OCR', '阿里云 OSS'] as $service) {
|
|
if (strpos($privacyAppendix, $service) === false) {
|
|
fwrite(STDERR, "privacy disclosure is missing $service.\n");
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
$privacyContent = (string)($app['documents']['privacy']['content'] ?? '');
|
|
foreach (['手机号码', '护照', '美国签证', '订单', '支付结果', '保存期限'] as $topic) {
|
|
if (strpos($privacyContent, $topic) === false) {
|
|
fwrite(STDERR, "Android privacy policy is missing $topic.\n");
|
|
exit(1);
|
|
}
|
|
}
|
|
if (stripos($privacyContent, 'cookie') !== false || strpos($privacyContent, '计算机') !== false) {
|
|
fwrite(STDERR, "Android privacy policy must not contain legacy website-only collection claims.\n");
|
|
exit(1);
|
|
}
|
|
|
|
echo "legal app config self-check passed\n";
|