Skip to content

Commit

Permalink
Fix regex matching for MacBookPro10,1
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z committed Oct 28, 2019
1 parent 59b7040 commit 3f3aa8a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,6 @@
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "44F969A8-7554-4827-854A-665495271EBC"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "free-sidecar/utils.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "129"
endingLineNumber = "129"
landmarkName = "dostuff2(sidecarCore:)"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "2EB77558-C8E6-4C9D-8D67-53C9B54B3AEA"
shouldBeEnabled = "No"
ignoreCount = "0"
condition = "[UInt8](Data(hex: modelHex))[0] &amp; 0xC0 != 0"
continueAfterRunningActions = "No"
filePath = "free-sidecar/utils.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "125"
endingLineNumber = "125"
landmarkName = "dostuff2(sidecarCore:)"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
Expand Down Expand Up @@ -85,21 +52,5 @@
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "0539A45D-F2EB-420C-9498-E2DD01307A1A"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "free-sidecar/utils.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "110"
endingLineNumber = "110"
landmarkName = "dostuff2(sidecarCore:)"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
4 changes: 2 additions & 2 deletions free-sidecar/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>2</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion free-sidecar/utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func dostuff2(sidecarCore: URL) -> [Model] {
let hexStr = contents.hexEncodedString(options: [.upperCase])

let devicesStr = devices.map{ hexDict[$0]! }.joined(separator: "|")
let matched = hexStr.match(pattern: "(\(devicesStr))([^(\(hexDict[" "]!))]+)\(hexDict[","]!)([^(\(hexDict[" "]!))]+)\(hexDict[" "]!)")
let matched = hexStr.match(pattern: "(\(devicesStr))((?:(?!00)[0-9A-Z])+)\(hexDict[","]!)((?:(?!00)[0-9A-Z])+)\(hexDict[" "]!)")

let models = matched.map({ res -> Model in
let hex = res[0].matchedStr
Expand Down

0 comments on commit 3f3aa8a

Please sign in to comment.