기기의 위치가 시뮬레이션되거나 위조되었는지 감지하는 플러터 플러그인입니다. 안드로이드 및 iOS에서 플랫폼 전용 API를 활용하여 GPS 신호의 일관성 부족이나 비정상적인 이동 패턴과 같은 위조 징후를 분석합니다. 이를 통해 앱은 사용자 위치의 진위 여부를 확인할 수 있으며, 위치 민감한 애플리케이션의 보안과 신뢰성을 향상시킵니다. 이 플러그인은 가볍고 기존 플러터 프로젝트에 원활하게 통합됩니다.
사용 사례
공유 탑승 앱에서 사용자 위치 확인
지오로케이션 기반 서비스에서의 사기 방지
피트니스 트래킹 앱의 정확성 보장
지역 제한 콘텐츠에 대한 액세스 보호
가짜 체크인 또는 위치 공유 감지
주요 기능
Android 및 iOS용 크로스 플랫폼 지원
정확한 탐지에 네이티브 장치 API 사용
경량이며 통합이 쉬움
위치 위조에 대한 명확한 표시 제공
최소 성능 오버헤드
적합한 대상
안전한 위치 검증이 필요한 앱
위치 인식 서비스를 구축하는 개발자
사기 방지 요구 사항이 있는 애플리케이션
실시간 지리 위치를 사용하는 모바일 앱
위치 무결성 기준 준수를 필요로 하는 프로젝트
고려 사항
위치 접근을 위한 적절한 권한이 필요합니다
모든 고급 스푸핑 방법을 감지하지 못할 수 있습니다
기기 간에 동작이 약간 다를 수 있습니다
서버 측 검증의 대체가 아님
루트 또는 제일브레이크된 장치에서의 효과는 제한적
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
detect_fake_location
This is a Flutter plugin that detects if the user is using a fake(mock or simulated) location on their device.
Installation
To use this plugin, add detect_fake_location as a dependency in your pubspec.yaml file.
Permissions
iOS
Add the following entries to your Info.plist file
<key>NSLocationAlwaysUsageDescription</key><string>App needs access to location when in the background.</string><key>NSLocationWhenInUseUsageDescription</key><string>App requires access to location when open.</string>
Add the following to your Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
# Start of the permission_handler configuration
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
# dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
'PERMISSION_LOCATION=1'
]
end
end
end
Android
Add the ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permission to your Android Manifest.
By default, the plugin detects fake locations from both software simulation and external accessories. However, external accessories like CarPlay, external GPS devices, or other legitimate hardware can trigger false positives.
Default:false (maintains backward compatibility)
When to use true: If you want to ignore location data from external accessories and only detect software-based fake locations
Use case: Prevent false positives when users have legitimate external accessories connected
For iOS, the plugin uses the CLLocationSourceInformation class to detect if the location is simulated by software or produced by an external accessory. This class is only available on iOS 15 or later.
Contribute
Contributions are welcome! Please submit issues and pull requests on the GitHub repository.