Skip to content

Commit

Permalink
chg: [apollo] include some changes from @Shadow0ps, @stark4n6, @raidrob
Browse files Browse the repository at this point in the history
  • Loading branch information
cvandeplas committed Oct 21, 2024
1 parent 08faf0c commit 1e470b5
Show file tree
Hide file tree
Showing 5 changed files with 359 additions and 125 deletions.
266 changes: 197 additions & 69 deletions src/sysdiagnose/utils/apollo_modules/health_workout_general.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------------------------------------------------------------------------------
# Copyright (c) 2018-2020 Sarah Edwards (Station X Labs, LLC,
# Copyright (c) 2018-2020 Sarah Edwards (Station X Labs, LLC,
# @iamevltwin, mac4n6.com). All rights reserved.

# This software is provided "as is," without warranty of any kind,
Expand All @@ -22,19 +22,19 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, disclaimer, and this list of conditions in the documenta-
# tion and/or other materials provided with the distribution.
# 3. All advertising, training, and documentation materials mentioning
# features or use of this software must display the following
# acknowledgment. Character-limited social media may abbreviate this
# acknowledgment to include author and APOLLO name ie: "This new
# feature brought to you by @iamevltwin's APOLLO". Please make an
# 3. All advertising, training, and documentation materials mentioning
# features or use of this software must display the following
# acknowledgment. Character-limited social media may abbreviate this
# acknowledgment to include author and APOLLO name ie: "This new
# feature brought to you by @iamevltwin's APOLLO". Please make an
# effort credit the appropriate authors on specific APOLLO modules.
# The spirit of this clause is to give public acknowledgment to
# The spirit of this clause is to give public acknowledgment to
# researchers where credit is due.

# This product includes software developed by Sarah Edwards
# (Station X Labs, LLC, @iamevltwin, mac4n6.com) and other
# contributors as part of APOLLO (Apple Pattern of Life Lazy
# Output'er).
# This product includes software developed by Sarah Edwards
# (Station X Labs, LLC, @iamevltwin, mac4n6.com) and other
# contributors as part of APOLLO (Apple Pattern of Life Lazy
# Output'er).


