Back to top

This section shows you the steps required to migrate the app in Android Studio.

Import the new libraries

  1. Go to your Knox Developer account and download supportlib.jar file.

    If you are a VPN provider, looking to migrate your solution to Knox 3.4 or higher, see VPN namespace changes.

  2. In your IDE, add the JAR files. In Android Studio, you right-click the libs folder and click Paste.

    Update your app

  3. Delete the old Knox JAR files from your project.

    Update your app

  4. Edit build.gradle to prevent Android Studio from including the JAR files during compile and run-time:

    Update your app

  5. Edit build.gradle to remove references to the old JAR files.

    Update your app

  6. Edit the build.gradle file to include supportlib.jar at run-time and knoxsdk.jar at compile-time:

    Update your app

  7. Delete the corresponding XML files from your project.

    Update your app

Update the package names

  1. After trying a build, the IDE will highlight unresolved packages that were in the deleted JAR files. Find these.

    Update your app

  2. Replace old package names with the new ones. To find the new name, use any of these methods:

  • Use your IDE’s quick fix feature. In Android Studio, delete all the import statements for the old Samsung Knox packages. Then highlight an unresolved class name and press [Alt] + [Enter] (for Windows/Linux) or [Option] + [Enter] (for Mac) to add its required import statement.

    Update your app

  • If that doesn’t work, use your IDE’s find class feature. In Android Studio, select the class name and press [Ctrl]-[n] (for Windows/Linux) or [Command]-[o] (for Mac) to see its new package name:

    Update your app

To find new namespace, you can also:

  • Enter the class name in the API reference Search tool, which shows the class’ full package name.

  • Look up the new package name in the API reference Package index

  • Check the list of new package names for the API class.

Update the class names

In a few cases, the package name cannot be resolved because the class name has changed with the new Samsung Knox SDK, for better clarity or consistency:

Old Package Old Class New Package New Class
android.app.enterprise Attestation com.samsung.android.knox.integrity AttestationPolicy
android.app.enterprise MiscPolicy com.samsung.android.knox.xxx BrowserPolicy, and so on.
android.app.enterprise.devicesettings DeviceSettingsPolicy com.samsung.android.knox.net GlobalProxy
android.app.enterprise.devicesettings DeviceSettingsPolicy com.samsung.android.knox.nfc NfcPolicy
android.app.enterprise.lso SecurityPolicy com.samsung.android.knox.lockscreen BootBanner
android.app.enterprise.SecurityPolicy SecurityPolicy com.samsung.android.knox.keystore CertificateProvisioning
com.sec.enterprise.knox.seams SEAMS com.samsung.android.knox.seams SEAMSPolicy

In these cases, look up the API method name in the new Knox SDK API reference and update its class name as well as the package name.

update your app 9

Update the API method names

A few API methods were also renamed for better clarity and consistency. Update these names as well.

Old Package Old Class Old Method New Package New Class New Method
android.app.enterprise.multiuser MultiUserManager getInstance com.samsung.android.knox EnterpriseDeviceManager getMultiUserManager
com.sec.enterprise.knoxauditlog AuditLog getInstance com.samsung.android.knox KnoxContainermanager getAuditLogPolicy
android.app.enterprise.geofencing Geofencing getInstance com.samsung.android.knox EnterpriseDeviceManager getGeofencing
android.app.enterprise.devicesettings DeviceSettingsPolicy getInstance com.samsung.android.knox EnterpriseDeviceManager getGlobalProxy
android.app.enterprise.kioskmode KioskMode getInstance com.samsung.android.knox EnterpriseDeviceManager getKioskMode
android.app.enterprise.lso LockscreenOverlay getInstance com.samsung.android.knox EnterpriseDeviceManager getLockscreenOverlay
android.app.enterprise.devicesettings DeviceSettingsPolicy getInstance com.samsung.android.knox EnterpriseDeviceManager getNfcPolicy
android.app.enterprise.remotecontrol RemoteInjection getInstance com.samsung.android.knox EnterpriseDeviceManager getRemoteInjection

Update the permissions

Permissions allow you to specify what Knox SDK features your app can access.

If you have…

Is this page helpful?