diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 28d82f26b4..176c658056 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="50" + android:versionName="1.0.52"> diff --git a/app/src/main/java/org/flyve/mdm/agent/utils/ConnectionHTTP.java b/app/src/main/java/org/flyve/mdm/agent/utils/ConnectionHTTP.java index 43bdf8e974..d259f44aaf 100644 --- a/app/src/main/java/org/flyve/mdm/agent/utils/ConnectionHTTP.java +++ b/app/src/main/java/org/flyve/mdm/agent/utils/ConnectionHTTP.java @@ -134,6 +134,7 @@ public static String getSyncWebData(String url, String method, Map entry : header.entrySet()) { diff --git a/app/src/main/java/org/flyve/mdm/agent/utils/EnrollmentHelper.java b/app/src/main/java/org/flyve/mdm/agent/utils/EnrollmentHelper.java index f1a2a1b8e2..1594339338 100644 --- a/app/src/main/java/org/flyve/mdm/agent/utils/EnrollmentHelper.java +++ b/app/src/main/java/org/flyve/mdm/agent/utils/EnrollmentHelper.java @@ -141,12 +141,12 @@ public void run() { JSONObject jsonFullSession = new JSONObject(dataFullSession); jsonSession = jsonFullSession.getJSONObject("session"); - JSONObject jsonActiveProfile = jsonSession.getJSONObject("glpiactiveprofile"); - String profileId = jsonActiveProfile.getString("id"); + String profileId = jsonSession.getString("plugin_flyvemdm_guest_profiles_id"); + cache.setProfileId( profileId ); // STEP 3 Activated the profile - final String dataActiveProfile = getSyncWebData(routes.changeActiveProfile(cache.getProfileId()), "GET", header); + final String dataActiveProfile = getSyncWebData(routes.changeActiveProfile(cache.getProfileId()), "POST", header); final String errorActiveProfile = manageError(dataActiveProfile); if(!errorActiveProfile.equals("")) { EnrollmentHelper.runOnUI(new Runnable() { @@ -253,7 +253,7 @@ public void run() { FlyveLog.e(error); EnrollmentHelper.runOnUI(new Runnable() { public void run() { - callback.onError(error); + callback.onError(context.getResources().getString(R.string.ERROR_INTERNAL)); } }); } diff --git a/app/src/main/java/org/flyve/mdm/agent/utils/Helpers.java b/app/src/main/java/org/flyve/mdm/agent/utils/Helpers.java index 1aca44af75..e0186bc6a3 100644 --- a/app/src/main/java/org/flyve/mdm/agent/utils/Helpers.java +++ b/app/src/main/java/org/flyve/mdm/agent/utils/Helpers.java @@ -94,7 +94,7 @@ public static String base64encode(String text) { public static String getDeviceSerial() { String serial; if(Build.SERIAL.equalsIgnoreCase("unknown")) { - serial = "ABCDEFGHIJ123456"; + serial = "ABCDEFGHIJ1234568"; } else { serial = Build.SERIAL; } diff --git a/app/src/main/java/org/flyve/mdm/agent/utils/Routes.java b/app/src/main/java/org/flyve/mdm/agent/utils/Routes.java index 9db285388e..70abfe2fe4 100644 --- a/app/src/main/java/org/flyve/mdm/agent/utils/Routes.java +++ b/app/src/main/java/org/flyve/mdm/agent/utils/Routes.java @@ -37,7 +37,7 @@ public class Routes { private String url; - DataStorage cache; + private DataStorage cache; /** * Constructor @@ -54,7 +54,9 @@ public Routes(Context context) { * @return String with the url */ public String initSession(String userToken) { - return url + "/initSession?user_token=" + userToken; + String str = url + "/initSession?user_token=" + userToken; + FlyveLog.d("initSession URL: ", str); + return str; } /** @@ -62,7 +64,10 @@ public String initSession(String userToken) { * @return String with the url */ public String getFullSession() { - return url + "/getFullSession"; + String str = url + "/getFullSession"; + FlyveLog.d("getFullSession: ", str); + return str; + } /** @@ -71,7 +76,9 @@ public String getFullSession() { * @return String with the url */ public String changeActiveProfile(String profileId) { - return url + "/changeActiveProfile?profile_id=" + profileId; + String str = url + "/changeActiveProfile?profiles_id=" + profileId; + FlyveLog.d("changeActiveProfile: ", str); + return str; } /** @@ -79,7 +86,9 @@ public String changeActiveProfile(String profileId) { * @return String with the url */ public String pluginFlyvemdmAgent() { - return url + "/PluginFlyvemdmAgent"; + String str = url + "/PluginFlyvemdmAgent"; + FlyveLog.d("pluginFlyvemdmAgent: ", str); + return str; } /** @@ -88,7 +97,9 @@ public String pluginFlyvemdmAgent() { * @return String with the url */ public String pluginFlyvemdmAgent(String agentId) { - return url + "/PluginFlyvemdmAgent/" + agentId; + String str = url + "/PluginFlyvemdmAgent/" + agentId; + FlyveLog.d("pluginFlyvemdmAgent: ", str); + return str; } /** @@ -97,7 +108,9 @@ public String pluginFlyvemdmAgent(String agentId) { * @return String url */ public String PluginFlyvemdmFile(String fileId, String sessionToken) { - return url + "/PluginFlyvemdmFile/" + fileId + "?session_token=" + sessionToken; + String str = url + "/PluginFlyvemdmFile/" + fileId + "?session_token=" + sessionToken; + FlyveLog.d("PluginFlyvemdmFile: ", str); + return str; } /** @@ -106,7 +119,9 @@ public String PluginFlyvemdmFile(String fileId, String sessionToken) { * @return String url */ public String PluginFlyvemdmPackage(String fileId, String sessionToken) { - return url + "/PluginFlyvemdmPackage/" + fileId + "?session_token=" + sessionToken; + String str = url + "/PluginFlyvemdmPackage/" + fileId + "?session_token=" + sessionToken; + FlyveLog.d("PluginFlyvemdmPackage: ", str); + return str; }