Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload the Android App to a F-Droid repository #1261

Open
KoalaSat opened this issue May 1, 2024 · 43 comments
Open

Upload the Android App to a F-Droid repository #1261

KoalaSat opened this issue May 1, 2024 · 43 comments
Labels
Android enhancement 🆙 New feature or request

Comments

@KoalaSat
Copy link
Member

KoalaSat commented May 1, 2024

Is your feature request related to a problem? Please describe.
Users now have to access directly to the github page to be up to date with the Android app or using tools like obtanium. Would be great to have it available on a major F-Droid repository

@KoalaSat
Copy link
Member Author

KoalaSat commented May 1, 2024

Hello @IzzySoft I was thinking on you while I was creating this issue, can we apply to have Robosats available in your repo? 😃 I'll take care of adding all the necessary configurations to the Android App, which I assume will be the same as we did for Nostros. Thanks in advance!

@Reckless-Satoshi Reckless-Satoshi added Android enhancement 🆙 New feature or request labels May 5, 2024
@IzzySoft
Copy link

I could include one of the per-ABI builds (arm64 probably). Scan results look good except for one thing that will at least need clarification:

Dangerous flags:
----------------
* usesCleartextTraffic

@KoalaSat
Copy link
Member Author

I could include one of the per-ABI builds (arm64 probably). Scan results look good except for one thing that will at least need clarification:

Dangerous flags:
----------------
* usesCleartextTraffic

Probably introduced by the Tor engine library, the app only works over the Tor network.

@IzzySoft
Copy link

So it connects via a local (on-device) Tor proxy, with "cleartext" traffic just on-device?

@KoalaSat
Copy link
Member Author

KoalaSat commented May 11, 2024

So it connects via a local (on-device) Tor proxy, with "cleartext" traffic just on-device?

The proxy is loaded in-app with this library https://github.com/05nelsonm/kmp-tor/ and 100% of the traffic pass through it because everything is a .onion call

@IzzySoft
Copy link

OK, that makes it easy:

usesCleartextTraffic: used only on-device to communicate with the integrated Tor proxy

Guess you've nailed that even to localhost via network security policy? If not, you might want to do that (sorry, cannot help you with setting that up as that's beyond my knowledge).

That said: There's no APK at the latest release. Do you want me to pick up pre-releases then, or shall I wait for the next release having an APK?

@KoalaSat
Copy link
Member Author

@IzzySoft I'll take a look and do some test thanks!

We are planning to create the release this weekend, also we have a PR with the fastlane metadata, we'll ping you once we are ready 😁

Thank you again!

@KoalaSat
Copy link
Member Author

Fastlane files ready for review #1270

@IzzySoft
Copy link

Reviewed 😃 Just the full_description.txt needs a little formatting updates, as indicated.

@KoalaSat
Copy link
Member Author

@IzzySoft
Copy link

Preparing the listing here then 😃 Just one question left: Can the network service used be self-hosted? Is the server component FOSS? We might need the NonFreeNet or TetheredNet anti-feature here.

@IzzySoft
Copy link

PS: If you plan to get your app listed at F-Droid.org, the fastlane directory will need to go to the top level (root) of the repo. No issue for IzzyOnDroid where any custom location can be configured.

@KoalaSat
Copy link
Member Author

KoalaSat commented May 13, 2024

PS: If you plan to get your app listed at F-Droid.org, the fastlane directory will need to go to the top level (root) of the

Okay @IzzySoft thanks for the hint we'll move it right now! 🚀

@IzzySoft
Copy link

Please let me know when done, as I then need to update your app's config here as well 😉 And do not forget to answer the other questions please (server part):

Can the network service used be self-hosted? Is the server component FOSS? We might need the NonFreeNet or TetheredNet anti-feature here.

I know there are instructions for self-hosting – what is not clear is if one can choose that self-hosted server in the app itself. If not, it's TetheredNet. If the server part were not FOSS, it would be NonFreeNet.

