Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Merge remote-tracking branch 'origin/main' into HEAD

Lakr233fa3c2520ab6c
diff --cc VPhoneGuestComponents/LaunchHook/launchdhook-vphone.c
index 6a59aea7,c447f6cd..b297db36
--- a/VPhoneGuestComponents/LaunchHook/launchdhook-vphone.c
+++ b/VPhoneGuestComponents/LaunchHook/launchdhook-vphone.c
@@@ -94,19 -93,23 +94,25 @@@ static int vpSpawnWith(VPSpawnFunction
if (!path || strcmp(path, "/sbin/launchd") == 0)
return spawn(pid, path, actions, attributes, argv, envp);
// launchd starts some jobs itself rather than through xpcproxy — SpringBoard
- // is one — so the MIS, battery health and DeviceHub hooks have to be
- // decided here as well as in SystemHook.
- const char *library = vpInsertedLibraryFor(path);
- VPInjectionEnvironment injected = vpInsertHooks(envp, vpBootRoot, library);
+ // is one — so the MIS, battery health, DeviceHub and device name hooks
+ // have to be decided here as well as in SystemHook.
+ const VPInsertedLibraries libraries = vpInsertedLibrariesFor(path);
+ VPInjectionEnvironment injected = vpInsertHooksFor(envp, vpBootRoot, &libraries);
+ VPJetsamLimits limits = vpRaiseJetsamLimits(vpBootRoot, path, attributes, envp);
int status = spawn(pid, path, actions, attributes, argv, injected.values ? injected.values : envp);
+ vpRestoreJetsamLimits(&limits);
- if (bootstrapProgram || appProgram || library || strcmp(path, "/usr/libexec/xpcproxy") == 0) {
- const char *event = !injected.values ? "unchanged" :
- library && strcmp(library, VP_MIS_FIX) == 0 ? "inserted+misfix" :
- library && strcmp(library, VP_BATTERY_HEALTH_FIX) == 0 ? "inserted+batteryhealthfix" :
- library ? "inserted+devicehubfix" :
- vpInjectionDisabled(envp) ? "inserted-tweaks-disabled" : "inserted";
+ if (bootstrapProgram || appProgram || libraries.count || strcmp(path, "/usr/libexec/xpcproxy") == 0) {
+ char event[128];
+ if (!injected.values) {
+ snprintf(event, sizeof(event), "unchanged");
+ } else if (libraries.count) {
+ char names[96];
+ vpDescribeInsertedLibraries(&libraries, names, sizeof(names));
+ snprintf(event, sizeof(event), "inserted%s", names);
+ } else {
+ snprintf(event, sizeof(event), "%s",
+ vpInjectionDisabled(envp) ? "inserted-tweaks-disabled" : "inserted");
+ }
vpLogInjection(event, path, status);
vpLogSpawn(event, path, status == 0 && pid ? *pid : -1, status);
}