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 927253f commit 1d07d41
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 1d07d41

Please sign in to comment.