가이드
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- 사용자에게 개발자 도구나 Mock 도구를 비활성화하도록 안내합니다.
사용 예시
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/