# LICENSE 2 (GNU GPL v3 or later):
Expand Down Expand Up @@ -75,88 +75,216 @@ QUERY=
SELECT
DATETIME(SAMPLES.START_DATE + 978307200, 'UNIXEPOCH') AS "START DATE",
DATETIME(SAMPLES.END_DATE + 978307200, 'UNIXEPOCH') AS "END DATE",
CASE WORKOUTS.ACTIVITY_TYPE
WHEN 63 THEN "HIGH INTENSITY INTERVAL TRAINING (HIIT)"
WHEN 37 THEN "INDOOR / OUTDOOR RUN"
WHEN 3000 THEN "OTHER"
WHEN 52 THEN "INDOOR / OUTDOOR WALK"
WHEN 20 THEN "FUNCTIONAL TRAINING"
WHEN 13 THEN "INDOOR CYCLE"
WHEN 16 THEN "ELLIPTICAL"
WHEN 35 THEN "ROWER"
CASE WORKOUTS.ACTIVITY_TYPE
WHEN 1 THEN "AMERICAN FOOTBALL"
WHEN 2 THEN "ARCHERY"
WHEN 3 THEN "AUSTRALIAN FOOTBALL"
WHEN 4 THEN "BADMINTON"
WHEN 5 THEN "BASEBALL"
WHEN 6 THEN "BASKETBALL"
WHEN 7 THEN "BOWLING"
WHEN 8 THEN "BOXING"
WHEN 9 THEN "CLIMBING"
WHEN 10 THEN "CRICKET"
WHEN 11 THEN "CROSS TRAINING"
WHEN 12 THEN "CURLING"
WHEN 13 THEN "CYCLING"
WHEN 16 THEN "ELLIPTICAL"
WHEN 17 THEN "EQUESTRIAN SPORTS"
WHEN 18 THEN "FENCING"
WHEN 19 THEN "FISHING"
WHEN 20 THEN "FUNCTION STRENGTH TRAINING"
WHEN 21 THEN "GOLF"
WHEN 22 THEN "GYMNASTICS"
WHEN 23 THEN "HANDBALL"
WHEN 24 THEN "HIKING"
WHEN 25 THEN "HOCKEY"
WHEN 26 THEN "HUNTING"
WHEN 27 THEN "LACROSS"
WHEN 28 THEN "MARTIAL ARTS"
WHEN 29 THEN "MIND AND BODY"
WHEN 31 THEN "PADDLE SPORTS"
WHEN 32 THEN "PLAY"
WHEN 33 THEN "PREPARATION AND RECOVERY"
WHEN 34 THEN "RACQUETBALL"
WHEN 35 THEN "ROWING"
WHEN 36 THEN "RUGBY"
WHEN 37 THEN "RUNNING"
WHEN 38 THEN "SAILING"
WHEN 39 THEN "SKATING SPORTS"
WHEN 40 THEN "SNOW SPORTS"
WHEN 41 THEN "SOCCER"
WHEN 42 THEN "SOFTBALL"
WHEN 43 THEN "SQUASH"
WHEN 44 THEN "STAIRSTEPPER"
WHEN 45 THEN "SURFING SPORTS"
WHEN 46 THEN "SWIMMING"
WHEN 47 THEN "TABLE TENNIS"
WHEN 48 THEN "TENNIS"
WHEN 49 THEN "TRACK AND FIELD"
WHEN 50 THEN "TRADITIONAL STRENGTH TRAINING"
WHEN 51 THEN "VOLLEYBALL"
WHEN 52 THEN "WALKING"
WHEN 53 THEN "WATER FITNESS"
WHEN 54 THEN "WATER POLO"
WHEN 55 THEN "WATER SPORTS"
WHEN 56 THEN "WRESTLING"
WHEN 57 THEN "YOGA"
WHEN 58 THEN "BARRE"
WHEN 59 THEN "CORE TRAINING"
WHEN 60 THEN "CROSS COUNTRY SKIING"
WHEN 61 THEN "DOWNHILL SKIING"
WHEN 62 THEN "FLEXIBILITY"
WHEN 63 THEN "HIGH INTENSITY INTERVAL TRAINING (HIIT)"
WHEN 64 THEN "JUMP ROPE"
WHEN 65 THEN "KICKBOXING"
WHEN 66 THEN "PILATES"
WHEN 67 THEN "SNOWBOARDING"
WHEN 68 THEN "STAIRS"
WHEN 69 THEN "STEP TRAINING"
WHEN 70 THEN "WHEELCHAIR WALK PACE"
WHEN 71 THEN "WHEELCHAIR RUN PACE"
WHEN 72 THEN "TAI CHI"
WHEN 73 THEN "MIXED CARDIO"
WHEN 74 THEN "HAND CYCLING"
WHEN 3000 THEN "OTHER"
ELSE "UNKNOWN" || "-" || WORKOUTS.ACTIVITY_TYPE
END "WORKOUT TYPE",
WORKOUTS.DURATION / 60.00 AS "DURATION (IN MINUTES)",
WORKOUTS.TOTAL_ENERGY_BURNED AS "CALORIES BURNED",
END "WORKOUT TYPE",
WORKOUTS.DURATION / 60.00 AS "DURATION (IN MINUTES)",
WORKOUTS.TOTAL_ENERGY_BURNED AS "CALORIES BURNED",
WORKOUTS.TOTAL_DISTANCE AS "DISTANCE IN KILOMETERS",
WORKOUTS.TOTAL_DISTANCE*0.621371 AS "DISTANCE IN MILES",
WORKOUTS.TOTAL_BASAL_ENERGY_BURNED AS "TOTAL BASEL ENERGY BURNED",
CASE WORKOUTS.GOAL_TYPE
WHEN 2 THEN "MINUTES"
WHEN 0 THEN "OPEN"
WORKOUTS.TOTAL_DISTANCE*0.621371 AS "DISTANCE IN MILES",
WORKOUTS.TOTAL_BASAL_ENERGY_BURNED AS "TOTAL BASEL ENERGY BURNED",
CASE WORKOUTS.GOAL_TYPE
WHEN 2 THEN "MINUTES"
WHEN 0 THEN "OPEN"
END "GOAL TYPE",
WORKOUTS.GOAL AS "GOAL",
WORKOUTS.TOTAL_FLIGHTS_CLIMBED AS "FLIGHTS CLIMBED",
WORKOUTS.TOTAL_W_STEPS AS "STEPS"
WORKOUTS.GOAL AS "GOAL",
WORKOUTS.TOTAL_FLIGHTS_CLIMBED AS "FLIGHTS CLIMBED",
WORKOUTS.TOTAL_W_STEPS AS "STEPS"
FROM
SAMPLES
SAMPLES
LEFT OUTER JOIN
METADATA_VALUES
ON METADATA_VALUES.OBJECT_ID = SAMPLES.DATA_ID
METADATA_VALUES
ON METADATA_VALUES.OBJECT_ID = SAMPLES.DATA_ID
LEFT OUTER JOIN
METADATA_KEYS
ON METADATA_KEYS.ROWID = METADATA_VALUES.KEY_ID
METADATA_KEYS
ON METADATA_KEYS.ROWID = METADATA_VALUES.KEY_ID
LEFT OUTER JOIN
WORKOUTS
ON WORKOUTS.DATA_ID = SAMPLES.DATA_ID
WORKOUTS
ON WORKOUTS.DATA_ID = SAMPLES.DATA_ID
WHERE
WORKOUTS.ACTIVITY_TYPE NOT NULL
WORKOUTS.ACTIVITY_TYPE NOT NULL
AND (KEY IS NULL OR KEY IS "HKIndoorWorkout")

