https://github.com/dreamlinerm/capacitor-check-ismock-location
Capacitor plugin for Android which checks if location is spoofed/mock/fake or MockProvider is enabled.
https://github.com/dreamlinerm/capacitor-check-ismock-location
Last synced: about 1 month ago
JSON representation
Capacitor plugin for Android which checks if location is spoofed/mock/fake or MockProvider is enabled.
- Host: GitHub
- URL: https://github.com/dreamlinerm/capacitor-check-ismock-location
- Owner: Dreamlinerm
- Created: 2023-09-12T14:59:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-27T20:41:00.000Z (over 1 year ago)
- Last Synced: 2024-05-02T04:11:02.959Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 417 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# capacitor-check-ismock-location
The Capacitor plugin finds out if a location is spoofed/mock/fake on android not yet ios.
Implemented the functions on https://stackoverflow.com/questions/6880232/disable-check-for-mock-location-prevent-gps-spoofing as a Capacitor plugin
## Install
```bash
npm install capacitor-check-ismock-location
npx cap sync
```
## Example
```javascriptimport { Location } from "capacitor-check-ismock-location";
...
const isMocked = await Location.isMocked();
alert('isMocked: ' + JSON.stringify(isMocked));
const isLastLocationMocked = await Location.isLastLocationMocked();
alert('isLastLocationMocked: ' + JSON.stringify(isLastLocationMocked));
const installedMockPermissionApps = await Location.installedMockPermissionApps();
alert('installedMockPermissionApps: ' + JSON.stringify(installedMockPermissionApps));
```Add this to your app Manifest.xml
```html```
or,
```html```
## API* [`isMocked()`](#ismocked)
* [`isLastLocationMocked()`](#islastlocationmocked)
* [`installedMockPermissionApps()`](#installedmockpermissionapps)
* [Interfaces](#interfaces)### isMocked()
```typescript
isMocked() => Promise
```Is the last location mocked or MockProvider is enabled. Returns false on error.
**Returns:**
Promise<ObjectWithBooleanValue>
**Since:** 1.0.0
--------------------
### isLastLocationMocked()
```typescript
isLastLocationMocked() => Promise
```Is the last location mocked. Returns false on error.
**Returns:**
Promise<ObjectWithBooleanValue>
**Since:** 1.0.0
--------------------
### installedMockPermissionApps()
```typescript
installedMockPermissionApps() => Promise
```Is MockProvider enabled. Returns false on error.
**Returns:**
Promise<ObjectWithBooleanValue>
**Since:** 1.0.0
--------------------
### Interfaces
#### ObjectWithBooleanValue
Object with the value property that is a boolean. Returns false on error.
| Prop | Type |
| ----------- | -------------------- |
| **`value`** |boolean
|