halo / LinkLiar

:link: Link-Layer MAC spoofing GUI for macOS
http://halo.github.io/LinkLiar
MIT License
1.23k stars 84 forks source link

Support 10.8 #22

Closed 1-61803 closed 8 years ago

1-61803 commented 8 years ago

…or even older systems.

halo commented 8 years ago

Hi! Thank you for your thoughts. Technically, right now, I could do that (it's just a matter of changing the build target version I guess), but I'm planning to migrate LinkLiar from Objective-C to swift and that requires at least 10.9.

Migrating to swift would greatly increase maintainability and testing. So that's almost a must.

If I would compile it for older versions once, I would not be able to backport bugfixes and new features to the older versions.

1-61803 commented 8 years ago

If you compile it at least once for older systems then the application will be usable from the menu bar instead of the prefpane. I think this type of application could serve back as far as 10.6, or even older systems. And reach a broader (and older :) public.

halo commented 8 years ago

Mind giving it a try?

https://github.com/halo/LinkLiar/releases/tag/1.1.3

Unfortunately I cannot go further back, because I'm using XPC to talk to the HelperTool.

1-61803 commented 8 years ago

Crashed


Process:         Link [1610]
Path:            /Users/USER/Desktop/LinkLiar.app/Contents/MacOS/Link
Identifier:      com.funkensturm.Link
Version:         1.0 (1.1.2)
Code Type:       X86-64 (Native)
Parent Process:  launchd [234]
User ID:         501

Date/Time:       2016-03-01 22:06:32.164 +0100
OS Version:      Mac OS X 10.8.5 (12F2560)
Report Version:  10

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSStatusItem button]: unrecognized selector sent to instance 0x7fa64ac17bb0'
terminate called throwing an exception
abort() called

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff8f8c0b06 __exceptionPreprocess + 198
1   libobjc.A.dylib                     0x00007fff865753f0 objc_exception_throw + 43
2   CoreFoundation                      0x00007fff8f95740a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3   CoreFoundation                      0x00007fff8f8af02e ___forwarding___ + 414
4   CoreFoundation                      0x00007fff8f8aee18 _CF_forwarding_prep_0 + 232
5   Link                                0x0000000109bbe3c4 Link + 33732
6   Link                                0x0000000109bbd15d Link + 29021
7   CoreFoundation                      0x00007fff8f8b88e9 -[NSSet makeObjectsPerformSelector:] + 201
8   AppKit                              0x00007fff84fb4136 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1168
9   AppKit                              0x00007fff84f9311d loadNib + 317
10  AppKit                              0x00007fff84f92649 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 219
11  AppKit                              0x00007fff84f9247e -[NSBundle(NSNibLoading) loadNibNamed:owner:topLevelObjects:] + 200
12  AppKit                              0x00007fff84f9225e +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 360
13  AppKit                              0x00007fff84f8e9ff NSApplicationMain + 398
14  libdyld.dylib                       0x00007fff88efd7e1 start + 0

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8423a212 __pthread_kill + 10
1   libsystem_c.dylib               0x00007fff88f7db24 pthread_kill + 90
2   libsystem_c.dylib               0x00007fff88fc1f61 abort + 143
3   libc++abi.dylib                 0x00007fff85d719eb abort_message + 257
4   libc++abi.dylib                 0x00007fff85d6f39a default_terminate() + 28
5   libobjc.A.dylib                 0x00007fff86575873 _objc_terminate() + 91
6   libc++abi.dylib                 0x00007fff85d6f3c9 safe_handler_caller(void (*)()) + 8
7   libc++abi.dylib                 0x00007fff85d6f424 std::terminate() + 16
8   libc++abi.dylib                 0x00007fff85d7058b __cxa_throw + 111
9   libobjc.A.dylib                 0x00007fff8657550c objc_exception_throw + 327
10  com.apple.CoreFoundation        0x00007fff8f95740a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
11  com.apple.CoreFoundation        0x00007fff8f8af02e ___forwarding___ + 414
12  com.apple.CoreFoundation        0x00007fff8f8aee18 _CF_forwarding_prep_0 + 232
13  com.funkensturm.Link            0x0000000109bbe3c4 0x109bb6000 + 33732
14  com.funkensturm.Link            0x0000000109bbd15d 0x109bb6000 + 29021
15  com.apple.CoreFoundation        0x00007fff8f8b88e9 -[NSSet makeObjectsPerformSelector:] + 201
16  com.apple.AppKit                0x00007fff84fb4136 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1168
17  com.apple.AppKit                0x00007fff84f9311d loadNib + 317
18  com.apple.AppKit                0x00007fff84f92649 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 219
19  com.apple.AppKit                0x00007fff84f9247e -[NSBundle(NSNibLoading) loadNibNamed:owner:topLevelObjects:] + 200
20  com.apple.AppKit                0x00007fff84f9225e +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 360
21  com.apple.AppKit                0x00007fff84f8e9ff NSApplicationMain + 398
22  libdyld.dylib                   0x00007fff88efd7e1 start + 1
halo commented 8 years ago

Yep, NSStatusItem was changed in Yosemite... :/ I think I remember now. that was the reason why I didn't try 10.8 before...

1-61803 commented 8 years ago

Are you willing to give it a try? Don't let Yosemite's ugly interface let us down :]

halo commented 8 years ago

Since I'm planning on moving over to Swift, I'm not going to maintain backwards compatibility. Sorry.

1-61803 commented 8 years ago

Would you mind giving a hint as to why it doesn't work and where to look at to eventually give the code a try? You mentioned in a previous post NSStatusItem.

halo commented 8 years ago

Basically you open the project in Xcode on OS X 10.8. I think it should open it. And if it does, you try the "Play" button in the top to compile and run LinkLiar. It will probably not compile, but it will give you detailed warnings about which line is problematic.

If I am not mistaken, the problem should be with one of these lines. The way a NSStatusItem is instantiated has changed over time.

halo commented 8 years ago

In fact, your stack trace from above already says it:

*\ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSStatusItem button]: unrecognized selector sent to instance 0x7fa64ac17bb0'

So the line where the button is called on the status bar is problematic. There is no such method on the NsStatusItem any longer. You could start with simply deleting those lines.

1-61803 commented 8 years ago

I commented those and other lines you mentioned above that were giving an error, but the resulting application of course won't work. NsStatusItem should have an equivalent on 10.8. If you could give it a last shot before moving to Swift ML users would be grateful.