├── Makefile
├── README.md
├── Tweak.xm
├── control
├── iOSWeChatFakeLocation.h
├── iOSWeChatFakeLocation.plist
└── images
├── 1.jpeg
├── 2.jpeg
├── 3.jpeg
├── 4.jpeg
└── 5.jpeg
/Makefile:
--------------------------------------------------------------------------------
1 | THEOS_DEVICE_IP = 192.168.1.110
2 | ARCH = arm64
3 | TARGET = iphone:9.3
4 |
5 | include /opt/theos/makefiles/common.mk
6 |
7 | TWEAK_NAME = iOSWeChatFakeLocation
8 | iOSWeChatFakeLocation_FILES = Tweak.xm
9 |
10 | include $(THEOS_MAKE_PATH)/tweak.mk
11 |
12 | after-install::
13 | install.exec "killall -9 WeChat"
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # iOSWeChatFakeLocation
2 | tweek插件,在微信中自定义用户当前所在的位置,从而查看附近的人。
3 |
4 | ### 1.实现界面
5 | 
6 | 
7 | 
8 | 
9 |
10 | ### 2.怎么安装
11 | #### 2.1 修改Makefile中的一些值
12 | * THEOS_DEVICE_IP: You JailBreak iOS device's ip, staying in the same wifi network with your mac
13 | * TARGET: iOS SDK version you use
14 |
15 | #### 2.2 安装
16 | ```
17 | make package install
18 | ```
19 |
20 | 作为一名iOS逆向工程师,我想你能很轻松的理解以上说明。
21 |
22 |
23 | # 作者熬夜开发不容易,如果您觉得插件不错,请给个star,🙏!!!
24 |
--------------------------------------------------------------------------------
/Tweak.xm:
--------------------------------------------------------------------------------
1 | #import "iOSWeChatFakeLocation.h"
2 | #import
3 |
4 | %hook SeePeopleNearByLogicController
5 | - (void)onRetrieveLocationOK:(CLLocation*)location
6 | {
7 | CGFloat lat = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PD_FAKE_LOCATION_LAT"] doubleValue];
8 | CGFloat lng = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PD_FAKE_LOCATION_LNG"] doubleValue];
9 | if (lat < 0.1 || lng < 0.1) {
10 | lat = 35.707013;
11 | lng = 139.730562;
12 | }
13 |
14 | location = [[CLLocation alloc] initWithLatitude:lat longitude:lng];
15 |
16 | %orig;
17 | }
18 | %end
19 |
20 | %hook NewSettingViewController
21 |
22 | - (void)reloadTableData {
23 | %orig;
24 |
25 | MMTableViewInfo *tableViewInfo = MSHookIvar(self, "m_tableViewInfo");
26 |
27 | MMTableViewSectionInfo *sectionInfo = [%c(MMTableViewSectionInfo) sectionInfoDefaut];
28 |
29 | MMTableViewCellInfo *fakeLocationCell = [%c(MMTableViewCellInfo) normalCellForSel:@selector(fakeLocation) target:self title:@"伪装定位" accessoryType:1];
30 | [sectionInfo addCell:fakeLocationCell];
31 |
32 | [tableViewInfo insertSection:sectionInfo At:0];
33 |
34 | MMTableView *tableView = [tableViewInfo getTableView];
35 | [tableView reloadData];
36 | }
37 |
38 | static MMPickLocationViewController* pickLocationViewController = nil;
39 |
40 | %new
41 | - (void)fakeLocation {
42 | pickLocationViewController = [[%c(MMPickLocationViewController) alloc] initWithScene:0 OnlyUseUserLocation:NO];
43 |
44 | pickLocationViewController.delegate = self;
45 |
46 | MMUINavigationController* nc = [[%c(MMUINavigationController) alloc] initWithRootViewController:pickLocationViewController];
47 |
48 | [self PresentModalViewController:nc animated:YES];
49 | }
50 |
51 | %new
52 | - (UIBarButtonItem *)onGetRightBarButton {
53 | return [[UIBarButtonItem alloc] initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(onSureSeletctedLocation)];
54 | }
55 |
56 | %new
57 | - (void)onCancelSeletctedLocation {
58 | if (pickLocationViewController) {
59 | [pickLocationViewController DismissMyselfAnimated:YES];
60 | [pickLocationViewController reportOnDone];
61 | }
62 | }
63 |
64 | %new
65 | - (void)onSureSeletctedLocation {
66 | if (pickLocationViewController) {
67 | [pickLocationViewController DismissMyselfAnimated:YES];
68 |
69 | POIInfo* poiItem = [pickLocationViewController getCurrentPOIInfo];
70 | [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:poiItem.coordinate.latitude] forKey:@"PD_FAKE_LOCATION_LAT"];
71 | [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:poiItem.coordinate.longitude] forKey:@"PD_FAKE_LOCATION_LNG"];
72 | [pickLocationViewController reportOnDone];
73 | }
74 | }
75 |
76 | %end
77 |
--------------------------------------------------------------------------------
/control:
--------------------------------------------------------------------------------
1 | Package: com.zcx.ioswechatfakelocation
2 | Name: iOSWeChatFakeLocation
3 | Depends: mobilesubstrate
4 | Version: 0.0.1
5 | Architecture: iphoneos-arm
6 | Description: An awesome MobileSubstrate tweak!
7 | Maintainer: zcx
8 | Author: zcx
9 | Section: Tweaks
10 |
--------------------------------------------------------------------------------
/iOSWeChatFakeLocation.h:
--------------------------------------------------------------------------------
1 |
2 | @interface MMTableView : UITableView
3 |
4 | @end
5 |
6 | @interface MMTableViewCellInfo : NSObject
7 |
8 | + (id)normalCellForSel:(SEL)sel target:(id)target title:(NSString*)title accessoryType:(long long)type;
9 |
10 | @end
11 |
12 | @interface MMTableViewSectionInfo : NSObject
13 |
14 | + (MMTableViewSectionInfo*)sectionInfoDefaut;
15 | - (void)addCell:(MMTableViewCellInfo*)sectionInfo;
16 |
17 | @end
18 |
19 | @interface MMTableViewInfo : NSObject
20 |
21 | - (MMTableView*)getTableView;
22 | - (void)insertSection:(MMTableViewSectionInfo*)sectionInfo At:(unsigned int)index;
23 |
24 | @end
25 |
26 | @interface UIViewController (ModalView)
27 | - (void)DismissMyselfAnimated:(BOOL)animated;
28 | - (void)DismissModalViewControllerAnimated:(BOOL)animated;
29 | - (void)PresentModalViewController:(id)arg1 animated:(BOOL)animated;
30 |
31 | @end
32 |
33 | @interface UINavigationController (LogicController)
34 |
35 | - (void)PushViewController:(UIViewController*)vc animated:(BOOL)animated;
36 |
37 | @end
38 |
39 | @interface MMUIViewController : UIViewController
40 |
41 | @end
42 |
43 | @interface MMUINavigationController : UINavigationController
44 |
45 | @end
46 |
47 | @protocol MMPickLocationViewControllerDelegate
48 |
49 | @optional
50 | - (UIBarButtonItem *)onGetRightBarButton;
51 | - (void)onCancelSeletctedLocation;
52 |
53 | @end
54 |
55 | @interface NewSettingViewController : MMUIViewController
56 |
57 | - (void)reloadTableData;
58 |
59 | @end
60 |
61 | @interface MMSearchBarDisplayController : MMUIViewController
62 |
63 | @end
64 |
65 | @interface POIInfo : NSObject
66 |
67 | @property(nonatomic) struct CLLocationCoordinate2D coordinate;
68 |
69 | @end
70 |
71 | @interface MMPickLocationViewController : MMSearchBarDisplayController
72 |
73 | @property(nonatomic,weak) id delegate; // @synthesize delegate=_delegate;
74 |
75 | - (id)initWithScene:(unsigned int)arg1 OnlyUseUserLocation:(BOOL)arg2;
76 | - (POIInfo*)getCurrentPOIInfo;
77 | - (void)reportOnDone;
78 |
79 | @end
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/iOSWeChatFakeLocation.plist:
--------------------------------------------------------------------------------
1 | { Filter = { Bundles = ( "com.tencent.xin" ); }; }
2 |
--------------------------------------------------------------------------------
/images/1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaochengxiang/iOSWeChatFakeLocation/b38e92ab81c4de2f31cf76d2fc758f36cd60fab4/images/1.jpeg
--------------------------------------------------------------------------------
/images/2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaochengxiang/iOSWeChatFakeLocation/b38e92ab81c4de2f31cf76d2fc758f36cd60fab4/images/2.jpeg
--------------------------------------------------------------------------------
/images/3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaochengxiang/iOSWeChatFakeLocation/b38e92ab81c4de2f31cf76d2fc758f36cd60fab4/images/3.jpeg
--------------------------------------------------------------------------------
/images/4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaochengxiang/iOSWeChatFakeLocation/b38e92ab81c4de2f31cf76d2fc758f36cd60fab4/images/4.jpeg
--------------------------------------------------------------------------------
/images/5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaochengxiang/iOSWeChatFakeLocation/b38e92ab81c4de2f31cf76d2fc758f36cd60fab4/images/5.jpeg
--------------------------------------------------------------------------------