Currently, your listing would look like this when "going live" around 6 pm UTC:

image

(just the TetheredNet description was updated to "Server URL is currently hardcoded")

@KoalaSat
Copy link
Member Author

Can the network service used be self-hosted?

Not from the android app, all frontend clients are hardcoded to use very specific URL and there is no way for an end user to change it. The self-hosted options are meant to always refer to the web client, not the backend.

Is the server component FOSS?

Asking @Reckless-Satoshi to confirm, but I would say yes! You can find the list of main services for backend here https://github.com/RoboSats/robosats/blob/main/docker-compose.yml

@IzzySoft
Copy link

Thanks, then I got that correct with TetheredNet – and all is ready for the go-live later today. After checking, you are welcome to pick a badge to link there e.g. from your Readme (check the details; guess you might want one of the shields to accompany those already present there; shields are available in the detailed instructions here; you might wish to increase the cacheSeconds to something like 3600 or higher as updates won't happen more often than once a day, so 1h caching should be fine).

@KoalaSat
Copy link
Member Author

thank you so much for the support!! I'll ping you once we move fastlane to the root 😃

@Reckless-Satoshi
Copy link
Collaborator

Can the network service used be self-hosted? Is the server component FOSS? We might need the NonFreeNet or TetheredNet anti-feature here.

Yes. RoboSats has 2 components, the client (for example the Android app is a full client) and the coordinator (we could say this is "the server"). There is many clients and many coordinators. The coordinators are, of course, fully FOSS (this monorepo contains the coordinator codebase as well).

Anyone can run a coordinator, the only current limitation is that coordinators are whitelisted and hardcoded into the client (new coordinators must open an Issue and a PR in this repo for inclusion in the client).

In the near future, it would be trivial to add a feature for users to add new coordinators to their client through a form: although that might likely put users at risk...

@IzzySoft
Copy link

Thanks for clarification, @Reckless-Satoshi – that matches my guesses. Then we go with TetheredNet as configured for now. Once it's possible to configure the server URL in the app you'll simply let me know, and that anti-feature can be dropped again. Should such a feature not come we simply keep TetheredNet: it's rather a transparency hint than a "black mark". I can update its description if you suggest a different phrasing of course; I just wanted to keep it simple and easy to understand, even for beginners. Hope this is fine with you.

@KoalaSat
Copy link
Member Author

KoalaSat commented May 13, 2024

@IzzySoft fastlane has been moved to root

@IzzySoft
Copy link

Eek, and forgive the blind me: fastlane/metadata/android/<locale> is where F-Droid.org would expect it 🙈 See the freshly updated IzzyOnDroid Fastlane Documentation for details…

@KoalaSat
Copy link
Member Author

KoalaSat commented May 13, 2024

Eek, and forgive the blind me: fastlane/metadata/android/<locale> is where F-Droid.org would expect it 🙈 See the freshly updated IzzyOnDroid Fastlane Documentation for details…

Oops! Okay then I'll change it, is it required also for Izzydroid? Should we do it asap?

@IzzySoft
Copy link

is it required also for Izzydroid?

Nope, not at all (see the link in my previous comment: at IzzyOnDroid, any entry-point works as it's configured for each app explicitly. I've already adjusted it to the current location. It will just be needed if you decide for a listing at F-Droid.org.

And if you wonder, here are some details on that "entry-point":

  • fastlane/: all the fastlane stuff goes here. Including the fastlane binaries, should you want to use them.
  • fastlane/metadata/: here go the metadata. But there might be different platforms requiring different metadata, think e.g. of screenshots, so:
  • fastlane/metadata/android / fastlane/metadata/ios/: the metadata for the specific platforms.

That's the "official" locations by Fastlane. F-Droid.org and IzzyOnDroid have some freedom of interpretation, so F-Droid.org e.g. also accepts /metadata/<locale> and IzzyOnDroid quite any place with the locales as next directory level.

TL;DR: Nothing urgent. Just let me know if and when you change it, and ideally before you make another release after having changed it (so the updater finds it).

@KoalaSat
Copy link
Member Author

Great explanation! 👏👏

@KoalaSat
Copy link
Member Author

Hey @IzzySoft we just included a new feature on the latest pre-release where user can manually add external coordinators, guessing if with that we can earn to get that anti-feature out 😄 #1297

@IzzySoft
Copy link

Not before there's a new release including that 🤣 But yes. Please give me another ping then.

@KoalaSat
Copy link
Member Author

KoalaSat commented Jul 7, 2024

Not before there's a new release including that 🤣 But yes. Please give me another ping then.

We are good to go 🚀 https://github.com/RoboSats/robosats/releases/tag/v0.6.3-alpha

@IzzySoft
Copy link

IzzySoft commented Jul 8, 2024

Heh – the IoD updater pulled that already in yesterday, so it's even live already 🥳

@KoalaSat
Copy link
Member Author

KoalaSat commented Jul 8, 2024

Thank you @IzzySoft !!! closing this issue 😃

@KoalaSat KoalaSat closed this as completed Jul 8, 2024
@KoalaSat
Copy link
Member Author

@IzzySoft I see the anti-feature is still appearing, any insight? Thanks!

@IzzySoft
Copy link

Oops – missed that "coordinator" = "server", and thus no longer tethered. Too many issues to follow in too many projects 🙈 I just removed it, should be gone with the next sync around 6 pm UTC. Apologies for the delay!

@KoalaSat
Copy link
Member Author

haha thank you for checking and for your work!!

@licaon-kter
Copy link

@KoalaSat got a recipe ready for F-Droid

  - versionName: 0.7.1-alpha
    versionCode: 5
    commit: c11c264654195c0d4b72eac5cf2ef1a133d3b6d3
    subdir: mobile/android
    sudo:
      - sysctl fs.inotify.max_user_watches=524288 || true
      - echo "deb https://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list
      - apt-get update
      - apt-get install -y -t bullseye openjdk-11-jdk-headless
      - update-java-alternatives --set java-1.11.0-openjdk-amd64
      - apt-get install -y npm build-essential
    gradle:
      - yes
    output: app/build/outputs/apk/release/app-universal-release-unsigned.apk
    srclibs:
      - robo-identities@c95a9f563bf50377f82665661152ee42097e773c
      - rustup@1.27.1
    rm:
      - desktopApp
      - docker
    prebuild:
      - cd ../..
      - npm install --build-from-source
      - cd frontend
      - npm install --build-from-source
      - npm run build
      - cd ../mobile
      - npm install --build-from-source
      - cp -r patch_modules/* node_modules/
      - sdkmanager "build-tools;30.0.3" "platforms;android-33"
      - $$rustup$$/rustup-init.sh -y --default-toolchain 1.82.0 --target aarch64-linux-android
        armv7-linux-androideabi x86_64-linux-android
      - source $HOME/.cargo/env
    scanignore:
      - mobile/android/build.gradle
      - mobile/node_modules/jsc-android
      - mobile/node_modules/react-native/build.gradle.kts
      - mobile/node_modules/@react-native-community/netinfo/android/build.gradle
      - mobile/node_modules/react-native-encrypted-storage/android/build.gradle
      - mobile/node_modules/react-native-webview/android/build.gradle
      - mobile/patch_modules/react-native-encrypted-storage/android/build.gradle
    scandelete:
      - frontend/node_modules
      - mobile/android/app/src/main/jniLibs
      - mobile/node_modules
    build:
      - export ANDROID_NDK_ROOT=$$NDK$$
      - source $HOME/.cargo/env
      - cargo install cargo-ndk
      - pushd ../../frontend
      - npm run build
      - popd
      - pushd $$robo-identities$$
      - cd robonames
      - cargo ndk -t armeabi-v7a -t arm64-v8a -t x86_64 -o ./target build --release
      - cd ../robohash
      - cargo ndk -t armeabi-v7a -t arm64-v8a -t x86_64 -o ./target build --release
      - popd
      - mv $$robo-identities$$/target/armv7-linux-androideabi/release/librobo*.so
        app/src/main/jniLibs/armeabi-v7a/
      - mv $$robo-identities$$/target/x86_64-linux-android/release/librobo*.so app/src/main/jniLibs/x86_64/
      - mv $$robo-identities$$/target/aarch64-linux-android/release/librobo*.so app/src/main/jniLibs/arm64-v8a/
    ndk: 25.1.8937393

some questions:

  • does it look ok to you in general?
  • do I need to run npm install in all those folders?
  • which commit did you build robo-identities from? maybe there's a chance for reproducibility
  • you have a libs/x86 folder but you don't build robo-identities for it? won't that crash on x86 devices?

@KoalaSat
Copy link
Member Author

KoalaSat commented Nov 4, 2024

Ey @licaon-kter this is awesome thank you!

  • The workflow looks great!
  • Only for /frontend and /mobile
  • This is the code https://github.com/RoboSats/robo-identities, in local it just works with docker compose up, so everything you need to launch it should be on the docker-compose.yml
  • I can´t remember if we ever test it out 🤔 but what do you meant we don't build robo-identities for it?

@KoalaSat KoalaSat reopened this Nov 4, 2024
@licaon-kter
Copy link

This is the code https://github.com/RoboSats/robo-identities, in local it just works with docker compose up, so everything you need to launch it should be on the docker-compose.yml

we use our clean Debian VM, so no Docker, but we can mirror your Docker commands, the only thing that we'd like to match is exact commit the libs were build from: https://github.com/RoboSats/robo-identities/commits/main/ like see srclibs section, I used latest RoboSats/robo-identities@c95a9f5 but the .so differences are massive 😞

rust built libs can be made reproducible, afaik, so this might be possible, here's the full difflog:
robo5_final2.log.7z.zip

I can´t remember if we ever test it out 🤔 but what do you meant we don't build robo-identities for it?

open the APK, look in libs/x86 folder, see no librobo*.so files and see no rust tooling, nor build command for x86: RoboSats/robo-identities@c95a9f5#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3R18 just x86_64

(yes, Android x86 is rather rare these days but you added the rest of the libs so...)

@KoalaSat
Copy link
Member Author

KoalaSat commented Nov 5, 2024

I'm pretty sure this was the commit, before x86: RoboSats/robo-identities@424a297

We can even update those files on Robosats with the output of the last commit to keep everything consistent

@licaon-kter
Copy link

I'm pretty sure this was the commit, before x86: RoboSats/robo-identities@424a297

that commit does not build x86_64 but your APK has libs/x86_64/librobo*.so from "somewhere" ?

We can even update those files on Robosats with the output of the last commit to keep everything consistent

you mean for the next beta release?

@KoalaSat
Copy link
Member Author

KoalaSat commented Nov 5, 2024

Yes, we are planning to release another version soon, I can just rebuild those libs with the latest commits and take a look to that x86

@licaon-kter
Copy link

@KoalaSat ping when ready to test

@KoalaSat
Copy link
Member Author

KoalaSat commented Nov 5, 2024

#1600

@licaon-kter
Copy link

licaon-kter commented Nov 26, 2024

For a final checkup, final-ish recipe, this is repro 🎉 fyi:

Binaries: https://github.com/RoboSats/robosats/releases/download/v%v/robosats-v0.7.3.alpha-universal.apk

Builds:
  - versionName: 0.7.3-alpha
    versionCode: 7
    commit: a600e70be019bdaade8594dbe9b4638b8a977959
    subdir: mobile/android
    sudo:
      - chown -R vagrant /root
      - sysctl fs.inotify.max_user_watches=524288 || true
      - echo "deb https://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list
      - apt-get update
      - apt-get install -y -t bullseye openjdk-11-jdk-headless
      - update-java-alternatives --set java-1.11.0-openjdk-amd64
      - apt-get install -y build-essential npm
    gradle:
      - yes
    output: app/build/outputs/apk/release/app-universal-release-unsigned.apk
    srclibs:
      - robo-identities@c95a9f563bf50377f82665661152ee42097e773c
      - rustup@1.27.1
    rm:
      - desktopApp
      - docker
    prebuild:
      - export ndkversion=$(grep ndkVersion build.gradle | head -n1 | cut -d "\"" -f2)
      - '[[ $ndkversion ]] || exit 1'
      - sdkmanager "ndk;$ndkversion"
      - cd ../../frontend
      - npm install --build-from-source
      - cd ../mobile
      - npm install --build-from-source
      - cp -r patch_modules/* node_modules/
      - export CARGO_HOME=/root/.cargo
      - $$rustup$$/rustup-init.sh -y --default-toolchain nightly-2024-07-08 --target
        aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
    scanignore:
      - mobile/android/build.gradle
      - mobile/node_modules/jsc-android
      - mobile/node_modules/react-native/build.gradle.kts
      - mobile/node_modules/@react-native-community/netinfo/android/build.gradle
      - mobile/node_modules/react-native-encrypted-storage/android/build.gradle
      - mobile/node_modules/react-native-webview/android/build.gradle
      - mobile/patch_modules/react-native-encrypted-storage/android/build.gradle
    scandelete:
      - frontend/node_modules
      - mobile/android/app/src/main/jniLibs
      - mobile/node_modules
    build:
      - export ndkversion=$(grep ndkVersion build.gradle | head -n1 | cut -d "\"" -f2)
      - export ANDROID_NDK_ROOT=/opt/android-sdk/ndk/$ndkversion
      - export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT
      - pushd ../../frontend
      - npm run build
      - popd
      - export CARGO_HOME=/root/.cargo
      - source $CARGO_HOME/env
      - cargo install cargo-ndk
      - mv $$robo-identities$$/* /root/
      - pushd /root/robonames
      - cargo ndk -t armeabi-v7a -t arm64-v8a -t x86_64 -o ./target build --release
      - cd ../robohash
      - cargo ndk -t armeabi-v7a -t arm64-v8a -t x86_64 -o ./target build --release
      - popd
      - mv /root/target/armv7-linux-androideabi/release/librobo*.so app/src/main/jniLibs/armeabi-v7a/
      - mv /root/target/x86_64-linux-android/release/librobo*.so app/src/main/jniLibs/x86_64/
      - mv /root/target/aarch64-linux-android/release/librobo*.so app/src/main/jniLibs/arm64-v8a/

AllowedAPKSigningKeys: 21a2cef69f8a304945d1d57ab16747971c08d288c13e0756f0f65d6e70c9c924

from top to bottom some issues:

  • Binaries is templated from versionCode, versionName, or a combo of these, your APK name in 0.7.3 is neither, but Izzy already picked this version up so you can't change the name, maybe for the next release?
  • robo-identities commit used, can this be written somewhere in THIS repo?
  • rust-default toolchain version, same as above

@KoalaSat
Copy link
Member Author

KoalaSat commented Dec 3, 2024

Binaries is templated from versionCode, versionName, or a combo of these, your APK name in 0.7.3 is neither, but Izzy already picked this version up so you can't change the name, maybe for the next release?

Alright, let's remember this @Reckless-Satoshi

robo-identities commit used, can this be written somewhere in THIS repo?
rust-default toolchain version, same as above

What do you think about including the commit hash as part of the file name?

@licaon-kter
Copy link

licaon-kter commented Dec 3, 2024

we need to be able to grep the commit hash from the source code tree of that release, not sure which file you have in mind

eg. when looking at https://github.com/RoboSats/robosats/tree/v0.7.3-alpha the hash would be there somewhere in a file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android enhancement 🆙 New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants