0

I use the latest (3.4.1) version of the KNOX libraries, and trying to activate my license.

My AndroidManifest entry:

        <receiver
            android:name=".receiver.KnoxLicenseReceiver"
            tools:ignore="ExportedReceiver">
            <intent-filter>
                <action android:name="com.samsung.android.knox.intent.action.LICENSE_STATUS" />
            </intent-filter>
        </receiver>

And activating the license like this:

KnoxEnterpriseLicenseManager
                .getInstance(context)
                .activateLicense(context.getString(R.string.const_kpe_key), getPackageName.exec())

It shows the Toast that the license was activated successfully (and works fine — I can, for example, disable the camera), but the receiver is never called.

I've tried on multiple devices with different Android versions (5.1 and 7.1) with no luck. What's wrong?

Andrii Artamonov
  • 622
  • 8
  • 15
artem
  • 16,382
  • 34
  • 113
  • 189
  • have you read throught the LogCat to see if Knox sends out a broadcast & if so how it differs from your receiver – Blundell Jan 31 '20 at 15:41
  • @Blundell `adb shell dumpsys activity broadcasts history | grep LICENSE_STATUS` does not show anything – artem Jan 31 '20 at 15:49

1 Answers1

2

Well, Samsung docs are not correct. Correct intent action is

com.samsung.android.knox.intent.action.KNOX_LICENSE_STATUS

while action in docs is

com.samsung.android.knox.intent.action.LICENSE_STATUS
artem
  • 16,382
  • 34
  • 113
  • 189
  • 1
    It seems like the differentiator is whether you use KnoxEnterpriseLicenseManager or EnterpriseDeviceManager. Which depends on what type of license you want to activate. I guess they have many types and they might keep changing it but for simplification it might be either ELM(EnterpriseDeviceManager) or KPE(KnoxEnterpriseLicenseManager) license. https://docs.samsungknox.com/devref/knox-sdk/reference/com/samsung/android/knox/license/KnoxEnterpriseLicenseManager.html https://docs.samsungknox.com/devref/knox-sdk/reference/com/samsung/android/knox/license/EnterpriseLicenseManager.html – Tomas Kosar Jan 08 '21 at 10:45