commit 696325e086ea5133000511a49ef957a80bc7bbf7
parent 21b00b01db86a0c6f0c1193656456311b40bd5c8
Author: Iván Ávalos <avalos@disroot.org>
Date: Fri, 16 Aug 2024 16:03:48 +0200
Revert "Harsher fix for NFC crash"
This reverts commit 21b00b01db86a0c6f0c1193656456311b40bd5c8.
Diffstat:
5 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
@@ -16,14 +16,10 @@
<module name="common_commonTest" target="1.6" />
<module name="common_jvmMain" target="1.6" />
<module name="common_jvmTest" target="1.6" />
- <module name="taler-android.anastasis" target="17" />
- <module name="taler-android.anastasis-lib" target="17" />
- <module name="taler-android.anastasis-test-driver-app" target="17" />
<module name="taler-android.multiplatform.common.commonMain" target="1.8" />
<module name="taler-android.multiplatform.common.commonTest" target="1.8" />
<module name="taler-android.multiplatform.common.jvmMain" target="1.8" />
<module name="taler-android.multiplatform.common.jvmTest" target="1.8" />
- <module name="taler-android.wallet-test-driver-app" target="17" />
<module name="taler-kotlin-common_jvmMain" target="1.6" />
<module name="taler-kotlin-common_jvmTest" target="1.6" />
</bytecodeTargetLevel>
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
@@ -4,8 +4,10 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
+ <option name="testRunner" value="GRADLE" />
+ <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
- <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
+ <option name="gradleJvm" value="jbr-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
@@ -16,7 +18,6 @@
<option value="$PROJECT_DIR$/wallet" />
</set>
</option>
- <option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
diff --git a/build.gradle b/build.gradle
@@ -8,7 +8,7 @@ buildscript {
constraintlayout_version = '2.1.4'
junit_version = "4.13.2"
// should debug build types be minified with D8 as well? good for catching issues early
- minify_debug = false
+ minify_debug = true
}
repositories {
google()
diff --git a/taler-kotlin-android/src/main/java/net/taler/lib/android/TalerNfcService.kt b/taler-kotlin-android/src/main/java/net/taler/lib/android/TalerNfcService.kt
@@ -27,7 +27,6 @@ import android.nfc.NfcAdapter.getDefaultAdapter
import android.nfc.cardemulation.CardEmulation
import android.nfc.cardemulation.HostApduService
import android.os.Bundle
-import android.os.UserHandle
import android.util.Log
import java.math.BigInteger
@@ -305,12 +304,10 @@ class TalerNfcService : HostApduService() {
val adapter = getDefaultAdapter(activity) ?: return
val emulation = CardEmulation.getInstance(adapter)
// TODO: find an alternative for when canonicalName is null
- try {
- val cn = ComponentName(activity, TalerNfcService::class.java)
+ TalerNfcService::class.java.canonicalName?.let {
+ val cn = ComponentName(activity.packageName, it)
emulation.setPreferredService(activity, cn)
- } catch (e: NullPointerException) {
- Log.d(TAG, "Not setting this app as the preferred NFC handler!")
- }
+ } ?: Log.d(TAG, "Not setting this app as the preferred NFC handler!")
}
fun unsetDefaultHandler(activity: Activity) {
diff --git a/wallet/build.gradle b/wallet/build.gradle
@@ -41,7 +41,7 @@ android {
compileSdk 34
defaultConfig {
- applicationId "net.taler.wallet.nfc"
+ applicationId "net.taler.wallet"
minSdkVersion 24
targetSdkVersion 34
versionCode 44