Backup workaround, to import from other Applications

This commit is contained in:
Martin/Geno 2019-02-11 12:51:44 +01:00
parent a3662b4f34
commit f14ffd304f
1 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ public class BackupFileHeader {
}
public BackupFileHeader(String app, Jid jid, long timestamp, byte[] iv, byte[] salt) {
this.app = app.replace("sum7", "siacs");
this.app = app;
this.jid = jid;
this.timestamp = timestamp;
this.iv = iv;
@ -39,7 +39,7 @@ public class BackupFileHeader {
public void write(DataOutputStream dataOutputStream) throws IOException {
dataOutputStream.writeInt(VERSION);
dataOutputStream.writeUTF(app);
dataOutputStream.writeUTF(app.replace("sum7", "siacs"));
dataOutputStream.writeUTF(jid.asBareJid().toEscapedString());
dataOutputStream.writeLong(timestamp);
dataOutputStream.write(iv);
@ -51,7 +51,7 @@ public class BackupFileHeader {
if (version > VERSION) {
throw new IllegalArgumentException("Backup File version was "+version+" but app only supports up to version "+VERSION);
}
String app = inputStream.readUTF();
String app = inputStream.readUTF().replace("siacs", "sum7);
String jid = inputStream.readUTF();
long timestamp = inputStream.readLong();
byte[] iv = new byte[12];
@ -59,7 +59,7 @@ public class BackupFileHeader {
byte[] salt = new byte[16];
inputStream.readFully(salt);
return new BackupFileHeader(app.replace("sum7", "siacs"),Jid.of(jid),timestamp,iv,salt);
return new BackupFileHeader(app,Jid.of(jid),timestamp,iv,salt);
}