Skip to content

Commit

Permalink
Delete temp apk file if it is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
soupslurpr committed Jan 5, 2024
1 parent a5aff30 commit 8fbf52d
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,16 @@ class VerifyAppViewModel(application: Application) : AndroidViewModel(applicatio

if (packageInfo == null) {
setApkFailedToParse(true)

val isFileDeleted = tempFile.delete()

if (!isFileDeleted) {
throw IOException(
"Temporary APK file couldn't be deleted! Report this bug please with instructions " +
"on how to reproduce!"
)
}

return
}

Expand Down

0 comments on commit 8fbf52d

Please sign in to comment.