photolocations.js 941 B

1234567891011121314151617181920212223242526272829
  1. module.exports.name = 'photolocations'
  2. module.exports.description = 'List all geolocation information for iOS photos (iOS 10+)'
  3. // Specify this reporter requires a backup.
  4. // The second parameter to func() is now a backup instead of the path to one.
  5. module.exports.requiresBackup = true
  6. // Specify this only works for iOS 10+
  7. module.exports.supportedVersions = '>=10.0'
  8. // Reporting function
  9. module.exports.func = function (program, backup) {
  10. backup.getPhotoLocationHistory()
  11. .then((history) => {
  12. // Format the output according to the configured formatter.
  13. program.formatter.format(history, {
  14. color: program.color,
  15. columns: {
  16. 'Time': el => el.XFORMATTEDDATESTRING,
  17. 'Latitude': el => el.ZLATITUDE,
  18. 'Longitude': el => el.ZLONGITUDE,
  19. 'File': el => el.ZFILENAME,
  20. }
  21. })
  22. })
  23. .catch((e) => {
  24. console.log('[!] Encountered an Error:', e)
  25. })
  26. }