Sandeep Gandhi
Feb 20, 2018
2:19 pm

Knox SDK ELM License activation getting failed

Hi Team,

      I want to convert my existing application to use the new samsung knox sdk (IDE- Android studio 3.0.1 & gradle-4.1).I have followed exact steps as you mentioned in your samsung knox sdk migration guide.

Steps :

       1. Added knoxsdk.jar & supportlib.jar  as i want to run that application on a device that is running Knox v2.7 or earlier.

      2. Also added these .jar files in build.gradle file in dependencies as follows:

          To include supportlib.jar at run-time :-

              apk files('libs/supportlib.jar')

        To include knoxsdk.jar at compile-time:-

             provided files('libs/knoxsdk.jar')

    3.Replaced an old package name with its new one. 

          'android.app.enterprise.' replaced by 'com.samsung.android.knox

  .I already have an ELM (Enterprise License Management) license key which i am using for activation of license .

Application runs successfully .After activating device admin i am getting ELM Activation page to activate that license

But when i confirm to activate that license that LicenseReceiver is not getting called .

i have registered this LicenseReceiver in Android Manifest as follows:

  <receiver android:name=".knox.broadcastreceiver.LicenseReceiver"

            android:enabled="true">

            <intent-filter>

                <action android:name="com.samsung.android.knox.intent.action.LICENSE_STATUS" />

            </intent-filter>

</receiver>

I have tried all this in your sample application which you have provided on your portal.

1> Get started with the Knox SDK :-

     I have added supportlib.jar  for backward Compatibilty.

But getting same issue i am not able to Activate ELM license.

So Kindly help me to resolve this issue.

Thanks.

 

 

Samuel Goldwax
Feb 20, 2018
5:46 pm

Hi Sandeep,

The Knox SDKs no longer uses legacy ELM and KLM license keys for activation, they use new SKL keys. You can generate them from the license key page of SEAP similar to the legacy keys. Simply activate an SKL key using KnoxLicenseManager and you should be good to go. A backwards compatible key is generated alongside the SKL key. You'll need to activate this key using EnterpriseLicenseManager in order to run the Knox SDK on devices running Knox version < 2.8.

Thanks,

Sam

Comments

Hi Samuel,

 I have refered below link to generate SKL Key and backward compatible key :

"https://seap.samsung.com/license-keys/how-to"

How to use License keys.

In that you have mentioned to activate SKL key on devices with Knox v2.7 or earlier we have to use below code :

KnoxEnterpriseLicenseManager klmManager = KnoxEnterpriseLicenseManager.getInstance(context);
// Activate the Samsung Knox License key
klmManager.activateLicense("SKL_KEY");

this SKL key activation Listen for broadcast intent edm.intent.action.knox_license.status

And to activate backwardcompatible key :-

// Get an instance of the License Manager
EnterpriseLicenseManager elmManager = EnterpriseLicenseManager.getInstance(context);

// Activate the backwards-compatible backwards-compatible ELM license key
elmManager.activateLicense("backward-compatible_key");

This backward compatible key Listen for broadcast intent edm.intent.action.license.status.

edm.intent.action.knox_license.status
edm.intent.action.license.status

When i used these broadcast intent that time my broadcast receiver get called but this intent action does not get matched with 
KnoxEnterpriseLicenseManager.ACTION_LICENSE_STATUS which gives this action "com.samsung.android.knox.intent.action.KNOX_LICENSE_STATUS" provided by knoxsdk.jar
And when i add this "com.samsung.android.knox.intent.action.KNOX_LICENSE_STATUS" as broadcast intent ,My LIcenseReceiver doesn't get called.

I am not able to activate this SKL  Key Can you explain me where i am going wrong.

I have downloaded these  knoxsdk.jar & supportlib.jar files from your SEAP portal.

Thanks.

Sandeep GandhiFeb 23, 2018 at 1:22 pm

Hi Sandeep,

It looks like you're activating the licenses correctly. If you listen for the edm.x actions, are the broadcasts properly received? Also are the receivers correctly registered in the Android manifest?

Thanks,
Sam

Samuel GoldwaxFeb 23, 2018 at 6:29 pm
2
Samuel Goldwax
Feb 26, 2018
5:38 pm

