-
Download
llocy.dylibfrom here or compile it yourself from sources (see thellocy.mmbelow). -
Move this
llocy.dylibto any place on your disk. I've placed in~/Library/Application Support/Tweetbot/llocy.dylibso I'm going to use this path in examples below. -
Close
Tweetbotif you haven't done it yet. -
Open
Terminal.app(/Application/Utilities/Terminal.app) and enter (or just copy-paste) this command (without$):$ DYLD_INSERT_LIBRARIES="~/Library/Application Support/Tweetbot/llocy.dylib" open -a Tweetbot --args 56.885752 -109.294739There you must change the path for
llocy.dylibto your own, then replace56.885752and-109.294739to your own latitude and longitude respectively. -
Done! Try to compose a new tweet now (^^,)
Last active
December 12, 2015 06:49
-
-
Save ericbroska/4731661 to your computer and use it in GitHub Desktop.
«Easy hack» #2: fake geolocating for Tweetbot (OS X).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * clang -dynamiclib -framework CoreLocation -framework Foundation -o llocy.dylib llocy.mm | |
| * $ DYLD_INSERT_LIBRARIES=/path/to/llocy.dylib open -a Tweetbot --args {LATITUDE_HERE} {LONGITUDE_HERE} | |
| * | |
| * Distributed under WTFPL License — http://www.wtfpl.net/about/ | |
| */ | |
| #import <Foundation/Foundation.h> | |
| #import <CoreLocation/CoreLocation.h> | |
| #include <objc/runtime.h> | |
| static CLLocationCoordinate2D _c00rdinate = {0}; | |
| static int _l0aded = 0; | |
| @interface CLLocation (LLocy) | |
| - (CLLocationCoordinate2D)__coordinate; | |
| @end | |
| @implementation CLLocation (LLocy) | |
| + (void)load | |
| { | |
| method_exchangeImplementations(class_getInstanceMethod(self, @selector(coordinate)), | |
| class_getInstanceMethod(self, @selector(__coordinate))); | |
| } | |
| - (CLLocationCoordinate2D)__coordinate | |
| { | |
| if (0 == _l0aded) { | |
| if ([[[[NSProcessInfo processInfo] arguments] objectAtIndex: 1] hasPrefix: @"-psn"]) { | |
| /* | |
| * Use the original `-coordinate` method. | |
| */ | |
| return [self __coordinate]; | |
| } | |
| NSUInteger argc = [[[NSProcessInfo processInfo] arguments] count]; | |
| NSArray *args = [[NSProcessInfo processInfo] arguments]; | |
| if (argc > 1) { | |
| _c00rdinate.latitude = [[args objectAtIndex: 1] doubleValue] ?: _c00rdinate.latitude; | |
| } | |
| if (argc > 2) { | |
| _c00rdinate.longitude = [[args objectAtIndex: 2] doubleValue] ?: _c00rdinate.longitude; | |
| } | |
| ++_l0aded; | |
| } | |
| return _c00rdinate; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment