Skip to content

Change Security Settings

Patryk Michalik edited this page Mar 22, 2021 · 2 revisions

MainActivity.kt (in package directory) contains security settings.

Amazon AppStore

You can allow installs from Amazon AppStore via amazonInstallsEnabled.

  • true allows installs from Amazon AppStore.
  • false disables the app if it has been obtained from Amazon AppStore.
override fun amazonInstallsEnabled():Boolean = true | false

Lucky Patcher

checkLPF defines whether to disable the app on devices with Lucky Patcher installed.

  • true disables your app if Lucky Patcher is detected.
  • false ignores Lucky Patcher.
override fun checkLPF():Boolean = true | false

Third-Party Stores

checkStores can disable your app on devices with third-party stores installed.

  • true disables your app if third-party stores are detected.
  • false ignores third-party stores.
override fun checkStores():Boolean = true

Set up the License Checker

The license checker disables your app if it’s been pirated. In Google Play Console, go to Monetisation Setup. Copy the license key and set it as an argument for getLicKey.

override fun getLicKey():String? = "MIIBIjANBgkqhkiGgKglYGYGihLuihUuhhuBlouBkuiuBIyvYV"

Customise or Turn Off the License Checker

By default, the license checker is only turned on for release builds. You can customise this behaviour by editing the return statement of getLicenseChecker. Common configurations include:

  • return null to disable the license checker.
  • return super.getLicenseChecker() to enable the license checker in all builds.
override fun getLicenseChecker():PiracyChecker? {
    destroyChecker() ...
    return if (BuildConfig.DEBUG) null else super.getLicenseChecker()
}