macos-artifacts 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7feb1e41e9f2850f24e4d73a0c4ba4f2d82de33ea6df5bbeb2fd808b5d674239
4
- data.tar.gz: 805ed33d8952f4c1194631ff05a204aef5b2c86db5e99199e72dd2e26d91ed3d
3
+ metadata.gz: ff8a46c9c151ddb085fd4c578d90e16aa922722d61728b7803934ef04617184f
4
+ data.tar.gz: 8ef9df8d3ca88f39c04988d856ae3d9d08cc870999d8b3058a055bec482c48bf
5
5
  SHA512:
6
- metadata.gz: dea8017fa8709d8da75402bd76ee5cf1161192d23703c06f4c52f0eca8d7e73906cca66e3322dea7f423f7347c4e4d682da212ccf7777902f5637fd907bb2a1f
7
- data.tar.gz: 8e44c1aaad14972586b11d4ea386b28fd09ca60771bd525ea817eaebb5302770e601b6593f7448937daa3389aa4bf6233c3092e9dd969c88d2e7b36d73cc9f14
6
+ metadata.gz: '09b71859a27f25c9db18c8ace5fcc00bfbae9023a4be65b632e8b3d3a341c4136a26c5c2eb6b445bf10e7727da52031f836af66c315bd29acce70dc697db9718'
7
+ data.tar.gz: 56786359ec1eca917904786f9171b481f2d5982252542b699dab1068841a9a9f00ff6a8db8db0f334a805cdc5d1613722e0b13c3f8816e1261616e66faee6e96
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log
2
2
 
3
3
 
4
+
5
+ ---
6
+ ## version 0.6.3
7
+ - Update: minor syntax change for System Extensions
8
+ - Fixed: error with Apps::InstallHistory US-ASCII error
9
+
10
+
4
11
  ---
5
12
  ## version 0.6.2
6
13
  - Fixed: workaround for listing files in user directory where listing items in the .Trash resulted in an error
data/README.md CHANGED
@@ -8,7 +8,7 @@ Output is simple text making it able to be scraped up by an MDM or EDR solution
8
8
  ---
9
9
  ## Installation:
10
10
 
11
- `sudp gem install macos-artifacts`
11
+ `sudo gem install macos-artifacts`
12
12
 
13
13
  ---
14
14
  ## Usage:
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
+ require 'json'
3
+ require 'date'
2
4
 
3
5
  module Macos
4
6
  module Artifacts
@@ -51,23 +53,22 @@ module Macos
51
53
  end
52
54
 
53
55
  def self.installHistory
54
- history = `system_profiler SPInstallHistoryDataType `.split("\n")
55
- history.shift
56
- history.shift
57
- puts "Application Install History:"
58
- history.each do |item|
59
- item = item.strip
60
- if ! item.empty?
61
- if item.start_with?(/^Version:/)
62
- puts " #{item}"
63
- elsif item.start_with?(/^Source:/)
64
- puts " #{item}"
65
- elsif item.start_with?(/^Install Date:/)
66
- puts " #{item}"
67
- else
68
- puts " #{item}"
69
- end
70
- end
56
+ time = DateTime.now
57
+ installs = `system_profiler -json SPInstallHistoryDataType`.strip
58
+ data = JSON.parse(installs)
59
+
60
+ puts "Software Install History:"
61
+ data["SPInstallHistoryDataType"].each do |item|
62
+ date = item["install_date"]
63
+ parsed_date = DateTime.parse(date)
64
+ installsDays = (time - parsed_date).to_i
65
+
66
+ puts " Name: #{item["_name"]}"
67
+ puts " Install Days: #{installsDays}"
68
+ puts " Install Date: #{item["install_date"]}"
69
+ puts " Version: #{item["install_version"]}"
70
+ puts " Install Source: #{item["package_source"]}"
71
+ puts ""
71
72
  end
72
73
  end
73
74
 
@@ -36,55 +36,66 @@ module Macos
36
36
 
37
37
  puts "System Extensions:"
38
38
  sysext.each do |line|
39
-
39
+
40
40
  if line.start_with?('---')
41
41
  line = line.split(" ")
42
- puts " Type: #{line[1]}"
42
+ $extType = line[1]
43
43
  elsif !line.start_with?("enabled")
44
44
  line = line.split(" ")
45
45
  if line[0] = "*"
46
- puts " Enabled: true"
46
+ extEnabled = "true"
47
47
  else
48
- puts " Enabled: false"
48
+ extEnabled = "false"
49
49
  end
50
50
  if line[1] = "*"
51
- puts " Active: true"
51
+ extActive = "true"
52
52
  else
53
- puts " Active: false"
53
+ extActive = "false"
54
54
  end
55
- puts " TeamID: #{line[2]}"
56
- puts " BundleID: #{line[3]}"
57
- puts " Version: #{line[4]}"
58
-
55
+ teamID = line[2]
56
+ bunldeID = line[3]
57
+ versionExt = line[4]
58
+
59
59
  if line[5] != "[activated"
60
60
  if line[6] != "[activated"
61
61
  if line[7] != "[activated"
62
62
  if line[8] != "[activated"
63
- puts " Name: #{line[5]} #{line[6]} #{line[7]} #{line[8]}"
63
+ nameExt = "#{line[5]} #{line[6]} #{line[7]} #{line[8]}"
64
64
  else
65
- puts " Name: #{line[5]} #{line[6]} #{line[7]}"
65
+ nameExt = "#{line[5]} #{line[6]} #{line[7]}"
66
66
  end
67
67
  end
68
68
  else
69
- puts " Name: #{line[5]}"
69
+ nameExt = "#{line[5]}"
70
70
  end
71
71
  else
72
- puts " Name: #{line[5]}"
72
+ nameExt = "#{line[5]}"
73
73
  end
74
74
 
75
75
  if line[6] == "[activated"
76
- puts " State: #{line[6]} #{line[7]}"
76
+ stateExt = "#{line[6]} #{line[7]}"
77
77
  elsif line[7] == "[activated"
78
- puts " State: #{line[7]} #{line[8]}"
78
+ stateExt = "#{line[7]} #{line[8]}"
79
79
  elsif line[8] == "[activated"
80
- puts " State: #{line[8]} #{line[9]}"
80
+ stateExt = "#{line[8]} #{line[9]}"
81
81
  elsif line[9] == "[activated"
82
- puts " State: #{line[9]} #{line[10]}"
82
+ stateExt = "#{line[9]} #{line[10]}"
83
83
  else
84
- puts " State: #{line[6]} #{line[7]}"
84
+ stateExt = "#{line[6]} #{line[7]}"
85
85
  end
86
+ puts " Type: #{$extType}"
87
+ puts " Enabled: #{extEnabled}"
88
+ puts " Active: #{extActive}"
89
+ puts " Team ID: #{teamID}"
90
+ puts " Bundle ID: #{bunldeID}"
91
+ puts " Version: #{versionExt}"
92
+ puts " Name: #{nameExt}"
93
+ puts " State: #{stateExt}"
86
94
  end
95
+
87
96
  end
97
+
98
+
88
99
  end
89
100
 
90
101
  def self.processCPU
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Macos
4
4
  module Artifacts
5
- VERSION = "0.6.2"
5
+ VERSION = "0.6.3"
6
6
  end
7
7
  end
@@ -7,6 +7,7 @@ require_relative "artifacts/apps"
7
7
  require_relative "artifacts/help"
8
8
  require 'cfpropertylist'
9
9
 
10
+
10
11
  $currentUser = ENV['USER']
11
12
 
12
13
  module Macos
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macos-artifacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nic scott
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-13 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler