Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
075b2ef
fix(enroll): remove mqtt restriction t to save
Oct 15, 2018
d2a9352
fix(policy): use the right policies connectiviity
Oct 5, 2018
187eab1
ci(release): update version on android manifest
teclib-bot Oct 15, 2018
07ff0d0
fix(mqtt): validate unique mqtt client
Oct 16, 2018
d3276be
fix(mqtt): set status true if is connected
Oct 16, 2018
fff7ae2
fix(mqtt): restore increase seconds
Oct 16, 2018
97a1ec7
ci(release): update version on android manifest
teclib-bot Oct 16, 2018
1913dce
fix(mqtt): set reconnection counter to zero
Oct 16, 2018
8bae71f
fix(mqtt): add TrustManagerFactory on the mqtt options
Oct 17, 2018
1b37530
fix(mqtt): remove increase tryEverySeconds
Oct 18, 2018
077ee2b
fix(mqtt): rewords variables
Oct 18, 2018
963538d
fix(mqtt): replace the TLSv1.2 for TLS
Oct 18, 2018
8820a22
fix(service): remove stop service from ui
Oct 18, 2018
934672e
fix(mqtt): add certification
Oct 19, 2018
1b75e43
ci(release): update version on android manifest
teclib-bot Oct 19, 2018
4bf5233
fix(MqttModel): fix will for online status
btry Oct 19, 2018
7ab5476
fix(MqttModel): offline will not on the good topic
btry Oct 20, 2018
ef97839
ci(release): update version on android manifest
teclib-bot Oct 29, 2018
22322a8
ci(transifex): upgrade urllib3 llibrary
Oct 29, 2018
2adc8a5
fix(policy): remove lock var on thread manager
Oct 29, 2018
1c726ba
ci(release): update version on android manifest
teclib-bot Oct 29, 2018
9afbd75
refactor(MqttModel): remove duplicate log message
btry Oct 31, 2018
469831d
ci(release): update version on android manifest
teclib-bot Oct 31, 2018
b15e0cf
feat(wipe): set external storage flag on wipe (#623)
abma Nov 14, 2018
36447ef
ci(release): update version on android manifest
teclib-bot Nov 14, 2018
5eed522
fix(log): add limit on the log file text with 3MB
Nov 15, 2018
6776960
fix(log): add log data structure
Nov 16, 2018
1db232e
fix(log): implement log with sqllite
Nov 16, 2018
74957d0
fix(log): load logs from sqllite
Nov 16, 2018
8c1a577
fix(log): add date and keep clear the log
Nov 16, 2018
2cdae96
fix(log): clear the data with ui
rafaelje Nov 19, 2018
75550ac
fix(log): refactor the save log
rafaelje Nov 19, 2018
f8a2d77
fix(log): add connection and reconnection logs
rafaelje Nov 19, 2018
2ab4d09
fix(log): check the message value
rafaelje Nov 19, 2018
ae05a59
ci(release): update version on android manifest
teclib-bot Nov 19, 2018
dbe94aa
feat(deeplink): add the textview information
Nov 20, 2018
36dbf29
feat(deeplink): show the deeplink infomrmation
Nov 20, 2018
07e6a29
ci(release): update version on android manifest
teclib-bot Nov 20, 2018
a59e551
fix(download): add session token on header
Nov 20, 2018
53adbeb
fix(log): implement where on log
Nov 20, 2018
8c65be5
ci(release): update version on android manifest
teclib-bot Nov 20, 2018
741c950
fix(connection): add user token on initsession
Nov 21, 2018
b55a7e3
fix(connection): add session token
Nov 21, 2018
540fee4
ci(release): update version on android manifest
teclib-bot Nov 21, 2018
4aa85b0
fix(mqtt): send online status
Nov 22, 2018
873a536
ci(release): update version on android manifest
teclib-bot Nov 22, 2018
a2c5b05
fix(policy): update the log message
Nov 23, 2018
350df93
fix(policy): send ? character iif gps fail
Nov 23, 2018
6da44c1
ci(release): update version on android manifest
teclib-bot Nov 23, 2018
ef52c0f
fix(mqtt): remove the retained true
Nov 23, 2018
ce1b02c
ci(release): update version on android manifest
teclib-bot Nov 23, 2018
89d8116
fix(mqtt): send the status connected
Nov 27, 2018
e33fc35
fix(mqtt): fix the FlyvemdmManifest topic
Nov 27, 2018
a019b98
fix(mqtt): send ? when gps is not available
Nov 27, 2018
0907a11
ci(release): update version on android manifest
teclib-bot Nov 27, 2018
14b1dbf
feat(policies): add policies module
Nov 28, 2018
21f0d06
ci(release): update version on android manifest
teclib-bot Nov 29, 2018
351db9e
refactor(policy): send a new gps payload response
Dec 3, 2018
8a2ddf4
ci(release): update version on android manifest
teclib-bot Dec 3, 2018
1ddec3d
refactor(enroll): add notification inputs
Dec 4, 2018
1129db8
ci(release): update version on android manifest
teclib-bot Dec 4, 2018
2c4e70c
feat(whitelist): mqtt service to android versions oreo and higher
Dec 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.21.0'
androidTestImplementation 'org.mockito:mockito-android:2.21.0'

// MQTT libraries
implementation('org.eclipse.paho:org.eclipse.paho.android.service:1.0.2') {
exclude module: 'support-v4'
Expand All @@ -79,24 +78,20 @@ dependencies {
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'com.google.zxing:core:3.3.0'

// Google libraries
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"

implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
// Logger
implementation 'com.orhanobut:logger:2.1.1'

// Android Inventory Library
implementation 'org.flyve:inventory:0.10.0@aar'

// Bug snag
implementation 'com.bugsnag:bugsnag-android:4.1.3'

implementation project(':policies')
}


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.flyve.mdm.agent"
android:versionCode="2618"
android:versionCode="3067"
android:versionName="2.0.0-rc.5">

<!-- For writing logfiles -->
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/assets/about.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
about.version=2.0.0-rc.4
about.build=2556
about.date=Wed Sep 26 19:33:47 2018
about.version=2.0.0-rc.5
about.build=2986
about.date=Thu Nov 29 10:54:09 2018
about.commit=
about.commitFull=
about.github=https://github.com/flyve-mdm/flyve-mdm-android-agent
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
try {
app = data[position];
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getView",ex.getMessage());
return vi;
}

Expand All @@ -114,7 +114,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
status = parent.getResources().getString(R.string.app_installed);
}
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getView", ex.getMessage());
}
} else {
status = parent.getResources().getString(R.string.app_not_installed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
try {
hashdata = data.get(position);
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getView", ex.getMessage());
return vi;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
try {
hashdata = data.get(position);
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getView", ex.getMessage());
return vi;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
try {
file = data[position];
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getView", ex.getMessage());
return vi;
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/flyve/mdm/agent/adapter/LogAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public LogAdapter(Activity activity, List<HashMap<String, String>> data) {
try {
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", LogAdapter", ex.getMessage());
}
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
try {
hashdata = data.get(position);
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getView", ex.getMessage());
return vi;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
try {
hashdata = data.get(position);
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getView", ex.getMessage());
return vi;
}

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/org/flyve/mdm/agent/core/Routes.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ public String pluginFlyvemdmAgent(String agentId) {
* @param fileId String file id
* @return String url
*/
public String pluginFlyvemdmFile(String fileId, String sessionToken) {
return url + "/PluginFlyvemdmFile/" + fileId + "?session_token=" + sessionToken;
public String pluginFlyvemdmFile(String fileId) {
return url + "/PluginFlyvemdmFile/" + fileId;
}

/**
* Download apk
* @param fileId String file id
* @return String url
*/
public String pluginFlyvemdmPackage(String fileId, String sessionToken) {
return url + "/PluginFlyvemdmPackage/" + fileId + "?session_token=" + sessionToken;
public String pluginFlyvemdmPackage(String fileId) {
return url + "/PluginFlyvemdmPackage/" + fileId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void lint(Context context, String deeplink) {
deepLinkData = Helpers.base64decode(deeplink);
} catch(Exception ex) {
presenter.showSnackError( CommonErrorType.DEEPLINK_BASE64DECODE, deepLinkErrorMessage);
FlyveLog.e(deepLinkErrorMessage + " - " + ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", lint", deepLinkErrorMessage + " - " + ex.getMessage());
return;
}

Expand Down Expand Up @@ -127,7 +127,7 @@ public void lint(Context context, String deeplink) {
presenter.lintSuccess(deeplinkSchema);

} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", lint", ex.getMessage());
presenter.showSnackError( CommonErrorType.DEEPLINK_GENERAL_EXCEPTION, deepLinkErrorMessage );
}
}
Expand All @@ -152,11 +152,9 @@ public void saveSupervisor(Context context, String name, String phone, String we
@Override
public void saveMQTTConfig(Context context, String url, String userToken, String invitationToken) {
MqttData cache = new MqttData(context);
if(cache.getUrl().isEmpty()) {
cache.setUrl(url);
cache.setUserToken(userToken);
cache.setInvitationToken(invitationToken);
}
cache.setUrl(url);
cache.setUserToken(userToken);
cache.setInvitationToken(invitationToken);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private String manageError(String error) {
String errorMessage = "";

if(error.contains("EXCEPTION_HTTP") || error.contains("ERROR")) {
FlyveLog.e(error);
FlyveLog.e(this.getClass().getName() + ", manageError", error);

errorMessage = error;

Expand All @@ -107,7 +107,7 @@ private String manageError(String error) {
errorMessage = errorArray[0];
}
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", manageError", ex.getMessage());
}

return errorMessage;
Expand All @@ -128,10 +128,11 @@ public void run()
String profileId = "";
JSONObject jsonSession;
HashMap<String, String> header = new HashMap();
header.put("user_token", cache.getUserToken());

try {
// STEP 1 get session token
data = getSyncWebData(routes.initSession(cache.getUserToken()), "GET", null);
data = getSyncWebData(routes.initSession(cache.getUserToken()), "GET", header);

final String errorMessage = manageError(data);
if(!errorMessage.equals("")) {
Expand All @@ -148,7 +149,7 @@ public void run() {
cache.setSessionToken(sessionToken);

} catch (final Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getActiveSessionToken", ex.getMessage());
EnrollmentHelper.runOnUI(new Runnable() {
public void run() {
callback.onError(CommonErrorType.ENROLLMENT_HELPER_INITSESSION, context.getString(R.string.wrong_json_format, data, ex.getMessage()));
Expand Down Expand Up @@ -182,7 +183,7 @@ public void run() {
cache.setProfileId(profileId);

} catch (final Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getActiveSessionToken", ex.getMessage());
EnrollmentHelper.runOnUI(new Runnable() {
public void run() {
callback.onError(CommonErrorType.ENROLLMENT_HELPER_FULLSESSION, context.getString(R.string.wrong_json_format, data, ex.getMessage()));
Expand All @@ -209,7 +210,7 @@ public void run() {
});
}
} catch (final Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", getActiveSessionToken", ex.getMessage());
EnrollmentHelper.runOnUI(new Runnable() {
public void run() {
callback.onError(CommonErrorType.ENROLLMENT_HELPER_CHANGEACTIVEPROFILE, context.getString(R.string.wrong_json_format, data, ex.getMessage()));
Expand Down Expand Up @@ -257,7 +258,7 @@ public void run() {

if(data.contains("ERROR")){
final String msgError = manageError(data);
FlyveLog.e(msgError + " - Device serial: " + Helpers.getDeviceSerial());
FlyveLog.e(this.getClass().getName() + ", enrollment", msgError + " - Device serial: " + Helpers.getDeviceSerial());

EnrollmentHelper.runOnUI(new Runnable() {
public void run() {
Expand Down Expand Up @@ -357,7 +358,7 @@ public void run() {
}
});
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
FlyveLog.e(this.getClass().getName() + ", createX509cert", ex.getMessage());
EnrollmentHelper.runOnUI(new Runnable() {
public void run() {
callback.onError(CommonErrorType.ENROLLMENT_HELPER_X509CERTIFICATION, "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ public void enroll(final Activity activity, final List<UserData.EmailsData> arrE
payload.put("type", "android");
payload.put("has_system_permission", Helpers.isSystemApp(activity));
payload.put("inventory", mInventory);
// could be mqtt or fcm
payload.put("notification_type", "mqtt");
// this is the token get from fcm register
payload.put("notification_token", "");

FlyveLog.d(mInventory);

Expand All @@ -192,7 +196,6 @@ public void onSuccess(String data) {
// -------------------------------
MqttData cache = new MqttData(activity);
cache.setInvitationToken("");
cache.setUserToken("");

presenter.enrollSuccess();
}
Expand Down
Loading