[SQL Query 9,10]
QUERY=
SELECT
DATETIME(SAMPLES.START_DATE + 978307200, 'UNIXEPOCH') AS "START DATE",
DATETIME(SAMPLES.END_DATE + 978307200, 'UNIXEPOCH') AS "END DATE",
CASE WORKOUTS.ACTIVITY_TYPE
WHEN 63 THEN "HIGH INTENSITY INTERVAL TRAINING (HIIT)"
WHEN 37 THEN "INDOOR / OUTDOOR RUN"
WHEN 3000 THEN "OTHER"
WHEN 52 THEN "INDOOR / OUTDOOR WALK"
WHEN 20 THEN "FUNCTIONAL TRAINING"
WHEN 13 THEN "INDOOR CYCLE"
WHEN 16 THEN "ELLIPTICAL"
WHEN 35 THEN "ROWER"
CASE WORKOUTS.ACTIVITY_TYPE
WHEN 1 THEN "AMERICAN FOOTBALL"
WHEN 2 THEN "ARCHERY"
WHEN 3 THEN "AUSTRALIAN FOOTBALL"
WHEN 4 THEN "BADMINTON"
WHEN 5 THEN "BASEBALL"
WHEN 6 THEN "BASKETBALL"
WHEN 7 THEN "BOWLING"
WHEN 8 THEN "BOXING"
WHEN 9 THEN "CLIMBING"
WHEN 10 THEN "CRICKET"
WHEN 11 THEN "CROSS TRAINING"
WHEN 12 THEN "CURLING"
WHEN 13 THEN "CYCLING"
WHEN 16 THEN "ELLIPTICAL"
WHEN 17 THEN "EQUESTRIAN SPORTS"
WHEN 18 THEN "FENCING"
WHEN 19 THEN "FISHING"
WHEN 20 THEN "FUNCTION STRENGTH TRAINING"
WHEN 21 THEN "GOLF"
WHEN 22 THEN "GYMNASTICS"
WHEN 23 THEN "HANDBALL"
WHEN 24 THEN "HIKING"
WHEN 25 THEN "HOCKEY"
WHEN 26 THEN "HUNTING"
WHEN 27 THEN "LACROSS"
WHEN 28 THEN "MARTIAL ARTS"
WHEN 29 THEN "MIND AND BODY"
WHEN 31 THEN "PADDLE SPORTS"
WHEN 32 THEN "PLAY"
WHEN 33 THEN "PREPARATION AND RECOVERY"
WHEN 34 THEN "RACQUETBALL"
WHEN 35 THEN "ROWING"
WHEN 36 THEN "RUGBY"
WHEN 37 THEN "RUNNING"
WHEN 38 THEN "SAILING"
WHEN 39 THEN "SKATING SPORTS"
WHEN 40 THEN "SNOW SPORTS"
WHEN 41 THEN "SOCCER"
WHEN 42 THEN "SOFTBALL"
WHEN 43 THEN "SQUASH"
WHEN 44 THEN "STAIRSTEPPER"
WHEN 45 THEN "SURFING SPORTS"
WHEN 46 THEN "SWIMMING"
WHEN 47 THEN "TABLE TENNIS"
WHEN 48 THEN "TENNIS"
WHEN 49 THEN "TRACK AND FIELD"
WHEN 50 THEN "TRADITIONAL STRENGTH TRAINING"
WHEN 51 THEN "VOLLEYBALL"
WHEN 52 THEN "WALKING"
WHEN 53 THEN "WATER FITNESS"
WHEN 54 THEN "WATER POLO"
WHEN 55 THEN "WATER SPORTS"
WHEN 56 THEN "WRESTLING"
WHEN 57 THEN "YOGA"
WHEN 58 THEN "BARRE"
WHEN 59 THEN "CORE TRAINING"
WHEN 60 THEN "CROSS COUNTRY SKIING"
WHEN 61 THEN "DOWNHILL SKIING"
WHEN 62 THEN "FLEXIBILITY"
WHEN 63 THEN "HIGH INTENSITY INTERVAL TRAINING (HIIT)"
WHEN 64 THEN "JUMP ROPE"
WHEN 65 THEN "KICKBOXING"
WHEN 66 THEN "PILATES"
WHEN 67 THEN "SNOWBOARDING"
WHEN 68 THEN "STAIRS"
WHEN 69 THEN "STEP TRAINING"
WHEN 70 THEN "WHEELCHAIR WALK PACE"
WHEN 71 THEN "WHEELCHAIR RUN PACE"
WHEN 72 THEN "TAI CHI"
WHEN 73 THEN "MIXED CARDIO"
WHEN 74 THEN "HAND CYCLING"
WHEN 3000 THEN "OTHER"
ELSE "UNKNOWN" || "-" || WORKOUTS.ACTIVITY_TYPE
END "WORKOUT TYPE",
WORKOUTS.DURATION / 60.00 AS "DURATION (IN MINUTES)",
WORKOUTS.TOTAL_ENERGY_BURNED AS "CALORIES BURNED",
WORKOUTS.TOTAL_DISTANCE AS "DISTANCE IN KILOMETERS",
WORKOUTS.TOTAL_BASAL_ENERGY_BURNED AS "TOTAL BASEL ENERGY BURNED",
CASE WORKOUTS.GOAL_TYPE
WHEN 2 THEN "MINUTES"
WHEN 0 THEN "OPEN"
END "WORKOUT TYPE",
WORKOUTS.DURATION / 60.00 AS "DURATION (IN MINUTES)",
WORKOUTS.TOTAL_ENERGY_BURNED AS "CALORIES BURNED",
WORKOUTS.TOTAL_DISTANCE AS "DISTANCE IN KILOMETERS",
WORKOUTS.TOTAL_BASAL_ENERGY_BURNED AS "TOTAL BASEL ENERGY BURNED",
CASE WORKOUTS.GOAL_TYPE
WHEN 2 THEN "MINUTES"
WHEN 0 THEN "OPEN"
END "GOAL TYPE",
WORKOUTS.GOAL AS "GOAL"
FROM
SAMPLES
SAMPLES
LEFT OUTER JOIN
QUANTITY_SAMPLES
ON SAMPLES.DATA_ID = QUANTITY_SAMPLES.DATA_ID
QUANTITY_SAMPLES
ON SAMPLES.DATA_ID = QUANTITY_SAMPLES.DATA_ID
LEFT OUTER JOIN
UNIT_STRINGS
ON QUANTITY_SAMPLES.ORIGINAL_UNIT = UNIT_STRINGS.ROWID
UNIT_STRINGS
ON QUANTITY_SAMPLES.ORIGINAL_UNIT = UNIT_STRINGS.ROWID
LEFT OUTER JOIN
CORRELATIONS
ON SAMPLES.DATA_ID = CORRELATIONS.OBJECT
CORRELATIONS
ON SAMPLES.DATA_ID = CORRELATIONS.OBJECT
LEFT OUTER JOIN
METADATA_VALUES
ON METADATA_VALUES.OBJECT_ID = SAMPLES.DATA_ID
METADATA_VALUES
ON METADATA_VALUES.OBJECT_ID = SAMPLES.DATA_ID
LEFT OUTER JOIN
METADATA_KEYS
ON METADATA_KEYS.ROWID = METADATA_VALUES.KEY_ID
METADATA_KEYS
ON METADATA_KEYS.ROWID = METADATA_VALUES.KEY_ID
LEFT OUTER JOIN
WORKOUTS
ON WORKOUTS.DATA_ID = SAMPLES.DATA_ID
WORKOUTS
ON WORKOUTS.DATA_ID = SAMPLES.DATA_ID
WHERE
WORKOUTS.ACTIVITY_TYPE NOT NULL AND KEY IS NULL
46 changes: 34 additions & 12 deletions src/sysdiagnose/utils/apollo_modules/passes23_wallet_passes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------------------------------------------------------------------------------
# Copyright (c) 2018-2020 Sarah Edwards (Station X Labs, LLC,
# Copyright (c) 2018-2020 Sarah Edwards (Station X Labs, LLC,
# @iamevltwin, mac4n6.com). All rights reserved.

