Skip to content

Commit

Permalink
Don't treat HashMismatchException as a fatal error when restoring
Browse files Browse the repository at this point in the history
because may just be a corrupted file
  • Loading branch information
grote committed Nov 19, 2024
1 parent 32aff32 commit 417531f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.stevesoltys.seedvault.header.HeaderReader
import com.stevesoltys.seedvault.header.MAX_SEGMENT_LENGTH
import com.stevesoltys.seedvault.header.UnsupportedVersionException
import com.stevesoltys.seedvault.header.getADForFull
import com.stevesoltys.seedvault.repo.HashMismatchException
import com.stevesoltys.seedvault.repo.Loader
import libcore.io.IoUtils.closeQuietly
import org.calyxos.seedvault.core.backends.AppBackupFileType.Blob
Expand Down Expand Up @@ -146,6 +147,9 @@ internal class FullRestore(
} catch (e: IOException) {
Log.w(TAG, "Error getting input stream for $packageName", e)
return TRANSPORT_PACKAGE_REJECTED
} catch (e: HashMismatchException) {
Log.w(TAG, "Hash mismatch for $packageName", e)
return TRANSPORT_PACKAGE_REJECTED
} catch (e: SecurityException) {
Log.e(TAG, "Security Exception while getting input stream for $packageName", e)
return TRANSPORT_ERROR
Expand Down

0 comments on commit 417531f

Please sign in to comment.