From ee11b9218e43e5c0fbad2bb290895430c872b307 Mon Sep 17 00:00:00 2001 From: lijianghuai Date: Wed, 17 Jul 2024 17:03:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=20Xcode16=20?= =?UTF-8?q?=E7=BC=96=E8=AF=91=EF=BC=8C=20=E5=9C=A8=20iOS18=20=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BF=9B=E8=A1=8C=20UI=20Debug=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82=20=E4=B8=BB=E8=A6=81=E6=98=AF=E7=94=B1?= =?UTF-8?q?=E4=BA=8E=20maskView=20=E5=B1=9E=E6=80=A7=E8=B7=9F=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=90=8C=E5=90=8D=E4=BA=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Main/Server/Others/LKS_ExportManager.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Src/Main/Server/Others/LKS_ExportManager.m b/Src/Main/Server/Others/LKS_ExportManager.m index be040b9c..9c6cc0ff 100644 --- a/Src/Main/Server/Others/LKS_ExportManager.m +++ b/Src/Main/Server/Others/LKS_ExportManager.m @@ -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 @@ -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]; @@ -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]; From d9f34d9fdf51bae1f0da4176bff27ef13c8a1cc4 Mon Sep 17 00:00:00 2001 From: linhey Date: Thu, 12 Sep 2024 15:39:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20=E5=9C=A8=20SwiftUI=20Previews=20?= =?UTF-8?q?=E4=B8=8D=E5=90=AF=E7=94=A8=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Main/Server/Connection/LKS_ConnectionManager.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Src/Main/Server/Connection/LKS_ConnectionManager.m b/Src/Main/Server/Connection/LKS_ConnectionManager.m index c1ec8fc1..bcc2dbc5 100644 --- a/Src/Main/Server/Connection/LKS_ConnectionManager.m +++ b/Src/Main/Server/Connection/LKS_ConnectionManager.m @@ -1,4 +1,4 @@ -#ifdef SHOULD_COMPILE_LOOKIN_SERVER +#ifdef SHOULD_COMPILE_LOOKIN_SERVER // // LookinServer.m @@ -39,6 +39,10 @@ + (instancetype)sharedInstance { } + (void)load { + if (NSProcessInfo.processInfo.environment[@"XCODE_RUNNING_FOR_PREVIEWS"]) { + return; + } + // 触发 init 方法 [LKS_ConnectionManager sharedInstance]; } From 7929384f7658a241576bacd0ad582d0171f9348b Mon Sep 17 00:00:00 2001 From: yangjie Date: Fri, 20 Dec 2024 14:46:49 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20data=E5=8F=AF=E8=83=BD=E5=9C=A8?= =?UTF-8?q?=E6=81=AF=E5=B1=8F=E7=8A=B6=E6=80=81=E4=B8=8B=E4=B8=BAnil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Main/Shared/Peertalk/Lookin_PTProtocol.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Main/Shared/Peertalk/Lookin_PTProtocol.m b/Src/Main/Shared/Peertalk/Lookin_PTProtocol.m index 72e85f8a..d18ca125 100644 --- a/Src/Main/Shared/Peertalk/Lookin_PTProtocol.m +++ b/Src/Main/Shared/Peertalk/Lookin_PTProtocol.m @@ -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) { From b5108a0fd8261a4da1d51b3b566a829dc8902d26 Mon Sep 17 00:00:00 2001 From: hongbo <1049145827@qq.com> Date: Sat, 18 Jul 2026 14:13:48 +0800 Subject: [PATCH 4/4] Document imported upstream patches --- README.md | 2 ++ UPSTREAM_PATCHES.md | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 UPSTREAM_PATCHES.md diff --git a/README.md b/README.md index f6e12ed7..11bdc79c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/UPSTREAM_PATCHES.md b/UPSTREAM_PATCHES.md new file mode 100644 index 00000000..870dbb79 --- /dev/null +++ b/UPSTREAM_PATCHES.md @@ -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.