Release 0.1.49: self-hosted maps and consented cloud location history

This commit is contained in:
Codex
2026-10-19 00:00:12 +08:00
parent d0b3db7f82
commit a5d2399d2e
58 changed files with 2586 additions and 223 deletions
+15 -8
View File
@@ -38,7 +38,7 @@ class AndroidLocationContractTests(unittest.TestCase):
self.assertEqual(launchers, ['.LocationActivity'])
self.assertEqual(television, ['.MainActivity'])
self.assertEqual(manifest.get(NS+'versionName'), (ROOT/'VERSION').read_text().strip())
self.assertEqual(manifest.get(NS+'versionCode'), '4')
self.assertGreaterEqual(int(manifest.get(NS+'versionCode')), 5)
def test_collection_is_visible_foreground_and_never_boot_started(self):
manifest = ET.parse(ANDROID/'AndroidManifest.xml').getroot()
@@ -54,14 +54,21 @@ class AndroidLocationContractTests(unittest.TestCase):
self.assertIn('new int[]{10,60,300}', ui)
self.assertIn('consent.isChecked()', ui)
def test_map_has_local_assets_no_external_coordinate_requests(self):
def test_map_uses_first_party_tiles_and_never_exposes_pairing_token(self):
source = (ANDROID/'src/cn/ucvl/zhaodisplay/LocationMapView.java').read_text(encoding='utf-8')
self.assertIn('getAssets().open("world-land.json")', source)
self.assertNotIn('http', source)
build = (ANDROID/'build.ps1').read_text(encoding='utf-8')
for name in ('world-land.json', 'WORLD-LAND-LICENSE.txt'):
self.assertIn(name, build)
self.assertTrue((ROOT/'frontend/src/data'/name).exists())
for text in ('https://zhao.ucvl.cn/maps/phone','shouldInterceptRequest','setGeolocationEnabled(false)','setAllowFileAccess(false)','JSONObject.quote','setItems(new JSONArray())'):
self.assertIn(text,source)
self.assertNotIn('addJavascriptInterface',source)
self.assertNotIn('getSharedPreferences',source)
def test_background_permission_only_in_phone_and_separately_requested(self):
for name,expected in [('AndroidManifest.xml',True),('AndroidManifest-terminal.xml',False)]:
manifest=ET.parse(ANDROID/name).getroot()
permissions=[x.get(NS+'name') for x in manifest.findall('uses-permission')]
self.assertEqual('android.permission.ACCESS_BACKGROUND_LOCATION' in permissions,expected)
source=(ANDROID/'src/cn/ucvl/zhaodisplay/LocationActivity.java').read_text(encoding='utf-8')
self.assertIn('ACTION_APPLICATION_DETAILS_SETTINGS',source)
self.assertIn('new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION},48',source)
self.assertIn('if(request==47||request==48){render();return;}',source)
if __name__ == '__main__': unittest.main()