mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-22 10:43:57 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
817b8db019 | ||
|
|
a321b8971b | ||
|
|
783b2de9db | ||
|
|
77604d4078 | ||
|
|
21b5404180 |
8
.github/ISSUE_TEMPLATE/bug-report.md
vendored
8
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -7,18 +7,18 @@ assignees: oSumAtrIX, Sculas
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# 🐞 Issue
|
## 🐞 Issue
|
||||||
|
|
||||||
<!-- Describe your issue in detail here -->
|
<!-- Describe your issue in detail here -->
|
||||||
|
|
||||||
# ⚙ Reproduce
|
## ⚙ Reproduce
|
||||||
|
|
||||||
<!-- Include your environment and steps to reproduce the issue as detailed as possible -->
|
<!-- Include your environment and steps to reproduce the issue as detailed as possible -->
|
||||||
|
|
||||||
# 🛠 Solution
|
## 🛠 Solution
|
||||||
|
|
||||||
<!-- If applicable, add a possible solution -->
|
<!-- If applicable, add a possible solution -->
|
||||||
|
|
||||||
# ⚠ Additional context
|
## ⚠ Additional context
|
||||||
|
|
||||||
<!-- Add any other context about the problem here -->
|
<!-- Add any other context about the problem here -->
|
||||||
|
|||||||
11
.github/ISSUE_TEMPLATE/feature_request.md
vendored
11
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -3,21 +3,22 @@ name: Feature request
|
|||||||
about: Suggest a change for the patcher. Do not submit suggestions for patches here.
|
about: Suggest a change for the patcher. Do not submit suggestions for patches here.
|
||||||
title: 'feat: some feature'
|
title: 'feat: some feature'
|
||||||
labels: feature-request
|
labels: feature-request
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# 🐞 Issue
|
## 🐞 Issue
|
||||||
|
|
||||||
<!-- Explain here, what the current problem is and why it lead you to request a feature change -->
|
<!-- Explain here, what the current problem is and why it leads you to request a feature change -->
|
||||||
|
|
||||||
# ❗ Solution
|
## ❗ Solution
|
||||||
|
|
||||||
<!-- Explain how your current issue can be solved -->
|
<!-- Explain how your current issue can be solved -->
|
||||||
|
|
||||||
# ❓ Motivation
|
## ❓ Motivation
|
||||||
|
|
||||||
<!-- Explain why your feature should be considered -->
|
<!-- Explain why your feature should be considered -->
|
||||||
|
|
||||||
# ⚠ Additional context
|
## ⚠ Additional context
|
||||||
|
|
||||||
<!-- Add any other context or screenshots about the feature request here -->
|
<!-- Add any other context or screenshots about the feature request here -->
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
## [2.5.2](https://github.com/revanced/revanced-patcher/compare/v2.5.1...v2.5.2) (2022-07-24)
|
||||||
|
|
||||||
|
## [2.5.1](https://github.com/revanced/revanced-patcher/compare/v2.5.0...v2.5.1) (2022-07-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* close stream when closing `DomFileEditor` ([77604d4](https://github.com/revanced/revanced-patcher/commit/77604d40785847b775155c0e75b663a3c7336aa3))
|
||||||
|
|
||||||
# [2.5.0](https://github.com/revanced/revanced-patcher/compare/v2.4.0...v2.5.0) (2022-07-11)
|
# [2.5.0](https://github.com/revanced/revanced-patcher/compare/v2.4.0...v2.5.0) (2022-07-11)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ dependencies {
|
|||||||
implementation("xpp3:xpp3:1.1.4c")
|
implementation("xpp3:xpp3:1.1.4c")
|
||||||
implementation("org.smali:smali:2.5.2")
|
implementation("org.smali:smali:2.5.2")
|
||||||
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
implementation("org.apktool:apktool-lib:2.6.9-SNAPSHOT")
|
implementation("org.apktool:apktool-lib:2.7.0-SNAPSHOT")
|
||||||
|
|
||||||
testImplementation(kotlin("test"))
|
testImplementation(kotlin("test"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.5.0
|
version = 2.5.2
|
||||||
|
|||||||
@@ -26,17 +26,24 @@ class ResourceData(private val resourceCacheDirectory: File) : Data, Iterable<Fi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DomFileEditor internal constructor(inputStream: InputStream, private val outputStream: Lazy<OutputStream>) : Closeable {
|
class DomFileEditor internal constructor(
|
||||||
|
private val inputStream: InputStream,
|
||||||
|
private val outputStream: Lazy<OutputStream>,
|
||||||
|
) : Closeable {
|
||||||
|
val file: Document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream)
|
||||||
|
.also(Document::normalize)
|
||||||
|
|
||||||
// lazily open an output stream
|
// lazily open an output stream
|
||||||
// this is required because when constructing a DomFileEditor the output stream is created along with the input stream, which is not allowed
|
// this is required because when constructing a DomFileEditor the output stream is created along with the input stream, which is not allowed
|
||||||
// the workaround is to lazily create the output stream. This way it would be used after the input stream is closed, which happens in the constructor
|
// the workaround is to lazily create the output stream. This way it would be used after the input stream is closed, which happens in the constructor
|
||||||
constructor(file: File) : this(file.inputStream(), lazy { file.outputStream() })
|
constructor(file: File) : this(file.inputStream(), lazy { file.outputStream() })
|
||||||
|
|
||||||
val file: Document =
|
override fun close() {
|
||||||
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream).also(Document::normalize)
|
val result = StreamResult(outputStream.value)
|
||||||
|
TransformerFactory.newInstance().newTransformer().transform(DOMSource(file), result)
|
||||||
|
|
||||||
override fun close() =
|
inputStream.close()
|
||||||
TransformerFactory.newInstance().newTransformer().transform(DOMSource(file), StreamResult(outputStream.value))
|
outputStream.value.close()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user