Skip to content

Commit

Permalink
Merge branch 'master' into mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
dpad85 committed Nov 30, 2023
2 parents 3ef1848 + da40a47 commit 8e5a484
Show file tree
Hide file tree
Showing 74 changed files with 1,894 additions and 521 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# base image to build eclair-core
FROM eclipse-temurin:11.0.20_8-jdk-alpine as ECLAIR_CORE_BUILD
FROM eclipse-temurin:11.0.21_9-jdk-alpine as ECLAIR_CORE_BUILD

# this is necessary to extract the eclair-core version that we need to clone for the build
COPY ./buildSrc/src/main/kotlin/Versions.kt .
Expand Down Expand Up @@ -30,16 +30,16 @@ RUN git clone https://github.com/ACINQ/eclair -b v$(cat eclair-core-version.txt)
RUN cd eclair && mvn install -pl eclair-core -am -Dmaven.test.skip=true

# main build image
FROM ubuntu:22.10
FROM ubuntu:23.10

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
# get latest version number from https://developer.android.com/studio/index.html, bottom section
ENV ANDROID_CMDLINETOOLS_FILE commandlinetools-linux-8092744_latest.zip
ENV ANDROID_CMDLINETOOLS_URL https://dl.google.com/android/repository/${ANDROID_CMDLINETOOLS_FILE}
ENV ANDROID_API_LEVELS android-30
ENV ANDROID_BUILD_TOOLS_VERSION 30.0.2
ENV ANDROID_API_LEVELS android-33
ENV ANDROID_BUILD_TOOLS_VERSION 33.0.2
ENV ANDROID_NDK_VERSION 23.1.7779620
ENV CMAKE_VERSION 3.18.1
ENV ANDROID_HOME /usr/local/android-sdk
Expand All @@ -64,7 +64,7 @@ RUN mkdir /usr/local/android-sdk && \
rm ${ANDROID_CMDLINETOOLS_FILE}

# install sdk packages
RUN echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "cmake;${CMAKE_VERSION}" "ndk;${ANDROID_NDK_VERSION}" "patcher;v4" "platforms;${ANDROID_API_LEVELS}"
RUN echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "cmake;${CMAKE_VERSION}" "ndk;${ANDROID_NDK_VERSION}" "platforms;${ANDROID_API_LEVELS}"

