Ejemplo n.º 1
0
    def get_files(self, backupUDID, snapshotId, files):
        r = []
        h = {}
        for file in files:
            if file.Size == 0:
                continue

            ff = MBSFile()
            ff.FileID = file.FileID
            h[file.FileID] = file.Signature
            r.append(ff)
            self.files[file.Signature] = file

        body = encode_protobuf_array(r)
        z = self.mobile_backup_request(
            "POST",
            MBS[self.dsPrsID][backupUDID.encode("hex")][snapshotId].getFiles(),
            None, body)
        tokens = decode_protobuf_array(z, MBSFileAuthToken)
        z = MBSFileAuthTokens()

        for token in tokens:
            toto = z.tokens.add()
            toto.FileID = h[token.FileID]
            toto.AuthToken = token.AuthToken

        return z
Ejemplo n.º 2
0
    def get_files(self, backupUDID, snapshotId, files):
        r = []
        h = {}
        for file in files:
            if file.Size == 0:
                continue

            ff = MBSFile()
            ff.FileID = file.FileID
            h[file.FileID] = file.Signature
            r.append(ff)
            self.files[file.Signature] = file

        body = encode_protobuf_array(r)
        z = self.mobile_backup_request("POST", MBS[self.dsPrsID][backupUDID.encode("hex")][snapshotId].getFiles(), None,
                                       body)
        tokens = decode_protobuf_array(z, MBSFileAuthToken)
        z = MBSFileAuthTokens()

        for token in tokens:
            toto = z.tokens.add()
            toto.FileID = h[token.FileID]
            toto.AuthToken = token.AuthToken

        return z
Ejemplo n.º 3
0
 def getFiles(self, backupUDID, snapshotId, files):
     r = []
     h = {}
     for f in files:
         if f.Size == 0:
             continue
         ff = MBSFile()
         ff.FileID = f.FileID
         h[f.FileID] = f.Signature
         r.append(ff)
         self.files[f.Signature] = f
     body = encode_protobuf_array(r)
     z = self.mobileBackupRequest("POST", "/mbs/%d/%s/%d/getFiles" % (self.dsPrsID, backupUDID.encode("hex"), snapshotId), None, body)
     tokens = decode_protobuf_array(z, MBSFileAuthToken)
     z = MBSFileAuthTokens()
     for t in tokens:
         toto = z.tokens.add()
         toto.FileID = h[t.FileID]   #use signature
         toto.AuthToken = t.AuthToken
     return z
Ejemplo n.º 4
0
Archivo: iloot.py Proyecto: yike8/iloot
 def getFiles(self, backupUDID, snapshotId, files):
     r = []
     h = {}
     for f in files:
         if f.Size == 0:
             continue
         ff = MBSFile()
         ff.FileID = f.FileID
         h[f.FileID] = f.Signature
         r.append(ff)
         self.files[f.Signature] = f
     body = encode_protobuf_array(r)
     z = self.mobileBackupRequest(
         "POST", "/mbs/%d/%s/%d/getFiles" %
         (self.dsPrsID, backupUDID.encode("hex"), snapshotId), None, body)
     tokens = decode_protobuf_array(z, MBSFileAuthToken)
     z = MBSFileAuthTokens()
     for t in tokens:
         toto = z.tokens.add()
         toto.FileID = h[t.FileID]
         toto.AuthToken = t.AuthToken
     return z