# This software is provided "as is," without warranty of any kind,
Expand All @@ -22,19 +22,19 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, disclaimer, and this list of conditions in the documenta-
# tion and/or other materials provided with the distribution.
# 3. All advertising, training, and documentation materials mentioning
# features or use of this software must display the following
# acknowledgment. Character-limited social media may abbreviate this
# acknowledgment to include author and APOLLO name ie: "This new
# feature brought to you by @iamevltwin's APOLLO". Please make an
# 3. All advertising, training, and documentation materials mentioning
# features or use of this software must display the following
# acknowledgment. Character-limited social media may abbreviate this
# acknowledgment to include author and APOLLO name ie: "This new
# feature brought to you by @iamevltwin's APOLLO". Please make an
# effort credit the appropriate authors on specific APOLLO modules.
# The spirit of this clause is to give public acknowledgment to
# The spirit of this clause is to give public acknowledgment to
# researchers where credit is due.

# This product includes software developed by Sarah Edwards
# (Station X Labs, LLC, @iamevltwin, mac4n6.com) and other
# contributors as part of APOLLO (Apple Pattern of Life Lazy
# Output'er).
# This product includes software developed by Sarah Edwards
# (Station X Labs, LLC, @iamevltwin, mac4n6.com) and other
# contributors as part of APOLLO (Apple Pattern of Life Lazy
# Output'er).