# build tor library
RUN git clone https://github.com/ACINQ/Tor_Onion_Proxy_Library && \
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object Versions {
const val lightningKmp = "1.5.11"
const val secp256k1 = "0.10.1"
const val lightningKmp = "1.5.12"
const val secp256k1 = "0.11.0"
const val torMobile = "0.2.0"

const val kotlin = "1.8.21"
Expand Down Expand Up @@ -37,7 +37,7 @@ object Versions {
}

object AndroidLegacy {
const val eclair = "0.4.22-android-phoenix"
const val eclair = "0.4.23-android-phoenix"

const val safeArgs = "2.4.2"
const val appCompat = "1.3.0"
Expand Down
6 changes: 3 additions & 3 deletions phoenix-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ android {
applicationId = "fr.acinq.phoenix.mainnet"
minSdk = 26
targetSdk = 33
versionCode = 67
versionName = "2.0.12"
versionCode = 68
versionName = gitCommitHash()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations.addAll(listOf("en", "fr", "de", "es", "cs", "pt-rBR"))
resourceConfigurations.addAll(listOf("en", "fr", "de", "es", "b+es+419", "cs", "pt-rBR"))
}

buildTypes {
Expand Down
6 changes: 3 additions & 3 deletions phoenix-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<!-- firebase cloud messaging -->
<service
android:name="fr.acinq.phoenix.android.service.FCMService"
android:name="fr.acinq.phoenix.android.services.FCMService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
Expand All @@ -84,13 +84,13 @@

<!-- node service -->
<service
android:name="fr.acinq.phoenix.android.service.NodeService"
android:name="fr.acinq.phoenix.android.services.NodeService"
android:exported="false"
android:stopWithTask="false" />

<!-- broadcast receivers -->
<receiver
android:name="fr.acinq.phoenix.android.service.BootReceiver"
android:name="fr.acinq.phoenix.android.services.BootReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import fr.acinq.phoenix.android.payments.ScanDataView
import fr.acinq.phoenix.android.payments.details.PaymentDetailsView
import fr.acinq.phoenix.android.payments.history.CsvExportView
import fr.acinq.phoenix.android.payments.history.PaymentsHistoryView
import fr.acinq.phoenix.android.service.NodeServiceState
import fr.acinq.phoenix.android.services.NodeServiceState
import fr.acinq.phoenix.android.settings.*
import fr.acinq.phoenix.android.settings.channels.ChannelDetailsView
import fr.acinq.phoenix.android.settings.channels.ChannelsView
Expand Down Expand Up @@ -201,7 +201,6 @@ fun AppView(
onTorClick = { navController.navigate(Screen.TorConfig) },
onElectrumClick = { navController.navigate(Screen.ElectrumServer) },
onShowSwapInWallet = { navController.navigate(Screen.WalletInfo.SwapInWallet) },
onShowChannels = { navController.navigate(Screen.Channels) },
onShowNotifications = { navController.navigate(Screen.Notifications) }
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory.Companion.APPLICATION_KEY
import androidx.lifecycle.viewmodel.CreationExtras
import fr.acinq.phoenix.android.service.NodeService
import fr.acinq.phoenix.android.service.NodeServiceState
import fr.acinq.phoenix.android.services.NodeService
import fr.acinq.phoenix.android.services.NodeServiceState
import fr.acinq.phoenix.android.utils.datastore.InternalDataRepository
import org.slf4j.LoggerFactory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import androidx.navigation.compose.rememberNavController
import fr.acinq.lightning.io.PhoenixAndroidLegacyInfoEvent
import fr.acinq.lightning.utils.Connection
import fr.acinq.phoenix.PhoenixBusiness
import fr.acinq.phoenix.android.service.NodeService
import fr.acinq.phoenix.android.services.NodeService
import fr.acinq.phoenix.android.utils.LegacyMigrationHelper
import fr.acinq.phoenix.android.utils.PhoenixAndroidTheme
import fr.acinq.phoenix.legacy.utils.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import fr.acinq.bitcoin.TxId
import fr.acinq.phoenix.android.R
import fr.acinq.phoenix.android.business
import fr.acinq.phoenix.android.utils.copyToClipboard
Expand Down Expand Up @@ -147,7 +148,8 @@ fun InlineButton(
backgroundColor = Color.Transparent,
shape = RoundedCornerShape(6.dp),
maxLines = maxLines,
textStyle = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.primary, fontSize = fontSize, textDecoration = TextDecoration.Underline)
textStyle = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.primary, fontSize = fontSize, textDecoration = TextDecoration.Underline),
horizontalArrangement = Arrangement.Start,
)
}

Expand Down Expand Up @@ -397,10 +399,10 @@ fun WebLink(
@Composable
fun TransactionLinkButton(
modifier: Modifier = Modifier,
txId: String,
txId: TxId,
) {
WebLink(
text = txId,
text = txId.toString(),
url = txUrl(txId = txId),
space = 4.dp,
maxLines = 1,
Expand All @@ -412,7 +414,7 @@ fun TransactionLinkButton(
}

@Composable
fun txUrl(txId: String): String {
fun txUrl(txId: TxId): String {
return business.blockchainExplorer.txUrl(txId = txId, website = BlockchainExplorer.Website.MempoolSpace)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,31 @@ package fr.acinq.phoenix.android.components
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -167,42 +182,56 @@ fun RowScope.IconPopup(
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
) {
var showPopup by remember { mutableStateOf(false) }
if (showPopup) {
Popup(
onDismissRequest = { showPopup = false },
offset = IntOffset(x = -200, y = 54)
spaceLeft?.let { Spacer(Modifier.width(it)) }
Box {
BorderButton(
icon = icon,
iconTint = if (showPopup) MaterialTheme.colors.onPrimary else colorAtRest,
backgroundColor = if (showPopup) MaterialTheme.colors.primary else MaterialTheme.colors.surface,
borderColor = if (showPopup) MaterialTheme.colors.primary else colorAtRest,
padding = PaddingValues(iconPadding),
modifier = modifier.size(iconSize),
interactionSource = interactionSource,
onClick = { showPopup = true }
)
if (showPopup) {
PopupDialog(onDismiss = { showPopup = false }, message = popupMessage, button = popupLink?.let { (text, link) ->
{ WebLink(text = text, url = link, fontSize = 14.sp, modifier = Modifier.fillMaxWidth(), padding = PaddingValues(horizontal = 10.dp, vertical = 8.dp)) }
})
}
}
spaceRight?.let { Spacer(Modifier.width(it)) }
}

@Composable
fun PopupDialog(
onDismiss: () -> Unit,
message: String,
button: @Composable (() -> Unit)? = null,
) {
Popup(
alignment = Alignment.TopCenter,
offset = IntOffset(x = 0, y = 58),
onDismissRequest = onDismiss,
) {
Surface(
modifier = Modifier.widthIn(min = 280.dp, max = 280.dp),
shape = RoundedCornerShape(8.dp),
border = BorderStroke(1.dp, MaterialTheme.colors.primary),
elevation = 6.dp,
) {
Surface(
modifier = Modifier
.padding(horizontal = 4.dp)
.widthIn(min = 280.dp, max = 280.dp),
shape = RoundedCornerShape(8.dp),
border = BorderStroke(1.dp, MaterialTheme.colors.primary),
elevation = 6.dp,
) {
Column(modifier = Modifier.padding(10.dp)) {
Text(
text = popupMessage,
style = MaterialTheme.typography.body1.copy(fontSize = 14.sp)
)
popupLink?.let { (text, link) ->
Spacer(modifier = Modifier.height(8.dp))
WebLink(text = text, url = link, fontSize = 14.sp)
}
Column() {
Text(
modifier = Modifier.padding(start = 10.dp, end = 10.dp, top = 8.dp),
text = message,
style = MaterialTheme.typography.body1.copy(fontSize = 14.sp)
)
button?.let {
it()
} ?: run {
Spacer(modifier = Modifier.height(8.dp))
}
}
}
}
spaceLeft?.let { Spacer(Modifier.width(it)) }
BorderButton(
icon = icon,
iconTint = if (showPopup) MaterialTheme.colors.onPrimary else colorAtRest,
backgroundColor = if (showPopup) MaterialTheme.colors.primary else MaterialTheme.colors.surface,
borderColor = if (showPopup) MaterialTheme.colors.primary else colorAtRest,
padding = PaddingValues(iconPadding),
modifier = modifier.size(iconSize),
interactionSource = interactionSource,
onClick = { showPopup = true }
)
spaceRight?.let { Spacer(Modifier.width(it)) }
}
}
Loading

0 comments on commit 8e5a484

Please sign in to comment.