From d31e7ccaad7929eaded9c5d1e966bac2d111a8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20=C4=8Eurech?= Date: Wed, 7 Dec 2022 16:28:36 +0100 Subject: [PATCH 1/2] Fix #26: License all files under Apache 2.0 --- buildSrc/src/main/kotlin/Constants.kt | 17 +++++++++------ .../src/main/kotlin/ProjectConfiguration.kt | 17 +++++++++------ .../android/powerauth/networking/Api.kt | 17 +++++++++------ .../powerauth/networking/ECIESInterceptor.kt | 17 +++++++++------ .../android/powerauth/networking/Endpoint.kt | 17 +++++++++------ .../android/powerauth/networking/Logger.kt | 17 +++++++++------ .../powerauth/networking/data/Requests.kt | 17 +++++++++------ .../powerauth/networking/data/Responses.kt | 21 ++++++++++++------- .../powerauth/networking/error/ApiError.kt | 17 +++++++++------ .../networking/error/ApiErrorCode.kt | 17 +++++++++------ .../networking/error/ApiHttpException.kt | 17 +++++++++------ .../networking/error/ErrorResponse.kt | 17 +++++++++------ .../networking/error/ErrorResponseObject.kt | 17 +++++++++------ .../processing/GsonRequestBodyBytes.kt | 17 +++++++++------ .../processing/GsonResponseBodyConverter.kt | 17 +++++++++------ .../networking/ssl/ISSLPinningProvider.kt | 17 +++++++++------ .../networking/ssl/SSLValidationStrategy.kt | 17 +++++++++------ .../ssl/TrustAllCertsTrustManager.kt | 17 +++++++++------ .../tokens/IPowerAuthTokenListener.kt | 17 +++++++++------ .../tokens/IPowerAuthTokenProvider.kt | 17 +++++++++------ .../networking/tokens/TokenManager.kt | 17 +++++++++------ .../powerauth/networking/utils/AppUtils.kt | 17 +++++++++------ .../networking/utils/DeviceInfoUtils.kt | 17 +++++++++------ 23 files changed, 255 insertions(+), 140 deletions(-) diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index 1b2a58d..3a3bd35 100644 --- a/buildSrc/src/main/kotlin/Constants.kt +++ b/buildSrc/src/main/kotlin/Constants.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2021, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ import org.gradle.api.JavaVersion diff --git a/buildSrc/src/main/kotlin/ProjectConfiguration.kt b/buildSrc/src/main/kotlin/ProjectConfiguration.kt index f4a8f38..f071daf 100644 --- a/buildSrc/src/main/kotlin/ProjectConfiguration.kt +++ b/buildSrc/src/main/kotlin/ProjectConfiguration.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2022, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ import com.android.build.api.dsl.BaseFlavor diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/Api.kt b/library/src/main/java/com/wultra/android/powerauth/networking/Api.kt index c6c27f8..5f3fce9 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/Api.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/Api.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ @file:Suppress("unused") diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/ECIESInterceptor.kt b/library/src/main/java/com/wultra/android/powerauth/networking/ECIESInterceptor.kt index ceaaf81..2ca3c18 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/ECIESInterceptor.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/ECIESInterceptor.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2022, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/Endpoint.kt b/library/src/main/java/com/wultra/android/powerauth/networking/Endpoint.kt index b92fc59..592ed06 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/Endpoint.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/Endpoint.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2021, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/Logger.kt b/library/src/main/java/com/wultra/android/powerauth/networking/Logger.kt index 1842b7b..2f27684 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/Logger.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/Logger.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/data/Requests.kt b/library/src/main/java/com/wultra/android/powerauth/networking/data/Requests.kt index d617f43..0d7a9c5 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/data/Requests.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/data/Requests.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2021, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.data diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/data/Responses.kt b/library/src/main/java/com/wultra/android/powerauth/networking/data/Responses.kt index 587bffe..30f9b24 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/data/Responses.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/data/Responses.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.data @@ -22,8 +27,8 @@ open class StatusResponse(@SerializedName("status") val status: Status) { @SerializedName("OK") OK, - @SerializedName("ERROR") - ERROR + @SerializedName("ERROR") + ERROR } } diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiError.kt b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiError.kt index cb0c3a5..ebce05f 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiError.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiError.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.error diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorCode.kt b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorCode.kt index 4fde183..eac4d03 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorCode.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorCode.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.error diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiHttpException.kt b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiHttpException.kt index 44dedb2..dd75ab3 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiHttpException.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiHttpException.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.error diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponse.kt b/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponse.kt index 07ebf04..88316f9 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponse.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponse.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.error diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponseObject.kt b/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponseObject.kt index 8824301..934729f 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponseObject.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponseObject.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.error diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonRequestBodyBytes.kt b/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonRequestBodyBytes.kt index a236acf..1023580 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonRequestBodyBytes.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonRequestBodyBytes.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.processing diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonResponseBodyConverter.kt b/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonResponseBodyConverter.kt index fcec78c..ae57f9f 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonResponseBodyConverter.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/processing/GsonResponseBodyConverter.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.processing diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/ssl/ISSLPinningProvider.kt b/library/src/main/java/com/wultra/android/powerauth/networking/ssl/ISSLPinningProvider.kt index 37c9b53..1c09cfb 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/ssl/ISSLPinningProvider.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/ssl/ISSLPinningProvider.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.ssl diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/ssl/SSLValidationStrategy.kt b/library/src/main/java/com/wultra/android/powerauth/networking/ssl/SSLValidationStrategy.kt index 5dc768a..d60f851 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/ssl/SSLValidationStrategy.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/ssl/SSLValidationStrategy.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.ssl diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/ssl/TrustAllCertsTrustManager.kt b/library/src/main/java/com/wultra/android/powerauth/networking/ssl/TrustAllCertsTrustManager.kt index aca852a..7db09a8 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/ssl/TrustAllCertsTrustManager.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/ssl/TrustAllCertsTrustManager.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2018, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.ssl diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenListener.kt b/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenListener.kt index 1109daf..e4682b4 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenListener.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenListener.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.tokens diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenProvider.kt b/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenProvider.kt index 4e62e62..f306d2a 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenProvider.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/tokens/IPowerAuthTokenProvider.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.tokens diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/tokens/TokenManager.kt b/library/src/main/java/com/wultra/android/powerauth/networking/tokens/TokenManager.kt index e1e0627..9d7d83c 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/tokens/TokenManager.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/tokens/TokenManager.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2020, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.tokens diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/utils/AppUtils.kt b/library/src/main/java/com/wultra/android/powerauth/networking/utils/AppUtils.kt index 2b66fae..b3d2e5f 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/utils/AppUtils.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/utils/AppUtils.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2022, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.utils diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/utils/DeviceInfoUtils.kt b/library/src/main/java/com/wultra/android/powerauth/networking/utils/DeviceInfoUtils.kt index e6fc5b8..b1ad96c 100644 --- a/library/src/main/java/com/wultra/android/powerauth/networking/utils/DeviceInfoUtils.kt +++ b/library/src/main/java/com/wultra/android/powerauth/networking/utils/DeviceInfoUtils.kt @@ -1,12 +1,17 @@ /* - * Copyright (c) 2022, Wultra s.r.o. (www.wultra.com). + * Copyright 2022 Wultra s.r.o. * - * All rights reserved. This source code can be used only for purposes specified - * by the given license contract signed by the rightful deputy of Wultra s.r.o. - * This source code can be used only by the owner of the license. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Any disputes arising in respect of this agreement (license) shall be brought - * before the Municipal Court of Prague. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. */ package com.wultra.android.powerauth.networking.utils From 38497f734e1c26391e33735f709fe8e6bde7fbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20=C4=8Eurech?= <1719814+hvge@users.noreply.github.com> Date: Thu, 8 Dec 2022 15:15:01 +0100 Subject: [PATCH 2/2] Fix #27: Add ApiErrorException (#29) * Fix #27: Add ApiErrorException --- .../networking/error/ApiErrorException.kt | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorException.kt diff --git a/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorException.kt b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorException.kt new file mode 100644 index 0000000..06c8d6a --- /dev/null +++ b/library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorException.kt @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Wultra s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. + */ + +package com.wultra.android.powerauth.networking.error + +/** + * Error reported in functions using callback with `Result` type. + */ +class ApiErrorException( + /** + * Error code extracted from the response's error. + */ + val errorCode: ApiErrorCode? = null, + /** + * The detailed message. + */ + message: String? = null, + /** + * The cause of the exception. + */ + cause: Throwable? = null + +): Exception(message, cause) { + + /** + * Construct exception from existing [ApiError]. + * + * @param apiError Instance of [ApiError]. + */ + constructor(apiError: ApiError) : this(apiError.error, apiError.e.message, apiError.e) + + /** + * Construct exception from another exception. If exception is one from known exceptions, + * then the [errorCode] property is also initialized. + */ + constructor(cause: Throwable) : this(ApiError(cause).error, cause.message, cause) + + companion object { + /** + * Wrap any [Throwable] object into [ApiErrorException]. If throwable is already [ApiErrorException] + * then return the object as is. + */ + fun wrap(t: Throwable): ApiErrorException { + return if (t is ApiErrorException) t else ApiErrorException(t) + } + } +} \ No newline at end of file