# LICENSE 2 (GNU GPL v3 or later):
Expand Down Expand Up @@ -63,7 +63,7 @@ MODULE_NOTES=Wallet Passes
[Database Metadata]
DATABASE=passes23.sqlite
PLATFORM=IOS
VERSIONS=10,11,12,13
VERSIONS=10,11,12,13,15

[Query Metadata]
QUERY_NAME=passes23_passes
Expand All @@ -90,4 +90,26 @@ QUERY=
LEFT JOIN PAYMENT_TRANSACTION ON PASS.PID == PAYMENT_TRANSACTION.PASS_PID
LEFT JOIN LOCATION_SOURCE ON LOCATION_SOURCE.URL LIKE '%'||PASS.UNIQUE_ID||'%'
LEFT JOIN LOCATION ON LOCATION.LOCATION_SOURCE_PID == LOCATION_SOURCE.PID
WHERE AMOUNT IS NULL

[SQL Query 15]
QUERY=
SELECT
DATETIME(PASS.INGESTED_DATE+978307200,'UNIXEPOCH') AS "INGESTED DATE",
DATETIME(PASS.MODIFIED_DATE+978307200,'UNIXEPOCH') AS "MODIFIED DATE",
DATETIME(PASS.RELEVANT_DATE+978307200,'UNIXEPOCH') AS "RELEVANT TIME",
PASS.ORGANIZATION_NAME AS "ORGANIZATION NAME",
PASS_TYPE.IDENTIFIER AS "IDENTIFIER",
LOCATION.RELEVANT_TEXT AS "RELEVANT TEXT",
LOCATION.LATITUDE AS "LATITUDE",
LOCATION.LONGITUDE AS "LONGITUDE",
DATETIME(PASS.PUSH_REGISTRATION_DATE+978307200,'UNIXEPOCH') AS "PUSH REGISTRATION TIME",
PASS.LAST_MODIFIED_TAG AS "LAST MODIFIED TAG",
SERIAL_NUMBER AS "SERIAL NUMBER",
PASS.UNIQUE_ID AS "PASS ID"
FROM PASS
LEFT JOIN PASS_TYPE ON PASS.PASS_TYPE_PID == PASS_TYPE.PID
LEFT JOIN PAYMENT_TRANSACTION ON PASS.PID == PAYMENT_TRANSACTION.PID
LEFT JOIN LOCATION_SOURCE ON LOCATION_SOURCE.URL LIKE '%'||PASS.UNIQUE_ID||'%'
LEFT JOIN LOCATION ON LOCATION.LOCATION_SOURCE_PID == LOCATION_SOURCE.PID
WHERE AMOUNT IS NULL
Loading

0 comments on commit 1e470b5

Please sign in to comment.