app: support download image and patch#9382
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for downloading and patching images directly from URLs to Magisk, expanding installation options beyond local files. It also includes a complete rewrite of the payload processing logic using Java Channel APIs and protobuf support.
Key changes:
- New download functionality with URL-based image patching
- Complete rewrite of payload processing using protobuf
- Added Java Channel-based data source implementation for efficient file/network operations
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
app/gradle/libs.versions.toml |
Added protobuf and XZ compression dependencies |
app/core/src/main/res/values/strings.xml |
Added UI strings for download functionality |
app/core/src/main/proto/update_metadata.proto |
Added protobuf definitions for OTA payload parsing |
app/core/src/main/java/com/topjohnwu/magisk/core/utils/DataSourceChannel.java |
New efficient data source abstraction for files and HTTP |
app/core/src/main/java/com/topjohnwu/magisk/core/tasks/Payload.kt |
New payload processing implementation using protobuf |
app/core/src/main/java/com/topjohnwu/magisk/core/tasks/ExtractImage.kt |
New image extraction logic for factory images and OTA packages |
app/core/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt |
Updated installer with download support and simplified processing |
app/apk/src/main/java/com/topjohnwu/magisk/dialog/DownloadDialog.kt |
New dialog for URL input validation |
| UI layouts | Updated to support download option and fix console display issues |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
app/core/src/main/java/com/topjohnwu/magisk/core/utils/DataSourceChannel.java
Show resolved
Hide resolved
app/core/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt
Outdated
Show resolved
Hide resolved
app/core/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt
Outdated
Show resolved
Hide resolved
| callback(it) | ||
| } ?: run { | ||
| doNotDismiss = true | ||
| editText.error = context.getString(R.string.download_dialog_title) |
There was a problem hiding this comment.
Using the dialog title string as an error message is confusing and unhelpful. The error should use a descriptive message like 'Invalid URL format' or create a dedicated error string resource.
| editText.error = context.getString(R.string.download_dialog_title) | |
| editText.error = context.getString(R.string.download_dialog_invalid_url) |
app/core/src/main/java/com/topjohnwu/magisk/core/tasks/ExtractImage.kt
Outdated
Show resolved
Hide resolved
|
@vvb2060 can you take a look at the build error? |
|
blocked by google/protobuf-gradle-plugin#797 |
|
If you want to merge immediately, there are two options:
|
|
@vvb2060 let's switch over to use com.squareup.wire |
No description provided.