# Location Risk evidence record Status: reviewed Question: does this process observe violations of the public `Location` object contract, mock marks in accessible cached fixes, or the exact package used by the reference project? Passing these checks does not authenticate a location, establish that spoofing is absent, or establish that a particular module is active. ## Ownership and design - `domain` owns typed states, contract identifiers and severity. `data` owns Android objects, the optional cache reader, consent persistence and a packageinventory adapter. `presentation` supplies one model/export for App and SDK; `ui` uses the existing paired facts, card frame and collapsible sections. `detector` composes these layers. There is no dependency on another detector. - No new third-party dependency, native probe, reflection, privileged service, root request, shell command or hidden API is used. The operating system's location permission and AppOps checks remain authoritative for cached access. - At most eight app-owned synthetic objects and three `getLastKnownLocation` calls per scan. No callbacks or active location requests, no location foreground service and no background location permission. Binder calls have no application-enforced hard timeout; the call count, rather than service latency, is bounded. - Minimum API 29. `Location` setters, getters, optional field flags and reset predate this minimum. The public mock setter/getter round trip requires API 31. API 29–30 uses `isFromMockProvider` only on cached fixes; it does not reflectively call the hidden setter. Later public API implementations should preserve the contracts, but OEM alterations and injected runtimes may differ. - Failures use UNAVAILABLE, PERMISSION_LIMITED, UNSUPPORTED or INCONCLUSIVE instead of absence. A local contract mismatch, an observed cached mock mark or an exact reference-package hit is WARNING. Warning requests review of the observed signal; it does not establish hostile activity. Clean checks and coverage limitations remain INFO. No result says that the real position is trusted or the device is compromised. ## Reference project Research snapshot: [eltavine/VirtualLocation, dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7](https://github.com/eltavine/VirtualLocation/tree/dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7). Source [gradle.properties](https://github.com/eltavine/VirtualLocation/blob/dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7/gradle.properties) declares 3.0.0 / 30000. [app/build.gradle.kts](https://github.com/eltavine/VirtualLocation/blob/dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7/app/build.gradle.kts) declares `com.vincenthzr.locationspoofer` for scoped and global flavors. These are source facts, not proof of an installed artifact's identity or behavior. No upstream release artifact/signing pin was established during this research; package hits remain identity unverified. GPL source was inspected as a behavior reference; the implementation independently exercises public Android contracts and incorporates no upstream implementation code. [LocationGetterHooker](https://github.com/eltavine/VirtualLocation/blob/dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/LocationGetterHooker.kt) hooks base-class latitude, longitude, provider, time, elapsed time, accuracy, optional flags, speed, bearing, altitude and mock getters. When active, these broad hooks can affect a plain app-created `Location`, not just framework-delivered fixes. Some hooks exclude the module's own application. [AntiDetectionHooker](https://github.com/eltavine/VirtualLocation/blob/dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/AntiDetectionHooker.kt) can alter permission/AppOps/mock-setting observations. No deprecated `Settings.Secure.mock_location` or AppOps mode is therefore used as a reliable detector. [SystemLocationServiceHooker](https://github.com/eltavine/VirtualLocation/blob/dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemLocationServiceHooker.kt) and [SystemHookUtils](https://github.com/eltavine/VirtualLocation/blob/dcbe62037d0ac01df8d6b341b0da1ba438cdd2c7/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemHookUtils.kt) also permit system-service-side rewriting and clearing mock flags. Such coherent service-side output can pass local object tests. Selective hooks can recognize synthetic objects, the detector's package or call sites. This feature does not claim a universal bypass of the reference project's hiding behavior, and does not combine same-surface observations into independent corroboration. ## Signals ### App-owned Location contract violations - Observable signal: Setter/getter values, presence flags, reset state, or a synthetic mock flag round trip disagree on two locally constructed objects. Only typed mismatched field identifiers are retained. - Producing subsystem: `android.location.Location`, a mutable framework value object within this process; no LocationManager service is involved. - Mechanism: Write two different sets of exactly representable synthetic values and read the matching getters. Check absent then present optional fields. Populate and reset an object, then check documented zero/null/absent state. API 31+ toggles `setMock(true)` then false and checks both public getter forms. The synthetic mock test never sets a test provider and cannot show that a real fix is mock. - References: [Android Location](https://developer.android.com/reference/android/location/Location); AOSP Android 10 [Location.java](https://android.googlesource.com/platform/frameworks/base/+/android-10.0.0_r1/location/java/android/location/Location.java), Android 12 [Location.java](https://android.googlesource.com/platform/frameworks/base/+/android-12.0.0_r1/location/java/android/location/Location.java), Android 15 [Location.java](https://android.googlesource.com/platform/frameworks/base/+/android-15.0.0_r1/core/java/android/location/Location.java), especially setters/getters, `reset`, `mFieldsMask`, `isMock` and `setMock`; reference-project getter hook source above. - Applicability: All supported releases for value/flag/reset checks; public mock mutation API 31+. No assumption about parcel internals, private fields or ABI layout. - Visibility limits: Same process and same framework surface only. System-only spoofing, disabled spoofing, excluded applications, scoped/selective hooks or coordinated setter/getter rewrites may leave these contracts intact. A mismatch can also arise from instrumentation or an OEM/framework defect; it does not identify its author or prove that a real location was changed. Four groups are diagnostic coverage, not four independent sources. - Result states: OBSERVED for mismatch, NOT_OBSERVED for tested agreement, UNSUPPORTED for pre-31 mock round trip, PERMISSION_LIMITED for SecurityException and UNAVAILABLE for other runtime failures. A mismatch collected before a later getter fails remains OBSERVED with its failure recorded. Failed checks alongside passing checks produce a partially evaluated verdict. The latter states never mean passing. - Interpretation: WARNING identifies a local contract violation only. Agreement is INFO and makes no authenticity claim. Observed coordinate values from a rewritten getter never enter the report, logs or export. ### Optional cached mock metadata and freshness - Observable signal: Per requested GPS/network/passive provider, whether an accessible cached fix carries the framework mock mark and its monotonic age bucket; separately the caller's permission precision, location-switch state and sample start. - Producing subsystem: LocationManager, LocationManagerService, per-user LocationProviderManager caches, permission/AppOps enforcement, and the returned Location object. - Mechanism: After explicit consent and coarse or fine foreground permission, perform at most one `getLastKnownLocation` for each of three fixed provider names. Read only the mock marker and `elapsedRealtimeNanos`. No coordinate getter, extras, raw fix wall time or accuracy is read. Buckets are RECENT (at most five minutes), STALE, FUTURE or UNKNOWN; five minutes is a display policy, not an Android trust threshold. Each provider is independent: no alleged contradiction is inferred from non-atomic reads or provider differences. - References: [Android LocationManager.getLastKnownLocation](https://developer.android.com/reference/android/location/LocationManager#getLastKnownLocation(java.lang.String)), [Location.isMock](https://developer.android.com/reference/android/location/Location#isMock()), [location permissions](https://developer.android.com/develop/sensors-and-location/location/permissions); AOSP Android 10 [LocationManagerService.getLastLocation](https://android.googlesource.com/platform/frameworks/base/+/android-10.0.0_r1/services/core/java/com/android/server/LocationManagerService.java); Android 15 [LocationManager](https://android.googlesource.com/platform/frameworks/base/+/android-15.0.0_r1/location/java/android/location/LocationManager.java), [LocationManagerService.getLastLocation](https://android.googlesource.com/platform/frameworks/base/+/android-15.0.0_r1/services/core/java/com/android/server/location/LocationManagerService.java), [LocationProviderManager.getLastLocation/getPermittedLocation](https://android.googlesource.com/platform/frameworks/base/+/android-15.0.0_r1/services/core/java/com/android/server/location/provider/LocationProviderManager.java), [LocationFudger.createCoarse](https://android.googlesource.com/platform/frameworks/base/+/android-15.0.0_r1/services/core/java/com/android/server/location/fudger/LocationFudger.java). - Applicability: Project minimum API 29; `isMock` API 31+, deprecated public `isFromMockProvider` API 18–30. No new fix is requested. Android 10 `checkResolutionLevelIsSufficientForProviderUseLocked` requires fine permission for GPS/passive and coarse for network; those two rows remain PERMISSION_LIMITED when this feature requests only coarse. Android 15 enforces at least coarse centrally and projects permitted cache data. Individual provider/OEM denials remain explicit. An SDK host's existing fine permission is recorded but never requested by this feature. - Visibility limits: Calling UID, package, current user/profile, enabled state, AppOps, foreground/background policy and cache availability constrain the answer. A null can mean no cache, disabled/inactive access or denied AppOps; these cannot be distinguished from the returned null. GPS/provider availability differs by device. Coarse-location processing can remove optional fields and add offsets. Cached values may predate a stopped service. Mock false, plausible timestamps and provider agreement are forgeable. No GNSS, cell, Wi-Fi, IP, trajectory or external attestation corroboration is implemented. - Result states: Opt-out UNAVAILABLE/DISABLED_BY_USER; missing/revoked permission or SecurityException PERMISSION_LIMITED; null cache UNAVAILABLE/NO_CACHE; missing/rejected provider UNSUPPORTED; runtime failure UNAVAILABLE. Mock true OBSERVED, false NOT_OBSERVED for that cached object only. Mock and monotonic timestamp getters have independent failure boundaries: a timestamp failure retains any mock observation with a separate freshness failure, while a mock getter failure retains any readable age. A getter's IllegalArgumentException is a field failure, not evidence that its provider is absent. Old, future or unknown timestamps have separate INCONCLUSIVE freshness rows without changing the observed mock flag. A readable unmarked fix alongside inaccessible providers produces an INCONCLUSIVE cached-mark summary, preserving the partial coverage. - Interpretation: An observed mock mark is WARNING in the headline, summary fact, provider row and App/SDK export, including stale or unknown-age caches. The warning describes the cached object, not current spoofing; a separate freshness failure cannot erase the readable mark. Legitimate test providers, emulators, automation and development can produce mock fixes. Cached mock evidence does not establish current activity; missing mock evidence does not authenticate position. Empty cache, different providers, disabled location and timestamps alone never imply spoofing. ### Exact reference package context - Observable signal: Exact `com.vincenthzr.locationspoofer` membership in the shared package inventory and the inventory's visibility assessment. - Producing subsystem: PackageManager through `capability/packageinventory`; the feature owns the one-entry reference catalog. - Mechanism: Exact package name from pinned upstream build configuration, no application-name matching. A `` entry enables normal visibility for this package; no all-users or work-profile query is issued. No signer pin is invented from the project name or repository owner. - References: Pinned upstream build configuration above; [Android package visibility](https://developer.android.com/training/package-visibility), [targeted package declarations](https://developer.android.com/training/package-visibility/declaring); [shared packageinventory evidence](../../capability/packageinventory/EVIDENCE.md) records the corresponding PackageManager filtering implementation and version boundaries. - Applicability: All supported releases, Android 11+/target 30+ visibility filtering, querying user/profile only. Repackaged applications and other package names are outside this catalog. - Visibility limits: Inventory may be incomplete or modified; other users/profiles, hidden packages, package changes during the query and hooked PackageManager output remain limitations. This source snapshot has no established upstream release signer, so no hit is marked signature verified. - Result states: OBSERVED package-name match with identity unverified; NOT_OBSERVED within stated visibility only; UNAVAILABLE on failed inventory. Query absence is never displayed as globally uninstalled. - Interpretation: WARNING for an observed exact package-name match, including identity-unverified matches. The verdict explicitly identifies package evidence. It does not establish LSPosed scope, loaded hooks, service activity, changed coordinates or attribution of a contract mismatch. Package visibility itself remains INFO. ### Consent and permission boundary - Observable signal: An explicit optional cache-consent decision plus current Android permission enforcement; local canaries remain independent of both. - Producing subsystem: Feature-owned SharedPreferences, Android runtime permission UI and location service permission/AppOps enforcement. - Mechanism: Default UNDECIDED/disabled. Setup and settings use the same feature-supplied consent card; enabling explicitly requests only ACCESS_COARSE_LOCATION. Permission denial leaves consent recorded and produces PERMISSION_LIMITED, not a false clean result. Generic app permission controls permit retry/change in OS settings. Disabling causes subsequent scans to skip even permission/service queries. Scans and the headless SDK never trigger permission prompts. Listeners owned by a consent flow are unregistered when collection ends. - References: [Android runtime permissions](https://developer.android.com/training/permissions/requesting), [location permissions](https://developer.android.com/develop/sensors-and-location/location/permissions), service enforcement sources above; [SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences). - Applicability: All supported releases; approximate foreground access is requested. No background or fine permission is added to the feature manifest. Location hardware and network location are explicitly optional so the coarse permission does not impose hardware filtering on the App or SDK host; see [permission-implied features](https://developer.android.com/guide/topics/manifest/uses-feature-element#permissions). Android may revoke permissions independently of the saved consent. - Visibility limits: Permission self-checks can be hooked; service denial/null remains explicit. An in-flight scan uses its initial consent decision; disabling takes effect on subsequent scans. The app rescans permission-dependent detectors after returning from its OS settings entry; other OS changes require a new scan. Coarse cached Location objects can contain coordinates transiently in platform-owned fields even though this feature never reads those getters. - Result states: UNDECIDED or DECLINED means cache access disabled; GRANTED does not imply OS permission or cache availability. The report independently retains access/coverage states. - Interpretation: Local synthetic checks are always available. No persistent real location, connection history, coordinates or raw location exception messages are exported. Host applications must present the SDK consent, record a decision, request coarse permission themselves if desired, and scan from an appropriate foreground lifecycle. ## Severity policy The domain owns warning aggregation and the cached-mark predicate. Presentation applies the same decisions to summary facts and detail rows; export consumes that shared model. Positive evidence takes precedence over unrelated probe failures, which remain visible in their own rows. API 31+ `isMock` and API 29–30 `isFromMockProvider` retain their existing collection paths; this policy adds no probe, permission, stored coordinate or platform assumption. Stale/future timestamps, unmarked caches, disabled collection, permission denials and package-query failures alone never trigger warning. The platform and pinned source references above establish the observations; the review severity is product policy rather than an Android security guarantee. ## Validation and remaining device coverage Severity-policy regression validation on 2026-10-24: 20 domain/presentation JVM tests passed. The full build passed 1706 JVM tests, `:app:assembleDebug`, `:app:lintDebug`, `:feature:networkrisk:data:assembleDebugAndroidTest`, `:sdk:aar:publish` and `:sdk:aar:verifySdkAar`, plus `./gradlew -p samples/sdk-consumer assembleDebug`, using the repository-pinned uihelper revision `32988d6539ec3bb2dadefa8a24a685616bec0439`. The seven repository guards passed. The severity policy has not been revalidated on a physical device; the earlier emulator results below establish collection coverage rather than validation of the new warning policy. Verified on API 29 / Android 10 and API 36 / Android 16 arm64 emulators under ordinary application UIDs: thirteen instrumentation cases passed both without location permission and with coarse permission. The local contract tests and typed domain/presentation/cache-age JVM tests passed. Physical-module coverage remains pending. - Domain rules cover every non-observed state, local mismatches, mock marks across all age buckets, freshness failure alongside a readable mock mark, and installed-only warnings. Presentation verifies matching headline/fact/detail/export warnings while freshness and visibility rows remain informational. Presentation tests keep synthetic mock mismatches separate from cached mock marks, preserve access/freshness limits and verify App/SDK export verdict parity. - Android instrumentation exercises ordinary UID, clean platform contracts, a deliberately rewritten getter, a hidden mock getter, unavailable/denied local probes, opt-out zero access, missing-permission zero service calls, consent revocation and bounded cached reads. It also verifies that later getter failures preserve earlier mismatches, mock and timestamp failures remain independent, coordinate/extra getters are never read, getter argument failures do not imply absent providers, and cancellation propagates. Injected subclasses verify the diagnostic mechanism; they are not an end-to-end validation against a loaded LSPosed module. - Required physical-device follow-up: pinned VirtualLocation scoped/global flavors, only installed, hooks disabled, spoofing active, detector excluded, selective hooks, mock hiding, service stop and coarse-permission revocation; compare observed behavior against module configuration/logs while DuckDetector retains ordinary permissions. Also verify clean OEM devices, legitimate mock providers, offline/no-cache states and work-profile boundaries. Unperformed cases are not represented as successful detections.