Skip to content

Commit

Permalink
Merge pull request #1304 from dashpay/merge-dashpay-into-dash-wallet
Browse files Browse the repository at this point in the history
Merge Dash Wallet into DashPay 

* disable DashPay features for prod and testnet
  • Loading branch information
HashEngineering authored Sep 9, 2024
2 parents 71d1092 + 394bae3 commit a47cc17
Show file tree
Hide file tree
Showing 86 changed files with 941 additions and 3,032 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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class OrbitView @JvmOverloads constructor(
view.y = centerY + sin(angle.toFloat() * Math.PI.toFloat() / 180f) * r
}

override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)

color?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class PlanetView @JvmOverloads constructor(
}
}

override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)

planetDrawable?.setBounds(0, 0, measuredWidth, measuredHeight)
Expand Down
10 changes: 5 additions & 5 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 @@ -91,8 +91,8 @@ dependencies {
implementation "com.google.zxing:core:$zxingVersion"

// Maps & Location
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.android.gms:play-services-maps:18.0.0'
implementation 'com.google.android.gms:play-services-location:21.3.0'
implementation 'com.google.android.gms:play-services-maps:18.2.0'
implementation 'com.google.maps.android:maps-ktx:3.2.0'
implementation 'com.google.maps.android:android-maps-utils:2.2.6'

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ constructor(private val context: Context, private val client: FusedLocationProvi
override fun onLocationResult(locationResult: LocationResult) {
super.onLocationResult(locationResult)
val location = locationResult.lastLocation
val newLocation = Pair(location.latitude, location.longitude)
val newLocation = Pair(location!!.latitude, location.longitude)
val distance =
distanceBetween(
previousLocation.first,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ class ExploreDatabaseTest {
}
}

@Test
@Test @Ignore // sometimes this fails due to missing empty_explore.db error
fun emptyPreloadedDb_throwDoesNotUpdateLocalTimestamp() = runTest {
val dbBuilder =
Room.databaseBuilder(appContext, ExploreDatabase::class.java, "explore.db").allowMainThreadQueries()

val resource = javaClass.classLoader?.getResource("empty_explore.db")
val updateFile = File(resource?.file ?: throw Resources.NotFoundException("explore.db not found"))
val updateFile = File(resource?.file ?: throw Resources.NotFoundException("empty_explore.db not found"))

var database: ExploreDatabase? = null

Expand All @@ -98,7 +98,7 @@ class ExploreDatabaseTest {
}
}

@Test
@Test @Ignore // sometimes this fails due to missing explore.db error
fun badPreloadedDb_throwsAndDoesNotUpdateLocalTimestamp() = runTest {
val dbBuilder =
Room.databaseBuilder(appContext, ExploreDatabase::class.java, "explore.db").allowMainThreadQueries()
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
15 changes: 11 additions & 4 deletions wallet/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<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 -->
Expand All @@ -23,6 +25,7 @@
<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 @@ -107,6 +110,7 @@
android:label="@string/app_name_short"
android:screenOrientation="portrait"
android:theme="@style/LockScreenActivity.Child.Theme"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize" />

<activity-alias
Expand Down Expand Up @@ -408,10 +412,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 All @@ -430,7 +436,8 @@
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name="de.schildbach.wallet.ui.dashpay.CreateIdentityService"
android:exported="false" />
android:exported="false"
android:foregroundServiceType="dataSync"/>

<service
android:name="de.schildbach.wallet.ui.notifications.PushMessagingService"
Expand Down
10 changes: 10 additions & 0 deletions wallet/CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Dash Wallet
v10.2.0
* Support Core 21
* Fix syncing stuck at 30% or 31% bug

v10.1.1
* Attempt to fix stuck at Syncing 30 or 31%
* Support devices without a camera flash
* Warn user of stale (old) exchange rates
* Add Jetpack Compose component

v10.1.0
* Add ZenLedger support
* Coinbase: upgrade payment methods to v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ open class DatabaseMigrationTest {

private val migrations = arrayOf(
AppDatabaseMigrations.migration11To12,
AppDatabaseMigrations.migration12To17,
AppDatabaseMigrations.migration17To18,
AppDatabaseMigrations.migration18To19
AppDatabaseMigrations.migration12To13
)

@Rule
Expand Down Expand Up @@ -91,7 +89,7 @@ open class DatabaseMigrationTest {
InstrumentationRegistry.getInstrumentation().targetContext,
AppDatabase::class.java, TEST_DB_NAME
).addMigrations(*migrations)
.fallbackToDestructiveMigrationFrom(1,2, 3, 4, 5,6, 7,8 ,9, 10)
.fallbackToDestructiveMigrationFrom(1, 2, 3, 4, 5, 6, 7, 8 , 9, 10)
.build()

// Check that data is valid
Expand Down
Loading

0 comments on commit a47cc17

Please sign in to comment.