calls.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module.exports.name = 'calls'
  2. module.exports.description = 'List all call records contained in the backup.'
  3. module.exports.requiresBackup = true
  4. module.exports.functions = {
  5. //
  6. // iOS 9+ Call Log Extraction
  7. //
  8. '>=9.0': function (program, backup) {
  9. // File ID for calls is `5a4935c78a5255723f707230a451d79c540d2741`
  10. backup.queryDatabase('5a4935c78a5255723f707230a451d79c540d2741',
  11. `
  12. SELECT *,
  13. datetime(ZDATE + 978307200, 'unixepoch') AS XFORMATTEDDATESTRING
  14. FROM ZCALLRECORD
  15. ORDER BY ZDATE ASC
  16. `)
  17. .then((items) => {
  18. // Use the configured formatter to print the rows.
  19. program.formatter.format(items, {
  20. // Color formatting?
  21. color: program.color,
  22. // Columns to be displayed in human-readable printouts.
  23. // Some formatters, like raw or CSV, ignore these.
  24. columns: {
  25. 'ID': el => el.Z_PK,
  26. 'Date': el => el.XFORMATTEDDATESTRING,
  27. 'Answered': el => el.ZANSWERED + '',
  28. 'Originated': el => el.ZORIGINATED + '',
  29. 'Call Type': el => el.ZCALLTYPE + '',
  30. 'Duration': el => el.ZDURATION + '',
  31. 'Location': el => el.ZLOCATION + '',
  32. 'Country': el => el.ZISO_COUNTRY_CODE + '',
  33. 'Service': el => el.ZSERVICE_PROVIDER + '',
  34. 'Address': el => (el.ZADDRESS || '').toString()
  35. }
  36. })
  37. })
  38. .catch((e) => {
  39. console.log('[!] Encountered an Error:', e)
  40. })
  41. }
  42. }