Class LicenseUtil

java.lang.Object
com.jwplayer.pub.api.license.LicenseUtil

public class LicenseUtil extends Object
Reads license keys from (in this order): application's manifest, app_data_dir/LICENSE_FILENAME, SHARED_PREFERENCES_FILE_NAME, or BuildConfig.LICENSE_KEY

Writes license keys to app_data_dir/LICENSE_FILENAME, or SHARED_PREFERENCES_FILE_NAME

  • Constructor Details

    • LicenseUtil

      public LicenseUtil()
  • Method Details

    • getLicenseKey

      public String getLicenseKey(Context context)
      Attempt to read the license key from several locations in this order:
      • Application preferences
      • BuildConfig.LICENSE_KEY
      Parameters:
      context - Current context.
      Returns:
      The license key, empty string if none could be found.
    • setLicenseKey

      public void setLicenseKey(Context context, String license)
      Writes the provided license to the shared preferences
      Parameters:
      context - The application's context
      license - The license key to write