Hi Sandeep,

Thanks for the information so far! Just to ensure that this license activation isn't a device issue, could you try activating your license with one of our sample applications? If the device runs knox 2.7.1 or below, please use the backwards compatibility app. If it works you might want to check out the implementation of the license activation. Also please let me know the model, OS, and Knox version of the device you're using and I'll try to reproduce the issue.

Thanks,

Sam

Edit: Added hyperlinks

Comments

Hi Samuel,

As You said I have tried Backward Compatibility app from your portal.

With the sample application I have made following changes.
1. min Sdk version i have changed to 17
2. checkApiLevel i have passed - 8

in your application gradle :

dependencies {
    //compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    provided files('libs/knoxsdk.jar')
    apk files('libs/supportlib.jar')
    provided files('libs/supportlib.jar')
}
  • Backward compatible application test result for following devices.
  1. Samsung (Galaxy s5) - SM-G900H - Android Version 6.0.1 - SKL Activation - WorkingBackward compatible (ELM Activation Key) - Working
  2. Galaxy Grand 2 - SM-G7102 - Android Version 4.3 - SKL Activation - Working, Backward compatible (ELM Activation Key) - Not Working, Error - (Error Code 502) - " network general error"
  3. Galaxy Grand Neo -  GT-I9060 - Android Version 4.2.2 - SKL Activation - Not Working, Backward compatible (ELM Activation Key) - Working        

Note: 1. For Error Code 502 we have Refered link. i got to know This could be caused by restrictions from your admin blocking our servers or a spotty WiFi connection.so i have tried it using mobile network but still i am getting the same error code.

2. For Galaxy Grand Neo - I m getting this  logs in logcat "Activating KLM license" in your sample application. 

So can you please help us out with this. 

Thanks.


 
Sandeep GandhiFeb 27, 2018 at 3:14 pm

Hi Sandeep, could you let me know the Knox version of each of these devices? You can view it in Settings > About Device ( > Software Information). I might also need a device dumpstate for the failed license activations. I'll try to reproduce them on my end first. Thanks!

Samuel GoldwaxFeb 27, 2018 at 5:55 pm
3
Samuel Goldwax
Mar 01, 2018
6:10 pm

Hi Sandeep,

Could you reproduce these errors then send me dumpstates of the affected devices to s.goldwax@partner.samsung.com? I will do what I can to try and resolve these licensing issues, but if it turns out they are device issues, there may not be a whole lot to be done, since I don't believe firmware updates are being pushed to devices that old.

Thanks,

Sam

Comments

Hi Samuel,

              Thank you for your reply and I truly appreciate your time and efforts for helping us to solve this issue,Could you please guide us how to capture dumpstates after reproducing these errors.

Thanks.

Sandeep GandhiMar 02, 2018 at 6:39 am

Hi Sandeep,

You can take a device dumpstate in two ways:

  • Using the adb command: adb shell dumpstate > dumpstate.txt
    • This will create a file dumpstate.txt in the adb directory that contains the dumpstate.
  • In the phone's dialer, type *#9900#. This should open a menu, from there set debug level to high. This may prompt a device restart, simply navigate back the the menu after the restart. After that press Run dumpstate/logcat. This will create the dumpstate in the log directory in internal storage.
    • Note that this method may not work depending on your carrier, so if you cannot open the menu via *#9900#, you'll have to use the adb command

Thanks,

Sam

Samuel GoldwaxMar 02, 2018 at 6:06 pm
Vanda Cabanova
Oct 10, 2018
3:15 pm

Hello, I was having exactly the same problem and the solution is to add the IntentConverterReceiver to the manifest as descrbed here https://seap.samsung.com/html-docs/knox-migration/Content/support-older-...

Comments

I came here because I am also having trouble getting licences to be validated. This `IntentConverterReceiver` sounds promising - but that link is dead. Is there an updated link to follow?

Richard Le MesurierMar 06, 2019 at 7:58 am

Hi Richard,

Here is the updated link that Vanda provided. 

Best regards,

Mikayla N.Mar 11, 2019 at 9:24 pm
1