{"id":21039335,"url":"https://github.com/clsty/uhuruphotos-android-testbuild","last_synced_at":"2026-04-10T05:02:36.463Z","repository":{"id":217313536,"uuid":"743515711","full_name":"clsty/uhuruphotos-android-testbuild","owner":"clsty","description":"Non-official hint and files for building and localization for uhuruphotos-android","archived":false,"fork":false,"pushed_at":"2024-01-15T14:58:35.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T16:42:27.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clsty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-15T12:03:12.000Z","updated_at":"2024-01-15T12:03:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"091f414d-2f31-4ad1-975a-25ed01d33030","html_url":"https://github.com/clsty/uhuruphotos-android-testbuild","commit_stats":null,"previous_names":["clsty/uhuruphotos-android-testbuild"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clsty%2Fuhuruphotos-android-testbuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clsty%2Fuhuruphotos-android-testbuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clsty%2Fuhuruphotos-android-testbuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clsty%2Fuhuruphotos-android-testbuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clsty","download_url":"https://codeload.github.com/clsty/uhuruphotos-android-testbuild/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243482942,"owners_count":20297908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T13:39:03.979Z","updated_at":"2025-12-30T05:48:11.089Z","avatar_url":"https://github.com/clsty.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is uhuruphotos-android?\nYou may see it as a FOSS gallery manager and also a client for [LibrePhotos](https://github.com/LibrePhotos/librephotos).\n\nSee [official repo](https://github.com/savvasdalkitsis/uhuruphotos-android) for details.\n\n# What is this repo for?\nThis is a **non-official** repo, not related with uhuruphotos-android.\n\nAlso note that I **don't** know about android developing (at least for now),\ndon't take my instructions here too seriously (although I'll try to write it better).\n\nI created this repo for notes and backup about building and translation (localization) thingy.\n\nI've also [forked](https://github.com/clsty/uhuruphotos-android) the official repo when I tested building.\nYou may find the result apk file [there](https://github.com/clsty/uhuruphotos-android/releases).\n\n# How to translate\nThe official provides a link to [weblate](https://hosted.weblate.org/engage/uhuruphotos/), where you can contribute translation online.\n\nAlso, the localization file is actually at `foundation/strings/api/src/main/res/values*` inside the git repo.\n\nYou may download those files packed as zip from weblate once you've done translations, or edit the file directly.\n\n## Sync entries\nIdeally, the strings of the original file and the translated file should be automatically synchronized, but in practice, there may be differences.\n\nHere's a stupid way to synchronize them mannually.\n\nFirstly, cp them to a temp dir:\n```bash\ncd foundation/strings/api/src/main/res/values\nt=/tmp/uhurut;mkdir $t\ncp ./strings.xml $t/strings-en.xml\ncp ../values-zh-rCN/strings.xml $t/\ncd $t\n```\nNow if you run `ls`, there should be `strings-en.xml` `strings.xml`.\n\nThen, open them with vim (or neovim) splitted horizontally:\n```bash\nvim -O *.xml\n```\nIn every window (you may use `Ctrl+W` to switch window for normal mode), use the command to sort all lines:\n```vimcommand\n:%sort\n```\nand then:\n```vimcommand\n:%s/\u003cstring name=\"\\([^\"]*\\)\"\u003e[^\u003c]*\u003c\\/string\u003e/\u003cstring name=\"\\1\"\u003e\u003c\\/string\u003e/g\n```\nThis will delete the content between `\u003cstring name=\"NAME\"\u003e` and `\u003c/string\u003e`.\n\nNow, remove every lines (using dd) **except** for `plurals` and `string` ones (examples below):\n```xml\n\u003cplurals name=\"days\"\u003e\n\u003cstring name=\"about\"\u003e\u003c/string\u003e\n```\nThat's done! Now you can tell the differences of the entries easily.\nYou can also save and exit and use `diff *.xml` to show them even more clearly.\n\n\n# How to build\nFor system on the build machine, take Arch Linux as an example.\n\nGet the repo:\n```bash\ngit clone https://github.com/savvasdalkitsis/uhuruphotos-android\n```\n\nInstall dependencies:\n```bash\nsudo pacman -S jdk-openjdk gradle\nyay -S android-sdk{,-build-tools}\n```\nAdd the following to your `.bashrc` or `.zshrc`:\n```bash\nexport ANDROID_HOME=/usr/lib/android-sdk\nexport PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools\n```\n\nThen, check the file `build.gradle` under the git repo.\nSearch for `android` block, for example:\n```gradle\n    android {\n        compileSdk 34\n\n        defaultConfig {\n            minSdk 24\n            targetSdk 34\n        }\n...\n```\nIn this example, we take the `34` here, and therefore we do:\n```bash\nsdkmanager --list|grep 34|grep \"build-tools\\|platforms\"\n```\nExample output:\n```plain\nbuild-tools;34.0.0           | 34.0.0      | Android SDK Build-Tools 34                                          \nbuild-tools;34.0.0-rc1       | 34.0.0 rc1  | Android SDK Build-Tools 34-rc1                                      \nbuild-tools;34.0.0-rc2       | 34.0.0 rc2  | Android SDK Build-Tools 34-rc2                                      \nbuild-tools;34.0.0-rc3       | 34.0.0 rc3  | Android SDK Build-Tools 34-rc3                                      \nplatforms;android-34         | 2           | Android SDK Platform 34                                             \nplatforms;android-34-ext10   | 1           | Android SDK Platform 34-ext10                                       \nplatforms;android-34-ext8    | 1           | Android SDK Platform 34-ext8   \n```\nSo we need to install:\n```bash\nsudo sdkmanager \"build-tools;34.0.0-rc3\" \"platforms;android-34\"\n```\n\nNow, let's build the project (before that you may want to overwrite the localization file as we mentioned above).\n\nChange dir (cd) to the repo before executing the gradle wrapper inside:\n```bash\n./gradlew assembleDebug --stacktrace\n```\nAnd that's done!\nIf it went all right, then you'll find your apk file at `app/build/outputs/apk/debug/app-debug.apk`.\n\nHowever, there could be one or more errors preventing a successful build.\nI just encountered that myself (see [issue](https://github.com/savvasdalkitsis/uhuruphotos-android/issues/515)).\n\nBelow is how you may deal with those errors.\n\n## Refer to GitHub workflow file\nAn error I encountered was:\n```bash\n\u003e Task :app:processDebugGoogleServices FAILED\n\nFAILURE: Build failed with an exception.\n\n* What went wrong:\nExecution failed for task ':app:processDebugGoogleServices'.\n\u003e File google-services.json is missing. The Google Services Plugin cannot function without it.\n```\nAfter I refer to the [workflow file](https://github.com/savvasdalkitsis/uhuruphotos-android/blob/main/.github/workflows/main.yml):\n```yml\n    ...\n    - name: Create local properties\n      run: touch local.properties\n    - name: Copy mock google services\n      run: cp mock-google-services.json app/google-services.json\n    ...\n```\nI ran `cp local.defaults.properties local.properties` and `cp mock-google-services.json app/google-services.json` under the git repo.\nThen the error disapeared.\n\n## Clean\n\u003e NOTE: This appeared to be of no effect, so this operation may be unnecessary.\n\nUse `./gradlew clean` to clean cache.\n\n## Update packages\n\u003e NOTE: This appeared to be of no effect, so this operation may be unnecessary.\n\nI noticed that in [Pull Requests](https://github.com/savvasdalkitsis/uhuruphotos-android/pulls) of the official repo, there're some PRs created by a bot named `renovate`, all of which modifying version info in the file `gradle/libs.versions.toml`.\n\nSo, I mannually applied the commits into that file.\n\nAlso, I searched checked the file `gradle/wrapper/gradle-wrapper.properties` and edit the `gradle-8.4-bin.zip` to `gradle-8.5-bin.zip`。\n\n## Make use of flag `--stacktrace`\nI actually didn't use that flag at first; however, after the flag was applied, the real problem behind finally showed up.\n\n```plain\n...\nCaused by: java.io.FileNotFoundException: /xxx/uhuruphotos-android/feature/feed/domain/implementation/build/intermediates/javac/debug/classes/com/savvasdalkitsis/uhuruphotos/feature/feed/domain/implementation/broadcast/Hilt_CancelFeedDetailsDownloadWorkBroadcastReceiver.class (No such file or directory)\n...\n```\nAnd then, it seemed that `/xxx/uhuruphotos-android/feature/feed/domain/implementation/build/intermediates/javac/debug/` had no `classes` folder under it but a `compileDebugJavaWithJavac` ;\nHowever, the `/xxx/uhuruphotos-android/feature/feed/domain/implementation/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes` exist, and the file\n```plain\n/xxx/uhuruphotos-android/feature/feed/domain/implementation/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/savvasdalkitsis/uhuruphotos/feature/feed/domain/implementation/broadcast/Hilt_CancelFeedDetailsDownloadWorkBroadcastReceiver.class\n```\nalso exist.\n\nApprently, the following command may solve the problem:\n```\ncd /xxx/uhuruphotos-android/feature/feed/domain/implementation/build/intermediates/javac/debug\ncp -r compileDebugJavaWithJavac/classes classes\n```\nAnd that's it! As I built again, it worked!\n\n# Extra notes\nTo setup a LibrePhotos server, if you use docker, it may not create an admin account for you automatically.\nIf this happened, you may do:\n```bash\nc(){docker exec -ti backend python manage.py $@ ; }\nc createsuperuser\n```\nAlso `c --help` to see a list of available commands.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclsty%2Fuhuruphotos-android-testbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclsty%2Fuhuruphotos-android-testbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclsty%2Fuhuruphotos-android-testbuild/lists"}