GitHub 儲存庫SethuSenthil/is-pirated

is-pirated

檢查您的應用是否從未經授權的來源安裝

is-pirated 專案封面
星標
9
分支
5
最近推送(UTC)
2023年12月12日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

is_pirated 🏴‍☠️

Pub Version

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

dependencies:
  is_pirated: <version>

Example

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/id1546532666' 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

Sethu Narayan Senthil GitHub avatar
GitHub 作者

Sethu Narayan Senthil ↗

PSU '25 • Full Stack Developer

CS @PennState & CEO of @Vibin-LLC™ & AI Engineer @IBMState College, PA
語言DartRubyKotlinSwiftObjective-C

分類

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項

  • url_launcher^6.1.2
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