https://github.com/sethusenthil/is-pirated
Check if your app is installed from an unauthorized source
https://github.com/sethusenthil/is-pirated
dart flutter piracy pubdev
Last synced: 3 months ago
JSON representation
Check if your app is installed from an unauthorized source
- Host: GitHub
- URL: https://github.com/sethusenthil/is-pirated
- Owner: SethuSenthil
- License: mit
- Created: 2021-04-18T06:09:56.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T00:59:09.000Z (about 2 years ago)
- Last Synced: 2025-10-23T00:53:59.083Z (3 months ago)
- Topics: dart, flutter, piracy, pubdev
- Language: Dart
- Homepage: https://pub.dev/packages/is_pirated
- Size: 74.2 KB
- Stars: 8
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# is_pirated 🏴☠️
[](https://pub.dev/packages/is_pirated/)
Check if your app is installed from an unauthorized source
On Android API 29 and below, uses `Context.getInstallerPackageName()`
On Android API 30 and above, uses `PackageManager.getInstallSourceInfo()`
On iOS, parses `Bundle.main.appStoreReceiptURL`
Installing
----------
Add to your pubspec.yaml
```yaml
dependencies:
is_pirated:
```
Example
-------
```dart
IsPirated isPirated = await getIsPirated();
print(isPirated.status);
// false - (iOS) if installed from AppStore or TestFlight, (Android) if installed from PlayStore
// true - if installed without authorization or receipt (Via ABD, APK, IPA)
//full example
IsPirated isPirated = await getIsPirated(debugOverride: true, openStoreListing: true, appStoreId: '546532666', playStoreIdentifier: 'tikmoji.sethusenthil.com');
//debugOverride will disable installer integrity checking on debug mode (recommended setting after you finish setting up this lib!)
//openStoreListing will auto open your appstore or playstore listing depending on the platform
```
## Options for .getIsPirated()
| Name | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **debugOverride** | **bool**
Default set to false. Override unauthorized installation checking when on debug mode. Set this to true after configuring this library. |
| **openStoreListing** | **bool**
Default set to false. Open the AppStore or PlayStore listing if isPirated.status = true. Must set appStoreId & playStoreIdentifier for this to take any effect on its respective platform. |
| **appStoreId** | **String**
The AppStore App Id for your app so openStoreListing can open your store listing. You can find it in the url of your app: 'https://apps.apple.com/us/app/tikmoji/id**1546532666**' Must set openStoreListing true. |
| **playStoreIdentifier** | **String**
The PlayStore App Store Identifier for your app so it can open your listing on the PlayStore. You can find this in your manifest or your PlayStore URL: https://play.google.com/store/apps/details?id=**com.sethusenthil.tikmoji** |
| **closeApp** | **bool**
Default set to false. Closes and quits out of your app if isPirated.status = true. If openStoreListing is set to true, it will open your store listing before quitting. Note that getIsPirated() may not return a value if set to true because the Dart VM will likely be terminated before. | |
## Credits
Inspired and heavely based on https://github.com/caiopo/flutter-installer-info