manifest.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const fs = require('fs')
  2. const path = require('path')
  3. const log = require('../../util/log')
  4. const plist = require('../../util/plist')
  5. module.exports = {
  6. version: 4,
  7. name: 'backup.manifest',
  8. description: `Gets a backup's manifest plist`,
  9. requiresBackup: true,
  10. // Run on a v3 lib / backup object.
  11. async run (lib, { backup }) {
  12. // Load and parse the maniest for the backup.
  13. log.verbose('parsing manifest', backup.path)
  14. let data = plist.parseFile(path.join(backup.path, 'Manifest.plist'))
  15. // Remove this data, it's kind of useless.
  16. delete data['BackupKeyBag']
  17. return data
  18. },
  19. // Manifest fields.
  20. output: {
  21. SystemDomainsVersion: el => el.SystemDomainsVersion,
  22. Applications: el => el.Applications,
  23. Lockdown: el => {
  24. el = el.Lockdown
  25. return {
  26. ProductVersion: el.ProductVersion,
  27. BuildVersion: el.BuildVersion,
  28. DeviceName: el.DeviceName,
  29. SerialNumber: el.SerialNumber,
  30. ProductType: el.ProductType,
  31. UniqueDeviceID: el.UniqueDeviceID,
  32. ...el
  33. }
  34. },
  35. Version: el => el.Version,
  36. IsEncrypted: el => el.IsEncrypted,
  37. WasPasscodeSet: el => el.WasPasscodeSet,
  38. Date: el => el.Date
  39. }
  40. }