Lebih cepat ke konten

Mulai Berlatih

GitHub
Jendela terminal
bun add @capgo/capacitor-mock-location-detector
bunx cap sync
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.riskScore, result.checks);
}
const mockFlag = await MockLocationDetector.runCheck({
check: 'system_mock_flag',
});
await MockLocationDetector.addListener('locationIntegrityChanged', (event) => {
console.log('Integrity changed', event.confidence, event.checks);
});
await MockLocationDetector.startMonitoring({ intervalMs: 30000 });

Aplikasi tidak dapat menonaktifkan mode pengembang atau lokasi palsu secara otomatis. Buka pengaturan saja:

await MockLocationDetector.openDeveloperSettings();

Konfigurasi Platform

Platform Setup

Pengaturan Android

Sumber Kebenaran

Source Of Truth src/definitions.ts. Re-run docgen upstream when the public API changes.