summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--.idea/codeStyles/Project.xml13
-rw-r--r--build.gradle6
-rw-r--r--cashier/.gitlab-ci.yml4
-rw-r--r--merchant-terminal/.gitlab-ci.yml4
-rw-r--r--wallet/.gitlab-ci.yml4
-rw-r--r--wallet/build.gradle10
-rw-r--r--wallet/src/main/java/net/taler/wallet/MainActivity.kt16
-rw-r--r--wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt9
-rw-r--r--wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt3
-rw-r--r--wallet/src/main/java/net/taler/wallet/withdraw/TosSection.kt5
-rw-r--r--wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt2
12 files changed, 40 insertions, 38 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7f304d8..9b4c4c0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: registry.gitlab.com/fdroid/ci-images-client:latest
+image: briar/ci-image-android:latest
cache:
paths:
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 587f132..28083bf 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -2,18 +2,7 @@
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
- <value>
- <package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
- </value>
- </option>
- <option name="PACKAGES_IMPORT_LAYOUT">
- <value>
- <package name="" alias="false" withSubpackages="true" />
- <package name="java" alias="false" withSubpackages="true" />
- <package name="javax" alias="false" withSubpackages="true" />
- <package name="kotlin" alias="false" withSubpackages="true" />
- <package name="" alias="true" withSubpackages="true" />
- </value>
+ <value />
</option>
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
diff --git a/build.gradle b/build.gradle
index 87765ad..06bd425 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,10 +1,10 @@
buildscript {
- ext.kotlin_version = '1.5.30'
+ ext.kotlin_version = '1.5.31'
ext.ktor_version = "1.6.3"
ext.nav_version = "2.3.5"
ext.material_version = "1.4.0"
ext.lifecycle_version = "2.3.1"
- ext.constraintlayout_version = "2.1.0"
+ ext.constraintlayout_version = "2.1.1"
ext.junit_version = "4.13.2"
// check https://android-rebuilds.beuc.net/ for availability of free build tools
ext.build_tools_version = "30.0.3"
@@ -15,7 +15,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.1'
+ classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
diff --git a/cashier/.gitlab-ci.yml b/cashier/.gitlab-ci.yml
index 6330c91..57c9971 100644
--- a/cashier/.gitlab-ci.yml
+++ b/cashier/.gitlab-ci.yml
@@ -39,8 +39,8 @@ cashier_deploy_nightly:
- ./gradlew :cashier:assembleRelease
# Rename APK, so fdroid nightly accepts it (looks for *-debug.apk)
- mv cashier/build/outputs/apk/release/*.apk cashier-debug.apk
- # START only needed while patch not accepted/released upstream
- - apt update && apt install patch
+ # START only needed while fdroidserver and patch not accepted/released upstream
+ - apt update && apt-get -qy install --no-install-recommends fdroidserver openssh-client patch
- patch /usr/lib/python3/dist-packages/fdroidserver/nightly.py nightly-stats.patch
# END
- CI_PROJECT_URL="https://gitlab.com/gnu-taler/fdroid-repo" CI_PROJECT_PATH="gnu-taler/fdroid-repo" fdroid nightly -v
diff --git a/merchant-terminal/.gitlab-ci.yml b/merchant-terminal/.gitlab-ci.yml
index 023b7bf..63b58f1 100644
--- a/merchant-terminal/.gitlab-ci.yml
+++ b/merchant-terminal/.gitlab-ci.yml
@@ -42,8 +42,8 @@ merchant_deploy_nightly:
- ./gradlew :merchant-terminal:assembleRelease
# Rename APK, so fdroid nightly accepts it (looks for *-debug.apk)
- mv merchant-terminal/build/outputs/apk/release/*.apk merchant-terminal-debug.apk
- # START only needed while patch not accepted/released upstream
- - apt update && apt install patch
+ # START only needed while fdroidserver and patch not accepted/released upstream
+ - apt update && apt-get -qy install --no-install-recommends fdroidserver openssh-client patch
- patch /usr/lib/python3/dist-packages/fdroidserver/nightly.py nightly-stats.patch
# END
- CI_PROJECT_URL="https://gitlab.com/gnu-taler/fdroid-repo" CI_PROJECT_PATH="gnu-taler/fdroid-repo" fdroid nightly -v
diff --git a/wallet/.gitlab-ci.yml b/wallet/.gitlab-ci.yml
index 67de977..403d13e 100644
--- a/wallet/.gitlab-ci.yml
+++ b/wallet/.gitlab-ci.yml
@@ -28,8 +28,8 @@ wallet_deploy_nightly:
- ./gradlew :wallet:assembleNightlyRelease
# Rename APK, so fdroid nightly accepts it (looks for *-debug.apk)
- mv wallet/build/outputs/apk/nightly/release/*.apk wallet-debug.apk
- # START only needed while patch not accepted/released upstream
- - apt update && apt install patch
+ # START only needed while fdroidserver and patch not accepted/released upstream
+ - apt update && apt-get -qy install --no-install-recommends fdroidserver openssh-client patch
- patch -b /usr/lib/python3/dist-packages/fdroidserver/nightly.py nightly-stats.patch
# END
- fdroid --version
diff --git a/wallet/build.gradle b/wallet/build.gradle
index 2fce66e..e5da3a3 100644
--- a/wallet/build.gradle
+++ b/wallet/build.gradle
@@ -23,8 +23,8 @@ plugins {
id "de.undercouch.download"
}
-def walletCoreVersion = "v0.8.1"
-def walletCoreSha256 = "23bf89b663f0fd0e84a3d7e54a19766766c7306e5704e43a25df57da72056fa7"
+def walletCoreVersion = "v0.9.0-dev.1"
+def walletCoreSha256 = "4c7add4ef814974fe129f8c06c4ebb08876c95cd689ee8629fa0ac0109320021"
static def versionCodeEpoch() {
return (new Date().getTime() / 1000).toInteger()
@@ -47,8 +47,8 @@ android {
applicationId "net.taler.wallet"
minSdkVersion 21
targetSdkVersion 30
- versionCode 9
- versionName "v0.8.1"
+ versionCode 11
+ versionName "v0.9.0-dev.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "WALLET_CORE_VERSION", "\"$walletCoreVersion\""
}
@@ -111,7 +111,7 @@ android {
dependencies {
implementation project(":taler-kotlin-android")
implementation project(":anastasis-ui")
- implementation 'net.taler:akono:0.1'
+ implementation 'net.taler:akono:0.2'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
diff --git a/wallet/src/main/java/net/taler/wallet/MainActivity.kt b/wallet/src/main/java/net/taler/wallet/MainActivity.kt
index ca53de3..3b8be4f 100644
--- a/wallet/src/main/java/net/taler/wallet/MainActivity.kt
+++ b/wallet/src/main/java/net/taler/wallet/MainActivity.kt
@@ -150,19 +150,29 @@ class MainActivity : AppCompatActivity(), OnNavigationItemSelectedListener,
if (uri.fragment != null && !isOnline()) {
connectToWifi(this, uri.fragment!!)
}
+ val normalizedURL = url.lowercase(ROOT)
+ val action = normalizedURL.substring(
+ if (normalizedURL.startsWith("taler://")) {
+ "taler://".length
+ } else if (normalizedURL.startsWith("taler+http://") && model.devMode.value == true) {
+ "taler+http://".length
+ } else {
+ normalizedURL.length
+ }
+ )
when {
- url.lowercase(ROOT).startsWith("taler://pay/") -> {
+ action.startsWith("pay/") -> {
Log.v(TAG, "navigating!")
nav.navigate(R.id.action_nav_main_to_promptPayment)
model.paymentManager.preparePay(url)
}
- url.lowercase(ROOT).startsWith("taler://withdraw/") -> {
+ action.startsWith("withdraw/") -> {
Log.v(TAG, "navigating!")
// there's more than one entry point, so use global action
nav.navigate(R.id.action_global_promptWithdraw)
model.withdrawManager.getWithdrawalDetails(url)
}
- url.lowercase(ROOT).startsWith("taler://refund/") -> {
+ action.startsWith("refund/") -> {
model.showProgressBar.value = true
model.refundManager.refund(url).observe(this, Observer(::onRefundResponse))
}
diff --git a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt
index 8312d9b..f99f38d 100644
--- a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt
+++ b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt
@@ -17,7 +17,6 @@
package net.taler.wallet.backend
-import akono.AkonoJni
import android.app.Service
import android.content.Intent
import android.os.Handler
@@ -26,6 +25,7 @@ import android.os.Message
import android.os.Messenger
import android.os.RemoteException
import android.util.Log
+import net.taler.akono.AkonoJni
import net.taler.wallet.BuildConfig.WALLET_CORE_VERSION
import net.taler.wallet.HostCardEmulatorService
import org.json.JSONObject
@@ -75,7 +75,6 @@ class WalletBackendService : Service() {
akono.evalNodeCode("tw = require('@gnu-taler/taler-wallet-embedded');")
akono.evalNodeCode("tw.installNativeWalletListener();")
sendInitMessage()
- initialized = true
super.onCreate()
}
@@ -92,13 +91,14 @@ class WalletBackendService : Service() {
* Handler of incoming messages from clients.
*/
class IncomingHandler(
- service: WalletBackendService
+ service: WalletBackendService,
) : Handler() {
private val serviceWeakRef = WeakReference(service)
override fun handleMessage(msg: Message) {
val svc = serviceWeakRef.get() ?: return
+ if (!svc.initialized) Log.w(TAG, "Warning: Not yet initialized")
when (msg.what) {
MSG_COMMAND -> {
val data = msg.data
@@ -203,7 +203,8 @@ class WalletBackendService : Service() {
"response" -> {
when (message.getString("operation")) {
"init" -> {
- Log.v(TAG, "got response for init operation: ${message.toString(2)}")
+ Log.d(TAG, "got response for init operation: ${message.toString(2)}")
+ initialized = true
sendNotify(message.toString(2))
}
"reset" -> {
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt
index 73fe760..e3c5da6 100644
--- a/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt
@@ -87,7 +87,8 @@ class ReviewExchangeTosFragment : Fragment() {
private fun onTosError(msg: String) {
ui.tosList.fadeIn()
ui.progressBar.fadeOut()
- ui.buttonCard.fadeOut()
+ ui.acceptTosCheckBox.fadeIn()
+ // ui.buttonCard.fadeOut()
ui.errorView.text = getString(R.string.exchange_tos_error, "\n\n$msg")
ui.errorView.fadeIn()
}
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/TosSection.kt b/wallet/src/main/java/net/taler/wallet/withdraw/TosSection.kt
index b198478..64dff8a 100644
--- a/wallet/src/main/java/net/taler/wallet/withdraw/TosSection.kt
+++ b/wallet/src/main/java/net/taler/wallet/withdraw/TosSection.kt
@@ -16,6 +16,7 @@
package net.taler.wallet.withdraw
+import android.util.Log
import io.noties.markwon.Markwon
import kotlinx.serialization.Serializable
import org.commonmark.node.Code
@@ -50,7 +51,7 @@ internal fun parseTos(markwon: Markwon, text: String): List<TosSection> {
lastHeading = getNodeText(node)
if (lastHeading.isBlank()) throw ParseException("Empty heading", 0)
} else if (lastHeading == null) {
- throw ParseException("Found text before first primary heading", 0)
+ throw ParseException("The exchange ToS does not follow the correct format", 0)
} else {
section.appendChild(node)
}
@@ -77,6 +78,6 @@ private fun getNodeText(rootNode: Node): String {
@Serializable
data class TosResponse(
- val tos: String,
+ val content: String,
val currentEtag: String
)
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
index 5afb125..cc4c057 100644
--- a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
+++ b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
@@ -167,7 +167,7 @@ class WithdrawManager(
exchangeBaseUrl = exchangeBaseUrl,
amountRaw = details.amountRaw,
amountEffective = details.amountEffective,
- tosText = it.tos,
+ tosText = it.content,
tosEtag = it.currentEtag,
showImmediately = showImmediately.toEvent(),
)