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: Read and write arbitrary files in APK files #272

Merged
merged 2 commits into from
Feb 13, 2024
Merged

Conversation

oSumAtrIX
Copy link
Member

About

This PR allows reading and writing arbitrary files in an APK file. Additionally, it allows deleting files from APK files. A RawResourcePatch class has been added, which has access to ResourceContext but ReVanced Patcher will not decode APK resources. A regular ResourcePatch can read and write arbitrary files from an APK file unless they are decoded to PatcherConfig.apkFiles. On an attempt to get a file from PatcherConfig.apkFiles if the second parameter is true, it will read and write the raw resource file from the original APK to PatcherConfig.apkFiles if it does not exist. With this commit, many APIs have been deprecated as well, such as DomFileEditor and instead, a Document has been added.

This commit allows reading and writing arbitrary files in an APK file. Additionally it allows deleting files from APK files. A `RawResourcePatch` class has been added which has access to `ResourceContext` but ReVanced Patcher will not decode APK resources. A regular `ResourcePatch` can read and write arbitrary files from an APK file, unless they are decoded to `PatcherConfig.apkFiles`. On attempt to get a file from `PatcherConfig.apkFiles` if the second parameter is true, it will read and write the raw resource file from the original APK to `PatcherConfig.apkFiles` if it does not exist. With this commit, many APIs have been deprecated as well, such as `DomFileEditor` and instead a `Document` has been added.
@oSumAtrIX oSumAtrIX linked an issue Feb 11, 2024 that may be closed by this pull request
gradle.properties Outdated Show resolved Hide resolved
@oSumAtrIX oSumAtrIX merged commit 0b18f22 into dev Feb 13, 2024
2 checks passed
@oSumAtrIX oSumAtrIX deleted the feat/rw-raw branch February 13, 2024 02:39
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.

feat: ApkPatch
2 participants