Skip to content

Commit

Permalink
feat: target android 14 (#1295)
Browse files Browse the repository at this point in the history
* chore: update checkpoints

* chore: use dashj 21.0.0-SNAPSHOT

* chore: target Android 14

* feat: update NFC based on Bitcoin Wallet

* feat: satisfy Android 14 requirements for services

* feat: update Bluetooth services based on Bitcoin Wallet

* fix: update InteractionAwareActivity receiver (not exported)

* fix(exploredash): use robolectric 4.13 (supports Android SDK 34)
  • Loading branch information
HashEngineering authored Aug 7, 2024
1 parent b3db176 commit 0ba26f2
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 172 deletions.
4 changes: 2 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ apply plugin: 'dagger.hilt.android.plugin'
android {

defaultConfig {
compileSdk 33
compileSdk 34
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
vectorDrawables.useSupportLibrary = true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;

import androidx.annotation.Nullable;
Expand All @@ -33,7 +34,12 @@ public class InteractionAwareActivity extends SecureActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
IntentFilter filter = new IntentFilter(FORCE_FINISH_ACTION);
registerReceiver(forceFinishReceiver, filter);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
registerReceiver(forceFinishReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(forceFinishReceiver, filter);
}
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions features/exploredash/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ plugins {

android {
defaultConfig {
compileSdk 33
compileSdk 34
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
javaCompileOptions {
Expand Down Expand Up @@ -115,7 +115,7 @@ dependencies {
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoVersion"
testImplementation "androidx.arch.core:core-testing:$coreTestingVersion"
testImplementation "org.robolectric:robolectric:4.9.2"
testImplementation "org.robolectric:robolectric:4.13"
testImplementation "androidx.room:room-testing:$roomVersion"

androidTestImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoVersion"
Expand Down
4 changes: 2 additions & 2 deletions integrations/coinbase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ plugins {
android {

defaultConfig {
compileSdk 33
compileSdk 34
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
4 changes: 2 additions & 2 deletions integrations/crowdnode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ plugins {

android {
defaultConfig {
compileSdk 33
compileSdk 34
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
Expand Down
4 changes: 2 additions & 2 deletions integrations/uphold/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ plugins {
android {

defaultConfig {
compileSdk 33
compileSdk 34
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 2 additions & 2 deletions sample-integration-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ android {
}

defaultConfig {
compileSdk 33
compileSdk 34
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
multiDexEnabled true
}
compileOptions {
Expand Down
11 changes: 8 additions & 3 deletions wallet/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<!-- dangerous permissions -->
<uses-permission android:name="android.permission.CAMERA" /> <!-- group: CAMERA -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<uses-feature
android:name="android.hardware.touchscreen"
Expand Down Expand Up @@ -321,10 +324,12 @@

<service
android:name="de.schildbach.wallet.service.BlockchainServiceImpl"
android:exported="false" />
android:exported="false"
android:foregroundServiceType="dataSync" />
<service
android:name="de.schildbach.wallet.offline.AcceptBluetoothService"
android:exported="false" />
android:exported="false"
android:foregroundServiceType="connectedDevice" />

<receiver
android:name="de.schildbach.wallet.service.BootstrapReceiver"
Expand Down
4 changes: 2 additions & 2 deletions wallet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ android {
android.ndkVersion '21.3.6528147'

defaultConfig {
compileSdk 33
compileSdk 34
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 102000
versionName project.hasProperty('versionName') ? project.property('versionName') : "10.2.0"
multiDexEnabled true
Expand Down
12 changes: 12 additions & 0 deletions wallet/res/drawable-anydpi/stat_notify_bluetooth_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#000"
android:pathData="M14.88,16.29L13,18.17V14.41M13,5.83L14.88,7.71L13,9.58M17.71,7.71L12,2H11V9.58L6.41,5L5,6.41L10.59,12L5,17.58L6.41,19L11,14.41V22H12L17.71,16.29L13.41,12L17.71,7.71Z" />
</vector>
1 change: 1 addition & 0 deletions wallet/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
<string name="notification_inactivity_message">You still have Dash on this device! Please be sure to write down your recovery phrase before you uninstall the Dash Wallet or you will lose your balance of %s.</string>
<string name="notification_inactivity_action_dismiss">Remind me later</string>
<string name="notification_inactivity_action_dismiss_forever">Don\'t remind me</string>
<string name="notification_bluetooth_service_listening">Ready to receive payments via Bluetooth</string>
<string name="appwidget_wallet_balance_title">Dash balance</string>

<!-- generic buttons -->
Expand Down
1 change: 1 addition & 0 deletions wallet/src/de/schildbach/wallet/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public final static class Files {
public static final int NOTIFICATION_ID_INACTIVITY = 2;
public static final int NOTIFICATION_ID_BLOCKCHAIN_SYNC = 3;
public static final int NOTIFICATION_ID_UPGRADE_WALLET = 4;
public static final int NOTIFICATION_ID_BLUETOOTH = 5;

public static String NOTIFICATION_CHANNEL_ID_TRANSACTIONS = "dash.notifications.transactions";
public static String NOTIFICATION_CHANNEL_ID_ONGOING = "dash.notifications.ongoing";
Expand Down
Loading

0 comments on commit 0ba26f2

Please sign in to comment.