mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +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
|
||||
).decodeManifest(
|
||||
extInputFile.directory.getFileInput("AndroidManifest.xml"),
|
||||
// Older Android versions do not support OutputStream.nullOutputStream()
|
||||
object : OutputStream() {
|
||||
override fun write(b: Int) {
|
||||
// do nothing
|
||||
|
@ -261,7 +262,7 @@ class Patcher(private val options: PatcherOptions) {
|
|||
// read of the resourceTable which is created by reading the manifest file
|
||||
context.packageMetadata.let { metadata ->
|
||||
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.sdkInfo = resourceTable.sdkInfo
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue