BLW not FTBFS anymore, Retest BLW in fdroidbuildserver with same environment for RB check WIP
The current BLW review ended with error of:
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
And then supplied link to stackoverflow answer that contain the solution (use ln command for the mips64el-linux-android directory, which I used in below Containerfile)
f-droid version 0.4.6: https://f-droid.org/repo/com.lightning.walletapp_155.apk git checkout 0.4.6
for google-play:
git clone https://github.com/btcontract/lnwallet.git
cd lnwallet
git checkout 0.4.7
Beware the 0.4.7 tag is incorrect (little older, missing 1 code changes), latest currently commit 5d78e9d338076849e47365d7e4bb9e09b21139c8 is for 0.4.7 version (both release on github & google-play)
The reason a specific ndk version is used instead of ndk-bundle is to overcome the issue:
NDK is missing a “platforms” directory
Soultion from: https://stackoverflow.com/questions/46741528/ndk-is-missing-a-platforms-directory-while-trying-to-build#65646489
Add file Containerfile
with content:
FROM debian:stretch-slim
RUN set -ex; \
mkdir -p /usr/share/man/man1/; \
apt-get update; \
apt-get install --yes --no-install-recommends openjdk-8-jdk wget unzip; \
wget https://services.gradle.org/distributions/gradle-3.5.1-bin.zip; \
unzip gradle-3.5.1-bin.zip; \
apt-get remove --purge --yes wget unzip; \
rm -rf gradle-3.5.1-bin.zip /var/lib/apt/lists/*; \
useradd -ms /bin/bash appuser;
USER appuser
COPY --chown=appuser:root . /app/blw
ENV ANDROID_SDK_ROOT="/app/sdk" \
ANDROID_HOME="/app/sdk"
RUN set -ex; \
# Create required license accept file
ANDROID_SDK_LICENSES="${ANDROID_SDK_ROOT}/licenses"; \
mkdir -p "${ANDROID_SDK_LICENSES}"; \
printf "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "${ANDROID_SDK_LICENSES}/android-sdk-license";
WORKDIR /app/blw/
Then Build & Run the container:
podman build --rm -t blw_build_apk_main .
podman run --rm --name blw_built_apk -ti blw_build_apk_main
Then run inside the container the commands (first one will fail, it's ok)
/gradle-3.5.1/bin/gradle assembleRelease
/app/sdk/tools/bin/sdkmanager --install "ndk;21.1.6352462"
ln -s /app/sdk/ndk/21.1.6352462/toolchains/aarch64-linux-android-4.9 /app/sdk/ndk/21.1.6352462/toolchains/mips64el-linux-android
ANDROID_NDK_HOME=/app/sdk/ndk/21.1.6352462/ /gradle-3.5.1/bin/gradle assembleRelease
from other tab run while the above container running, after file is copied, run exit
.
podman cp blw_built_apk:/app/blw/app/build/outputs/apk/app-release-unsigned.apk ~/blw-apk-rebuild.apk
Also did the above with the changes:
-
debian:stretch-slim
toubuntu:rolling
-
3.5.1
to3.4
Diff between the versions contains many changes that looks like caused by using different compiler versions (debug symbols, ordering of ifs/code, etc..).
Examples (from JADX decompile diff):
+ /* JADX INFO: Multiple debug info for r4v2 java.util.Iterator<java.lang.Throwable>: [D('i$' java.util.Iterator), D('i$' int)] */
- /* JADX INFO: Multiple debug info for r4v2 java.util.Iterator<java.lang.Throwable>: [D('i$' int), D('i$' java.util.Iterator)] */
+ /* access modifiers changed from: package-private */
+ public class LegacyGoldfinger implements Goldfinger {
- class LegacyGoldfinger implements Goldfinger {
ordering of if-else in file: com/lightning/walletapp/ln/NormalChannel$anonfun
doProcess$9.java
Still didn't figure out what the component that cause the changes, is it java or gradle version difference? something else? will look later at f-droid builder to try to figure this out, still all the changes are minor and the same code is used, so it's kinda reproducible, will still look at how to exactly reproduce the app...