Commit d58e26a5 authored by narinder Rana's avatar narinder Rana Committed by Romain Hunault
Browse files

Delete all Apk file which is Download for installing, after Install

parent 48ba9036
...@@ -26,6 +26,7 @@ import android.net.Uri ...@@ -26,6 +26,7 @@ import android.net.Uri
import android.util.Log import android.util.Log
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider import androidx.core.content.FileProvider
import foundation.e.apps.XAPK.FsUtils.deleteFileOrDir
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
import java.io.InputStream import java.io.InputStream
...@@ -138,6 +139,10 @@ class Installer(private val packageName: String, ...@@ -138,6 +139,10 @@ class Installer(private val packageName: String,
if (p1.action == Intent.ACTION_PACKAGE_ADDED && if (p1.action == Intent.ACTION_PACKAGE_ADDED &&
(p1.data.encodedSchemeSpecificPart == packageName)) { (p1.data.encodedSchemeSpecificPart == packageName)) {
Log.i(TAG, "Broadcast received") Log.i(TAG, "Broadcast received")
var path = apk.absolutePath.split("Download")
//delete all APK file after install
deleteFileOrDir(path[0]+"Download");
callback.onInstallationComplete(p0) callback.onInstallationComplete(p0)
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment