From 4f0381bcb7d0b7c5594c7f943bb7bdd09690da8d Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Fri, 17 Nov 2023 10:40:08 +0100 Subject: [PATCH] Filelist/Broadcst (#467) -filelists, device discovery. --- HotReloading | 2 +- InjectionIII.xcodeproj/project.pbxproj | 4 +-- InjectionIII/Info.plist | 2 +- README.md | 44 ++++++++++++++++++++++++-- SwiftRegex5 | 2 +- 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/HotReloading b/HotReloading index 54274243..14e924a0 160000 --- a/HotReloading +++ b/HotReloading @@ -1 +1 @@ -Subproject commit 542742437ac9dfc1b12454365660e8abef4b0750 +Subproject commit 14e924a017cc5bb31e15a7883c404037653432fc diff --git a/InjectionIII.xcodeproj/project.pbxproj b/InjectionIII.xcodeproj/project.pbxproj index 8b4cc408..85e3627f 100644 --- a/InjectionIII.xcodeproj/project.pbxproj +++ b/InjectionIII.xcodeproj/project.pbxproj @@ -1473,7 +1473,7 @@ INFOPLIST_FILE = InjectionIII/Info.plist; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 4.7.5; + MARKETING_VERSION = 4.7.6; PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionIII; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1497,7 +1497,7 @@ INFOPLIST_FILE = InjectionIII/Info.plist; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 4.7.5; + MARKETING_VERSION = 4.7.6; PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionIII; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/InjectionIII/Info.plist b/InjectionIII/Info.plist index a24be051..31f0fd39 100644 --- a/InjectionIII/Info.plist +++ b/InjectionIII/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 7869 + 7900 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/README.md b/README.md index de0ccc02..e601ac0b 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ Swift Package to your target _during development_. See the README for that project for details on how to debug having your program connect to the InjectionIII.app (which runs on the menu bar). You will also need to select the project -directory for the file watcher manually from the popdown menu. +directory for the file watcher manually from the pop-down menu. _Remember to not release your app with the HotReloading package included!_ @@ -175,10 +175,48 @@ blog post](https://www.mikeash.com/pyblog/friday-qa-2012-11-09-dyld-dynamic-link or the README of the [fishhook project](https://github.com/facebook/fishhook). For more information about the organisation of the app itself, consult [ROADMAP.md](https://github.com/johnno1962/InjectionIII/blob/main/ROADMAP.md). +### A bit of terminology + +Getting injection to work has three components. A FileWatcher, the code to +recompile any changed files and build a dynamic library that can be loaded +and the injection code itself which stitches the new versions of your code +into the app while it's running. How these three components are combined +gives rise to the number of ways injection can be used. + +"Injection classic" is where you download one of the [binary releases](https://github.com/johnno1962/InjectionIII/releases) +from github and run the InjectionIII.app. You then load one of the bundles +inside that app into your program as shown above in the simulator. +In this configuration, the file watcher and source recompiling is done +inside the app and the bundle connects to the app using a socket to +know when a new dynamic library is ready to be loaded. + +"App Store injection" This version of the app is sandboxed and while +the file watcher still runs inside the app, the recompiling and loading +is delegated to be performed inside the simulator. This can create +problems with C header files as the simulator uses a case sensitive +file system to be a faithful simulation of a real device. + +"HotReloading injection" is where you are running your app on a device +and because you cannot load a bundle off your Mac's filesystem on a real +phone you add the [HotReloading Swift Package](https://github.com/johnno1962/HotReloading) +to your project (during development only!) which contains all the code that +would normally be in the bundle to perform the dynamic loading. This +requires that you use one of the un-sandboxed binary releases. + +"Standalone injection". This was the most recent evolution of the project +where you don't run the app itself anymore but simply load one of the +injection bundles and the file watcher, re-compilation and injection are +all performed inside the simulator. By default this watches for changes +to any Swift file inside your home directory though you can change this +using the environment variable `INJECTION_DIRECTORIES`. + +All these variations require you to add the "-Xlinker -interposble" linker flags +for a Debug build or you will only be able to inject non-final methods of classes. + ### Further information Consult the [old README](https://github.com/johnno1962/InjectionIII/blob/main/OLDME.md) which if anything contained -simply "too much information" including the various enviroment +simply "too much information" including the various environment variables you can use for customisation. A few examples: | Environment var. | Purpose | @@ -222,4 +260,4 @@ for the code to be evaluated using injection under an MIT license. The fabulous app icon is thanks to Katya of [pixel-mixer.com](http://pixel-mixer.com/). -$Date: 2023/10/08 $ +$Date: 2023/11/17 $ diff --git a/SwiftRegex5 b/SwiftRegex5 index 8ecb4a85..552d07e8 160000 --- a/SwiftRegex5 +++ b/SwiftRegex5 @@ -1 +1 @@ -Subproject commit 8ecb4a8570757b7f8bce72f82242742e13891f99 +Subproject commit 552d07e8b2297f90882424f4118d6bcc3a338eb6