<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Stoner Physics</title>
    <description>The latest articles on DEV Community by Stoner Physics (@stonerphysics).</description>
    <link>https://dev.to/stonerphysics</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4281910%2F4fd46201-6874-4abb-bd46-dd643e296b05.png</url>
      <title>DEV Community: Stoner Physics</title>
      <link>https://dev.to/stonerphysics</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stonerphysics"/>
    <language>en</language>
    <item>
      <title>Why Android 15 &amp; 16 Catch Fake GPS Apps (and How Fused Location + ADB Stealth Actually Work Without Root)</title>
      <dc:creator>Stoner Physics</dc:creator>
      <pubDate>Fri, 04 Dec 2026 23:10:20 +0000</pubDate>
      <link>https://dev.to/stonerphysics/why-android-15-16-catch-fake-gps-apps-and-how-fused-location-adb-stealth-actually-work-without-gk5</link>
      <guid>https://dev.to/stonerphysics/why-android-15-16-catch-fake-gps-apps-and-how-fused-location-adb-stealth-actually-work-without-gk5</guid>
      <description>&lt;p&gt;If you build or test location-aware Android apps—or you have ever wondered why a plain Play Store fake-GPS app immediately snaps back to your real location or gets rejected—Android's location stack checks three completely separate signals. Fixing only one of them is why most mock-location apps fail on Android 14, 15, and 16.&lt;/p&gt;

