AlienKevin / wordshk_app

An open Cantonese dictionary for iOS and Android built with Flutter
https://words.hk/
MIT License
35 stars 6 forks source link

F-Droid #2

Closed linsui closed 2 years ago

linsui commented 2 years ago

Could I package this app for F-Droid? There is an open RFP: https://gitlab.com/fdroid/rfp/-/issues/2166

AlienKevin commented 2 years ago

I'd be more than happy to see this app on F-Droid! I made a new release v2.1.1 just now that contains the Android app bundle and apk files. On the RFP issue page, I saw a Fastlane error. Currently, I'm only using Fastlane for deploying beta iOS versions. I tried a few times to automate screenshot taking using Fastlane but all of the attempts failed. I also can't find a reliable and up-to-date tool to take screenshot with Flutter. So, I manually took the screenshots for iOS and Android. I can send the screenshots if F-Droid needs them.

linsui commented 2 years ago

The faslane is not a big problem. I'll file a PR to add fastlane metadata. F-Droid only uses fastlane structure for app descriptions. The screenshots is not required but if you can add them to the fastlane structure it would be great.

The flutter_rust_bridge is a difficult part. When I packaged rustdesk the flutter_rust_bridge has some problems. Hopefully these problems are solved in new versions.

The mlkit is not FOSS so google_mlkit_digital_ink_recognition needs to be removed for F-Droid version. I thought I need to remove DigitalInkView from F-Droid build. Do you have any suggestions?

linsui commented 2 years ago

I saw yout issue in flutter_rust_bridge. Should I still use cargo-ndk 2.6.0 and ndk r22b? It seems cargo ndk has fixed the problem with ndk r23.

linsui commented 2 years ago

My MR: https://gitlab.com/fdroid/fdroiddata/-/merge_requests/11567/diffs

linsui commented 2 years ago

Looks like the way I patched out the mlkit has some problem.

linsui commented 2 years ago

About the fastlane and screenshots, see https://gitlab.com/-/snippets/1895688.

AlienKevin commented 2 years ago

I saw yout issue in flutter_rust_bridge. Should I still use cargo-ndk 2.6.0 and ndk r22b? It seems cargo ndk has fixed the problem with ndk r23.

