ExtensionLoader: Fix incorrect ext file deletion (#10026)

Ref c492efcb31
This commit is contained in:
Ivan Iskandar 2023-10-16 09:05:35 +07:00 committed by GitHub
parent 2bf77f1d81
commit ea99d77fda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,7 +98,7 @@ internal object ExtensionLoader {
val target = File(getPrivateExtensionDir(context), "${extension.packageName}.$PRIVATE_EXTENSION_EXTENSION") val target = File(getPrivateExtensionDir(context), "${extension.packageName}.$PRIVATE_EXTENSION_EXTENSION")
return try { return try {
file.delete() target.delete()
file.copyAndSetReadOnlyTo(target, overwrite = true) file.copyAndSetReadOnlyTo(target, overwrite = true)
if (currentExtension != null) { if (currentExtension != null) {
ExtensionInstallReceiver.notifyReplaced(context, extension.packageName) ExtensionInstallReceiver.notifyReplaced(context, extension.packageName)