Skip to content

Commit 91bd78e

Browse files
authored
Remove the phoenix-legacy module (#671)
This commits removes the old 1.x Android legacy code, which was using the eclair-core Scala library. This version has been deprecated 18 months ago and all legacy channels have now been closed. This includes code that was added in the modern android app to manage the switch to the legacy app, as well as the migration. Gone as well is the special init TLV sent to the peer to check for legacy channels.
1 parent 2a5e78b commit 91bd78e

File tree

413 files changed

+130
-479096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

413 files changed

+130
-479096
lines changed

.github/workflows/testnet-build.yml

+4-38
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ name: Build
44
on:
55
workflow_dispatch:
66
push:
7-
branches: [ master, test-ci-build, offer ]
7+
branches: [ master, test-ci-build ]
88
paths:
9-
- 'phoenix-legacy/**'
109
- 'phoenix-android/**'
1110
- '.github/workflows/**'
1211

@@ -29,28 +28,8 @@ jobs:
2928
ref: master
3029
path: lightning-kmp
3130

32-
- name: Checkout eclair-core
33-
uses: actions/checkout@v2
34-
with:
35-
repository: ACINQ/eclair
36-
ref: android-phoenix
37-
path: eclair-core
38-
39-
- name: Checkout Tor_Onion_Proxy_Library (Tor for legacy android app)
40-
uses: actions/checkout@v2
41-
with:
42-
repository: ACINQ/Tor_Onion_Proxy_Library
43-
path: tor-lib
44-
4531
# 2 - setup cache/jdk
4632

47-
- name: Cache maven dependencies
48-
uses: actions/cache@v4
49-
with:
50-
path: ~/.m2
51-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
52-
restore-keys: ${{ runner.os }}-m2
53-
5433
- name: Cached Konan
5534
uses: actions/cache@v4
5635
with:
@@ -61,7 +40,7 @@ jobs:
6140
- name: Set up jdk 1.17
6241
uses: actions/setup-java@v1
6342
with:
64-
java-version: 17
43+
java-version: 17
6544

6645
# 3 - build dependencies & app
6746

@@ -70,20 +49,7 @@ jobs:
7049
cd lightning-kmp
7150
./gradlew clean build publishToMavenLocal -x check
7251
73-
- name: Build eclair-core and install to local maven repo
74-
run: |
75-
cd eclair-core
76-
mvn clean install -pl eclair-core -am -Dmaven.test.skip=true
77-
78-
- name: Build Tor_Onion_Proxy_Library and install to local maven repo
79-
run: |
80-
cd tor-lib
81-
./gradlew :universal:build
82-
./gradlew :universal:publishToMavenLocal
83-
./gradlew :android:build
84-
./gradlew :android:publishToMavenLocal
85-
86-
- name: Assemble new android app apk
52+
- name: Assemble the android apk
8753
run: |
8854
cd phoenix
8955
./gradlew clean
@@ -102,7 +68,7 @@ jobs:
10268
run: |
10369
mkdir upload
10470
mv phoenix/phoenix-android/build/outputs/apk/release/phoenix-*.apk upload/phoenix-testnet-latest.apk
105-
/usr/local/lib/android/sdk/build-tools/30.0.3/apksigner sign --ks signingkey --ks-pass pass:$TESTNET_STORE_PASS --ks-key-alias $TESTNET_ALIAS --key-pass pass:$TESTNET_KEY_PASS upload/phoenix-testnet-latest.apk
71+
/usr/local/lib/android/sdk/build-tools/34.0.0/apksigner sign --ks signingkey --ks-pass pass:$TESTNET_STORE_PASS --ks-key-alias $TESTNET_ALIAS --key-pass pass:$TESTNET_KEY_PASS upload/phoenix-testnet-latest.apk
10672
shell: bash
10773
env:
10874
TESTNET_STORE_PASS: ${{secrets.TESTNET_STORE_PASS}}

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ phoenix-android/release/
2323
.externalNativeBuild
2424
sdk-dependencies
2525
apk
26-
phoenix-legacy/release
27-
phoenix-legacy/debug
2826
.cxx
27+
logs/
2928

3029
# LangTool
3130
.langtool/deepl.authtoken

BUILD.md

+16-33
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Building
22

3-
This document explains how to build Phoenix for iOS or for Android. Phoenix is a [Kotlin Multiplatform Mobile](https://kotlinlang.org/docs/mobile/home.html) application. It can run on many different platforms, including mobile devices (iOS and Android).
4-
5-
Note: that the legacy Android app is now a library within a new Android app. To build the old versions of this app, checkout one of the `android-legacy-vXX` tags, and follow the build instructions.
3+
This document explains how to build Phoenix for iOS or for Android.
64

75
## Requirements
86

@@ -12,9 +10,11 @@ You'll need to install the following:
1210

1311
## Build lightning-kmp
1412

15-
Phoenix is an actual lightning node running on your phone. It contains much of the bitcoin/lightning protocol. For that, Phoenix relies on the [lightning-kmp](https://github.com/ACINQ/lightning-kmp) library. Tags of this library are released on public maven repository, but this repository may from time to time use a SNAPSHOT development version.
13+
Phoenix is an actual lightning node running on your phone. It contains much of the bitcoin/lightning protocol, contained in the [lightning-kmp](https://github.com/ACINQ/lightning-kmp) library, also developed by ACINQ.
14+
15+
Tags of the lightning-kmp library are released on public Maven repository, so you'll likely not have to build it yourself.
1616

17-
When that happens, you will have to build this library yourself on your local machine. To do that, follow those [instructions](https://github.com/ACINQ/lightning-kmp/blob/master/BUILD.md).
17+
However, from time to time, Phoenix uses a SNAPSHOT development version of lightning-kmp. When that happens, you will have to build this library yourself on your local machine. To do that, follow [the lightning-kmp build instructions](https://github.com/ACINQ/lightning-kmp/blob/master/BUILD.md).
1818

1919
## Build the application
2020

@@ -25,39 +25,16 @@ git clone git@github.com:ACINQ/phoenix.git
2525
cd phoenix
2626
```
2727

28-
### The `phoenix-legacy` module
29-
30-
This module contains an older version of the Android application. This version is now an AAR, that is a Android library (and not a standalone application). It is embedded within the new `phoenix-android` app and must be built if you want to run the Android application.
31-
32-
Follow [those instructions](https://github.com/ACINQ/phoenix/blob/master/phoenix-legacy/BUILD.md) to build the legacy app.
33-
34-
Note:
35-
- in the future, the legacy app code will be removed and the modern Android app won't have this dependency anymore.
36-
- iOS developers who don't need the Android app and wish to save time can do so by [skipping the Android app altogether](#skipping-the-android-app).
37-
3828
### The `phoenix-shared` module
3929

40-
This module is where [Kotlin Multiplatform Mobile](https://kotlinlang.org/docs/mobile/home.html) is used. The code written in Kotlin is shared between the Android and the iOS application. It contains common logic, such as the database queries, or the MVI controllers. Development on this module should be done with Android Studio.
30+
Like the lightning-kmp library, Phoenix shares some logic between the Android and the iOS application, thanks to [Kotlin Multiplatform](https://www.jetbrains.com/kotlin-multiplatform/). This includes database queries, or the some view controllers, and more (but not the UI!). The `phoenix-shared` module is where this cross-platform code is contained.
4131

42-
You do not need to run a command to build this module. It will be built automatically whether you're building the Android or the iOS app:
43-
44-
- the `phoenix-android` module has a direct gradle dependency to this module, so Android Studio will build it automatically when building the Android app.
45-
46-
- when building the iOS app, XCode will automatically call this command:
47-
48-
```
49-
./gradlew :phoenix-shared:packForXCode -PXCODE_CONFIGURATION=Debug -PXCODE_PLATFORM_NAME=iphoneos -PskipAndroid=true
50-
```
32+
Development on this module should be done with Android Studio.
5133

52-
which will generate the required phoenix-ios-framework used by iOS.
34+
This module will be built automatically when you build the Android or the iOS app:
5335

54-
### Skipping the Android app
55-
56-
If you are only interested in the iOS application, create a `local.properties` file at the root of the project, and add the following line:
57-
58-
```
59-
skip.android=true
60-
```
36+
- on Android, because the `phoenix-android` module has a direct gradle dependency to this module;
37+
- on iOS, because a build phase in iOS is set up to build a `PhoenixShared.framework` whenever needed.
6138

6239
### Building the iOS app
6340

@@ -69,6 +46,12 @@ If the project builds successfully, you can then run it on a device or an emulat
6946

7047
Open the entire phoenix project in Android Studio, then build the `phoenix-android` application.
7148

49+
If you are only interested in building the iOS application, create a `local.properties` file at the root of the project, and add the following line:
50+
51+
```
52+
skip.android=true
53+
```
54+
7255
## Troubleshooting
7356

7457
### Lightning-kmp versions

Dockerfile

+3-46
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,5 @@
1-
# base image to build eclair-core
2-
FROM eclipse-temurin:17.0.10_7-jdk-alpine as ECLAIR_CORE_BUILD
3-
4-
# this is necessary to extract the eclair-core version that we need to clone for the build
5-
COPY ./buildSrc/src/main/kotlin/Versions.kt .
6-
RUN cat Versions.kt | grep "const val eclair =" | cut -d '"' -f 2 > eclair-core-version.txt
7-
8-
ARG MAVEN_VERSION=3.9.9
9-
ARG USER_HOME_DIR="/root"
10-
ARG SHA=a555254d6b53d267965a3404ecb14e53c3827c09c3b94b5678835887ab404556bfaf78dcfe03ba76fa2508649dca8531c74bca4d5846513522404d48e8c4ac8b
11-
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
12-
13-
RUN apk add --no-cache curl tar bash git
14-
15-
# setup maven
16-
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
17-
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
18-
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
19-
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
20-
&& rm -f /tmp/apache-maven.tar.gz \
21-
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
22-
23-
ENV MAVEN_HOME /usr/share/maven
24-
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
25-
26-
# clone eclair at the specified branch
27-
RUN git clone https://github.com/ACINQ/eclair -b v$(cat eclair-core-version.txt)
28-
29-
# build eclair-core
30-
RUN cd eclair && mvn install -pl eclair-core -am -Dmaven.test.skip=true
31-
321
# main build image
33-
FROM ubuntu:23.10
2+
FROM ubuntu:24.04
343

354
ENV LC_ALL en_US.UTF-8
365
ENV LANG en_US.UTF-8
@@ -40,8 +9,6 @@ ENV ANDROID_CMDLINETOOLS_FILE commandlinetools-linux-8092744_latest.zip
409
ENV ANDROID_CMDLINETOOLS_URL https://dl.google.com/android/repository/${ANDROID_CMDLINETOOLS_FILE}
4110
ENV ANDROID_API_LEVELS android-33
4211
ENV ANDROID_BUILD_TOOLS_VERSION 33.0.2
43-
ENV ANDROID_NDK_VERSION 23.1.7779620
44-
ENV CMAKE_VERSION 3.18.1
4512
ENV ANDROID_HOME /usr/local/android-sdk
4613
ENV PATH ${PATH}:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
4714
ENV JAVA_OPTS "-Dprofile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8"
@@ -64,21 +31,11 @@ RUN mkdir /usr/local/android-sdk && \
6431
rm ${ANDROID_CMDLINETOOLS_FILE}
6532

6633
# install sdk packages
67-
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}"
68-
69-
# build tor library
70-
RUN git clone https://github.com/ACINQ/Tor_Onion_Proxy_Library && \
71-
cd Tor_Onion_Proxy_Library && \
72-
./gradlew :universal:build && \
73-
./gradlew :universal:publishToMavenLocal && \
74-
./gradlew :android:build && \
75-
./gradlew :android:publishToMavenLocal
34+
RUN echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platforms;${ANDROID_API_LEVELS}"
7635

77-
# copy eclair-core dependency
78-
COPY --from=ECLAIR_CORE_BUILD /root/.m2/repository/fr/acinq/eclair /root/.m2/repository/fr/acinq/eclair
7936
# copy phoenix project over to docker image
8037
COPY . /home/ubuntu/phoenix
81-
# make sure we don't read properties the host environment
38+
# make sure we don't read properties from the host environment
8239
RUN rm -f /home/ubuntu/phoenix/local.properties
8340
# make sure we use unix EOL files
8441
RUN find /home/ubuntu/phoenix -type f -print0 | xargs -0 dos2unix --

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
2-
[![Testnet Build](https://github.com/ACINQ/phoenix/workflows/TESTNET%20Build/badge.svg)](https://github.com/ACINQ/phoenix/actions?query=workflow%3A%22TESTNET+Build%22)
2+
[![Testnet Build](https://github.com/ACINQ/phoenix/actions/workflows/testnet-build.yml/badge.svg)](https://github.com/ACINQ/phoenix/actions?query=testnet-build)
33
[![Download Testnet APK](https://img.shields.io/badge/Download-Testnet%20APK-green?style=flat&logo=android&logoColor=white)](https://acinq.co/pub/phoenix/phoenix-testnet-latest.apk)
44

55
![Phoenix Logo](.readme/phoenix_text.png)
@@ -32,9 +32,6 @@ Phoenix is separated in 3 modules:
3232

3333
Instructions to build the iOS and the Android apps are provided [here](https://github.com/ACINQ/phoenix/blob/master/BUILD.md).
3434

35-
Deprecated module:
36-
- `phoenix-legacy`: contains the old, legacy Android application (version 1.x), using [eclair-core](https://github.com/ACINQ/eclair) for Lightning, which has been replaced by `phoenix-android`. However, this legacy app is still embedded in the new production application for migration purposes so the code remains. It will be removed eventually.
37-
3835
## Contribute
3936

4037
We use GitHub for bug tracking. Search [the existing issues](https://github.com/ACINQ/phoenix/issues) for your bug and create a new one if needed.

build.gradle.kts

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ buildscript {
1010
classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}")
1111
classpath("app.cash.sqldelight:gradle-plugin:${Versions.sqlDelight}")
1212

13-
if (System.getProperty("includeAndroid")?.toBoolean() == true) {
14-
// Plugins for the legacy android app
15-
// Argument classes generation plugin for the androidx navigation component
16-
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${Versions.AndroidLegacy.safeArgs}")
17-
}
1813
// Firebase cloud messaging plugin
1914
classpath("com.google.gms:google-services:${Versions.fcmPlugin}")
2015
}
@@ -30,5 +25,5 @@ allprojects {
3025
}
3126

3227
val clean by tasks.creating(Delete::class) {
33-
delete(rootProject.buildDir)
28+
delete(rootProject.layout.buildDirectory)
3429
}

buildSrc/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
repositories {
2-
jcenter()
2+
mavenCentral()
33
}
44
plugins {
55
`kotlin-dsl`

buildSrc/src/main/kotlin/Versions.kt

+3-16
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ object Versions {
1616
object Android {
1717
const val coreKtx = "1.9.0"
1818
const val lifecycle = "2.6.0"
19-
const val prefs = "1.2.0"
2019
const val datastore = "1.0.0"
2120
const val compose = "1.6.8"
2221
const val composeCompiler = "1.5.8"
@@ -29,24 +28,12 @@ object Versions {
2928
const val fcm = "24.0.0"
3029
const val logback = "2.0.0"
3130

32-
const val testRunner = "1.3.0"
33-
const val espresso = "3.3.0"
34-
}
35-
36-
object AndroidLegacy {
37-
const val eclair = "0.4.25-android-phoenix"
38-
39-
const val safeArgs = "2.6.0"
40-
const val appCompat = "1.3.0"
4131
const val material = "1.7.0"
4232
const val navigation = "2.4.2"
4333
const val constraint = "2.0.4"
44-
const val lifecycleExtensions = "2.2.0"
45-
const val lifecycle = "2.7.0"
4634
const val work = "2.8.1"
47-
const val viewpager = "1.0.0"
48-
const val eventbus = "3.1.1"
49-
const val torWrapper = "0.0.6"
50-
const val torCtl = "0.4"
35+
36+
const val testRunner = "1.3.0"
37+
const val espresso = "3.3.0"
5138
}
5239
}

phoenix-android/build.gradle.kts

+1-8
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ android {
7575
composeOptions {
7676
kotlinCompilerExtensionVersion = Versions.Android.composeCompiler
7777
}
78-
79-
packagingOptions {
80-
resources.merges.add("reference.conf")
81-
}
8278
}
8379

8480
kotlin {
@@ -91,7 +87,6 @@ kotlin {
9187

9288
dependencies {
9389
implementation(project(":phoenix-shared"))
94-
api(project(":phoenix-legacy"))
9590

9691
implementation("com.google.android.material:material:1.7.0")
9792

@@ -105,7 +100,7 @@ dependencies {
105100
// -- AndroidX: biometric
106101
implementation("androidx.biometric:biometric:${Versions.Android.biometrics}")
107102
// -- AndroidX: work manager
108-
implementation("androidx.work:work-runtime-ktx:${Versions.AndroidLegacy.work}")
103+
implementation("androidx.work:work-runtime-ktx:${Versions.Android.work}")
109104

110105

111106
// -- jetpack compose
@@ -139,8 +134,6 @@ dependencies {
139134
implementation("com.google.firebase:firebase-messaging:${Versions.Android.fcm}")
140135
implementation("com.google.android.gms:play-services-base:18.5.0")
141136

142-
implementation("com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava")
143-
144137
testImplementation("junit:junit:${Versions.junit}")
145138
testImplementation("app.cash.sqldelight:sqlite-driver:${Versions.sqlDelight}")
146139
androidTestImplementation("androidx.test.ext:junit:1.1.4")

phoenix-android/src/main/AndroidManifest.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5+
<uses-feature
6+
android:name="android.hardware.camera"
7+
android:required="false" />
8+
59
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
610
<uses-permission android:name="android.permission.INTERNET" />
711
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
@@ -21,7 +25,7 @@
2125
android:supportsRtl="true"
2226
android:hardwareAccelerated="true"
2327
android:extractNativeLibs="true"
24-
android:theme="@style/default_theme"
28+
android:theme="@style/Theme.PhoenixAndroid"
2529
android:localeConfig="@xml/locales_config">
2630

2731
<!-- Set custom default icon for notifications -->

0 commit comments

Comments
 (0)