mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-01 13:44:25 +02:00
refactor: simplify code by removing the with
block
This commit is contained in:
parent
2dcbd8d079
commit
afcba5c212
@ -33,6 +33,7 @@ import org.jf.dexlib2.iface.ClassDef
|
||||
import org.jf.dexlib2.iface.DexFile
|
||||
import org.jf.dexlib2.writer.io.MemoryDataStore
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
val NAMER = BasicDexFileNamer()
|
||||
|
||||
@ -162,7 +163,11 @@ class Patcher(
|
||||
|
||||
ResXmlPatcher.fixingPublicAttrsInProviderAttributes(manifestFile)
|
||||
|
||||
with(cacheDirectory.resolve("aapt_temp_file")) {
|
||||
val aaptFile = cacheDirectory.resolve("aapt_temp_file")
|
||||
|
||||
// delete if it exists
|
||||
Files.deleteIfExists(aaptFile.toPath())
|
||||
|
||||
val resDirectory = cacheDirectory.resolve("res")
|
||||
val includedFiles = metaInfo.usesFramework.ids.map { id ->
|
||||
androlibResources.getFrameworkApk(
|
||||
@ -172,13 +177,13 @@ class Patcher(
|
||||
}.toTypedArray()
|
||||
|
||||
androlibResources.aaptPackage(
|
||||
this, manifestFile, resDirectory, null,
|
||||
aaptFile, manifestFile, resDirectory, null,
|
||||
null, includedFiles
|
||||
)
|
||||
|
||||
// write packaged resources to cache directory
|
||||
ExtFile(this).directory.copyToDir(cacheDirectory.resolve("build/"))
|
||||
}
|
||||
ExtFile(aaptFile).directory.copyToDir(cacheDirectory.resolve("build/"))
|
||||
|
||||
}
|
||||
|
||||
val newDexFile = object : DexFile {
|
||||
|
Loading…
x
Reference in New Issue
Block a user