Don't treat HashMismatchException as a fatal error when restoring
because may just be a corrupted file
This commit is contained in:
parent
32aff32c73
commit
417531ff49
1 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,7 @@ import com.stevesoltys.seedvault.header.HeaderReader
|
||||||
import com.stevesoltys.seedvault.header.MAX_SEGMENT_LENGTH
|
import com.stevesoltys.seedvault.header.MAX_SEGMENT_LENGTH
|
||||||
import com.stevesoltys.seedvault.header.UnsupportedVersionException
|
import com.stevesoltys.seedvault.header.UnsupportedVersionException
|
||||||
import com.stevesoltys.seedvault.header.getADForFull
|
import com.stevesoltys.seedvault.header.getADForFull
|
||||||
|
import com.stevesoltys.seedvault.repo.HashMismatchException
|
||||||
import com.stevesoltys.seedvault.repo.Loader
|
import com.stevesoltys.seedvault.repo.Loader
|
||||||
import libcore.io.IoUtils.closeQuietly
|
import libcore.io.IoUtils.closeQuietly
|
||||||
import org.calyxos.seedvault.core.backends.AppBackupFileType.Blob
|
import org.calyxos.seedvault.core.backends.AppBackupFileType.Blob
|
||||||
|
@ -146,6 +147,9 @@ internal class FullRestore(
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Log.w(TAG, "Error getting input stream for $packageName", e)
|
Log.w(TAG, "Error getting input stream for $packageName", e)
|
||||||
return TRANSPORT_PACKAGE_REJECTED
|
return TRANSPORT_PACKAGE_REJECTED
|
||||||
|
} catch (e: HashMismatchException) {
|
||||||
|
Log.w(TAG, "Hash mismatch for $packageName", e)
|
||||||
|
return TRANSPORT_PACKAGE_REJECTED
|
||||||
} catch (e: SecurityException) {
|
} catch (e: SecurityException) {
|
||||||
Log.e(TAG, "Security Exception while getting input stream for $packageName", e)
|
Log.e(TAG, "Security Exception while getting input stream for $packageName", e)
|
||||||
return TRANSPORT_ERROR
|
return TRANSPORT_ERROR
|
||||||
|
|
Loading…
Reference in a new issue