mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-16 17:24:07 -05:00
Fix memory leak on APK extension install
This commit is contained in:
@@ -95,7 +95,7 @@ object PackageTools {
|
|||||||
/** A modified version of `xyz.nulldev.androidcompat.pm.InstalledPackage.info` */
|
/** A modified version of `xyz.nulldev.androidcompat.pm.InstalledPackage.info` */
|
||||||
fun getPackageInfo(apkFile: Path): PackageInfo =
|
fun getPackageInfo(apkFile: Path): PackageInfo =
|
||||||
ApkParsers.getMetaInfo(apkFile.toFile()).toPackageInfo(apkFile.toFile()).apply {
|
ApkParsers.getMetaInfo(apkFile.toFile()).toPackageInfo(apkFile.toFile()).apply {
|
||||||
val parsed = ApkFile(apkFile.toFile())
|
ApkFile(apkFile.toFile()).use { parsed ->
|
||||||
val dbFactory = DocumentBuilderFactory.newInstance()
|
val dbFactory = DocumentBuilderFactory.newInstance()
|
||||||
val dBuilder = dbFactory.newDocumentBuilder()
|
val dBuilder = dbFactory.newDocumentBuilder()
|
||||||
val doc =
|
val doc =
|
||||||
@@ -136,6 +136,7 @@ object PackageTools {
|
|||||||
.map { Signature(it.data) }
|
.map { Signature(it.data) }
|
||||||
.toTypedArray()
|
.toTypedArray()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getSignatureHash(pkgInfo: PackageInfo): String? {
|
fun getSignatureHash(pkgInfo: PackageInfo): String? {
|
||||||
val signatures = pkgInfo.signatures
|
val signatures = pkgInfo.signatures
|
||||||
|
|||||||
Reference in New Issue
Block a user