Android enterpise app install payload creation

feature/appm-store/pbac
Saad Sahibjan 5 years ago
parent 76b34b3229
commit c9c4d7a64b

@ -47,15 +47,16 @@
</context-param>
<!-- Below configuration is used to redirect http requests to https -->
<security-constraint>
<web-resource-collection>
<web-resource-name>ApplicationMgt-Admin</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<!-- Below configuration is commented because artifact download API is accessed from the device -->
<!-- <security-constraint>-->
<!-- <web-resource-collection>-->
<!-- <web-resource-name>ApplicationMgt-Admin</web-resource-name>-->
<!-- <url-pattern>/*</url-pattern>-->
<!-- </web-resource-collection>-->
<!-- <user-data-constraint>-->
<!-- <transport-guarantee>CONFIDENTIAL</transport-guarantee>-->
<!-- </user-data-constraint>-->
<!-- </security-constraint>-->
<!--publish to apim-->
<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.DeviceIdentifier;
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.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.exceptions.UnknownApplicationTypeException;
@ -460,6 +461,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
MobileApp mobileApp = new MobileApp();
if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) {
if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
mobileApp.setType(MobileAppTypes.ENTERPRISE);
mobileApp.setLocation(application.getApplicationReleases().get(0).getInstallerPath());
return MDMAndroidOperationUtil.createInstallAppOperation(mobileApp);
} else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
return MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp);

@ -51,7 +51,9 @@ public class MDMAndroidOperationUtil {
EnterpriseApplication enterpriseApplication =
new EnterpriseApplication();
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());
break;
case PUBLIC:

Loading…
Cancel
Save