chronicle-imessage 0.2.2 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -10
- data/chronicle-imessage.gemspec +1 -1
- data/lib/chronicle/imessage/imessage_extractor.rb +7 -8
- data/lib/chronicle/imessage/imessage_transformer.rb +3 -3
- data/lib/chronicle/imessage/local_contacts.rb +2 -0
- data/lib/chronicle/imessage/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cb26617d37224afe34143ff667c42b021736feb1a4c50b40a69c123ffea215a
|
4
|
+
data.tar.gz: 0b09ac95860c9fb5c871d0f79703d5aa305e8563ff42fbd2849a36217d28934e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58438e98dafbf84d7a959d48428ad0ea63066f8f83b5112e70f63bdbc0c115642ab6876e10b0420e3ec6e1cba34d40e4bdc7573a0cc9bddb61046175f9b3be61
|
7
|
+
data.tar.gz: '0480e7dfce115a6471b2a7732175ff679560b083ea941157d4b765b115ae36e423e5bfbaf70ce49b1d4234d9ac3948446c45e64cb97388534784a3c10eb50b18'
|
data/README.md
CHANGED
@@ -1,18 +1,42 @@
|
|
1
1
|
# Chronicle::Imessage
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/chronicle-imessage.svg)](https://badge.fury.io/rb/chronicle-imessage)
|
2
3
|
|
3
|
-
|
4
|
+
Access your iMessage messages and attachments using the command line with this plugin for [chronicle-etl](https://github.com/chronicle-app/chronicle-etl).
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
```sh
|
9
|
+
# Install chronicle-etl and this plugin
|
10
|
+
$ gem install chronicle-etl
|
11
|
+
$ chronicle-etl plugins:install imessage
|
12
|
+
|
13
|
+
# Load messages since February 7
|
14
|
+
$ chronicle-etl --extractor imessage --transformer imessage --since "2022-02-07"
|
15
|
+
|
16
|
+
# Of the latest 1000 messages received, who were the top senders?
|
17
|
+
$ chronicle-etl -e imessage -t imessage --limit 1000 --no-header-row --fields actor.title | sort | uniq -c | sort -nr
|
18
|
+
|
19
|
+
# Get the raw query results for the latest 10 messages and save as a CSV
|
20
|
+
$ chronicle-etl -e imessage --loader csv --limit 10 -o imessages.csv
|
21
|
+
```
|
4
22
|
|
5
23
|
## Available Connectors
|
6
24
|
### Extractors
|
7
|
-
- `imessage` - Extractor for importing messages and attachments from local macOS iMessage install (`~/Library/Messages/chat.db`)
|
8
25
|
|
9
|
-
|
10
|
-
|
26
|
+
#### `imessage`
|
27
|
+
Extractor for importing messages and attachments from local macOS iMessage install (`~/Library/Messages/chat.db`)
|
11
28
|
|
12
|
-
|
29
|
+
##### Settings
|
30
|
+
- `load_attachments`: (default: false) Whether to load message attachments
|
31
|
+
- `only_attachments`: (default: fasle) Whether to load only messages with attachments
|
13
32
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
33
|
+
We want messages to have sender/receiver information set properly so we try to infer your iCloud information and phone number automatically. If these fail, you can provide the necessary information with:
|
34
|
+
- `my_phone_number`: Your phone number (for setting messages's actor fields properly)
|
35
|
+
- `my_name`: Your name (for setting messages's actor fields properly)
|
36
|
+
- `icloud_account_id`: Specify an email address that represents your iCloud account ID
|
37
|
+
- `icloud_account_dsid`: Specify iCloud DSID
|
38
|
+
- Can find in Keychain or by running `$ defaults read MobileMeAccounts Accounts`
|
39
|
+
### Transformers
|
40
|
+
|
41
|
+
#### `imessage`
|
42
|
+
Transform an iMessage message into Chronicle Schema
|
data/chronicle-imessage.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
36
|
spec.require_paths = ["lib"]
|
37
37
|
|
38
|
-
spec.add_dependency "chronicle-etl", "~> 0.4.
|
38
|
+
spec.add_dependency "chronicle-etl", "~> 0.4.4"
|
39
39
|
spec.add_dependency "sqlite3", "~> 1.4"
|
40
40
|
spec.add_dependency "phonelib", "~> 0.6"
|
41
41
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'chronicle/etl'
|
2
2
|
require 'sqlite3'
|
3
|
-
require 'pry'
|
4
3
|
|
5
4
|
module Chronicle
|
6
5
|
module Imessage
|
@@ -28,8 +27,8 @@ module Chronicle
|
|
28
27
|
meta = {}
|
29
28
|
meta[:participants] = @chats[message['chat_id']]
|
30
29
|
meta[:attachments] = @attachments[message['message_id']] if @attachments
|
31
|
-
meta[:my_phone_contact] = @my_phone_contact
|
32
|
-
meta[:my_icloud_account] = @my_icloud_account
|
30
|
+
meta[:my_phone_contact] = @my_phone_contact if @my_phone_contact.values.all?
|
31
|
+
meta[:my_icloud_account] = @my_icloud_account if @my_icloud_account.values.all?
|
33
32
|
|
34
33
|
yield Chronicle::ETL::Extraction.new(data: message, meta: meta)
|
35
34
|
end
|
@@ -59,16 +58,16 @@ module Chronicle
|
|
59
58
|
|
60
59
|
def load_my_phone_contact(local_contacts)
|
61
60
|
{
|
62
|
-
phone_number: @config.my_phone_number || local_contacts.my_phone_contact
|
63
|
-
name: @config.my_name || local_contacts.my_phone_contact
|
61
|
+
phone_number: @config.my_phone_number || local_contacts.my_phone_contact&.fetch(:phone_number),
|
62
|
+
name: @config.my_name || local_contacts.my_phone_contact&.fetch(:full_name)
|
64
63
|
}
|
65
64
|
end
|
66
65
|
|
67
66
|
def load_my_icloud_account(local_contacts)
|
68
67
|
{
|
69
|
-
id: @config.icloud_account_id || local_contacts.my_icloud_account
|
70
|
-
dsid: @config.icloud_account_dsid || local_contacts.my_icloud_account
|
71
|
-
display_name: @config.icloud_account_display_name || @config.my_name || local_contacts.my_icloud_account
|
68
|
+
id: @config.icloud_account_id || local_contacts.my_icloud_account&.fetch(:AccountID),
|
69
|
+
dsid: @config.icloud_account_dsid || local_contacts.my_icloud_account&.fetch(:AccountDSID),
|
70
|
+
display_name: @config.icloud_account_display_name || @config.my_name || local_contacts.my_icloud_account&.fetch(:DisplayName)
|
72
71
|
}
|
73
72
|
end
|
74
73
|
|
@@ -102,7 +102,7 @@ module Chronicle
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def build_identity identity
|
105
|
-
raise
|
105
|
+
raise(Chronicle::ETL::UntransformableRecordError, "Could not build record due to missing identity data") unless identity
|
106
106
|
|
107
107
|
record = ::Chronicle::ETL::Models::Entity.new({
|
108
108
|
represents: 'identity',
|
@@ -125,7 +125,7 @@ module Chronicle
|
|
125
125
|
|
126
126
|
def build_identity_mine_icloud
|
127
127
|
icloud_account = @extraction.meta[:my_icloud_account]
|
128
|
-
raise(UntransformableRecordError, "
|
128
|
+
raise(Chronicle::ETL::UntransformableRecordError, "Could not build record due to missing iCloud details. Please provide them through the extractor settings.") unless icloud_account
|
129
129
|
|
130
130
|
record = ::Chronicle::ETL::Models::Entity.new({
|
131
131
|
represent: 'identity',
|
@@ -140,7 +140,7 @@ module Chronicle
|
|
140
140
|
|
141
141
|
def build_identity_mine_phone
|
142
142
|
phone_account = @extraction.meta[:my_phone_contact]
|
143
|
-
raise(UntransformableRecordError, "
|
143
|
+
raise(Chronicle::ETL::UntransformableRecordError, "Could not build record due to missing phone details. Please provide them through the extractor settings.") unless phone_account
|
144
144
|
|
145
145
|
record = ::Chronicle::ETL::Models::Entity.new({
|
146
146
|
represent: 'identity',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chronicle-imessage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Louis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronicle-etl
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.
|
19
|
+
version: 0.4.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.
|
26
|
+
version: 0.4.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,7 +107,7 @@ metadata:
|
|
107
107
|
homepage_uri: https://github.com/chronicle-app/chronicle-imessage
|
108
108
|
source_code_uri: https://github.com/chronicle-app/chronicle-imessage
|
109
109
|
changelog_uri: https://github.com/chronicle-app/chronicle-imessage
|
110
|
-
post_install_message:
|
110
|
+
post_install_message:
|
111
111
|
rdoc_options: []
|
112
112
|
require_paths:
|
113
113
|
- lib
|
@@ -122,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubygems_version: 3.3.
|
126
|
-
signing_key:
|
125
|
+
rubygems_version: 3.3.3
|
126
|
+
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: iMessage importer for Chronicle
|
129
129
|
test_files: []
|