Repository navigation
Description
I ran a static security and usability review of main at f484eb8 (app 1.2.0). Overall the codebase is in very good shape: no critical or high findings, and most of the usual problems for this kind of app (plaintext tokens, backups, exported components, logged secrets, TLS bypass) are already handled well.
This issue tracks what is left. I'll work through it in small PRs, one at a time, each referencing this issue. Paths use …/ for app/src/main/java/dev/wander/android/opentagviewer/; line numbers are as of f484eb8.
Merged: #314 (pin actions by SHA, Dependabot for actions), #317 (the eager sign-out below).
Open: #313 (split release signing into its own job), #315 (Remove deletes a tag's keys, optional erase of history and all data), #320 (keep app data off device-to-device transfer), #321 (location-history retention setting).
Larger changes
- iCloud keychain join wording. The iCloud route adds the app to the account's iCloud Keychain as a trusted member and keeps the Apple ID password (encrypted with the Keystore). Neither is said on screen, and unlink/logout can't remove the membership. Say both before the passcode step, give verified removal steps or leave the circle on unlink, offer to forget the membership on logout, and consider StrongBox /
setUnlockedDeviceRequiredfor the two Keystore aliases. (…/FetchFromICloudActivity.java:427-444,app/src/main/python/icloud_bridge.py:594-660,strings.xml:213-214,271,…/util/android/AppCryptographyUtil.java:139-145) - Release workflow tidy-up. Move the remaining
${{ }}values in releaserun:blocks (--tag "${{ github.ref }}", theMAPS_API_KEYecho,TAG="${{ inputs.tag || github.ref }}") toenv:, and replacesoftprops/action-gh-releasein the exporter release withghas Sign the release APK in a job of its own #313 does for the app. (build-release.yml,macos-exporter-python.yml:70) - Exporter binaries. Publish SHA-256 checksums and build attestations; Developer ID signing / notarisation and Authenticode if wanted later. (
macos-exporter-python.yml:250-418)
Security hardening
- Exclude the database and
user_authDataStore from Android 12+ device-to-device transfer;data_extraction_rules.xmlis still the template, andallowBackup="false"doesn't cover transfer. (AndroidManifest.xml:82-84) In Keep app data off device-to-device transfer and backups #320. - Lock Chaquopy's transitive Python dependencies with a constraints file (only FindMy.py, NSKeyedUnArchiver and PyYAML are pinned), and use
--require-hashesfor the bridge-test pip install. (app/build.gradle.kts:427-458) - Gradle
distributionSha256Sum, wrapper validation,verification-metadata.xml, and Dependabot for gradle/pip/uv. (gradle/wrapper/gradle-wrapper.properties) - Encrypt the key columns (
content,accessory_json,alignment_plist) at rest, possibly withAppCryptographyUtilunder a new alias instead of SQLCipher, and add a location-history retention setting. (…/db/room/entity/OwnedBeacon.java:40,101) Retention in Add a setting for how long location history is kept #321; encryption will get its own issue first. - Size and entry-count limits on bundle and history imports; one huge entry currently causes an
OutOfMemoryErrorcrash. (…/util/parse/AppleZipImporterUtil.java:205-210,…/util/history/HistoryImporter.java:154-162) - Show a summary before an import updates tags already on the phone. Today
refreshFromImportoverwritescontent, keeps the oldaccessory_json, and clearsfrom_accountandis_removed. (…/db/room/dao/OwnedBeaconDao.java:91-101,…/MapsActivity.java:1387-1388) - Reject unencrypted entries in a passcode-locked bundle (not tested against zip4j). (
…/util/parse/AppleZipImporterUtil.java:177-184) - Warn on an
http://Anisette server URL, as the Find Hub screen already does. (…/util/validate/AnisetteUrlValidatorUtil.java:13,network_security_config.xml:9) - Drop unused
READ_PHONE_STATE,WRITE_EXTERNAL_STORAGEandACCESS_WIFI_STATE, and only set the AMap privacy flags when the user chooses AMap. (AndroidManifest.xml:52-54,…/OpenAirTagApplication.java:55,258-283) - Exporter: create the legacy decryptor's output
0700/0600with a delete-when-done warning (python/exporter/airtag_decryptor.py), use a per-user log directory on Linux (python/exporter/wizard.py:1293-1301), and remove the stale "Android can't import encrypted bundles" docstring (python/opentagviewer_export/zipsink.py:41-44). - Minor: don't log rejected 2FA codes or the SMS number (
…/AppleLoginActivity.java:979,1274,1313), mark the copied bundle passcodeEXTRA_IS_SENSITIVE(…/ui/mydevices/ExportedBundleDialog.java:74-75), considerFLAG_SECUREon login screens, neutralise= + - @in CSV export (…/util/export/HistoryCsvWriter.java:153-168). - Consider loading the Android ADI libraries in an isolated process like
:macadi. (…/anisette/LocalAnisette.java:224-243) - Build hygiene: Chaquopy plugin declared as 16.0.0 in
settings.gradle.kts:15and 16.1.0 inlibs.versions.toml.
Usability
- Friendly, translated messages for a wrong password or wrong 2FA code; today a wrong password falls through to
REASON_UNKNOWNand shows the Python exception text. Only suggest another Anisette server in remote mode. (app/src/main/python/main.py:604-650,…/AppleLoginActivity.java:870-873,1336-1340) - After a failed 2FA code request the login screen goes blank (the choice page is never re-shown), and Back does nothing anywhere in login. (
…/AppleLoginActivity.java:215-220,952-963,972-983) - Refresh failures are silent (the toast is commented out); show an error with Retry and mark the location as stale. (
…/MapsActivity.java:1771-1775,2998-3002) -
contentDescriptionfor icon-only buttons: map menu, navigate and my-location buttons, Back and page menu on every screen, history day navigation, icon picker; labels for the six 2FA boxes. (activity_maps.xml:65,124,142,inline_top_toolbar*.xml,view_history_bottom_sheet.xml:40,64,74,two_factor_code_row.xml) - History is only collected while the app is open (no WorkManager; look-back capped at 24 h), so the README's "automatically save" overstates it. Backfill up to 7 days on start, or say so in the README and History screen. (
README.md:40,…/util/rx/RefreshPolicy.java:119-123) - iCloud passcode step: the 3-attempt counter resets when the page is re-entered, the copy encourages retrying, and nothing mentions Apple's limit. Persist attempts per device and give exhaustion its own message. (
…/FetchFromICloudActivity.java:398,463-470,strings.xml:217) - Location-permission rationale says position is only shown on the map, but nearby sightings store the phone's position as tag history and exports include it. (
strings.xml:67,479,…/AccessorySightingPersister.java:143) - Empty state on the map when there are no tags (onboarding's "Later" also suppresses the iCloud offer). (
activity_maps.xml,…/OnboardingActivity.java) - 48dp touch targets (toolbar buttons are 35dp, map buttons 40dp) and flexible 2FA boxes for large font scales. (
inline_top_toolbar*.xml:28,two_factor_code_row.xml:21,29) - Remaining hardcoded toasts,
<plurals>for counts ("1 data points", "Found 1 tags"), and unused template strings (nav_header_title,menu_gallery,menu_slideshow). (…/AppleLoginActivity.java:889,…/DeviceInfoActivity.java:1437,…/HistoryViewActivity.java:621) - Map is locked to portrait despite landscape and wide-screen resources. (
AndroidManifest.xml:234) - README: "Inactive" / "feature-complete as of 1.1.0" status, names
malmeloo/FindMy.pyrather than the fork, no minimum Android version (7.0), iCloud route described as needing only the phone, newer features missing. (README.md:12,16,22,75)
Found along the way
- (fixed in Sign out only after the local Anisette choice is saved #317)
MapsActivity.offerLocalAnisetteUpgradeIfDuesigns out before (or regardless of) the save, becauseRxDataStore.updateDataAsyncstarts eagerly. Delete a removed tag's keys, and offer to erase its history #315 adds AGENTS rule 23 about this. -
DebugModeReachesEveryScreenTestfails between 00:00 and 02:00 UTC becauseAMapWithTagsOnItseeds its report at now minus 2 hours.
Activity