There are two options:

  1. Use cargo-ndk 2.7.0 and latest ndk version with this workaround. (this is how I build rust for Android locally)
  2. Use the latest cargo-ndk 2.11.0 and latest ndk version without any workaround (I haven't tested this approach yet but I think cargo-ndk has a script that generates the same workaround documented above)

If you choose option 2, please let me know if it works or not. Since I already configured my system with a manual workaround, I don't want to rerun cargo-ndk's script to generate potentially duplicated symlinks.

AlienKevin commented 2 years ago

Looks like the way I patched out the mlkit has some problem.

I think the patch is a good start though there are still a few things that needs to be removed. I created an fdroid branch with the DigitalInkView completely removed with I think the minial code changes. You might be able to reference the git diff for your patch.

AlienKevin commented 2 years ago

About the fastlane and screenshots, see https://gitlab.com/-/snippets/1895688.

I will add the fastlane metadata today with the screenshots. I can at you in this issue once I'm done.

AlienKevin commented 2 years ago

I have added the fastlane metadata and screenshots. Here's the link to the latest commit on main: https://github.com/AlienKevin/wordshk_app/commit/affd2e383f34ec60a7d5a41e9c860bf0d3666934

linsui commented 2 years ago

If you choose option 2, please let me know if it works or not. Since I already configured my system with a manual workaround, I don't want to rerun cargo-ndk's script to generate potentially duplicated symlinks.

I'll have a try.

You might be able to reference the git diff for your patch.

I can add another sed to do that. Or you can maintain a flavor or patch, or seperated tag for F-Droid, etc. Which methed do you prefer?

I have added the fastlane metadata and screenshots. Here's the link to the latest commit on main: https://github.com/AlienKevin/wordshk_app/commit/affd2e383f34ec60a7d5a41e9c860bf0d3666934

The fastlane directory must be in the root path so that fdroidserver can find it. You can add a symlink or move it a level up.

linsui commented 2 years ago

cargo ndk 2.11.0 works well with ndk r25. Is the network permission needed? The apk has a problem. I can only play the audio once. Then I can't play any audio.

AlienKevin commented 2 years ago

I can add another sed to do that. Or you can maintain a flavor or patch, or seperated tag for F-Droid, etc. Which methed do you prefer?

Seds seem to be a little fragile in general. I can maintain a separate branch for F-Droid, though it might not be updated as often as main.

The fastlane directory must be in the root path so that fdroidserver can find it. You can add a symlink or move it a level up.

I will create a symlink in the fdroid branch

The apk has a problem. I can only play the audio once. Then I can't play any audio.

I can't reproduce this issue on a real device running Android 10. Which device and version of Android are you testing on?

linsui commented 2 years ago

Then please add a special tag for F-Droid version, e.g. v2.1.1-fdroid so that F-Droid can pick it. Thanks!

I tested it onineageOS 18.1 Android 11 on Xiaomi Mi 6.

AlienKevin commented 2 years ago

I tested it onineageOS 18.1 Android 11 on Xiaomi Mi 6.

Did you click on the pronunciation button after the header word of an entry, or the button after a sentence? By default on Android, the header words are pronounced using syllable recordings while the sentences are pronounced by system TTS. So the problem can lie in either of the two components. Did you observe the issue in button 1, 2, or both? (See screenshot below).

pronunciation buttons
AlienKevin commented 2 years ago

Then please add a special tag for F-Droid version, e.g. v2.1.1-fdroid so that F-Droid can pick it. Thanks!

I tagged the latest commit on the f-droid branch with v2.1.1-fdroid. I add a symlink to the fastlane folder at the root in it.

linsui commented 2 years ago

The problem only happens when I tap the button after the sentences. I don't have tts on my system. I guess that's the reason.

linsui commented 2 years ago

Since you add a branch for F-Droid, could you please also add the lib/smtp_credentials.dart file? Thanks!

AlienKevin commented 2 years ago

The problem only happens when I tap the button after the sentences. I don't have tts on my system. I guess that's the reason.

That's a good issue to raise though. I'll look into detecting TTS support in flutter and fallback more gracefully.

AlienKevin commented 2 years ago

Since you add a branch for F-Droid, could you please also add the lib/smtp_credentials.dart file? Thanks!

I added a blank smtp_credentials.dart to the fdroid branch.

Thanks for taking the time to guide me through the process of packaging this app for F-Droid! Feel free to file new issues if any problems appear later on. I'm excited to see words.hk become available as an open source Cantonese dictionary on F-Droid.

linsui commented 2 years ago

Thanks for you help!

Is the network permission needed? When I test the apk it didn't connect to Internet.

AlienKevin commented 2 years ago

The network permission is needed for editing an entry on the words.hk website. There's a small edit icon on the top right of each entry. You can click on it to edit it on the website.

linsui commented 2 years ago

When I edit the entry, the webpage is opened in the browser. There is no connection from the app. Even if I disable the network for the app it can still open the page.

AlienKevin commented 2 years ago

You are right. The internet permission seems to be only needed by Flutter during debugging. I've removed the internet permissions from AndroidManifest in the fdroid branch.

linsui commented 2 years ago

Will you fix the audio problem before it's published on F-Droid? Or I should merge the MR first and you'll fix it in future versions?

AlienKevin commented 2 years ago

I can fix the issue along with a few others in a future release.

linsui commented 2 years ago

Should I wait for that? Or you'd like me to publish it sooner?

AlienKevin commented 2 years ago

You can go ahead and publish it. I'm a bit busy lately so I might fix it later.

linsui commented 2 years ago

The app will be available in F-Droid in 2 or 3 day. Thanks!

linsui commented 6 months ago

@AlienKevin Hi, a new version is released but I'm not sure which version of the tools I should use to build it. Is there any changes on the build steps? Which version of flutter, rust and cargo-ndk should I use?

linsui commented 6 months ago

And the fastlane symlink is removed. Could you please add it back? Thanks!

AlienKevin commented 5 months ago

@linsui Hi, the new build pipeline for the Rust backend has been significantly simplified. I updated the README to add a Set up section. You can basically run setup.sh to install the Rust backend.

As for fastlane, I used to upload App Store screenshots using it but I found that the script no longer works and the tool itself is very unreliable. So currently I just manually upload the screenshots to the app stores. I can upload the screenshots into a folder on GitHub for F-droid but for now I'm not going back to fastlane.

linsui commented 5 months ago

F-Droid doesn't use the fastlane tools. F-Droid fetches metadata from fastlane structure. So you only need to link https://github.com/AlienKevin/wordshk_app/tree/main/android/fastlane to root path as before.

linsui commented 5 months ago

Hi, the new build pipeline for the Rust backend has been significantly simplified.

Ah, so cargo ndk is not needed and flutter_rust_bridge_codegen is used instead?

linsui commented 5 months ago

When I run pub get the lock file are updated. Any idea?

AlienKevin commented 5 months ago

F-Droid doesn't use the fastlane tools. F-Droid fetches metadata from fastlane structure. So you only need to link https://github.com/AlienKevin/wordshk_app/tree/main/android/fastlane to root path as before.

I see. I can add that back in.

AlienKevin commented 5 months ago

When I run pub get the lock file are updated. Any idea?

I think that's fine because pub get will use the latest compatible version and will update the lock file if a package has a newer version.

AlienKevin commented 5 months ago

Ah, so cargo ndk is not needed and flutter_rust_bridge_codegen is used instead?

Yes, flutter_rust_bridge_codegen now manages all required dependencies for the native platforms.

proletarius101 commented 5 months ago

I think that's fine because pub get will use the latest compatible version and will update the lock file if a package has a newer version.

Although not required, it's preferred to have it locked for better reproducibility. In addition, pub updating the lock file implicitly indicates a conflict within the lock file.

linsui commented 4 months ago

Could you please update the fdroid branch? And we need a stub lib/sentry_dsn.dart or removing sentry completely.

proletarius101 commented 4 months ago

Relevant build log: https://gitlab.com/fdroid/fdroiddata/-/jobs/6751930046#L1748

proletarius101 commented 4 months ago

@AlienKevin lib/sentry_dsn.dart doesn't need to be a stub (sentry is OSS and thus allowed). The thing is that it's required by the code but it's not uploaded

proletarius101 commented 4 months ago

Thanks, @AlienKevin. With your latest changes, the F-droid version builds (with a small patch). The only thing left is a new tag.

AlienKevin commented 4 months ago

@proletarius101 Thanks for testing. I just updated the fastlane descriptions, screenshots, and changelogs as well and tagged the latest commit as v3.2.3. Let me know if there's anything else I need to do.

linsui commented 4 months ago

We still need those changes which were in the fdroid branch: removing digital_ink_view and linking the fastlane to the root of the repo.

proletarius101 commented 4 months ago

@linsui It's under android/fastlane. Do we support custom fastlane paths yet?

linsui commented 4 months ago

No, it's not supported yet.

AlienKevin commented 4 months ago

@proletarius101 Hi, is there anything else I can do to help with F-droid deployment?

linsui commented 4 months ago

@AlienKevin We still need fastlane. It was linked to the root of the repo in fdroid branch. Can we do that on master directly?

AlienKevin commented 4 months ago

@linsui Will it help if I put the fastlane folder directly at the root in master?