Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ You can inspect and modify views in iOS app via Lookin, just like UI Inspector i

Official Website:https://lookin.work/

Fork maintenance notes: [Imported Upstream Patches](UPSTREAM_PATCHES.md)

# Integration Guide
To use Lookin macOS app, you need to integrate LookinServer (iOS Framework of Lookin) into your iOS project.

Expand Down
6 changes: 5 additions & 1 deletion Src/Main/Server/Connection/LKS_ConnectionManager.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef SHOULD_COMPILE_LOOKIN_SERVER
#ifdef SHOULD_COMPILE_LOOKIN_SERVER

//
// LookinServer.m
Expand Down Expand Up @@ -39,6 +39,10 @@ + (instancetype)sharedInstance {
}

+ (void)load {
if (NSProcessInfo.processInfo.environment[@"XCODE_RUNNING_FOR_PREVIEWS"]) {
return;
}

// 触发 init 方法
[LKS_ConnectionManager sharedInstance];
}
Expand Down
12 changes: 6 additions & 6 deletions Src/Main/Server/Others/LKS_ExportManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ @interface LKS_ExportManager ()
@property(nonatomic, strong) UIDocumentInteractionController *documentController;
#endif

@property(nonatomic, strong) LKS_ExportManagerMaskView *maskView;
@property(nonatomic, strong) LKS_ExportManagerMaskView *lks_maskView;

@end

Expand Down Expand Up @@ -129,11 +129,11 @@ - (void)exportAndShare {

[[NSNotificationCenter defaultCenter] postNotificationName:@"Lookin_WillExport" object:nil];

if (!self.maskView) {
self.maskView = [LKS_ExportManagerMaskView new];
if (!self.lks_maskView) {
self.lks_maskView = [LKS_ExportManagerMaskView new];
}
[visibleVc.view.window addSubview:self.maskView];
self.maskView.frame = visibleVc.view.window.bounds;
[visibleVc.view.window addSubview:self.lks_maskView];
self.lks_maskView.frame = visibleVc.view.window.bounds;

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
LookinHierarchyInfo *info = [LookinHierarchyInfo exportedInfo];
Expand Down Expand Up @@ -165,7 +165,7 @@ - (void)exportAndShare {
NSString *path = [NSString stringWithFormat:@"%@%@", NSTemporaryDirectory(), fileName];
[data writeToFile:path atomically:YES];

[self.maskView removeFromSuperview];
[self.lks_maskView removeFromSuperview];

if (!self.documentController) {
self.documentController = [UIDocumentInteractionController new];
Expand Down
2 changes: 1 addition & 1 deletion Src/Main/Shared/Peertalk/Lookin_PTProtocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ - (void)readPayloadOfSize:(size_t)payloadSize overChannel:(dispatch_io_t)channel
__block dispatch_data_t allData = NULL;
dispatch_io_read(channel, 0, payloadSize, queue_, ^(bool done, dispatch_data_t data, int error) {
//NSLog(@"dispatch_io_read: done=%d data=%p error=%d", done, data, error);
size_t dataSize = dispatch_data_get_size(data);
size_t dataSize = data ? dispatch_data_get_size(data) : 0;

if (dataSize) {
if (!allData) {
Expand Down
11 changes: 11 additions & 0 deletions UPSTREAM_PATCHES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Imported Upstream Patches

This fork incorporates selected community pull requests that were not merged by the original project. Imported commits preserve the original author whenever possible. A listed pull request remains unmerged upstream unless its status is updated here.

| Local commit | Upstream pull request | Original commit | Local adaptation |
| --- | --- | --- | --- |
| `ee11b92` | [QMUI/LookinServer#159](https://github.com/QMUI/LookinServer/pull/159) | `6db2bb1858865255f7fa6c5424d08b509a4b9190` | None. Renames the export overlay property to avoid the iOS 18 `maskView` collision. |
| `d9f34d9` | [QMUI/LookinServer#165](https://github.com/QMUI/LookinServer/pull/165) | `2377dc6cb63be48bc6aef825110e35e8a86bb9ec` | Uses an early return when running inside SwiftUI Previews. |
| `7929384` | [QMUI/LookinServer#173](https://github.com/QMUI/LookinServer/pull/173) | `cb1f9baeda8c294c758a0a131a63283efe103e8a` | Treats a null dispatch payload as zero bytes so the existing completion and error paths still run. |

Large or cross-repository features are ported on dedicated branches instead of being applied directly. Every imported patch must build against the fork's current default branch before it is merged.