mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
huawei: Do not apply encryption to FileUpload on non encrypted devices
* Do not encrypt file payload on devices where paramsProvider.areTransactionsCrypted() == false because there is not even valid key avaliable. Related devices is older Honor (Watch Magic 2, GS Pro, GS3) and newer Honor (Watch 4, Watch 4 Pro)
This commit is contained in:
committed by
José Rebelo
parent
ce5881df12
commit
f354941bb6
@@ -38,12 +38,13 @@ public class SendFileUploadChunk extends Request {
|
||||
@Override
|
||||
protected List<byte[]> createRequest() throws RequestCreationException {
|
||||
try {
|
||||
boolean isEncrypted = huaweiUploadManager.getFileUploadInfo().getEncrypt() && paramsProvider.areTransactionsCrypted();
|
||||
return new FileUpload.FileNextChunkSend(this.paramsProvider).serializeFileChunk(
|
||||
huaweiUploadManager.getFileUploadInfo().getCurrentChunk(),
|
||||
huaweiUploadManager.getFileUploadInfo().getCurrentUploadPosition(),
|
||||
huaweiUploadManager.getFileUploadInfo().getUnitSize(),
|
||||
huaweiUploadManager.getFileUploadInfo().getFileId(),
|
||||
huaweiUploadManager.getFileUploadInfo().getEncrypt()
|
||||
isEncrypted
|
||||
);
|
||||
} catch(HuaweiPacket.SerializeException e) {
|
||||
throw new RequestCreationException(e.getMessage());
|
||||
|
Reference in New Issue
Block a user