DioxusLabs/dioxus

How to update Android res and .kt files without Dioxus-cli replacing them

Opened this issue · 4 comments

How can i change the default res images, the android manifest and change the package name?

replacinge the res folder in android/app/app/res seems to not work as it gets reset everytime the dioxus cli is run

At least for res i noticed that if i run dx serve --platform android and then replace the res icons, press "r" to refresh i manage to force the icons into the app without dioxus cli replacing them, but i have not had the same luck with android manifest / trying to change the package name

okay by using the strategy of running it first and then pressing "r" i also managed to update the package name by replacing the MainActivity.kt and the bulid.gradle.kts

so now the only remainnig question is how do i run dx build or dx serve without it always replacing my custom kt files and res icons

in flutter usually we have an android folder that we can customize however we want, i suppose something like this would a useful feature in the future, but for now i would be happy with any simple hack that i can use

for reference here is what i'm doing now,

  1. running dx serve --platform android --release
  2. running my custom script to replace rs and .kt files

https://raw.githubusercontent.com/waozixyz/myquest/refs/heads/master/update_android_resources.sh

  1. pressing 'r'

  2. extracting the apk that is generated on the phone

very hacky, and i would need to customize it further to then sign the apk