mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 09:08:04 +01:00
fix: using old instance of Androlib
when saving
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
0873703056
commit
5630e49663
1 changed files with 7 additions and 4 deletions
|
@ -45,17 +45,18 @@ class Patcher(
|
||||||
private val patcherData: PatcherData
|
private val patcherData: PatcherData
|
||||||
private val opcodes: Opcodes
|
private val opcodes: Opcodes
|
||||||
private var signaturesResolved = false
|
private var signaturesResolved = false
|
||||||
private val androlib = Androlib()
|
|
||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val extFileInput = ExtFile(inputFile)
|
val extFileInput = ExtFile(inputFile)
|
||||||
val resourceTable = androlib.getResTable(extFileInput, true)
|
|
||||||
val outDir = File(resourceCacheDirectory)
|
val outDir = File(resourceCacheDirectory)
|
||||||
|
|
||||||
if (outDir.exists()) outDir.deleteRecursively()
|
if (outDir.exists()) outDir.deleteRecursively()
|
||||||
outDir.mkdir()
|
outDir.mkdir()
|
||||||
|
|
||||||
|
val androlib = Androlib()
|
||||||
|
|
||||||
|
val resourceTable = androlib.getResTable(extFileInput, true)
|
||||||
// 1. decode resources to cache directory
|
// 1. decode resources to cache directory
|
||||||
androlib.decodeManifestWithResources(extFileInput, outDir, resourceTable)
|
androlib.decodeManifestWithResources(extFileInput, outDir, resourceTable)
|
||||||
androlib.decodeResourcesFull(extFileInput, outDir, resourceTable)
|
androlib.decodeResourcesFull(extFileInput, outDir, resourceTable)
|
||||||
|
@ -64,7 +65,7 @@ class Patcher(
|
||||||
usesFramework = UsesFramework()
|
usesFramework = UsesFramework()
|
||||||
usesFramework.ids = resourceTable.listFramePackages().map { it.id }.sorted()
|
usesFramework.ids = resourceTable.listFramePackages().map { it.id }.sorted()
|
||||||
|
|
||||||
// 3. read package info
|
// 2. read package info
|
||||||
packageName = resourceTable.packageOriginal
|
packageName = resourceTable.packageOriginal
|
||||||
packageVersion = resourceTable.versionInfo.versionName
|
packageVersion = resourceTable.versionInfo.versionName
|
||||||
|
|
||||||
|
@ -124,7 +125,9 @@ class Patcher(
|
||||||
// build modified resources
|
// build modified resources
|
||||||
if (patchResources) {
|
if (patchResources) {
|
||||||
val extDir = ExtFile(resourceCacheDirectory)
|
val extDir = ExtFile(resourceCacheDirectory)
|
||||||
androlib.buildResources(extDir, usesFramework)
|
|
||||||
|
// TODO: figure out why a new instance of Androlib is necessary here
|
||||||
|
Androlib().buildResources(extDir, usesFramework)
|
||||||
}
|
}
|
||||||
|
|
||||||
// write dex modified files
|
// write dex modified files
|
||||||
|
|
Loading…
Reference in a new issue