mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Android enterpise app install payload creation
This commit is contained in:
parent
76b34b3229
commit
c9c4d7a64b
@ -47,15 +47,16 @@
|
|||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
<!-- Below configuration is used to redirect http requests to https -->
|
<!-- Below configuration is used to redirect http requests to https -->
|
||||||
<security-constraint>
|
<!-- Below configuration is commented because artifact download API is accessed from the device -->
|
||||||
<web-resource-collection>
|
<!-- <security-constraint>-->
|
||||||
<web-resource-name>ApplicationMgt-Admin</web-resource-name>
|
<!-- <web-resource-collection>-->
|
||||||
<url-pattern>/*</url-pattern>
|
<!-- <web-resource-name>ApplicationMgt-Admin</web-resource-name>-->
|
||||||
</web-resource-collection>
|
<!-- <url-pattern>/*</url-pattern>-->
|
||||||
<user-data-constraint>
|
<!-- </web-resource-collection>-->
|
||||||
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
|
<!-- <user-data-constraint>-->
|
||||||
</user-data-constraint>
|
<!-- <transport-guarantee>CONFIDENTIAL</transport-guarantee>-->
|
||||||
</security-constraint>
|
<!-- </user-data-constraint>-->
|
||||||
|
<!-- </security-constraint>-->
|
||||||
|
|
||||||
<!--publish to apim-->
|
<!--publish to apim-->
|
||||||
<context-param>
|
<context-param>
|
||||||
|
|||||||
@ -50,6 +50,7 @@ import org.wso2.carbon.device.application.mgt.core.util.HelperUtil;
|
|||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.app.mgt.MobileApp;
|
import org.wso2.carbon.device.mgt.common.app.mgt.MobileApp;
|
||||||
|
import org.wso2.carbon.device.mgt.common.app.mgt.MobileAppTypes;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException;
|
import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.UnknownApplicationTypeException;
|
import org.wso2.carbon.device.mgt.common.exceptions.UnknownApplicationTypeException;
|
||||||
@ -460,6 +461,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|||||||
MobileApp mobileApp = new MobileApp();
|
MobileApp mobileApp = new MobileApp();
|
||||||
if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) {
|
if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) {
|
||||||
if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
||||||
|
mobileApp.setType(MobileAppTypes.ENTERPRISE);
|
||||||
|
mobileApp.setLocation(application.getApplicationReleases().get(0).getInstallerPath());
|
||||||
return MDMAndroidOperationUtil.createInstallAppOperation(mobileApp);
|
return MDMAndroidOperationUtil.createInstallAppOperation(mobileApp);
|
||||||
} else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
} else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
||||||
return MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp);
|
return MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp);
|
||||||
|
|||||||
@ -51,7 +51,9 @@ public class MDMAndroidOperationUtil {
|
|||||||
EnterpriseApplication enterpriseApplication =
|
EnterpriseApplication enterpriseApplication =
|
||||||
new EnterpriseApplication();
|
new EnterpriseApplication();
|
||||||
enterpriseApplication.setType(application.getType().toString());
|
enterpriseApplication.setType(application.getType().toString());
|
||||||
enterpriseApplication.setUrl(application.getLocation());
|
//TODO: replace needs to be removed after doing the proper config update in application-mgt.xml
|
||||||
|
enterpriseApplication.setUrl(application.getLocation().replace("https://localhost:9443",
|
||||||
|
"http://192.168.8.6:9763"));
|
||||||
operation.setPayLoad(enterpriseApplication.toJSON());
|
operation.setPayLoad(enterpriseApplication.toJSON());
|
||||||
break;
|
break;
|
||||||
case PUBLIC:
|
case PUBLIC:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user