- HoRNDIS: драйвер USB-модема для Mac OS X
- Загрузка и установка HoRNDIS
- Примечание для 32-разрядных машин
- Примечания к различным версиям Mac OS X
- Удаление HoRNDIS
- Получение и создание источника
- Благодарности
- Поддержка и контакты
- Horndis для mac os big sur
- HoRNDIS: USB tethering driver for Mac OS X
- HoRNDIS: USB tethering driver for Mac OS X
- Downloading and installing HoRNDIS
- Available versions
- A special note about 32-bit machines
- Notes about specific Mac OS X versions
- Uninstalling
- Getting and building the source
- Acknowledgements
- Support and contact
HoRNDIS: драйвер USB-модема для Mac OS X
HoRNDIS (произносится: «хоррендус») — это драйвер для Mac OS X, который позволяет вам использовать usb тетеринг на Android-устройстве для получения доступа в Интернет. Он работает с Mac OS X версии 10.6.8 (Snow Leopard) — 10.12 и протестирован на большом количестве телефонов. Вы должны быть осторожны со всеми драйверами, которые устанавливаете на компьютер; тем не менее, HoRNDIS тщательно протестирован. Поэтому вы можете полноценно работать с ним на персональных компьютерах.
HoRNDIS реализуется как kext, а не как программа пользовательского пространства, которая открывает устройство TAP или TUN; Это означает, что HoRNDIS не конфликтует с другими kext-файлами TAP / TUN, которые вы, возможно, установили (например, OpenVPN, Tunnelblick или Cisco VPN). Драйвер реализует проприетарный протокол Microsoft RNDIS, который является единственным протоколом, поддерживаемым встроенными устройствами Android; хотя пользователи Linux и Windows уже несколько лет пользуются родными драйверами RNDIS, Mac OS X поддерживает только устройства CDC Ethernet)
Главным преимуществом HoRNDIS над другими модемами является то, что он использует первоклассную поддерживаемую функцию в прошивке телефона. Другие решения принимают либо стек Wi-Fi телефона без знания операционной системы Android, либо создают IP-стек эмуляции в пользовательском пространстве на телефоне; Во многих случаях встроенная поддержка USB-модема может быть более стабильной, надежной и быстрой.
Загрузка и установка HoRNDIS
HoRNDIS доступен в исходном коде со страницы проекта на GitHub и в двоичной форме на этом сайте. Для быстрого запуска:
- Загрузите последний бинарный пакет и откройте его в папке «Загрузки». Следуйте инструкциям в программе установки.
- Если установка будет продолжена без ошибок, по ее завершению подключите свой телефон к Mac по USB.
- Войдите в меню настроек на телефоне.
- В разделе соединений ниже Wi-Fi и Bluetooth выберите «Ещё . ».
- Выберите «Тетеринг и точки доступа.
- Установите флажок «USB-модем». Он должен мигать один раз, а затем полностью проверяться. В некоторых версиях OS X может появиться диалоговое окно с предложением настроить устройство; Следуйте его инструкциям. Чтобы убедиться, что устройство подключено, запустите программу «Системные настройки» и выберите «Сеть»; Вы должны увидеть свой телефон в поле слева. Если повезет, вы сможете отключить Wi-Fi на своем Mac и просматривать Интернет через сетевое подключение вашего телефона.
Примечание для 32-разрядных машин
В предыдущих версиях HoRNDIS требовалось 64-битное ядро. Если при установке HoRNDIS вы получите сообщение об ошибке поддержки 64-битной версии, попробуйте еще раз с пакетом версии 3 (или новее).
Примечания к различным версиям Mac OS X
Mac OS X 10.9 (Mavericks) и 10.10 (Yosemite) поддерживаются HoRNDIS, но есть некоторые ошибки. Если вы обновили более раннюю версию OS X, то обнаружите, что телефоны реплицируются в вашей панели управления сетью.
Один из способов обхода — очистка файлов конфигурации сети. Сделайте резервную копию /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist и /Library/Preferences/SystemConfiguration/preferences.plist, а затем переместите или удалите их. (Обратите внимание, что это приведет к удалению пользовательской конфигурации сети). Я до сих пор не знаю, что вызывает эту проблему, и поэтому у меня нет более «красивого» обходного пути.
В версии Mac OS X 10.11 (и выше) перезаписан USB-стек, в нем больше проблем с совместимостью, чем 10.10 и ниже. К сожалению, Apple не опубликовала документацию для интерфейсов USB нового типа, представленных в 10.11, поэтому HoRNDIS использует только USB-интерфейсы, доступные в Mac OS 10.10 и ниже. Таким образом, в новейших версиях OS X могут возникнуть трудности с подключением определенных устройств.
Удаление HoRNDIS
Если по какой-то причине вам нужно удалить HoRNDIS, вы можете просто перетащить расширение в корзину. В Finder перейдите в меню «Перейти» и выберите «Перейти в папку . »; В этом случае введите /System/Library/Extensions. Найдите «HoRNDIS.kext» и перетащите его в Корзину. При появлении запроса введите пароль. Сделайте то же самое для «HoRNDIS.kext», который также находится в /Library/Extensions. Затем перезагрузите Mac, чтобы убедиться, что он выгружен.
Получение и создание источника
Источник доступен на GitHub; Он лицензируется в соответствии с GNU General Purpose License, версия 3. Для сборки исходного кода вам понадобится Xcode 4.0+; Для создания версии, которая будет работать под управлением Snow Leopard, вам также понадобится установленный Snow Leopard SDK. К сожалению, SDK Snow Leopard трудно найти; Вам нужно будет найти его где-нибудь в Интернете и вручную установить в папку Xcode SDK. (Для большинства приложений все в порядке, чтобы создать новый SDK, а для модуля ядра волшебные трюки с виртуальными виртуальными таблицами требуют компиляции против самого низкого общего знаменателя.)
Простого запуска xcodebuild в каталоге checkout должно быть достаточно для сборки kext. Если вы хотите упаковать пакет, вы можете запустить make, чтобы собрать пакет в каталоге build/ (хотя, пожалуйста, не публикуйте выпущенные версии, как если бы они были официальными!).
Благодарности
На плечах гигантов я стою. Мое спасибо Apple за то, что у меня есть хотя бы некоторый образец кода IOKit (хотя последний раз, когда он был успешно построен, был 10.2.x); Это было достойное начало, чтобы понять, как я могу это структурировать. Существенное спасибо David Brownell, который написал драйвер rndishost для Linux; Некоторые части HoRNDIS были перенесены из этой работы. Дэвид Браундел также написал драйвер frndis, который позволяет устройствам Android / Linux вести себя как устройства RNDIS; Чтение этого источника помогло понять, почему HoRNDIS не работал на ранних стадиях. (К сожалению, Дэвид Браунелл скончался в апреле 2011 года. Спасибо за всю вашу напряженную работу, Дэвид, дайте вам покой.)
Спасибо также тем, кто помог протестировать HoRNDIS до того, как я ее выпустил, а также всех других людей со времен проекта unrEVOked, без которых я, скорее всего, не был бы вовлечен в разработку Android.
Поддержка и контакты
После трехлетнего срока пребывания в должности, я ищу нового помощника для HoRNDIS. У меня больше нет времени, чтобы содержать HoRNDIS на должном уровне. Если вы считаете, что у вас есть навыки, необходимые для сопровождения этого программного обеспечения, сообщите мне об этом.
Будучи свободным программным обеспечением, HoRNDIS поставляется без гарантии. (Более подробно об этом читайте в лицензии). Тем не менее, я надеюсь, что это вам поможет; Если это не так, и вы можете помочь в отладке, я бы хотел услышать от вас.
Для обратной связи, пожалуйста, свяжитесь со мной!
Источник
Horndis для mac os big sur
HoRNDIS(the USB tethering driver for Mac OS X)
HoRNDIS (pronounce: «horrendous») is a driver for Mac OS X that allows you to use your Android phone’s native USB tethering mode to get Internet access.
- Get the installation package (Download or Build the installation package from source yourself)
- Run the installation package
- Assuming that the installation proceeds without errors, after it completes, connect your phone to your Mac by USB.
- Enter the settings menu on your phone.
- In the connections section, below Wi-Fi and Bluetooth:
- Select «More. «
- Select «Tethering & portable hotspot»
- Check the «USB tethering» box. It should flash once, and then become solidly checked.
- Delete the HoRNDIS.kext under /System/Library/Extensions and /Library/Extensions folder
- Restart your computer
Building the source
- git clone the repository
- Simply running xcodebuild in the checkout directory should be sufficient to build the kext.
- If you wish to package it up, you can run make to assemble the package in the build/ directory
Debugging and Development Notes
This sections contains tips and tricks for developing and debugging the driver.
USB Device Information
Mac OS System Menu -> About This Mac -> System Report —> Hardware/USB
Lists all USB devices that OS recognizes. Unfortunately, it does not give USB descriptors.
lsusb -v
It prints USB configuration, such as interface and endpoint descriptors. You can print it for all devices or limit the output to specific ones. In order to run this command, you need to install usbutils.
- Homebrew users: brew install mikhailai/misc/usbutils
Please do not install lsusb package from Homebrew Core, it’s a different utility with the same name. - Macports users: sudo port install usbutils
ioreg -l -r -c IOUSBHostDevice
This command lists all the Mac OS IO Registry information under all USB devices. Unlike lsusb, ioreg tells how Mac OS recognized USB devices and interfaces, and how it matched drivers to these interfaces. The -r -c IOUSBHostDevice limits the output to USB devices; to get complete OS registry, please run ioreg -l .
The LOG(. ) statements, sprinkled throughout the HoRNDIS code, call the IOLog functions. On Mac OS El Capitan (10.11) and earlier, the log messages go into /var/log/system.log . Starting from Sierra (10.12), these messages are no longer written to system.log and instead can be viewed via:
- GUI, using Console application, located in Utilities folder. You need to enter process:kernel in the search box in order to filter the relevant messages.
- Command Line, using the log command. For example:
log show —predicate process==\»kernel\» —start «2018-12-11 22:54:00»
The start value needs to be several minutes in the past, so it would not flood the console. Here is a convenient command that prints the messages from the past 3 mintes:
log show —predicate process==\»kernel\» —start «$(date -v-3M +’%F %T’)»
I’ve observed that Mac OS logging is unreliable (especially in Sierra). In some cases, the messages may come out garbled (looking like bad multi-threaded code). In other cases, either GUI or Command Line may be missing messages that were emitted. Sometimes, reloading the driver may fix the problem.
Источник
HoRNDIS: USB tethering driver for Mac OS X
HoRNDIS: USB tethering driver for Mac OS X
HoRNDIS is now maintained by Mikhail Iakhiaev, and this page is in a state of transition – keep your eyes peeled for updates soon .
HoRNDIS (pronounce: “horrendous”) is a driver for Mac OS X that allows you to use your Android phone’s native USB tethering mode to get Internet access. It is known to work with Mac OS X versions 10.6.8 (Snow Leopard) through 10.14 (Mojave – see notes below), and has been tested on a wide variety of phones. Although you should be careful with all drivers that you install on your computer, HoRNDIS has been tested at least well enough for the author (and many others) to run full time on their own personal computers.
HoRNDIS is implemented as a kext , rather than as a user-space program that opens a TAP or TUN device; this means that it does not conflict with other TAP/TUN kexts that you might have installed (like OpenVPN, Tunnelblick, or Cisco VPN). The driver implements Microsoft’s proprietary RNDIS protocol, which is the only protocol supported natively by Android devices; although Linux and Windows users have enjoyed native RNDIS drivers for years, Mac OS X supports only CDC Ethernet devices out of the box. 1)
The chief advantage of HoRNDIS over other tethering solutions is that it uses the a first-class supported feature in the phone’s firmware. Other solutions either take over the phone’s Wi-Fi stack without the Android operating system’s knowledge, or create an emulation IP stack in userspace on the phone; in many cases, the built-in USB tethering support can be more stable, more reliable, and faster. 2)
This page is also available in Russian: HoRNDIS: драйвер USB-модема для Mac OS X. My thanks to Vlad Brown for his effort in translation!
Downloading and installing HoRNDIS
HoRNDIS is available in source form from its project page on GitHub, and in binary form on this site. For quick start instructions:
On some versions of OS X, a dialog box may pop up, prompting you to configure the device; follow its instructions. To verify that the device is connected, start the System Preferences program, and select “Network”; you should see your phone appear in the box at left. With any luck, you should be able to turn off Wi-Fi on your Mac, and browse the Internet through your phone’s network connection.
Available versions
A special note about 32-bit machines
In previous versions, HoRNDIS required a 64-bit kernel. If you get an error message about 64-bit support on installing HoRNDIS, please try again with the version 3 package (or newer).
Notes about specific Mac OS X versions
OS X 10.9 (Mavericks) and 10.10 (Yosemite) are supported by HoRNDIS, but there are some gotchas. If you upgraded from an earlier version of OS X, you may find that phones appear to be replicating with abandon in your network control panel. If this happens to you, one somewhat heavy-handed workaround is to clean your network configuration files – take a backup of /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist and /Library/Preferences/SystemConfiguration/preferences.plist , and then either move them out of the way or delete them. (Note that this will remove any custom network configuration that you have performed!) I am still not sure what causes this problem, and so I do not yet have a workaround with finer granularity.
Versions of Mac OS X 10.11 and newer have a rewritten USB stack that is substantially less compatible than that in 10.10 and below. HoRNDIS 9.0 has been rewritten to support MacOS 10.11 and above (El Capitan, Sierra, High Sierra, and Mojave); for those versions of MacOS, please try the latest version of HoRNDIS! The latest version of HoRNDIS that supports older versions of MacOS (Yosemite and below) is HoRNDIS rel8.
Uninstalling
If, for some reason, you need to uninstall HoRNDIS, you can simply drag the extension to the trash. In the Finder, go to the “Go” menu, and select “Go to folder. ”; in that, type ”/System/Library/Extensions”. Find “HoRNDIS.kext ”, and drag it to the trash. When prompted, type your password. Do the same for the “HoRNDIS.kext ” that lives in ”/Library/Extensions”, as well. Then, restart your Mac to be sure it is unloaded.
Getting and building the source
(Fork me on GitHub!) The source is available on GitHub; it is licensed under the GNU General Purpose License, version 3. To build the source, you’ll need Xcode 4.0+ installed; to build a version that will work under Snow Leopard, you will also need the Snow Leopard SDK installed. Unfortunately, the Snow Leopard SDK is hard to come by nowadays; you’ll need to find it somewhere on the web, and manually install it into your Xcode SDKs folder. (For most applications, it’s OK to build against a newer SDK; for a kernel module, the magic vtable space-saving tricks require you to compile against the lowest common denominator.)
Acknowledgements
On the shoulders of giants, I stand. My vague thanks to Apple for having at least some IOKit sample code available (even though the last time it successfully built was 10.2.x); it was a decent start reading to understand how I might want to structure this. Substantial thanks to David Brownell, who wrote the rndis_host driver for Linux; some portions of HoRNDIS were ported over from that work. David Brownell also wrote the f_rndis driver that allows Android/Linux devices to behave like RNDIS devices; reading that source helped to understand why HoRNDIS wasn’t working in the early stages. (Sadly, David Brownell passed away in April of 2011. Thanks for all of your hard work, David; may you rest in peace.)
Thanks also to those who helped test HoRNDIS before I released it, as well as all of the other folks from the days of the unrEVOked project, without whom I would likely not be involved in Android development at all.
Finally, thanks to Mikhail Iakhiaev, who is the current maintainer of HoRNDIS, and who did the hard work of porting HoRNDIS to the new USB APIs in the latest versions of MacOS.
Support and contact
Being free software, HoRNDIS comes with no warranty (not even a guarantee that it won’t break your phone or computer! But I’m pretty sure it won’t.), express or implied. (For more on that, read the license.) However, I hope that it works for you; if it doesn’t, and you’re able to assist in debugging, I’d like to hear from you.
So, for feedback, feel free to get in touch with me, or HoRNDIS’s current maintainer, Mikhail Iakhiaev; especially if it works for you, or makes your life easier, I’d like to hear about it!
Источник