diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-12-16 22:07:48 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-12-16 22:07:48 +0100 |
commit | 5d61ae241e053363c62ad6a647cab2d1a35d8b5f (patch) | |
tree | 3c06601faa4298249ba16abf07852a0a8875f772 /app | |
parent | 76891aaceff7f6564cbeb71beb0451e778d6073f (diff) | |
download | wallet-android-5d61ae241e053363c62ad6a647cab2d1a35d8b5f.tar.gz wallet-android-5d61ae241e053363c62ad6a647cab2d1a35d8b5f.tar.bz2 wallet-android-5d61ae241e053363c62ad6a647cab2d1a35d8b5f.zip |
bump deps, fix crash on orientation change, add license headers
Diffstat (limited to 'app')
16 files changed, 259 insertions, 37 deletions
diff --git a/app/build.gradle b/app/build.gradle index 613df20..1e8d039 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,13 +10,13 @@ android { applicationId "net.taler.wallet" minSdkVersion 21 targetSdkVersion 29 - versionCode 3 - versionName "0.6.0pre4" + versionCode 4 + versionName "0.6.0pre5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -34,8 +34,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.0.2' - implementation 'androidx.core:core-ktx:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.core:core-ktx:1.1.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' @@ -45,15 +45,14 @@ dependencies { implementation project(":akono") implementation 'com.google.guava:guava:28.0-android' - def nav_version = "2.1.0-rc01" + def nav_version = "2.2.0-rc03" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" // ViewModel and LiveData - def lifecycle_version = "2.0.0" + def lifecycle_version = "2.1.0" implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" - kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version" // QR codes implementation 'com.google.zxing:core:3.4.0' diff --git a/app/src/main/java/net/taler/wallet/AlreadyPaid.kt b/app/src/main/java/net/taler/wallet/AlreadyPaid.kt index 40903f9..65785b9 100644 --- a/app/src/main/java/net/taler/wallet/AlreadyPaid.kt +++ b/app/src/main/java/net/taler/wallet/AlreadyPaid.kt @@ -1,5 +1,20 @@ -package net.taler.wallet +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + +package net.taler.wallet import android.os.Bundle import androidx.fragment.app.Fragment @@ -10,7 +25,8 @@ import android.widget.Button import androidx.navigation.findNavController /** - * A simple [Fragment] subclass. + * Display the message that the user already paid for the order + * that the merchant is proposing. */ class AlreadyPaid : Fragment() { diff --git a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt index 9134df4..77f3153 100644 --- a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt +++ b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet import android.content.* diff --git a/app/src/main/java/net/taler/wallet/MainActivity.kt b/app/src/main/java/net/taler/wallet/MainActivity.kt index b3090b8..5ea96a0 100644 --- a/app/src/main/java/net/taler/wallet/MainActivity.kt +++ b/app/src/main/java/net/taler/wallet/MainActivity.kt @@ -1,3 +1,20 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + + package net.taler.wallet diff --git a/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt b/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt index 039fa73..6332c39 100644 --- a/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt +++ b/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt @@ -1,22 +1,33 @@ -package net.taler.wallet +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + +package net.taler.wallet import android.os.Bundle -import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Button +import androidx.fragment.app.Fragment import androidx.navigation.findNavController -// TODO: Rename parameter arguments, choose names that match -// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER -private const val ARG_PARAM1 = "param1" -private const val ARG_PARAM2 = "param2" - /** - * A simple [Fragment] subclass. + * Fragment that shows the success message for a payment. * */ class PaymentSuccessful : Fragment() { @@ -32,6 +43,4 @@ class PaymentSuccessful : Fragment() { } return view } - - } diff --git a/app/src/main/java/net/taler/wallet/PromptPayment.kt b/app/src/main/java/net/taler/wallet/PromptPayment.kt index e9652be..42a9b39 100644 --- a/app/src/main/java/net/taler/wallet/PromptPayment.kt +++ b/app/src/main/java/net/taler/wallet/PromptPayment.kt @@ -1,5 +1,20 @@ -package net.taler.wallet +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +package net.taler.wallet import android.annotation.SuppressLint import android.os.Bundle @@ -17,8 +32,7 @@ import com.google.android.material.snackbar.Snackbar import me.zhanghai.android.materialprogressbar.MaterialProgressBar /** - * A simple [Fragment] subclass. - * + * Show a payment and ask the user to accept/decline. */ class PromptPayment : Fragment() { @@ -28,8 +42,7 @@ class PromptPayment : Fragment() { private fun triggerLoading() { val loading = model.payStatus.value == null || (model.payStatus.value is PayStatus.Loading) - val myActivity = activity!! - val progressBar = myActivity.findViewById<MaterialProgressBar>(R.id.progress_bar) + val progressBar = requireActivity().findViewById<MaterialProgressBar>(R.id.progress_bar) if (loading) { progressBar.visibility = View.VISIBLE } else { @@ -43,8 +56,6 @@ class PromptPayment : Fragment() { model = activity?.run { ViewModelProviders.of(this)[WalletViewModel::class.java] } ?: throw Exception("Invalid Activity") - - triggerLoading() } override fun onResume() { @@ -139,7 +150,7 @@ class PromptPayment : Fragment() { triggerLoading() - model.payStatus.observe(this, Observer { + model.payStatus.observe(viewLifecycleOwner, Observer { triggerLoading() showPayStatus(view, it) }) diff --git a/app/src/main/java/net/taler/wallet/PromptWithdraw.kt b/app/src/main/java/net/taler/wallet/PromptWithdraw.kt index 57965f5..0e0e680 100644 --- a/app/src/main/java/net/taler/wallet/PromptWithdraw.kt +++ b/app/src/main/java/net/taler/wallet/PromptWithdraw.kt @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet import android.annotation.SuppressLint diff --git a/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt b/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt index 542b855..ffde82e 100644 --- a/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt +++ b/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet diff --git a/app/src/main/java/net/taler/wallet/Settings.kt b/app/src/main/java/net/taler/wallet/Settings.kt index bf67f56..46bf2e3 100644 --- a/app/src/main/java/net/taler/wallet/Settings.kt +++ b/app/src/main/java/net/taler/wallet/Settings.kt @@ -1,5 +1,20 @@ -package net.taler.wallet +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +package net.taler.wallet import android.os.Bundle import androidx.fragment.app.Fragment @@ -9,12 +24,6 @@ import android.view.ViewGroup import android.widget.Button import androidx.lifecycle.ViewModelProviders - -// TODO: Rename parameter arguments, choose names that match -// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER -private const val ARG_PARAM1 = "param1" -private const val ARG_PARAM2 = "param2" - /** * A simple [Fragment] subclass. * diff --git a/app/src/main/java/net/taler/wallet/ShowBalance.kt b/app/src/main/java/net/taler/wallet/ShowBalance.kt index 81de260..5d4c35e 100644 --- a/app/src/main/java/net/taler/wallet/ShowBalance.kt +++ b/app/src/main/java/net/taler/wallet/ShowBalance.kt @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet diff --git a/app/src/main/java/net/taler/wallet/WalletHistory.kt b/app/src/main/java/net/taler/wallet/WalletHistory.kt index d5cd3b6..20e6688 100644 --- a/app/src/main/java/net/taler/wallet/WalletHistory.kt +++ b/app/src/main/java/net/taler/wallet/WalletHistory.kt @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet diff --git a/app/src/main/java/net/taler/wallet/WalletViewModel.kt b/app/src/main/java/net/taler/wallet/WalletViewModel.kt index 1ae9a80..9e93fcf 100644 --- a/app/src/main/java/net/taler/wallet/WalletViewModel.kt +++ b/app/src/main/java/net/taler/wallet/WalletViewModel.kt @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet import android.app.Application @@ -205,7 +221,7 @@ class WalletViewModel(val app: Application) : AndroidViewModel(app) { Log.v(TAG, "got history entry $h") val type = h.getString("type") Log.v(TAG, "got history entry type $type") - val detail = h.getJSONObject("detail") + val detail = h val timestamp = h.getJSONObject("timestamp") historyEntries.add(HistoryEntry(detail, type, timestamp)) } diff --git a/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt b/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt index c16dced..127f8f7 100644 --- a/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt +++ b/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet diff --git a/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt b/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt index 1c5b170..36795f5 100644 --- a/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt +++ b/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt @@ -1,3 +1,20 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + + package net.taler.wallet.backend import android.app.Application diff --git a/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt b/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt index 65cbeaf..297f0f7 100644 --- a/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt +++ b/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt @@ -1,3 +1,20 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + + package net.taler.wallet.backend import akono.AkonoJni diff --git a/app/src/test/java/net/taler/wallet/crypto/Base32CrockfordTest.kt b/app/src/test/java/net/taler/wallet/crypto/Base32CrockfordTest.kt index b5d2772..711a519 100644 --- a/app/src/test/java/net/taler/wallet/crypto/Base32CrockfordTest.kt +++ b/app/src/test/java/net/taler/wallet/crypto/Base32CrockfordTest.kt @@ -1,6 +1,21 @@ +/* + This file is part of GNU Taler + (C) 2019 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + package net.taler.wallet.crypto -import org.junit.Assert.* import org.junit.Test class Base32CrockfordTest { |