Skip to content

Commit

Permalink
Update oui.json
Browse files Browse the repository at this point in the history
  • Loading branch information
halo committed Feb 13, 2024
1 parent dc91b66 commit e31173c
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 93 deletions.
1 change: 0 additions & 1 deletion --help

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 4.0.0

Rewrite everything from scratch.

# 3.2.0

* [FEATURE] If connected to a network, re-associate to the same SSID after a disconnect to change the MAC address.
Expand Down
4 changes: 2 additions & 2 deletions LinkLiar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@
CODE_SIGN_ENTITLEMENTS = LinkLiar/LinkLiar.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"LinkLiar/Preview Content\"";
DEVELOPMENT_TEAM = B9J4QR64LK;
Expand Down Expand Up @@ -1300,7 +1300,7 @@
CODE_SIGN_ENTITLEMENTS = LinkLiar/LinkLiar.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"LinkLiar/Preview Content\"";
DEVELOPMENT_TEAM = B9J4QR64LK;
Expand Down
2 changes: 1 addition & 1 deletion LinkLiar/oui.json

Large diffs are not rendered by default.

130 changes: 45 additions & 85 deletions LinkTools/Backends/PopularVendorsDatabase.swift

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion airport

This file was deleted.

5 changes: 4 additions & 1 deletion bin/vendors
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ result.push '}'

path = Pathname.new('LinkTools/Backends/PopularVendorsDatabase.swift')
puts "Writing to #{path}"

path.write result.join("\n")

path = Pathname.new('LinkLiar/oui.json')
puts "Writing to #{path}"
path.write Macs::Vendors.as_json.to_json
3 changes: 1 addition & 2 deletions lib/macs/vendor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def to_s

def to_swift_ouis
# E.g. `"ibm": ["IBM": [0x3440b5,0x40f2e9,0x98be94,0xa897dc]],`
%| // #{@name} #{prefixes.join(',')}| + "\n" +
%| "#{id}": ["#{name}": [#{prefixes.map { "0x#{_1.to_i(16).to_s(16).to_s.rjust(6, '0')}" }.join(',')}]],|
%| "#{id}": ["#{name}": [#{prefixes.map { "0x#{_1.to_i(16).to_s(16).to_s.rjust(6, '0')}" }.join(',')}]],|
end

def to_swift_counts
Expand Down
11 changes: 11 additions & 0 deletions lib/macs/vendors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,21 @@ def self.all
result.values.select(&:popular?).sort
end

def self.as_json
result = {}

rows do |row|
result[row.first] = row.last
end

result
end

# See https://mac2vendor.com/articles/download
def self.rows
URI.open('https://mac2vendor.com/download/vendorMacs.prop') do |file|
CSV.foreach(file, liberal_parsing: true, col_sep: '=') do |row|
next if row.first.start_with?('*')
yield row
end
end
Expand Down

0 comments on commit e31173c

Please sign in to comment.