servers);
+
void success(MispServer server);
+
void success(Server server);
+
void failure(String error);
}
@@ -71,6 +80,7 @@ public class MispRestClient {
/**
* Initializes the rest client to communicate with a MISP instance.
+ *
* @param context needed to access the preferences for loading credentials
*/
public MispRestClient(Context context) {
@@ -95,13 +105,15 @@ public class MispRestClient {
/**
* NOTE: for development only!
- * Accepts all certificates so self signed certs are also accepted.
- * @return OkHttpClient which accepts all certificates
+ *
+ * Accepts all certificates including self signed.
+ *
+ * @return {@link OkHttpClient} which accepts all certificates
*/
private OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
- final TrustManager[] trustAllCerts = new TrustManager[] {
+ final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@SuppressLint("TrustAllX509TrustManager")
@Override
@@ -163,6 +175,7 @@ public class MispRestClient {
/**
* Check via pyMispRoute if server is available
+ *
* @param callback {@link AvailableCallback}
*/
public void isAvailable(final AvailableCallback callback) {
@@ -176,7 +189,7 @@ public class MispRestClient {
return;
}
- callback.unavailable();
+ callback.unavailable(extractError(response));
} else {
callback.available();
}
@@ -184,7 +197,7 @@ public class MispRestClient {
@Override
public void onFailure(Call call, Throwable t) {
- callback.unavailable();
+ callback.unavailable(extractError(t));
}
});
}
@@ -193,6 +206,7 @@ public class MispRestClient {
/**
* Fetches information about the user that is associated with saved auth key.
+ *
* @param callback {@link UserCallback} wrapper to return user directly
*/
public void getMyUser(final UserCallback callback) {
@@ -201,7 +215,7 @@ public class MispRestClient {
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
- if(!response.isSuccessful()) {
+ if (!response.isSuccessful()) {
callback.failure(extractError(response));
} else {
if (response.body() != null) {
@@ -222,7 +236,8 @@ public class MispRestClient {
/**
* Get an user with specific ID.
- * @param userId user identifier
+ *
+ * @param userId user identifier
* @param callback {@link UserCallback} wrapper to return user directly
*/
public void getUser(int userId, final UserCallback callback) {
@@ -231,7 +246,7 @@ public class MispRestClient {
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
- if(!response.isSuccessful()) {
+ if (!response.isSuccessful()) {
callback.failure(extractError(response));
} else {
if (response.body() != null) {
@@ -252,7 +267,8 @@ public class MispRestClient {
/**
* Add a given user to the MISP instance referenced by url in preferences.
- * @param user user to add
+ *
+ * @param user user to add
* @param callback {@link UserCallback} wrapper to return the created user directly
*/
public void addUser(User user, final UserCallback callback) {
@@ -261,9 +277,10 @@ public class MispRestClient {
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
- if(!response.isSuccessful()) {
+ if (!response.isSuccessful()) {
callback.failure(extractError(response));
} else {
+ assert response.body() != null;
callback.success(response.body().user);
}
}
@@ -280,7 +297,8 @@ public class MispRestClient {
/**
* Get an organisation by a given organisation id.
- * @param orgId organisation identifier
+ *
+ * @param orgId organisation identifier
* @param callback {@link OrganisationCallback} wrapper to return a organisation directly
*/
public void getOrganisation(int orgId, final OrganisationCallback callback) {
@@ -289,7 +307,7 @@ public class MispRestClient {
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
- if(!response.isSuccessful()) {
+ if (!response.isSuccessful()) {
callback.failure(extractError(response));
} else {
if (response.body() != null) {
@@ -307,10 +325,52 @@ public class MispRestClient {
});
}
+ public Organisation[] getAllOrganisations() throws IOException {
+ Call> call = mispRestService.getAllOrganisations();
+ Response> response = call.execute();
+
+ List mispOrganisations = response.body();
+ Organisation[] organisations = new Organisation[mispOrganisations.size()];
+
+ for (int i = 0; i < mispOrganisations.size(); i++) {
+ organisations[i] = mispOrganisations.get(i).organisation;
+ }
+
+ return organisations;
+
+// call.enqueue(new Callback>() {
+// @Override
+// public void onResponse(Call> call, Response> response) {
+// if (!response.isSuccessful()) {
+// // TODO handle
+// return;
+// }
+//
+// List mispOrganisations = response.body();
+//
+// assert mispOrganisations != null;
+//
+// Organisation[] organisations = new Organisation[mispOrganisations.size()];
+//
+// for (int i = 0; i < mispOrganisations.size(); i++) {
+// organisations[i] = mispOrganisations.get(i).organisation;
+// }
+//
+// callback.success(organisations);
+// }
+//
+// @Override
+// public void onFailure(Call> call, Throwable t) {
+// callback.failure(extractError(t));
+// }
+// });
+ }
+
/**
* Add a given organisation to the MISP instance referenced by url in preferences.
+ *
* @param organisation organisation to add
- * @param callback {@link OrganisationCallback} wrapper to return the created organisation directly
+ * @param callback {@link OrganisationCallback} wrapper to return the created organisation directly
*/
public void addOrganisation(Organisation organisation, final OrganisationCallback callback) {
Call call = mispRestService.addOrganisation(organisation);
@@ -318,9 +378,10 @@ public class MispRestClient {
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
- if(!response.isSuccessful()) {
+ if (!response.isSuccessful()) {
callback.failure(extractError(response));
} else {
+ assert response.body() != null;
callback.success(response.body().organisation);
}
}
@@ -336,6 +397,7 @@ public class MispRestClient {
/**
* Get all servers on MISP instance.
+ *
* @param callback {@link OrganisationCallback} wrapper to return a list of servers directly
*/
public void getServers(final ServerCallback callback) {
@@ -344,7 +406,7 @@ public class MispRestClient {
call.enqueue(new Callback>() {
@Override
public void onResponse(Call> call, Response> response) {
- if(!response.isSuccessful()) {
+ if (!response.isSuccessful()) {
callback.failure(extractError(response));
} else {
callback.success(response.body());
@@ -360,29 +422,10 @@ public class MispRestClient {
/**
* Add a server to the MISP instance
- * @param server the server to create
+ *
+ * @param server the server to create
* @param callback {@link ServerCallback} wrapper to return the created server directly
*/
-// public void addServer(MispServer server, final ServerCallback callback) {
-// Call call = mispRestService.addServer(server);
-//
-// call.enqueue(new Callback() {
-// @Override
-// public void onResponse(Call call, Response response) {
-// if(!response.isSuccessful()) {
-// callback.failure(extractError(response));
-// } else {
-// callback.success(response.body());
-// }
-// }
-//
-// @Override
-// public void onFailure(Call call, Throwable t) {
-// callback.failure(t.getMessage());
-// }
-// });
-// }
-
public void addServer(Server server, final ServerCallback callback) {
Call call = mispRestService.addServer(server);
@@ -403,6 +446,14 @@ public class MispRestClient {
});
}
+ // error parsing
+
+ /**
+ * Converts error {@link Response}s to human readable info.
+ * @param response erroneous response
+ * @param type of response
+ * @return human readable String that describes the error
+ */
private String extractError(Response response) {
switch (response.code()) {
// bad request (malformed)
@@ -416,9 +467,15 @@ public class MispRestClient {
// forbidden
case 403:
try {
+ assert response.errorBody() != null;
JSONObject jsonError = new JSONObject(response.errorBody().string());
String name = jsonError.getString("name") + "\n";
+
+ if (name.startsWith("Authentication failed")) {
+ return "Authentication failed";
+ }
+
String reasons = "";
JSONObject errorReasons = jsonError.getJSONObject("errors");
@@ -437,11 +494,33 @@ public class MispRestClient {
return "Could not parse (403) error";
- // not found
+ // not found
case 404:
return "Not found";
}
return "Unknown error";
}
+
+ /**
+ * Converts a {@link Throwable} to a human readable error message.
+ * @param t throwable
+ * @return human readable String that describes the error.
+ */
+ private String extractError(Throwable t) {
+
+ if (t.getCause() instanceof CertificateException) {
+ return "Trust anchor for certification path not found.\nSelf signed certificates are not supported.";
+ }
+
+ if (t instanceof SSLHandshakeException) {
+ return "SSL Handshake Error";
+ }
+
+ if (t instanceof NoRouteToHostException) {
+ return "Server is not available (no route to host)";
+ }
+
+ return t.getMessage();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/lu/circl/mispbump/restful_client/MispRestService.java b/app/src/main/java/lu/circl/mispbump/restful_client/MispRestService.java
index 92daf1a..4eb6430 100644
--- a/app/src/main/java/lu/circl/mispbump/restful_client/MispRestService.java
+++ b/app/src/main/java/lu/circl/mispbump/restful_client/MispRestService.java
@@ -34,6 +34,9 @@ public interface MispRestService {
@GET("organisations/view/{value}")
Call getOrganisation(@Path("value") int orgId);
+ @GET("organisations")
+ Call> getAllOrganisations();
+
@POST("admin/organisations/add")
Call addOrganisation(@Body Organisation organisation);
diff --git a/app/src/main/java/lu/circl/mispbump/restful_client/Organisation.java b/app/src/main/java/lu/circl/mispbump/restful_client/Organisation.java
index dcf0539..f24bd59 100644
--- a/app/src/main/java/lu/circl/mispbump/restful_client/Organisation.java
+++ b/app/src/main/java/lu/circl/mispbump/restful_client/Organisation.java
@@ -5,18 +5,6 @@ package lu.circl.mispbump.restful_client;
*/
public class Organisation {
- public Organisation() {
- }
-
- public Organisation(String name) {
- this.name = name;
- }
-
- public Organisation(String name, String description) {
- this.name = name;
- this.description = description;
- }
-
public Integer id;
public String name;
public String date_created;
@@ -32,7 +20,19 @@ public class Organisation {
public String created_by;
public Integer user_count;
- public Organisation syncOrganisation() {
+ public Organisation() {
+ }
+
+ public Organisation(String name) {
+ this.name = name;
+ }
+
+ public Organisation(String name, String description) {
+ this.name = name;
+ this.description = description;
+ }
+
+ public Organisation toSyncOrganisation() {
Organisation organisation = new Organisation();
organisation.local = true;
organisation.name = name;
diff --git a/app/src/main/java/lu/circl/mispbump/security/DiffieHellman.java b/app/src/main/java/lu/circl/mispbump/security/DiffieHellman.java
index 6a0ebb7..407b057 100644
--- a/app/src/main/java/lu/circl/mispbump/security/DiffieHellman.java
+++ b/app/src/main/java/lu/circl/mispbump/security/DiffieHellman.java
@@ -32,6 +32,7 @@ public class DiffieHellman {
private byte[] sharedSecret;
private IvParameterSpec ivParameterSpec;
+
private DiffieHellman() {
initialize();
}
@@ -68,25 +69,6 @@ public class DiffieHellman {
}
}
- /**
- * Generates a shared secret and derives an initialisation vector from it.
- * @param publickey public key of the sync partner
- */
- public void setForeignPublicKey(PublicKey publickey) {
- try {
- keyAgreement.doPhase(publickey, true);
-
- byte[] tmpSharedSecret = keyAgreement.generateSecret();
- sharedSecret = Arrays.copyOfRange(tmpSharedSecret, 0, 32);
-
- byte[] inputVector = Arrays.copyOfRange(sharedSecret, 32, 48);
- ivParameterSpec = new IvParameterSpec(inputVector);
-
- } catch (InvalidKeyException e) {
- e.printStackTrace();
- }
- }
-
/**
* Encrypts data.
* @param data data to encrypt
@@ -129,6 +111,27 @@ public class DiffieHellman {
return data;
}
+ /**
+ * Generates a shared secret and derives an initialisation vector from it.
+ * @param pk public key of the sync partner
+ */
+ public void setForeignPublicKey(PublicKey pk) {
+ try {
+ keyAgreement.doPhase(pk, true);
+
+ byte[] tmpSharedSecret = keyAgreement.generateSecret();
+ sharedSecret = Arrays.copyOfRange(tmpSharedSecret, 0, 32);
+
+ byte[] inputVector = Arrays.copyOfRange(sharedSecret, 32, 48);
+ ivParameterSpec = new IvParameterSpec(inputVector);
+ } catch (InvalidKeyException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @return this devices public key
+ */
public PublicKey getPublicKey() {
return publickey;
}
diff --git a/app/src/main/java/lu/circl/mispbump/security/KeyStoreWrapper.java b/app/src/main/java/lu/circl/mispbump/security/KeyStoreWrapper.java
index 7e044e1..0576074 100644
--- a/app/src/main/java/lu/circl/mispbump/security/KeyStoreWrapper.java
+++ b/app/src/main/java/lu/circl/mispbump/security/KeyStoreWrapper.java
@@ -35,6 +35,7 @@ public class KeyStoreWrapper {
public static final String USER_ORGANISATION_INFO_ALIAS = "ALIAS_USER_ORGANISATION_INFO";
public static final String AUTOMATION_ALIAS = "ALIAS_AUTOMATION_KEY";
public static final String SERVER_URL_ALIAS = "ALIAS_SERVER_URL";
+ public static final String UPLOAD_INFORMATION_ALIAS = "ALIAS_UPLOAD_INFORMATION";
private static final String KEYSTORE_PROVIDER = "AndroidKeyStore";
private static final String CIPHER_ALGORITHM = "AES/GCM/NoPadding";
@@ -174,7 +175,6 @@ public class KeyStoreWrapper {
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
byte[] byteData = data.getBytes(StandardCharsets.UTF_8);
-// byte[] byteData = Base64.decode(data, Base64.DEFAULT);
byte[] combined = getCombinedArray(cipher.getIV(), cipher.doFinal(byteData));
return Base64.encodeToString(combined, Base64.NO_WRAP);
}
@@ -262,15 +262,12 @@ public class KeyStoreWrapper {
}
public class IvAndData {
-
- public IvAndData() {}
-
- public IvAndData(byte[] iv, byte[] data) {
+ IvAndData(byte[] iv, byte[] data) {
this.iv = iv;
this.data = data;
}
- public byte[] iv;
- public byte[] data;
+ byte[] iv;
+ byte[] data;
}
}
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_in_right.xml b/app/src/main/res/anim/slide_in_right.xml
new file mode 100644
index 0000000..6fb52a3
--- /dev/null
+++ b/app/src/main/res/anim/slide_in_right.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_out_left.xml b/app/src/main/res/anim/slide_out_left.xml
new file mode 100644
index 0000000..020a1be
--- /dev/null
+++ b/app/src/main/res/anim/slide_out_left.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/slide_in_left.xml b/app/src/main/res/animator/slide_in_left.xml
new file mode 100644
index 0000000..ddc7c45
--- /dev/null
+++ b/app/src/main/res/animator/slide_in_left.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/slide_in_right.xml b/app/src/main/res/animator/slide_in_right.xml
new file mode 100644
index 0000000..206720e
--- /dev/null
+++ b/app/src/main/res/animator/slide_in_right.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/slide_out_left.xml b/app/src/main/res/animator/slide_out_left.xml
new file mode 100644
index 0000000..e3e2d1d
--- /dev/null
+++ b/app/src/main/res/animator/slide_out_left.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/slide_out_right.xml b/app/src/main/res/animator/slide_out_right.xml
new file mode 100644
index 0000000..10d8add
--- /dev/null
+++ b/app/src/main/res/animator/slide_out_right.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_arrow_back.xml b/app/src/main/res/drawable/ic_arrow_back.xml
new file mode 100644
index 0000000..f8ad49c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_arrow_back.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_arrow_forward.xml b/app/src/main/res/drawable/ic_arrow_forward.xml
index 25fb386..42d364a 100644
--- a/app/src/main/res/drawable/ic_arrow_forward.xml
+++ b/app/src/main/res/drawable/ic_arrow_forward.xml
@@ -1,5 +1,9 @@
-
-
+
+
diff --git a/app/src/main/res/drawable/ic_check.xml b/app/src/main/res/drawable/ic_check.xml
index 17aca2a..d04a04c 100644
--- a/app/src/main/res/drawable/ic_check.xml
+++ b/app/src/main/res/drawable/ic_check.xml
@@ -1,5 +1,9 @@
-
-
+
+
diff --git a/app/src/main/res/drawable/ic_check_outline.xml b/app/src/main/res/drawable/ic_check_outline.xml
new file mode 100644
index 0000000..9e25fdc
--- /dev/null
+++ b/app/src/main/res/drawable/ic_check_outline.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml
index 0c8775c..cbf794b 100644
--- a/app/src/main/res/drawable/ic_close.xml
+++ b/app/src/main/res/drawable/ic_close.xml
@@ -1,5 +1,9 @@
-
-
+
+
diff --git a/app/src/main/res/drawable/ic_cloud_upload.xml b/app/src/main/res/drawable/ic_cloud_upload.xml
new file mode 100644
index 0000000..55dbbae
--- /dev/null
+++ b/app/src/main/res/drawable/ic_cloud_upload.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_delete_forever.xml b/app/src/main/res/drawable/ic_delete_forever.xml
index 3047430..4469a5e 100644
--- a/app/src/main/res/drawable/ic_delete_forever.xml
+++ b/app/src/main/res/drawable/ic_delete_forever.xml
@@ -1,5 +1,9 @@
-
-
+
+
diff --git a/app/src/main/res/drawable/ic_help_outline.xml b/app/src/main/res/drawable/ic_help_outline.xml
new file mode 100644
index 0000000..fc62825
--- /dev/null
+++ b/app/src/main/res/drawable/ic_help_outline.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_help_outline_black_24dp.xml b/app/src/main/res/drawable/ic_info_outline.xml
similarity index 50%
rename from app/src/main/res/drawable/ic_help_outline_black_24dp.xml
rename to app/src/main/res/drawable/ic_info_outline.xml
index dbd0032..af0d4d0 100644
--- a/app/src/main/res/drawable/ic_help_outline_black_24dp.xml
+++ b/app/src/main/res/drawable/ic_info_outline.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/app/src/main/res/drawable/ic_key.xml b/app/src/main/res/drawable/ic_key.xml
new file mode 100644
index 0000000..ae7aa7b
--- /dev/null
+++ b/app/src/main/res/drawable/ic_key.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_keyboard_arrow_up.xml b/app/src/main/res/drawable/ic_keyboard_arrow_up.xml
new file mode 100644
index 0000000..bc01039
--- /dev/null
+++ b/app/src/main/res/drawable/ic_keyboard_arrow_up.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_open_in_browser.xml b/app/src/main/res/drawable/ic_open_in_browser.xml
new file mode 100644
index 0000000..3fb9799
--- /dev/null
+++ b/app/src/main/res/drawable/ic_open_in_browser.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_person.xml b/app/src/main/res/drawable/ic_person.xml
index d7366bd..f0aedfe 100644
--- a/app/src/main/res/drawable/ic_person.xml
+++ b/app/src/main/res/drawable/ic_person.xml
@@ -1,5 +1,9 @@
-
-
+
+
diff --git a/app/src/main/res/drawable/rounded_rect.xml b/app/src/main/res/drawable/rounded_rect.xml
new file mode 100644
index 0000000..8daefbc
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_rect.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml
index 326f6bd..cb08ed5 100644
--- a/app/src/main/res/layout/activity_home.xml
+++ b/app/src/main/res/layout/activity_home.xml
@@ -1,27 +1,25 @@
-
-
-
-
+ app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
+ android:background="@color/colorPrimary" />
+
-
-
+ app:backgroundTint="@color/colorAccent"
+ android:tint="@color/white"
+ android:src="@drawable/ic_qrcode_scan"/>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
index 57fe8a2..1cb59dc 100644
--- a/app/src/main/res/layout/activity_login.xml
+++ b/app/src/main/res/layout/activity_login.xml
@@ -1,78 +1,81 @@
-
-
+ app:layout_constraintTop_toTopOf="parent"
+ app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
-
-
-
+
-
-
-
-
+
-
@@ -91,5 +94,12 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar" />
+
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_preference.xml b/app/src/main/res/layout/activity_preference.xml
new file mode 100644
index 0000000..b471d0f
--- /dev/null
+++ b/app/src/main/res/layout/activity_preference.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml
index dac2590..f39fdea 100644
--- a/app/src/main/res/layout/activity_profile.xml
+++ b/app/src/main/res/layout/activity_profile.xml
@@ -1,19 +1,18 @@
-
-
+ android:layout_height="wrap_content">
-
@@ -57,22 +56,22 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/circle" />
-
-
-
+
+
-
@@ -86,7 +85,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sector"
app:pref_icon="@drawable/ic_description"
- app:subText="Hier steht ein sehr langer Text. Er kann sowohl mehrere Zeilen haben als auch keine Ahnung was noch. Aber auf jeden Fall viel Text."
+ app:subText=""
app:text="Description">
@@ -100,7 +99,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:pref_icon="@drawable/ic_code_black_24dp"
- app:subText="8464-4546546-8464684-654654"
+ app:subText=""
app:text="UUID" />
-
+
-
+ android:backgroundTint="@color/colorAccent"
+ android:src="@drawable/ic_sync_black_24dp"
+ android:tint="@color/white" />
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_start_up.xml b/app/src/main/res/layout/activity_start_up.xml
deleted file mode 100644
index 1e1628e..0000000
--- a/app/src/main/res/layout/activity_start_up.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_sync.xml b/app/src/main/res/layout/activity_sync.xml
index 7534f03..6c823e7 100644
--- a/app/src/main/res/layout/activity_sync.xml
+++ b/app/src/main/res/layout/activity_sync.xml
@@ -1,40 +1,15 @@
-
-
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
-
-
-
-
-
+ android:layout_height="match_parent">
+ app:layout_constraintTop_toTopOf="parent" >
+
+
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_sync_2.xml b/app/src/main/res/layout/activity_sync_2.xml
deleted file mode 100644
index 478fc34..0000000
--- a/app/src/main/res/layout/activity_sync_2.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_upload.xml b/app/src/main/res/layout/activity_upload.xml
new file mode 100644
index 0000000..6574145
--- /dev/null
+++ b/app/src/main/res/layout/activity_upload.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/bottom_sheet_public_key.xml b/app/src/main/res/layout/bottom_sheet_public_key.xml
new file mode 100644
index 0000000..66e4777
--- /dev/null
+++ b/app/src/main/res/layout/bottom_sheet_public_key.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/bottom_sheet_sync_information.xml b/app/src/main/res/layout/bottom_sheet_sync_information.xml
new file mode 100644
index 0000000..5d2c2d0
--- /dev/null
+++ b/app/src/main/res/layout/bottom_sheet_sync_information.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_camera.xml b/app/src/main/res/layout/fragment_camera.xml
index ed90573..7bd5ce8 100644
--- a/app/src/main/res/layout/fragment_camera.xml
+++ b/app/src/main/res/layout/fragment_camera.xml
@@ -1,6 +1,6 @@
-
-
+
+
+
diff --git a/app/src/main/res/layout/fragment_sync_options.xml b/app/src/main/res/layout/fragment_sync_options.xml
index 3b77564..7b32505 100644
--- a/app/src/main/res/layout/fragment_sync_options.xml
+++ b/app/src/main/res/layout/fragment_sync_options.xml
@@ -1,24 +1,21 @@
-
-
-
@@ -28,20 +25,20 @@
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="16dp"
- android:text="This will generate a sync server on your instance"
+ android:text="Server certificate must not be from a trusted CA (not recomended)"
android:textSize="12sp"
- app:layout_constraintEnd_toStartOf="@+id/share_events_switch"
+ app:layout_constraintEnd_toStartOf="@+id/self_signed_switch"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/share_events_title" />
+ app:layout_constraintTop_toBottomOf="@+id/allow_self_signed" />
+ app:layout_constraintTop_toTopOf="@+id/allow_self_signed" />
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/material_preference_text.xml b/app/src/main/res/layout/material_preference_text.xml
index af6963b..cc188b5 100644
--- a/app/src/main/res/layout/material_preference_text.xml
+++ b/app/src/main/res/layout/material_preference_text.xml
@@ -1,5 +1,5 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/view_upload_action.xml b/app/src/main/res/layout/view_upload_action.xml
new file mode 100644
index 0000000..9d88e7c
--- /dev/null
+++ b/app/src/main/res/layout/view_upload_action.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/viewholder_sync.xml b/app/src/main/res/layout/viewholder_sync.xml
new file mode 100644
index 0000000..2d262e7
--- /dev/null
+++ b/app/src/main/res/layout/viewholder_sync.xml
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/viewholder_sync_card.xml b/app/src/main/res/layout/viewholder_sync_card.xml
deleted file mode 100644
index f24cdec..0000000
--- a/app/src/main/res/layout/viewholder_sync_card.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/viewholder_user.xml b/app/src/main/res/layout/viewholder_user.xml
index 43df60b..f3950c3 100644
--- a/app/src/main/res/layout/viewholder_user.xml
+++ b/app/src/main/res/layout/viewholder_user.xml
@@ -1,5 +1,5 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_login.xml b/app/src/main/res/menu/menu_login.xml
index b67529f..83ee6ad 100644
--- a/app/src/main/res/menu/menu_login.xml
+++ b/app/src/main/res/menu/menu_login.xml
@@ -4,7 +4,7 @@
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 334b948..11144ba 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -1,14 +1,13 @@
MispBump
- MISP Informationen laden
Anmelden
Abmelden
Hilfe
MISP Automatisierungs-Schlüssel
Keine Informationen
Automatisierungs-Schlüssel speichern
- Das ist der Anmelde Informations Text.
+ MISP Server URL\nDie URL unter der Ihre MISP Instanz erreichbar ist.\n\nMISP Automatisierungs Schlüssel\nZu finden unter ...
QR code
Synchronisation
Sie haben noch keine MISP Instanzen verknüpft.
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
index cd9ebf5..1fa0848 100644
--- a/app/src/main/res/values/attrs.xml
+++ b/app/src/main/res/values/attrs.xml
@@ -5,4 +5,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 7edfe8d..cc2e9fc 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -2,6 +2,7 @@
#047EB4
#023850
+
#12B3FA
#8012B3FA
@@ -11,5 +12,6 @@
#FFFFFF
#80FFFFFF
#4CAF50
+ #FB8C00
#E53935
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index fb42d72..d881361 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -4,12 +4,11 @@
Log out
MISP Server URL
MISP Automation Key
- Download MISP Infos
No Information
Save Automation Key
Home
Help
- This is the login info text.
+ MISP Server URL\nPublic MISP URL\n\nMISP Automation key\nZu finden unter ...
Okay
QR code
Synchronization
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 8e591d9..3116eeb 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,11 +1,14 @@
+
+
-
diff --git a/gradle.properties b/gradle.properties
index 82618ce..34470d8 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,6 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
+android.useAndroidX=true
+android.enableJetifier=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
diff --git a/misc/structure.md b/misc/structure.md
deleted file mode 100644
index 18a97b2..0000000
--- a/misc/structure.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# Information in encrypted QR code (on MISP A)
-## Organisation
-+ Identifier (Organisation B on MISP A)
-+ UUID (of organisation B)
-+ description
-+ Nationality
-+ Sector
-+ type (freetext)
-+ (contacts?)
-
-## SyncUser
-+ email (orgb.syncuser@mispa.test)
-+ password (abcdefghijklmnop) (16 chars but depends on settings)
-
-## SyncServer
-+ base url
-+ instance name
-+ authkey from syncUser
-
-
-## Steps
-
-1. each instance generates a foreign organisation
-2. each instance generates a syncuser
-3. each instance generates a sync server
\ No newline at end of file