kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add additional info when backup verification fails.
rodzic
c03a183904
commit
10df4ee0d1
|
@ -48,7 +48,7 @@ object BackupVerifier {
|
|||
try {
|
||||
inputStream.readAttachmentTo(NullOutputStream, attachment.length)
|
||||
} catch (e: IOException) {
|
||||
Log.w(TAG, "Bad attachment: ${attachment.attachmentId}", e)
|
||||
Log.w(TAG, "Bad attachment id: ${attachment.attachmentId} len: ${attachment.length}", e)
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ object BackupVerifier {
|
|||
try {
|
||||
inputStream.readAttachmentTo(NullOutputStream, sticker.length)
|
||||
} catch (e: IOException) {
|
||||
Log.w(TAG, "Bad sticker: ${sticker.rowId}", e)
|
||||
Log.w(TAG, "Bad sticker id: ${sticker.rowId} len: ${sticker.length}", e)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
@ -69,7 +69,7 @@ object BackupVerifier {
|
|||
try {
|
||||
inputStream.readAttachmentTo(NullOutputStream, avatar.length)
|
||||
} catch (e: IOException) {
|
||||
Log.w(TAG, "Bad sticker: ${avatar.recipientId}", e)
|
||||
Log.w(TAG, "Bad avatar id: ${avatar.recipientId} len: ${avatar.length}", e)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
|
|
@ -473,7 +473,7 @@ public class FullBackupExporter extends FullBackupBase {
|
|||
try (InputStream inputStream = openAttachmentStream(attachmentSecret, random, data)) {
|
||||
outputStream.write(new AttachmentId(rowId, uniqueId), inputStream, size);
|
||||
} catch (FileNotFoundException e) {
|
||||
Log.w(TAG, "Missing attachment: " + e.getMessage());
|
||||
Log.w(TAG, "Missing attachment", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -498,7 +498,7 @@ public class FullBackupExporter extends FullBackupBase {
|
|||
try (InputStream inputStream = ModernDecryptingPartInputStream.createFor(attachmentSecret, random, new File(data), 0)) {
|
||||
outputStream.writeSticker(rowId, inputStream, size);
|
||||
} catch (FileNotFoundException e) {
|
||||
Log.w(TAG, "Missing sticker: " + e.getMessage());
|
||||
Log.w(TAG, "Missing sticker", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,7 @@ public class FullBackupExporter extends FullBackupBase {
|
|||
result += read;
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
Log.w(TAG, "Missing attachment: " + e.getMessage());
|
||||
Log.w(TAG, "Missing attachment for size calculation", e);
|
||||
return 0;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, "Failed to determine stream length", e);
|
||||
|
|
|
@ -52,7 +52,7 @@ public final class StreamUtil {
|
|||
|
||||
for (;;) {
|
||||
int read = in.read(buffer, offset, len - offset);
|
||||
if (read == -1) throw new EOFException("Stream ended early");
|
||||
if (read == -1) throw new EOFException("Stream ended early, offset: " + offset + " len: " + len);
|
||||
|
||||
if (read + offset < len) offset += read;
|
||||
else return;
|
||||
|
|
Ładowanie…
Reference in New Issue