mirror of
https://github.com/smittix/intercept.git
synced 2026-05-27 18:24:46 -07:00
Merge pull request #29 from kittyhutchinson/main
Macos compatibility fix
This commit is contained in:
@@ -81,11 +81,20 @@ def detect_rtlsdr_devices() -> list[SDRDevice]:
|
|||||||
return devices
|
return devices
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
env = os.environ.copy()
|
||||||
|
|
||||||
|
if platform.system() == 'Darwin':
|
||||||
|
lib_paths = ['/usr/local/lib', '/opt/homebrew/lib']
|
||||||
|
current_ld = env.get('DYLD_LIBRARY_PATH', '')
|
||||||
|
env['DYLD_LIBRARY_PATH'] = ':'.join(lib_paths + [current_ld] if current_ld else lib_paths)
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['rtl_test', '-t'],
|
['rtl_test', '-t'],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
timeout=5
|
timeout=5,
|
||||||
|
env=env
|
||||||
)
|
)
|
||||||
output = result.stderr + result.stdout
|
output = result.stderr + result.stdout
|
||||||
|
|
||||||
@@ -306,3 +315,5 @@ def detect_all_devices() -> list[SDRDevice]:
|
|||||||
logger.debug(f" {d.sdr_type.value}:{d.index} - {d.name} (serial: {d.serial})")
|
logger.debug(f" {d.sdr_type.value}:{d.index} - {d.name} (serial: {d.serial})")
|
||||||
|
|
||||||
return devices
|
return devices
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user