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

feat(android): Support ZIP format #385

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

samuel-rl
Copy link
Contributor

@samuel-rl samuel-rl commented Oct 7, 2024

Use the files and logic from the original repo examples

fix #384


Self Review:

  • Appropriate test coverage
  • Relevant Documentation updated

Smoke Tests:

  • Example app launches on Android
  • Update with .zip file work on the Example app with Android devices

@samuel-rl
Copy link
Contributor Author

Rewrote commit name in favour of conventional commits

@samuel-rl samuel-rl changed the title Add possibility to use zip files on Android feat(android): Support ZIP format Oct 7, 2024
Copy link
Contributor

@ball-hayden ball-hayden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

A couple of thoughts on this one to resolve, please.

@ball-hayden ball-hayden self-assigned this Oct 7, 2024
@ball-hayden
Copy link
Contributor

ball-hayden commented Oct 8, 2024

See what you think to that @samuel-rl.

I have given it a quick poke, but would you mind also confirming that this works with both a binary and a ZIP format update file?

@samuel-rl
Copy link
Contributor Author

@ball-hayden Got a "wrong magic number" error since your last commit 🤔

It seems to work on the previous one because I can have the CONFIRM state after a start update...

BTW, it looks like the onUploadProgressChanged function is never called, so the progress is not up to date

@samuel-rl
Copy link
Contributor Author

@ball-hayden It works well by using

val fileExtension = MimeTypeMap.getFileExtensionFromUrl(updateBundleUri.toString())
val mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension)

to get the type of file. it return:

  • application/octet-stream for .bin files
  • application/zip for .zip files

The only missing thing is the onUploadProgressChanged function, which is never triggered but may not be linked to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to upgrade with a .zip file on Android device
2 participants