Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (40 sloc) 1.27 KB
[Module Metadata]
AUTHOR=Sarah Edwards/mac4n6.com/@iamevltwin
MODULE_NOTES=Device battery level percentage.
[Database Metadata]
DATABASE=knowledgeC.db
PLATFORMS=IOS
VERSIONS=11
[Query Metadata]
QUERY_NAME=knowledge_device_batterylevel
ACTIVITY=Device Status
KEY_TIMESTAMP=ENTRY CREATION
[SQL Query]
QUERY=
SELECT
DATETIME(ZOBJECT.ZCREATIONDATE + 978307200, 'UNIXEPOCH') AS "ENTRY CREATION",
CASE ZOBJECT.ZSTARTDAYOFWEEK
WHEN "1" THEN "Sunday"
WHEN "2" THEN "Monday"
WHEN "3" THEN "Tuesday"
WHEN "4" THEN "Wednesday"
WHEN "5" THEN "Thursday"
WHEN "6" THEN "Friday"
WHEN "7" THEN "Saturday"
END "DAY OF WEEK",
DATETIME(ZOBJECT.ZSTARTDATE + 978307200, 'UNIXEPOCH') AS "START",
DATETIME(ZOBJECT.ZENDDATE + 978307200, 'UNIXEPOCH') AS "END",
(ZOBJECT.ZENDDATE - ZOBJECT.ZSTARTDATE) AS "USAGE IN SECONDS",
ZOBJECT.ZVALUEDOUBLE as "BATTERY LEVEL",
ZOBJECT.ZSTREAMNAME AS "STREAM NAME",
ZOBJECT.Z_PK AS "ZOBJECT TABLE ID"
FROM
ZOBJECT
LEFT JOIN
ZSTRUCTUREDMETADATA
ON ZOBJECT.ZSTRUCTUREDMETADATA = ZSTRUCTUREDMETADATA.Z_PK
LEFT JOIN
ZSOURCE
ON ZOBJECT.ZSOURCE = ZSOURCE.Z_PK
WHERE
ZSTREAMNAME LIKE "/device/BatteryPercentage"