&lt;p&gt;Here is how each check works under the hood and what actually happens on an unrooted device.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Per-Fix Mock Flag (&lt;code&gt;Location.isMock()&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;When you select a mock location app in Developer Options, Android grants &lt;code&gt;AppOpsManager.OPSTR_MOCK_LOCATION&lt;/code&gt; and allows that app to inject fixes via &lt;code&gt;LocationManager.setTestProviderLocation()&lt;/code&gt; and &lt;code&gt;FusedLocationProviderClient.setMockLocation()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The catch: Android stamps every injected &lt;code&gt;Location&lt;/code&gt; object before delivering it to any other process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Android 12+ (API 31–36):&lt;/strong&gt; &lt;code&gt;location.isMock()&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android 4.3–11 (still called by legacy SDKs):&lt;/strong&gt; &lt;code&gt;location.isFromMockProvider()&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extras bundle:&lt;/strong&gt; certain OEMs/providers attach mock metadata in &lt;code&gt;location.getExtras()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because Google Play's Device and Network Abuse policy prohibits Play-distributed apps from stripping those flags, Play Store mock-location apps (including &lt;a href="https://play.google.com/store/apps/details?id=com.gpspoofer.free" rel="noopener noreferrer"&gt;GPS Spoofer Lite&lt;/a&gt;) can only supply standard flagged test fixes.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. System Settings Checks (&lt;code&gt;mock_location&lt;/code&gt; &amp;amp; Developer Options)
&lt;/h2&gt;

&lt;p&gt;Enterprise attendance apps, banking/fintech SDKs, and geo-fenced work apps frequently fail &lt;strong&gt;before&lt;/strong&gt; even reading a GPS fix. They query:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Settings.Global.DEVELOPMENT_SETTINGS_ENABLED&lt;/code&gt; (&lt;code&gt;development_settings_enabled&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Settings.Secure.ALLOW_MOCK_LOCATION&lt;/code&gt; (&lt;code&gt;mock_location&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even though &lt;code&gt;ALLOW_MOCK_LOCATION&lt;/code&gt; was deprecated in API 23, many production Android apps still check both settings flags and refuse to run when Developer Options is turned on.&lt;/p&gt;

&lt;h3&gt;
  
  
  How ADB Stealth hides both flags without root
&lt;/h3&gt;

&lt;p&gt;An app holding &lt;code&gt;android.permission.WRITE_SECURE_SETTINGS&lt;/code&gt;—granted once over USB or Wireless ADB via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb shell pm grant com.gpspoofer.app android.permission.WRITE_SECURE_SETTINGS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can temporarily toggle &lt;code&gt;development_settings_enabled&lt;/code&gt; and &lt;code&gt;mock_location&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; while active spoofing is running, then automatically restore Developer Options to &lt;code&gt;1&lt;/code&gt; the moment spoofing stops.&lt;/p&gt;

&lt;p&gt;Here is an unedited screen recording on an unrooted Samsung Galaxy S22+ running Android 16 demonstrating both settings flipping live while coordinates continue updating:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/fP13_H-rdIY" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Fused Location Snap-Back (Samsung One UI, Xiaomi HyperOS, Vivo)
&lt;/h2&gt;

&lt;p&gt;The #1 complaint from testers is &lt;strong&gt;"my fake GPS keeps jumping back to my real location every few seconds."&lt;/strong&gt; That happens when an app mocks only &lt;code&gt;LocationManager.GPS_PROVIDER&lt;/code&gt; while Google Play Services' &lt;code&gt;FusedLocationProviderClient&lt;/code&gt; continues blending real Wi-Fi scan results, Bluetooth beacons, and cell-tower IDs into higher-priority fixes.&lt;/p&gt;

&lt;p&gt;Full troubleshooting breakdown for Samsung, Xiaomi, and Pixel snap-back: &lt;a href="https://stonerphysics.net/fake-gps-keeps-jumping" rel="noopener noreferrer"&gt;Fake GPS Keeps Jumping Back to Real Location — 2026 Fixes&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Hiding &lt;code&gt;isMock()&lt;/code&gt; Without Root: On-Device Patching vs. Container Mode
&lt;/h2&gt;

&lt;p&gt;On an unrooted phone, there are only two reliable ways to strip &lt;code&gt;Location.isMock()&lt;/code&gt; before a target app reads it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;On-device APK patching (LSPatch):&lt;/strong&gt; Embeds a lightweight hook module directly inside the target app's own process so &lt;code&gt;isMock()&lt;/code&gt;, &lt;code&gt;isFromMockProvider()&lt;/code&gt;, and mock extras return clean values—zero root, zero Magisk, zero system modification. Tradeoff: re-signing changes the APK signature, so Google Sign-In rejects the patched copy (use email, phone, or password login).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolated Container Mode:&lt;/strong&gt; Runs the unmodified target APK inside an isolated virtual Android container on-device that supplies clean GPS fixes without altering the original APK signature.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;More technical details on every detection layer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stonerphysics.net/hide-mock-location-android" rel="noopener noreferrer"&gt;How to Hide Mock Location on Android Without Root&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stonerphysics.net/gpspoofer" rel="noopener noreferrer"&gt;GPS Spoofer Unlimited (Android 8–16, No Root)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stonerphysics.net/fake-gps-india-android" rel="noopener noreferrer"&gt;India Setup Guide (Xiaomi / Samsung / OnePlus + UPI AutoPay)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stonerphysics.net/buy-fake-gps-with-crypto" rel="noopener noreferrer"&gt;Direct Crypto Checkout Guide (USDT / USDC / BTC / SOL — No Card Needed)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>androidkotlingpsmobile</category>
    </item>
    <item>
      <title>How Android Mock Location Detection Works in 2026 (Location.isMock, Developer Options &amp; Fused Location)</title>
      <dc:creator>Stoner Physics</dc:creator>
      <pubDate>Fri, 04 Dec 2026 05:46:34 +0000</pubDate>
      <link>https://dev.to/stonerphysics/how-android-mock-location-detection-works-in-2026-locationismock-developer-options-fused-1b73</link>
      <guid>https://dev.to/stonerphysics/how-android-mock-location-detection-works-in-2026-locationismock-developer-options-fused-1b73</guid>
      <description>&lt;p&gt;When building or testing location-aware Android apps in 2026, almost every developer runs into the same three questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How does Android's mock location system work on an unrooted device?&lt;/li&gt;
&lt;li&gt;What exact APIs and system flags do apps check to detect simulated GPS coordinates?&lt;/li&gt;
&lt;li&gt;Why does toggling Developer Options off immediately kill an active mock provider?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the technical breakdown based on AOSP source behavior and testing across Android 8.0 through Android 16 / 17 QPR1.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. How Android injects a mock location without root
&lt;/h2&gt;

&lt;p&gt;On an unrooted Android device (API 23+), ordinary apps cannot write directly to the GNSS HAL. The only sanctioned entry point is &lt;code&gt;LocationManager.addTestProvider()&lt;/code&gt; combined with &lt;code&gt;setTestProviderLocation()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Android throws a &lt;code&gt;SecurityException&lt;/code&gt; unless the calling package holds the &lt;code&gt;android:mock_location&lt;/code&gt; app-op — which is granted exclusively to the single app selected under &lt;strong&gt;Settings → Developer options → Select mock location app&lt;/strong&gt; (or via &lt;code&gt;adb shell appops set &amp;lt;pkg&amp;gt; android:mock_location allow&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The three detection layers apps inspect
&lt;/h2&gt;

&lt;p&gt;Apps that validate user coordinates (location-based games, dating apps, fleet/attendance tools, and anti-fraud SDKs) typically check three independent layers:&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer A: Per-&lt;code&gt;Location&lt;/code&gt; mock flags
&lt;/h3&gt;

&lt;p&gt;Every &lt;code&gt;Location&lt;/code&gt; object pushed through a test provider is flagged by the framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Android 12 (API 31)+:&lt;/strong&gt; &lt;code&gt;Location.isMock()&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android 11 and earlier:&lt;/strong&gt; &lt;code&gt;Location.isFromMockProvider()&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extras bundle:&lt;/strong&gt; legacy OEM / SDK checks also inspect &lt;code&gt;Location.getExtras()&lt;/code&gt; for mock markers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Layer B: System settings (&lt;code&gt;Settings.Global&lt;/code&gt; / &lt;code&gt;Settings.Secure&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Apps historically checked two settings flags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Settings.Global.DEVELOPMENT_SETTINGS_ENABLED&lt;/code&gt; (&lt;code&gt;development_settings_enabled&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Settings.Secure.ALLOW_MOCK_LOCATION&lt;/code&gt; (&lt;code&gt;mock_location&lt;/code&gt;, deprecated since Android 6, still read by older SDKs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On newer Android releases (documented in &lt;code&gt;Settings.Global&lt;/code&gt; and observed on Pixel Android 17 QPR1), &lt;code&gt;development_settings_enabled&lt;/code&gt; returns &lt;code&gt;0&lt;/code&gt; for third-party apps. On older OEM builds where it still returns &lt;code&gt;1&lt;/code&gt;, granting &lt;code&gt;WRITE_SECURE_SETTINGS&lt;/code&gt; once via ADB lets a testing utility temporarily clear those settings during a session without root.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer C: Fused location &amp;amp; rubber-banding
&lt;/h3&gt;

&lt;p&gt;Even when &lt;code&gt;GPS_PROVIDER&lt;/code&gt; receives clean mock fixes, Google Play Services' Fused Location Provider (&lt;code&gt;FusedLocationProviderClient&lt;/code&gt;) blends Wi-Fi scan results, cell towers, and inertial sensors. If a mock provider only updates &lt;code&gt;gps&lt;/code&gt; without also feeding fused/network providers or matching plausible velocity and altitude jitter, target apps see coordinates snap back ("rubber-banding") between real and simulated locations.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why you cannot turn Developer Options back off while mocking
&lt;/h2&gt;

&lt;p&gt;In AOSP's Settings app, &lt;code&gt;MockLocationAppPreferenceController.onDeveloperOptionsDisabled()&lt;/code&gt; explicitly revokes &lt;code&gt;android:mock_location&lt;/code&gt; from every app whenever the Developer Options master switch is flipped off. That is why no unrooted app can keep injecting mock locations with Developer Options disabled — the setting must remain on (or hidden from third-party reads via ADB stealth).&lt;/p&gt;




&lt;h2&gt;
  
  
  Full technical documentation &amp;amp; tools
&lt;/h2&gt;

&lt;p&gt;We maintain detailed no-root Android location testing documentation and build &lt;a href="https://stonerphysics.net/gpspoofer" rel="noopener noreferrer"&gt;GPS Spoofer for Android&lt;/a&gt; (with an official &lt;a href="https://stonerphysics.net/fake-gps-apk" rel="noopener noreferrer"&gt;Fake GPS APK guide&lt;/a&gt; and a free Lite edition on Google Play):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://stonerphysics.net/hide-mock-location-android" rel="noopener noreferrer"&gt;How to hide mock location on Android without root&lt;/a&gt; — deep dive into &lt;code&gt;isMock()&lt;/code&gt;, LSPatch, Container mode, and ADB stealth&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stonerphysics.net/fake-gps-without-developer-options" rel="noopener noreferrer"&gt;Fake GPS without Developer Options: what Android actually enforces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stonerphysics.net/fake-gps-keeps-jumping" rel="noopener noreferrer"&gt;Fixing mock GPS rubber-banding on Android&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/sensorshooter/gps-spoofer-android" rel="noopener noreferrer"&gt;Public documentation repository on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>android</category>
      <category>api</category>
      <category>mobile</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
