kp_admin kp_admin
Jun 28, 2019
1:35 am

Knox SDK 3.3 - Admin does not have android.permission.sec.MDM_APP_MGMT OR com.samsung.android.knox.permission.KNOX_APP_MGMT

Hello!

 

I'm trying to send my app to the device's white list. 

I sucessfully set user as admin and SDKs license.

My problem is the main goal, wich is actually adding to app to the whiteliste. When I try to do that, app SDK thows the following exception: 

java.lang.SecurityException: Admin  does not have android.permission.sec.MDM_APP_MGMT OR com.samsung.android.knox.permission.KNOX_APP_MGMT

Here's my code:

try {

     Signature packageSignature = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES).signatures[0];
     EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

     AppIdentity appIdentity = new AppIdentity("*****.yyyyyy.zzzzzzz", packageSignature.toCharsString());
     ApplicationPolicy appPolicy = edm.getApplicationPolicy();

     appPolicy.addPackageToBatteryOptimizationWhiteList(appIdentity);

} catch (SecurityException e) {

     Log.w(TAG, "ERROR ====> SecurityException: " + e);

} catch (Exception e) {

     Log.w(TAG, "ERROR ====> Exception: " + e);

}

I (think) have already set AndroidManifest's all permissions I needed:

    <uses-permission android:name="com.samsung.android.knox.permission.KNOX_HW_CONTROL" />
    <uses-permission android:name="com.samsung.android.knox.permission.KNOX_APP_MGMT"/>
    <uses-permission android:name="com.samsung.android.knox.permission.CUSTOM_SETTING" />
    <uses-permission android:name="android.permission.sec.MDM_APP_MGMT"/>

10x in advance for any help

Giovanni

Mikayla Neufeld
Jun 28, 2019
4:05 pm

Hi Giovanni,

What kind of a Knox license key are you using? The Development Limited key does not grant the KNOX_APP_MGMT permission.

Best regards,

Mikayla

Comments

Wich license do I need?

Is it free or must be bougth?

I’d like to be sure it solves my problem before buying. Is it possible?

 

Mine is an app builded with the current  stable  version of React Native 59 and must keep capturing GPS points even when my app is executing in background.

 

 

 

Jun 28, 2019 at 4:46 pm

Hi Giovanni,

You need a full Development License. These can be generated for free by partners. You can apply to upgrade your account to a partner account here.

Best regards,

Mikayla NeufeldJun 28, 2019 at 4:46 pm