1
mirror of https://github.com/revanced/revanced-patcher synced 2025-09-06 16:38:50 +02:00

Compare commits

...

9 Commits

Author SHA1 Message Date
semantic-release-bot
817b8db019 chore(release): 2.5.2 [skip ci]
## [2.5.2](https://github.com/revanced/revanced-patcher/compare/v2.5.1...v2.5.2) (2022-07-24)
2022-07-24 16:30:57 +00:00
Sculas
a321b8971b build: update Apktool to 2.7.0 2022-07-24 18:29:25 +02:00
semantic-release-bot
783b2de9db chore(release): 2.5.1 [skip ci]
## [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](77604d4078))
2022-07-17 23:30:04 +00:00
oSumAtrIX
77604d4078 fix: close stream when closing DomFileEditor 2022-07-18 01:28:16 +02:00
oSumAtrIX
21b5404180 docs: change size of headings [skip ci] 2022-07-12 01:12:45 +02:00
semantic-release-bot
9ac6d5c7da chore(release): 2.5.0 [skip ci]
# [2.5.0](https://github.com/revanced/revanced-patcher/compare/v2.4.0...v2.5.0) (2022-07-11)

### Bug Fixes

* missing additional items [skip ci] ([0ebab8b](0ebab8bf59))

### Features

* feature request issue template ([1b39278](1b39278b24))
* issue templates [skip ci] ([112bc99](112bc998f4))
2022-07-11 18:21:14 +00:00
oSumAtrIX
1b39278b24 feat: feature request issue template 2022-07-11 20:19:53 +02:00
oSumAtrIX
0ebab8bf59 fix: missing additional items [skip ci] 2022-07-10 00:34:55 +02:00
oSumAtrIX
112bc998f4 feat: issue templates [skip ci] 2022-07-10 00:32:05 +02:00
6 changed files with 84 additions and 7 deletions

24
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a bug report on the patcher. Do not submit suggestions for patches here.
title: 'problem: some problem'
labels: bug
assignees: oSumAtrIX, Sculas
---
## 🐞 Issue
<!-- Describe your issue in detail here -->
## ⚙ Reproduce
<!-- Include your environment and steps to reproduce the issue as detailed as possible -->
## 🛠 Solution
<!-- If applicable, add a possible solution -->
## ⚠ Additional context
<!-- Add any other context about the problem here -->

View File

@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest a change for the patcher. Do not submit suggestions for patches here.
title: 'feat: some feature'
labels: feature-request
assignees: ''
---
## 🐞 Issue
<!-- Explain here, what the current problem is and why it leads you to request a feature change -->
## ❗ Solution
<!-- Explain how your current issue can be solved -->
## ❓ Motivation
<!-- Explain why your feature should be considered -->
## ⚠ Additional context
<!-- Add any other context or screenshots about the feature request here -->

View File

@@ -1,3 +1,25 @@
## [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)
### Bug Fixes
* missing additional items [skip ci] ([0ebab8b](https://github.com/revanced/revanced-patcher/commit/0ebab8bf598d993df6e340651205cba48f1ef725))
### Features
* feature request issue template ([1b39278](https://github.com/revanced/revanced-patcher/commit/1b39278b24ba2f964d93bd8ad2e28472ee036d90))
* issue templates [skip ci] ([112bc99](https://github.com/revanced/revanced-patcher/commit/112bc998f4761a647cb9eab7454e35264fa96fd9))
# [2.4.0](https://github.com/revanced/revanced-patcher/compare/v2.3.1...v2.4.0) (2022-07-09)

View File

@@ -24,7 +24,7 @@ dependencies {
implementation("xpp3:xpp3:1.1.4c")
implementation("org.smali:smali:2.5.2")
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"))
}

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.4.0
version = 2.5.2

View File

@@ -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
// 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
constructor(file: File) : this(file.inputStream(), lazy { file.outputStream() })
val file: Document =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream).also(Document::normalize)
override fun close() {
val result = StreamResult(outputStream.value)
TransformerFactory.newInstance().newTransformer().transform(DOMSource(file), result)
override fun close() =
TransformerFactory.newInstance().newTransformer().transform(DOMSource(file), StreamResult(outputStream.value))
inputStream.close()
outputStream.value.close()
}
}