From 879dad62e8180204cb2075fcf87b33de176f8fc0 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Sun, 31 Aug 2014 01:11:08 -0700 Subject: [PATCH] Add a Makefile. Transition to new package system. Add support for code-signing (but still no authorization to sign the kext, so we'll have to wait until Apple reads their e-mail before that warning will go away.) --- HoRNDIS-Info.plist | 4 +-- HoRNDIS.xcodeproj/project.pbxproj | 6 +++-- Makefile | 41 +++++++++++++++++++++++++++++++ package/Distribution.xml | 19 ++++++++++++++ package/resources/intro-text.rtf | 22 +++++++++++++++++ package/resources/post-readme.rtf | 26 ++++++++++++++++++++ 6 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 Makefile create mode 100644 package/Distribution.xml create mode 100644 package/resources/intro-text.rtf create mode 100644 package/resources/post-readme.rtf diff --git a/HoRNDIS-Info.plist b/HoRNDIS-Info.plist index 350e3a2..546e90f 100644 --- a/HoRNDIS-Info.plist +++ b/HoRNDIS-Info.plist @@ -19,11 +19,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.0 + 6 CFBundleSignature ???? CFBundleVersion - 1.0.0d1 + 6 IOKitPersonalities HoRNDISComposite_SGS2 diff --git a/HoRNDIS.xcodeproj/project.pbxproj b/HoRNDIS.xcodeproj/project.pbxproj index 042a319..7d35311 100644 --- a/HoRNDIS.xcodeproj/project.pbxproj +++ b/HoRNDIS.xcodeproj/project.pbxproj @@ -243,6 +243,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1.0.0d1; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -251,7 +252,7 @@ INFOPLIST_FILE = "HoRNDIS-Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.6; MODULE_NAME = com.joshuawise.HoRNDIS; - MODULE_VERSION = 1.0.0d1; + MODULE_VERSION = 6; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx10.6; WRAPPER_EXTENSION = kext; @@ -262,6 +263,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1.0.0d1; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -270,7 +272,7 @@ INFOPLIST_FILE = "HoRNDIS-Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.6; MODULE_NAME = com.joshuawise.HoRNDIS; - MODULE_VERSION = 1.0.0d1; + MODULE_VERSION = 6; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx10.6; WRAPPER_EXTENSION = kext; diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d774653 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +# You may not be able to build with a modern Xcode, since we still support 10.6. +# So, if we have Xcode 4.6 around, we should use it. + +XCODEBUILD ?= /Applications/Xcode46-DP4.app/Contents/Developer/usr/bin/xcodebuild + +# Ok, no joy there? +ifeq (,$(wildcard $(XCODEBUILD))) + XCODEBUILD = xcodebuild +endif + +# Should we sign? Hack hack. Oh well. +ifeq (joshua,$(USER)) + CODESIGN_KEXT ?= "Developer ID Application: Joshua Wise (54GTJ2AU36)" + CODESIGN_INST ?= "Developer ID Installer: Joshua Wise (54GTJ2AU36)" +endif + +all: build/Release/HoRNDIS.kext build/signed/HoRNDIS.kext + +build/Release/HoRNDIS.kext: HoRNDIS.cpp HoRNDIS.h HoRNDIS-Info.plist HoRNDIS.xcodeproj HoRNDIS.xcodeproj/project.pbxproj + $(XCODEBUILD) + +build/HoRNDIS-kext.pkg: build/Release/HoRNDIS.kext + pkgbuild --component $< --install-location /System/Library/Extensions/ $@ + +build/HoRNDIS.pkg: build/HoRNDIS-kext.pkg package/Distribution.xml + productbuild --distribution package/Distribution.xml --package-path build --resources package/resources $(if $(CODESIGN_INST),--sign $(CODESIGN_INST)) build/HoRNDIS.pkg + +ifeq (,$(CODESIGN_KEXT)) + +build/signed/%: build/Release/% + @echo not building $@ because we have no key to sign with + +else + +build/signed/%: build/Release/% + rm -rf $@ + mkdir -p build/signed + cp -R $< $@ + codesign --force -s $(CODESIGN_KEXT) $@ + +endif \ No newline at end of file diff --git a/package/Distribution.xml b/package/Distribution.xml new file mode 100644 index 0000000..7816b44 --- /dev/null +++ b/package/Distribution.xml @@ -0,0 +1,19 @@ + + + HoRNDIS + + + + + + + + + + + + + + + HoRNDIS-kext.pkg + \ No newline at end of file diff --git a/package/resources/intro-text.rtf b/package/resources/intro-text.rtf new file mode 100644 index 0000000..a7ef1d0 --- /dev/null +++ b/package/resources/intro-text.rtf @@ -0,0 +1,22 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;} +{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural + +\f0\b\fs26 \cf0 HoRNDIS +\b0 is a kernel extension ("kext") that makes it possible to use your Android phone's built-in USB tethering support on your Mac OS X system. In order to use it, you will need:\ +\ +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural +\ls1\ilvl0\cf0 {\listtext \'95 }a Mac running OS X 10.6 or later (i.e., Snow Leopard, Lion, or Mountain Lion);\ +{\listtext \'95 }an Android phone that supports USB tethering natively;\ +{\listtext \'95 }and for the USB tethering feature on your phone to be enabled (either by your carrier, or through third-party firmware).\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\cf0 \ +For support, please visit {\field{\*\fldinst{HYPERLINK "http://www.joshuawise.com/horndis"}}{\fldrslt http://www.joshuawise.com/horndis}}.\ +\ +You will be guided through the steps necessary to install +\b HoRNDIS +\b0 on your Mac.} \ No newline at end of file diff --git a/package/resources/post-readme.rtf b/package/resources/post-readme.rtf new file mode 100644 index 0000000..5de81c6 --- /dev/null +++ b/package/resources/post-readme.rtf @@ -0,0 +1,26 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;} +{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural + +\f0\b\fs26 \cf0 HoRNDIS +\b0 installation is complete. Depending on your version of OS X, you may need to restart your Mac for the driver to be loaded.\ +\ +To get started using +\b HoRNDIS +\b0 , you will need to enable tethering on your phone. To do so:\ +\pard\tx220\tx687\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li658\fi-659\pardirnatural +\ls1\ilvl0\cf0 {\listtext \'95 }Connect your phone to your computer.\ +{\listtext \'95 }Enter the settings menu on your phone, and select 'More...', below 'Wi-Fi' and 'Bluetooth'.\ +{\listtext \'95 }Select 'Hotspot settings'.\ +{\listtext \'95 }Check the 'USB tethering' box.\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\cf0 (These instructions were developed on a Galaxy Nexus running Android 4.1; exact steps on your phone may vary.)\ +\ +Your Mac should subsequently detect the device, and connect to the Internet.\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +\cf0 For further support, please visit {\field{\*\fldinst{HYPERLINK "http://www.joshuawise.com/horndis"}}{\fldrslt http://www.joshuawise.com/horndis}}.} \ No newline at end of file