interceptor-sdk 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/docs/API.md +1 -1
- data/examples/info.rb +2 -2
- data/lib/{interceptor.rb → interceptor_sdk.rb} +3 -3
- data/test/protocol.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d219cae52ce846c3283baf996d66c28d1fad81f0dc12bdd429e374cf2207e684
|
|
4
|
+
data.tar.gz: 5e14fc3b9061c2f0d07f3496fbe8516062dc91737cb51d4b0b156b8e91c2255f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8c1f1d60c1179509ca5a27dc229f243caaf1dbe0cff2f1627496b9d4fdc16ca33e095388a0723b18ea83bb35951370c9261d9db9d35aab6c43ed640b6cce13f
|
|
7
|
+
data.tar.gz: 7c1e7d05755d7c7cbb9515bb9ab693eb8697538611fe2206415008948f02fe9060100b5f5b0b6e5771dfb1ec7cf2b774ce55306b22c2c3cba43c638d5c6ee732
|
data/README.md
CHANGED
|
@@ -5,10 +5,14 @@
|
|
|
5
5
|
Requires Ruby 3.1+ on Windows x64. Direct Fiddle bindings to this product's native SDK, with no Python dependency. Supported families: keyboard, mouse, hid, xinput, xinputhid, gip. Driver and original licensing requirements remain unchanged.
|
|
6
6
|
|
|
7
7
|
```ruby
|
|
8
|
-
require '
|
|
9
|
-
|
|
8
|
+
require 'interceptor_sdk'
|
|
9
|
+
InterceptorSDK::Interceptor.open do |client|
|
|
10
10
|
p client.info
|
|
11
11
|
end
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
The block form closes the native session even on an exception. Importing/constructing the SDK does not install a driver or start capture. See [API documentation](docs/API.md).
|
|
15
|
+
|
|
16
|
+
## Version 2 namespace
|
|
17
|
+
|
|
18
|
+
Use `require 'interceptor_sdk'` and `InterceptorSDK::Interceptor`. Version 1 used the generic `interceptor` require/module name, which can conflict with unrelated gems. Version 1 artifacts remain unchanged; version 2 deliberately uses an isolated namespace.
|
data/docs/API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interceptor Ruby API
|
|
2
2
|
|
|
3
|
-
`
|
|
3
|
+
`InterceptorSDK::Interceptor.open(library_path: nil) { |client| ... }`; or construct explicitly and call `close`. `initialize_devices`, `info`, `devices`, `receive(timeout: nil)`, `send(batch)`, `discard(batch)`, `cancel`, `descriptor(token, report: false)`, `inject(kind, state = {}, token: nil, report: nil)` expose the native C ABI.
|
|
4
4
|
|
|
5
5
|
Edit input fields through `event.field(name).value` or the unambiguous descriptor metadata in `event.fields`; set `event.blocked = true` to drop an input. Do not resize reports/fields or reuse stale/foreign batches. Partial failures expose `NativeError#code` and `#accepted`; retry sends only the remaining inputs. Sequence/timestamp use Ruby integers preserving unsigned 64-bit values. Cancellation works from another Ruby thread.
|
|
6
6
|
|
data/examples/info.rb
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require '
|
|
2
|
-
|
|
1
|
+
require 'interceptor_sdk'
|
|
2
|
+
InterceptorSDK::Interceptor.open { |client| p client.info }
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
require 'fiddle'
|
|
3
3
|
require 'thread'
|
|
4
4
|
|
|
5
|
-
module
|
|
6
|
-
VERSION = '
|
|
5
|
+
module InterceptorSDK
|
|
6
|
+
VERSION = '2.0.0'
|
|
7
7
|
KINDS = ['', 'keyboard', 'mouse', 'hid', 'xinput', 'xinputhid', 'gip'].freeze
|
|
8
8
|
class NativeError < StandardError
|
|
9
9
|
attr_reader :code, :accepted
|
|
@@ -66,7 +66,7 @@ module Interceptor
|
|
|
66
66
|
class Interceptor
|
|
67
67
|
def initialize(library_path: nil)
|
|
68
68
|
raise LoadError, 'Interceptor requires Windows x64 Ruby' unless /mswin|mingw/ =~ RUBY_PLATFORM && Fiddle::SIZEOF_VOIDP == 8
|
|
69
|
-
path = library_path || ENV['
|
|
69
|
+
path = library_path || ENV['INTERCEPTOR_SDK_NATIVE_PATH'] || File.expand_path('../native/InterceptorBridge.dll', __dir__)
|
|
70
70
|
@native = Native.load(File.expand_path(path)); @mutex = Mutex.new; @session = 0; @current = nil
|
|
71
71
|
raise LoadError, 'Incompatible native ABI' unless @native.call(:version) == 1 && [120,64,24,40,776,56].each_with_index.all? { |size,index| @native.call(:sizeof,index+1) == size }
|
|
72
72
|
out = Native.buffer(8); checked(:open,out); @session = Native.u64(out,0)
|
data/test/protocol.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require '
|
|
1
|
+
require 'interceptor_sdk'
|
|
2
2
|
require 'fiddle'
|
|
3
|
-
sdk=
|
|
3
|
+
sdk=InterceptorSDK
|
|
4
4
|
fixture=ARGV.fetch(0)
|
|
5
5
|
mode=Fiddle::Function.new(Fiddle::Handle.new(fixture)['interceptor_test_mode'],[Fiddle::TYPE_INT],Fiddle::TYPE_VOID)
|
|
6
6
|
def check(value);raise 'Product Ruby SDK contract failed' unless value;end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: interceptor-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TitanCSA
|
|
@@ -39,7 +39,7 @@ files:
|
|
|
39
39
|
- README.md
|
|
40
40
|
- docs/API.md
|
|
41
41
|
- examples/info.rb
|
|
42
|
-
- lib/
|
|
42
|
+
- lib/interceptor_sdk.rb
|
|
43
43
|
- native/InterceptorBridge.dll
|
|
44
44
|
- test/protocol.rb
|
|
45
45
|
homepage: https://github.com/TitanCSA/Interceptor
|