mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-13 02:14:27 +01:00
fix: use versionCode
if versionName
is unavailable
This commit is contained in:
parent
f3c9e28a62
commit
6e1b6479b6
1 changed files with 2 additions and 1 deletions
|
@ -249,6 +249,7 @@ class Patcher(private val options: PatcherOptions) {
|
||||||
axmlParser, AndrolibResources().resXmlSerializer
|
axmlParser, AndrolibResources().resXmlSerializer
|
||||||
).decodeManifest(
|
).decodeManifest(
|
||||||
extInputFile.directory.getFileInput("AndroidManifest.xml"),
|
extInputFile.directory.getFileInput("AndroidManifest.xml"),
|
||||||
|
// Older Android versions do not support OutputStream.nullOutputStream()
|
||||||
object : OutputStream() {
|
object : OutputStream() {
|
||||||
override fun write(b: Int) {
|
override fun write(b: Int) {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -261,7 +262,7 @@ class Patcher(private val options: PatcherOptions) {
|
||||||
// read of the resourceTable which is created by reading the manifest file
|
// read of the resourceTable which is created by reading the manifest file
|
||||||
context.packageMetadata.let { metadata ->
|
context.packageMetadata.let { metadata ->
|
||||||
metadata.packageName = resourceTable.currentResPackage.name
|
metadata.packageName = resourceTable.currentResPackage.name
|
||||||
metadata.packageVersion = resourceTable.versionInfo.versionName
|
metadata.packageVersion = resourceTable.versionInfo.versionName ?: resourceTable.versionInfo.versionCode
|
||||||
metadata.metaInfo.versionInfo = resourceTable.versionInfo
|
metadata.metaInfo.versionInfo = resourceTable.versionInfo
|
||||||
metadata.metaInfo.sdkInfo = resourceTable.sdkInfo
|
metadata.metaInfo.sdkInfo = resourceTable.sdkInfo
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue