ガイド
Capacitor で Mock Location Detector を使う方法
@capgo/capacitor-mock-location-detector の使用方法
iOS と Android で、App Store の規約に準拠した多層的なチェックを行い、偽装された GPS 位置情報を検知します。
インストール
bun add @capgo/capacitor-mock-location-detector
bunx cap sync
このプラグインで利用可能な機能
analyze- 利用可能なすべてのチェックを実行し、スコア化された総合結果を返します。runCheck- 指定した検出レイヤーを個別に実行します。getCapabilities- 現在のプラットフォームでサポートされているチェックを確認します。startMonitoring/stopMonitoring- イベントに基づいた定期的な解析を行います。openDeveloperSettings- 開発者ツールやモックツールの無効化をユーザーに促します。
使用例
import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
const result = await MockLocationDetector.analyze({
requestLocationSample: true,
minDetectedChecks: 1,
});
if (result.isSimulated) {
console.warn('Possible GPS spoofing detected', result.checks);
}
await MockLocationDetector.openDeveloperSettings();
リファレンス全文
- GitHub: https://github.com/Cap-go/capacitor-mock-location-detector/
- ドキュメント: /docs/plugins/mock-location-detector/