Unverified Commit 27cb6c9f authored by Javier Guerra's avatar Javier Guerra Committed by GitHub

Merge pull request #17 from openconnectivity/develop

Merge develop into master
parents 426e7055 541c6b64
...@@ -30,7 +30,7 @@ android { ...@@ -30,7 +30,7 @@ android {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 13 versionCode 13
versionName "2.4.0" versionName "2.5.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
compileOptions { compileOptions {
......
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIEEzCCA7mgAwIBAgIJAI0K+3tTskzXMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM MIIEEzCCA7mgAwIBAgIJAI0K+3tTsk0AMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM
A09DRjEiMCAGA1UECwwZS3lyaW8gVGVzdCBJbmZyYXN0cnVjdHVyZTEnMCUGA1UE A09DRjEiMCAGA1UECwwZS3lyaW8gVGVzdCBJbmZyYXN0cnVjdHVyZTEnMCUGA1UE
AwweS3lyaW8gVEVTVCBJbnRlcm1lZGlhdGUgQ0EwMDAyMB4XDTE5MDkyMzA5MjUx AwweS3lyaW8gVEVTVCBJbnRlcm1lZGlhdGUgQ0EwMDAyMB4XDTE5MTAyNDA5NDg1
OFoXDTE5MTAyMzA5MjUxOFowYTEMMAoGA1UECgwDT0NGMSIwIAYDVQQLDBlLeXJp NFoXDTE5MTEyMzA5NDg1NFowYTEMMAoGA1UECgwDT0NGMSIwIAYDVQQLDBlLeXJp
byBUZXN0IEluZnJhc3RydWN0dXJlMS0wKwYDVQQDDCQxZTFiZWJmYi04ZjAzLTQ3 byBUZXN0IEluZnJhc3RydWN0dXJlMS0wKwYDVQQDDCQxZTFiZWJmYi04ZjAzLTQ3
ODUtNWZhNy0xYjcwNGU2NTQzNjAwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQj ODUtNWZhNy0x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 @@ AjBgBgorBgEEAYORVgEABFIwUDAJAgECAgEAAgEAMDYMGTEuMy42LjEuNC4xLjUx
NDE0LjAuMC4xLjAMGTEuMy42LjEuNC4xLjUxNDE0LjAuMC4yLjAMBE9UR0MMBURF NDE0LjAuMC4xLjAMGTEuMy42LjEuNC4xLjUxNDE0LjAuMC4yLjAMBE9UR0MMBURF
S1JBMCoGCisGAQQBg5FWAQEEHDAaBgsrBgEEAYORVgEBAAYLKwYBBAGDkVYBAQEw S1JBMCoGCisGAQQBg5FWAQEEHDAaBgsrBgEEAYORVgEBAAYLKwYBBAGDkVYBAQEw
MAYKKwYBBAGDkVYBAgQiMCAMDjEuMy42LjEuNC4xLjcxDAlEaXNjb3ZlcnkMAzEu MAYKKwYBBAGDkVYBAgQiMCAMDjEuMy42LjEuNC4xLjcxDAlEaXNjb3ZlcnkMAzEu
MDAKBggqhkjOPQQDAgNIADBFAiBLKD1R5LUOUJdMq2VWlzbzpZjvLeN1CFQIPS4y MDAKBggqhkjOPQQDAgNIADBFAiEA3Ay4oPSGwARJWub9/k58xiqARpRKjCDaGGZi
cjbm9wIhANmGPf7y8/s/fKWy/dEaIGjo79lButKOe0JWZaburW3P mHTurqYCIC/e7Y9NAMiweZZ2JaGAYXC7T8YTqAFneT9jaq2o3c9m
-----END CERTIFICATE----- -----END CERTIFICATE-----
-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY----- -----BEGIN EC PRIVATE KEY-----
MHcCAQEEIChO1xeRf0WA/npKbjLKPzlnTDhE7v95O5ZG2fhZbBjLoAoGCCqGSM49 MHcCAQEEIDUCAKRYHFbz7MVYj4LASsOxX54sYcVNbE4MLwIa/0j/oAoGCCqGSM49
AwEHoUQDQgAEI1ezCcJDuCeD1keCoG1R6xR0kIqRzETbu9ODj5pwEEN7ZxIY52MZ AwEHoUQDQgAE1ndLf+RmoRDFEm/HYWjiGXUwxw03pW1ln40sQOjoXDMtbihnsAoO
9Ezgw7zfGHpBOb6Awzl/fJmKcYT2uYc+dg== 3tkdmUyu2TP7YSkl7jMsDdCVwOgaFvaJ/A==
-----END EC PRIVATE KEY----- -----END EC PRIVATE KEY-----
...@@ -147,6 +147,9 @@ public class IORepository { ...@@ -147,6 +147,9 @@ public class IORepository {
} catch (IOException e) { } catch (IOException e) {
Timber.e("%s file storage failed", path); Timber.e("%s file storage failed", path);
emitter.onError(e); emitter.onError(e);
} catch (Exception e) {
Timber.e(e.getMessage());
emitter.onError(e);
} }
}); });
} }
......
...@@ -25,6 +25,7 @@ import android.os.Bundle; ...@@ -25,6 +25,7 @@ import android.os.Bundle;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
...@@ -238,7 +239,16 @@ public class TrustAnchorActivity extends AppCompatActivity implements Injectable ...@@ -238,7 +239,16 @@ public class TrustAnchorActivity extends AppCompatActivity implements Injectable
} }
private void handleError(@NonNull ViewModelError error) { private void handleError(@NonNull ViewModelError error) {
// TODO: int errorId = -1;
switch ((TrustAnchorViewModel.Error)error.getType()) {
case ADD_ROOT_CERT:
errorId = R.string.trust_anchor_create_error;
break;
}
if (errorId != 0) {
Toast.makeText(this, errorId, Toast.LENGTH_SHORT).show();
}
} }
private void processCredential(@NonNull OcCredential credential) { private void processCredential(@NonNull OcCredential credential) {
......
...@@ -12,6 +12,7 @@ import org.openconnectivity.otgc.domain.usecase.trustanchor.RemoveTrustAnchorByC ...@@ -12,6 +12,7 @@ import org.openconnectivity.otgc.domain.usecase.trustanchor.RemoveTrustAnchorByC
import org.openconnectivity.otgc.domain.usecase.trustanchor.StoreTrustAnchorUseCase; import org.openconnectivity.otgc.domain.usecase.trustanchor.StoreTrustAnchorUseCase;
import org.openconnectivity.otgc.utils.rx.SchedulersFacade; import org.openconnectivity.otgc.utils.rx.SchedulersFacade;
import org.openconnectivity.otgc.utils.viewmodel.ViewModelError; import org.openconnectivity.otgc.utils.viewmodel.ViewModelError;
import org.openconnectivity.otgc.utils.viewmodel.ViewModelErrorType;
import java.io.File; import java.io.File;
...@@ -90,7 +91,7 @@ public class TrustAnchorViewModel extends ViewModel { ...@@ -90,7 +91,7 @@ public class TrustAnchorViewModel extends ViewModel {
.observeOn(schedulersFacade.ui()) .observeOn(schedulersFacade.ui())
.subscribe( .subscribe(
() -> retrieveTrustAnchors(), () -> retrieveTrustAnchors(),
throwable -> {} throwable -> mError.setValue(new ViewModelError(Error.ADD_ROOT_CERT, throwable.getMessage()))
)); ));
} }
...@@ -103,4 +104,8 @@ public class TrustAnchorViewModel extends ViewModel { ...@@ -103,4 +104,8 @@ public class TrustAnchorViewModel extends ViewModel {
throwable -> {} throwable -> {}
)); ));
} }
public enum Error implements ViewModelErrorType {
ADD_ROOT_CERT
}
} }
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
<string name="credentials_cardview_role">ID de rol: %1$s, Autoridad de rol: %2$s</string> <string name="credentials_cardview_role">ID de rol: %1$s, Autoridad de rol: %2$s</string>
<string name="credentials_cardview_credid">ID Credencial: %1$s</string> <string name="credentials_cardview_credid">ID Credencial: %1$s</string>
<string name="credentials_cardview_credusage">Uso: %1$s</string> <string name="credentials_cardview_credusage">Uso: %1$s</string>
<string name="trust_anchor_create_error">No se puede almacenar el certificado raíz desde la ubicación seleccionada</string>
<string name="devices_dialog_wifi_scan_error">Error escaneando las redes Wi-Fi</string> <string name="devices_dialog_wifi_scan_error">Error escaneando las redes Wi-Fi</string>
<string name="devices_dialog_wifi_easy_setup_connecting">Configurando y conectado el dispositivo mediante Wi-Fi Easy Setup</string> <string name="devices_dialog_wifi_easy_setup_connecting">Configurando y conectado el dispositivo mediante Wi-Fi Easy Setup</string>
<string name="devices_dialog_wifi_easy_setup_error">Wi-Fi Easy Setup ha fallado</string> <string name="devices_dialog_wifi_easy_setup_error">Wi-Fi Easy Setup ha fallado</string>
......
...@@ -216,6 +216,7 @@ ...@@ -216,6 +216,7 @@
<string name="credentials_cardview_credid">Credential ID: %1$s</string> <string name="credentials_cardview_credid">Credential ID: %1$s</string>
<string name="credentials_cardview_credusage">Usage: %1$s</string> <string name="credentials_cardview_credusage">Usage: %1$s</string>
<string name="credentials_cardview_role">Role ID: %1$s, Role Authority: %2$s</string> <string name="credentials_cardview_role">Role ID: %1$s, Role Authority: %2$s</string>
<string name="trust_anchor_create_error">Cannot store the root certificate from the selected location</string>
<string name="client_title_no_name">Unnamed</string> <string name="client_title_no_name">Unnamed</string>
<string name="client_menu_item_info">Info</string> <string name="client_menu_item_info">Info</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment